:root { color-scheme: light; --ink:#101928; --deep:#163449; --gold:#e0b665; --paper:#f0eee6; --clay:#b65b45; font-family: Inter, system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; color:var(--ink); background:var(--paper); }
button, input, textarea { font:inherit; }
button { min-height:44px; padding:.75rem 1rem; border:2px solid var(--deep); border-radius:.35rem; color:white; background:var(--deep); cursor:pointer; font-weight:700; }
button:hover { background:var(--ink); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
input, textarea { width:100%; padding:.8rem; border:2px solid #82909b; border-radius:.35rem; background:white; color:var(--ink); }
textarea { min-height:7rem; resize:vertical; }
.shell { max-width:1100px; margin:auto; min-height:100vh; }
.topbar { display:flex; justify-content:space-between; gap:1rem; padding:1rem; border-bottom:1px solid #c8c2b4; }
.brand { font-weight:900; letter-spacing:.13em; }
.player { color:var(--deep); }
.notice { margin:1rem; padding:.75rem 1rem; border-left:5px solid var(--clay); background:#fff8ed; }
.experiment-notice { margin:1rem; padding:.75rem 1rem; border:1px solid var(--gold); background:#fff8ed; font-weight:700; }
.start-card { max-width:36rem; margin:8vh auto; padding:clamp(1.5rem,5vw,4rem); background:white; border-top:7px solid var(--gold); box-shadow:0 12px 35px #1019281c; display:grid; gap:1rem; }
h1 { font-family:Georgia, serif; font-size:clamp(2rem,5vw,3.8rem); line-height:1; margin:.2rem 0 1rem; }
h2 { font-family:Georgia, serif; margin:1.5rem 0 .5rem; }
.eyebrow { color:var(--clay); font-weight:900; letter-spacing:.12em; font-size:.8rem; }
.game-grid { display:grid; grid-template-columns:minmax(280px, 1fr) minmax(320px, 1fr); min-height:calc(100vh - 64px); }
.scene { position:relative; overflow:hidden; min-height:420px; background:linear-gradient(#dce8e6 0 55%, #ceb486 55%); border-right:1px solid #c8c2b4; }
.sun { position:absolute; width:100px; height:100px; right:12%; top:10%; border-radius:50%; background:var(--gold); opacity:.8; }
.temple-shape { position:absolute; left:18%; right:18%; bottom:25%; height:45%; background:var(--deep); clip-path:polygon(50% 0, 100% 28%, 88% 28%, 88% 100%, 12% 100%, 12% 28%, 0 28%); }
.foundation { position:absolute; left:25%; right:25%; bottom:16%; height:8%; border:3px dashed var(--clay); }
.foundation--built { border:0; background:var(--clay); box-shadow:0 8px 0 var(--gold); }
.scene-label { position:absolute; left:1rem; bottom:1rem; padding:.5rem .8rem; color:white; background:var(--ink); }
.panel { padding:clamp(1.25rem,4vw,3rem); background:#fffdf8; }
.progress { height:8px; background:#d5d3cc; margin:1rem 0 2rem; }
.progress__fill { height:100%; background:var(--clay); transition:width .25s ease; }
.progress-meta { display:flex; justify-content:space-between; gap:1rem; color:#52606b; font-size:.85rem; }
.progress-block .progress { margin:.4rem 0 2rem; }
.phase-content { display:grid; gap:.8rem; }
.quote { padding:1rem; border-left:4px solid var(--gold); font-family:Georgia, serif; font-size:1.15rem; }
.source { display:block; color:#52606b; line-height:1.4; }
.symbol-card { padding:1rem; border:1px solid #c8c2b4; background:white; }
.symbol-card--open { border-left:5px solid var(--gold); }
.symbol-card h2 { margin-top:0; }
.choice-form { display:grid; gap:.8rem; }
.choice { display:flex; align-items:center; gap:.75rem; padding:.75rem; border:1px solid #c8c2b4; background:white; }
.choice input { width:auto; min-width:20px; min-height:20px; }
.consequences { padding:1rem; border-left:5px solid var(--clay); background:#f7f0e5; }
.consequences h2 { margin-top:0; font-size:1.1rem; }
.consequence-list { margin:0; padding-left:1.25rem; }
.foundation--shared { border-radius:50%; box-shadow:0 0 0 8px var(--gold); }
.foundation--corrected { transform:skewX(-12deg); box-shadow:12px 8px 0 var(--gold); }
.foundation--solo { left:43%; right:43%; box-shadow:0 8px 0 var(--gold); }
.layout-stacked .game-grid { grid-template-columns:1fr; }
.layout-stacked .scene { min-height:300px; border-right:0; border-bottom:1px solid #c8c2b4; }
@media (max-width:760px) { .game-grid { grid-template-columns:1fr; } .scene { min-height:300px; border-right:0; } .topbar { align-items:center; } }
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto!important; transition:none!important; } }

/* INTAR-MECHANICS-004: каждый экран занимает viewport; содержание доступно страницами. */
html, body { width:100%; height:100%; overflow:hidden; overscroll-behavior:none; }
body { min-height:0; }
#app, .shell { width:100%; height:100dvh; overflow:hidden; }
.shell { max-width:none; min-height:0; display:grid; grid-template-rows:auto minmax(0,1fr); }
.topbar { min-height:52px; padding:.65rem clamp(.75rem,2vw,1.25rem); align-items:center; }
.game-grid { min-height:0; height:100%; grid-template-columns:minmax(220px,.8fr) minmax(340px,1.2fr); overflow:hidden; }
.scene { min-height:0; height:100%; }
.panel { min-width:0; min-height:0; height:100%; padding:clamp(.75rem,2.2vw,1.75rem); display:grid; grid-template-rows:auto auto minmax(0,1fr); gap:.35rem; overflow:hidden; }
.panel-heading { min-width:0; }
.panel h1 { font-size:clamp(1.45rem,3vw,2.6rem); line-height:1.15; margin:.05rem 0 .35rem; white-space:normal; }
.eyebrow { margin:0 0 .2rem; }
.progress-block { min-width:0; }
.progress-block .progress { margin:.3rem 0 .55rem; }
.phase-content, .pager, .pager__content, .content-page { min-width:0; min-height:0; overflow:hidden; }
.phase-content, .pager { height:100%; }
.pager { display:grid; grid-template-rows:minmax(0,1fr) auto; gap:.55rem; }
.pager__content { display:grid; align-items:center; }
.content-page { width:min(100%,42rem); margin:auto; display:grid; align-content:center; gap:clamp(.45rem,1.4vh,.8rem); }
.content-page h2 { margin:0; font-size:clamp(1.2rem,2.4vw,1.7rem); line-height:1.12; }
.content-page p { margin:0; line-height:1.35; }
.content-page .quote { padding:.65rem; font-size:1rem; }
.pager__nav { display:grid; grid-template-columns:minmax(5.5rem,1fr) auto minmax(5.5rem,1fr); align-items:center; gap:.65rem; }
.pager__nav button { min-height:42px; padding:.45rem .7rem; }
.pager__status { min-width:3.3rem; text-align:center; font-variant-numeric:tabular-nums; }
button:disabled { opacity:.38; cursor:default; }
.scenario-link { display:flex; align-items:center; min-height:44px; padding:.65rem .8rem; border:2px solid var(--deep); border-radius:.35rem; color:var(--deep); background:white; font-weight:700; text-decoration:none; }
.scenario-link:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.start-card { width:min(42rem,calc(100% - 1.5rem)); height:min(38rem,calc(100% - 1.5rem)); max-width:none; margin:auto; padding:clamp(.8rem,3vw,1.8rem); overflow:hidden; align-self:center; }
.start-card .pager { width:100%; }
.experiment-notice { margin:0; padding:.65rem; font-size:.95rem; }
.source { font-size:clamp(.78rem,1.6vw,.9rem); }
.choice { min-height:44px; padding:.55rem .65rem; }
.choice input { min-width:22px; min-height:22px; }
.field-hint, .field-meta { color:#52606b; font-size:.88rem; }
.field-meta { display:flex; justify-content:space-between; gap:.75rem; }
.button-row { display:grid; grid-template-columns:1fr 1fr; gap:.55rem; }
.condition { padding:.65rem; border-left:4px solid var(--gold); background:#f7f0e5; }

@media (max-width:760px), (max-height:560px) {
  .game-grid, .layout-stacked .game-grid { grid-template-columns:1fr; }
  .scene, .layout-stacked .scene { display:none; }
  .topbar { min-height:44px; padding:.45rem .7rem; }
  .brand { font-size:.9rem; }
  .player { font-size:.82rem; }
  .panel { padding:.55rem .7rem; }
  .panel h1 { font-size:clamp(1.25rem,5vw,1.7rem); }
  .progress-meta { font-size:.78rem; }
}

@media (max-height:440px) {
  .panel-heading h1 { display:none; }
  .progress-meta span:first-child { display:none; }
  .progress-block .progress { margin:.15rem 0 .3rem; }
  .content-page { gap:.3rem; }
  .content-page p { line-height:1.2; }
  .pager__nav button, button { min-height:38px; padding:.35rem .6rem; }
}

/* INTAR-BUILD-007: временные объекты используют устойчивые ID из состояния. */
.world-object--build-meeting-canopy { left:13%; bottom:43%; width:40%; height:20%; border:4px solid var(--deep); border-top:12px solid var(--gold); background:#f0eee66b; }
.world-object--build-meeting-canopy::after { content:""; position:absolute; left:12%; right:12%; bottom:0; height:65%; border-left:4px solid var(--deep); border-right:4px solid var(--deep); }
.world-object--build-shared-tool-rack { right:13%; bottom:42%; width:27%; height:24%; border:4px solid var(--deep); background:linear-gradient(to bottom,#fff8ed 0 28%,var(--gold) 28% 36%,#fff8ed 36% 64%,var(--gold) 64% 72%,#fff8ed 72%); }
.world-object--place-meeting-edge, .world-object--place-store-wall { z-index:1; bottom:39%; width:44%; height:5%; border:2px dashed var(--clay); border-radius:50%; background:#fff8ed80; }
.world-object--place-meeting-edge { left:11%; }
.world-object--place-store-wall { right:8%; width:36%; }
.world-stage--building-select .world-object[class*="world-object--build-"] { opacity:.58; filter:saturate(.7); }
.world-stage--building-preview .world-object[class*="world-object--build-"] { filter:drop-shadow(0 10px 12px #10192829); }
.world-stage--building-preview .world-object[class*="world-object--place-"] { border-style:solid; border-color:var(--gold); }
.world-react .world-object[class*="world-object--build-"] { animation:build-settle .46s cubic-bezier(.16,1,.3,1) both; }
@keyframes build-settle { from { clip-path:inset(0 0 65% 0); filter:drop-shadow(0 2px 3px #10192814); } to { clip-path:inset(0); filter:drop-shadow(0 12px 14px #1019282b); } }
.content-page h3 { margin:0; font-family:Georgia,serif; font-size:1.05rem; }

@media (prefers-reduced-motion:reduce) {
  .world-react .world-object[class*="world-object--build-"] { animation:none!important; filter:drop-shadow(0 10px 12px #10192829); }
}

/* INTAR-FLOW-006: каталог прохождений и две связанные области игры. */
.home-card { width:min(54rem,calc(100% - 1.5rem)); height:min(42rem,calc(100% - 1.5rem)); margin:auto; padding:clamp(.8rem,3vw,1.8rem); background:#fffdf8; border-top:7px solid var(--gold); box-shadow:0 12px 35px #1019281c; display:grid; grid-template-rows:auto minmax(0,1fr); gap:1rem; overflow:hidden; }
.home-intro h1 { margin:.1rem 0 .45rem; font-size:clamp(1.65rem,4vw,2.7rem); line-height:1.15; }
.home-intro p { margin:.2rem 0; }
.home-pager { min-height:0; display:grid; grid-template-rows:minmax(0,1fr) auto; gap:.7rem; }
.home-pager__content { min-height:0; display:grid; align-items:center; overflow:hidden; }
.save-card, .new-game { width:min(100%,42rem); margin:auto; display:grid; gap:.75rem; align-content:center; }
.save-card__copy { display:grid; gap:.25rem; padding:1rem; border-left:5px solid var(--gold); background:#f7f0e5; }
.save-card__copy strong { font-size:1.25rem; }
.save-card__copy small { color:#52606b; }
.continue-link { display:flex; align-items:center; justify-content:center; min-height:48px; padding:.7rem 1rem; border:2px solid var(--deep); border-radius:.35rem; color:white; background:var(--deep); font-weight:800; text-decoration:none; text-align:center; }
.continue-link:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.new-game h2, .new-game p { margin:0; }
.world-caption { position:absolute; z-index:4; left:clamp(.7rem,3vw,1.5rem); right:clamp(.7rem,3vw,1.5rem); bottom:clamp(.7rem,3vw,1.5rem); max-height:42%; padding:.75rem; color:white; background:#101928e6; overflow:hidden; }
.world-caption h2, .world-caption p { margin:.15rem 0; }
.world-caption h2 { font-size:clamp(1.15rem,2vw,1.55rem); }
.world-ground { position:absolute; inset:55% 0 0; background:#ceb486; }
.world-object { position:absolute; z-index:2; transition:transform .22s ease, opacity .22s ease; }
.world-object--branches { left:18%; right:18%; bottom:31%; height:8%; border-radius:55% 15%; background:var(--clay); transform:rotate(-7deg); }
.world-object--dialogue { left:15%; right:15%; bottom:43%; height:12%; border:6px dotted var(--deep); border-radius:50%; }
.world-object--cleared { left:28%; right:28%; bottom:38%; height:22%; border:4px solid #fff8ed; border-width:0 4px; }
.world-object--foundation-shared, .world-object--shared { left:28%; right:28%; bottom:41%; height:16%; border:8px solid var(--gold); border-radius:50%; }
.world-object--foundation-corrected, .world-object--corrected { left:25%; right:25%; bottom:42%; height:14%; background:var(--clay); transform:skewX(-12deg); box-shadow:12px 8px 0 var(--gold); }
.world-object--foundation-solo, .world-object--solo { left:45%; right:45%; bottom:40%; height:22%; background:var(--clay); box-shadow:0 8px 0 var(--gold); }
.world-object--storage { left:18%; width:28%; bottom:43%; height:19%; border:5px solid var(--deep); background:#f0eee6; }
.world-object--inventory { right:17%; width:28%; bottom:43%; height:14%; border:5px solid var(--gold); background:#fff8ed; }
.world-object--rain-traces { left:9%; right:9%; bottom:35%; height:7%; border:2px solid #5f7d8680; border-radius:50%; background:#d8e6e280; }
.world-stage--consequence .world-object, .world-stage--followup .world-object { animation:event-arrival .36s ease-out both; }
@keyframes event-arrival { from { opacity:.25; transform:translateY(10px); } to { opacity:1; } }
.pane-switch { display:none; }

@media (max-width:760px), (max-height:560px) {
  .game-grid .scene { display:block; border:0; }
  .game-grid[data-mobile-pane="decision"] .world-pane { display:none; }
  .game-grid[data-mobile-pane="world"] .panel { display:none; }
  .panel { position:relative; }
  .panel-heading { padding-right:9rem; }
  .pane-switch { display:block; position:absolute; z-index:8; top:.45rem; right:.7rem; width:auto; min-height:38px; padding:.35rem .6rem; }
  .world-pane .pane-switch { position:absolute; top:.55rem; left:.7rem; right:.7rem; width:calc(100% - 1.4rem); }
  .world-caption { max-height:48%; }
}

@media (prefers-reduced-motion:reduce) {
  .world-object { animation:none!important; }
}

@media (max-height:440px) {
  .home-card { padding:.45rem .65rem; gap:.35rem; }
  .home-intro h1 { margin:0; font-size:1.35rem; }
  .home-intro p { margin:0; font-size:.82rem; line-height:1.15; }
  .save-card, .new-game { gap:.3rem; }
  .save-card__copy { padding:.35rem .55rem; gap:.1rem; }
  .save-card__copy strong { font-size:1rem; }
  .continue-link, .new-game .scenario-link { min-height:38px; padding:.35rem .55rem; }
  .new-game h2 { font-size:1.05rem; }
  .new-game p { font-size:.8rem; line-height:1.15; }
  .home-pager { gap:.3rem; }
}
