@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Nunito+Sans:wght@400;600;700;800&display=swap');
:root{color-scheme:dark;--ink:#f6f0e2;--muted:#bdc7c2;--gold:#d9bc77;--line:#d2b86c42;--base:#101b21;--panel:#1c2730;--accent:#adcee7;font-family:'Nunito Sans',system-ui,sans-serif;font-size:16px;background:var(--base);color:var(--ink)}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 45% 0,#3c3246 0,transparent 65%),#101b21}button,input,select{font:inherit}button,select{color:var(--ink);border:1px solid var(--line);background:#202c34;border-radius:9px;min-height:42px;padding:8px 12px}button{cursor:pointer;touch-action:manipulation}button:hover:not(:disabled){border-color:var(--gold);background:#34414a}button:disabled{cursor:default;opacity:.55}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #fff3b0;outline-offset:3px}a{color:var(--ink)}[hidden]{display:none!important}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:'Cormorant Garamond',Georgia,serif}h1{font-size:clamp(2rem,3.3vw,3rem);font-weight:600;line-height:1.05}.eyebrow{letter-spacing:.14em;font-size:.76rem;font-weight:800;color:var(--gold);margin-bottom:10px}.site-header{height:58px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:#231a2de6;gap:16px}.site-header a{text-decoration:none;font-weight:800}.site-header span{font-size:.8rem;font-weight:400;color:var(--muted);margin-left:12px}main{max-width:1500px;margin:auto}.setup{padding:22px 28px 24px}.intro{max-width:850px;margin-bottom:20px}.intro>p:last-child{margin-top:12px;color:var(--muted);line-height:1.5}.setup-settings{display:flex;gap:18px;align-items:center;flex-wrap:wrap;padding:14px 18px;background:#ffffff06;border:1px solid var(--line);border-radius:14px;margin-bottom:20px}.setup-settings label{display:grid;gap:4px;font-size:.85rem;color:var(--muted)}.setup-settings .check{display:flex;align-items:center;gap:8px;color:var(--ink)}input[type=checkbox]{width:19px;height:19px;accent-color:var(--gold)}input[type=range]{max-width:120px;accent-color:var(--gold)}.player-setup{display:grid;grid-template-columns:repeat(var(--count,4),minmax(0,1fr));gap:14px}.player-card{padding:14px;border:1px solid var(--line);border-top:3px solid var(--accent);border-radius:14px;background:linear-gradient(140deg,#ffffff08,#00000021);min-width:0}.player-card>label{display:block;font-size:.85rem;color:var(--muted);margin-top:9px}.player-card>label select{display:block;width:100%;margin-top:5px}.player-card h2{font-size:1.65rem}.player-card .keys{display:block;color:var(--muted);font-size:.8rem;margin:5px 0 12px}.characters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.character-choice{padding:4px 1px;display:grid;justify-items:center;border-color:transparent;background:#070e1438;min-width:0;border-radius:8px}.character-choice[aria-pressed=true]{border-color:var(--accent);box-shadow:inset 0 0 18px #d7f7ff15;background:#d7f7ff12}.character-choice .sprite{height:83px;width:50px}.character-choice span:last-child{font-size:.72rem;white-space:nowrap}.sprite{display:block;background-image:url('assets/duel/characters.webp');background-repeat:no-repeat;background-size:500% 100%;background-position:var(--sprite,0%) 0;aspect-ratio:.6}.sprite.extra{background-image:url('assets/forest/extra-characters.webp');background-size:300% 100%}.chosen-name{color:var(--accent);font-weight:800;margin-top:10px;font-size:.88rem;min-height:1.3em}.setup-bottom{margin-top:18px;display:flex;gap:24px;align-items:center;justify-content:space-between}.setup-bottom p{font-size:.85rem;line-height:1.5;color:var(--muted);max-width:950px}.setup-bottom p+p{margin-top:5px}.gold{background:linear-gradient(120deg,#ecd69f,#d3ae5d);color:#211e20;border-color:#ebd19a;font-weight:800}.gold:hover:not(:disabled){background:#f3dfac;color:#211e20}.start{padding:14px 32px;white-space:nowrap;font-size:1.05rem}#setup-error{color:#ffbaaf;margin-top:10px}
body.playing{overflow:hidden}.playing .site-header{display:none}.playing main{max-width:none}.game{height:100dvh;display:flex;flex-direction:column;background:#101b21}.game-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 14px;min-height:65px;border-bottom:1px solid var(--line);background:#211b2a}.game-title{display:grid;gap:3px;white-space:nowrap}.game-title strong{font-family:Georgia,serif;font-size:1.15rem;color:var(--gold)}.game-title span{font-size:.8rem;color:var(--muted)}.game-actions{display:flex;gap:6px}.game-actions button{font-size:.8rem;min-height:34px;padding:6px 9px}.game-actions button[aria-pressed=false]{opacity:.6}.stock,.personal-stock{display:flex;justify-content:center;gap:14px}.stock-item{white-space:nowrap;display:inline-flex;align-items:center;gap:5px}.stock .stock-item{font-size:1rem}.stock .stock-item strong{min-width:24px}.resource-symbol{font-size:1.15rem}.stock-item small{font-size:.75rem;color:var(--muted)}.team-message{height:30px;flex:none;padding:6px 12px;text-align:center;font-size:.8rem;color:var(--muted);background:#111820}.team-message.voting{background:#614c27;color:#fff1bf}.lanes{display:grid;grid-template-columns:repeat(var(--count,4),minmax(0,1fr));flex:1;min-height:0;gap:2px;background:#cbb57238}.lane{display:flex;flex-direction:column;min-width:0;min-height:0;background:#16212a;border-top:3px solid var(--accent)}.lane-head{display:flex;align-items:center;gap:8px;padding:5px 10px;min-height:35px;background:#172029}.lane-head strong{font-size:.85rem;white-space:nowrap}.lane-head select{flex:1;min-width:0;min-height:30px;padding:3px 6px;font-size:.8rem}.scene{position:relative;flex:1;min-height:100px;isolation:isolate;overflow:hidden;background:#182e32}.landscape{position:absolute;inset:0;background-repeat:no-repeat;transition:filter 1s;will-change:opacity}.scene .veil{position:absolute;inset:0;background:linear-gradient(180deg,#06101b09 30%,#08131a13 65%,#09141ddb 100%);pointer-events:none}.scene-label{position:absolute;top:8px;left:8px;right:8px;display:flex;justify-content:space-between;gap:8px;text-shadow:0 1px 5px #000;font-size:.8rem;color:#fff3dc}.stage-badge{background:#101b21a3;border:1px solid #dfc78166;border-radius:10px;padding:3px 7px;white-space:nowrap}.hero{position:absolute;bottom:6px;left:12px;width:clamp(55px,7vw,110px);filter:drop-shadow(0 6px 6px #081318aa);animation:breathe 4.4s ease-in-out infinite;transform-origin:50% 90%;z-index:2}.hero.casting{animation:cast .75s ease-in-out}.mist{position:absolute;width:160%;height:40%;left:-30%;bottom:0;border-radius:50%;background:radial-gradient(ellipse,#c9d9d52b,transparent 65%);filter:blur(12px);animation:mist 16s ease-in-out infinite;pointer-events:none}.mote{position:absolute;width:3px;height:3px;border-radius:50%;background:#f6db8b;box-shadow:0 0 8px #ffebaf;left:var(--x);top:var(--y);animation:float var(--duration) ease-in-out infinite alternate;animation-delay:var(--delay);pointer-events:none}.repair-flash{position:absolute;inset:0;z-index:4;pointer-events:none;background:radial-gradient(circle at 50% 60%,#fff4bf,#cf91ffbb 30%,transparent 70%);animation:repairflash 1.9s ease-in-out forwards;mix-blend-mode:screen}.spell{position:absolute;z-index:5;bottom:20%;left:25%;width:20px;height:20px;border-radius:50%;background:#fff8d5;box-shadow:0 0 15px 6px var(--accent),-28px 10px 18px var(--accent);animation:spell .75s ease-in forwards;pointer-events:none}.collected{background:#101b22e6;border-bottom:1px solid #d1c18b29;padding:6px 5px;text-align:center}.collected>span{display:block;font-size:.68rem;letter-spacing:.05em;color:var(--muted);margin-bottom:3px}.personal-stock{gap:10px;font-size:.8rem}.personal-stock .resource-symbol{font-size:.85rem}.personal-stock .stock-item{gap:3px}.question-deck{padding:10px 10px 7px;flex:none;height:clamp(238px,34vh,310px);display:flex;flex-direction:column;background:linear-gradient(160deg,#263039,#18232d)}.question-meta{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}.question-meta>span{font-size:.72rem;color:var(--muted)}.speak{min-height:28px;padding:3px 7px;font-size:.76rem}.question{font-size:clamp(.9rem,1.25vw,1.1rem);font-weight:800;line-height:1.3;min-height:3.9em;margin-bottom:8px;display:flex;align-items:center}.answers{display:grid;grid-template-columns:1fr 1fr;gap:6px}.answer{position:relative;min-height:43px;display:flex;gap:7px;align-items:center;padding:6px 8px;text-align:left;font-weight:700;line-height:1.2;font-size:clamp(.82rem,1.05vw,.98rem);overflow-wrap:anywhere;background:#35414c;border-color:#a4b4be44}.answer kbd{font-size:.65rem;min-width:17px;display:inline-flex;align-items:center;justify-content:center;height:20px;border:1px solid #d2e6e34a;border-radius:4px;color:#d2e6e3;font-family:inherit;font-weight:400}.answer.correct{background:#284e41;border-color:#83dbb6;opacity:1}.answer.wrong{background:#543a40;border-color:#d3a092;opacity:1}.feedback{font-size:.78rem;line-height:1.3;color:#d1ddd7;flex:1;display:flex;align-items:center;margin-top:7px;min-height:2.6em}.feedback.success{color:#aae6c7}.repair-area{background:#161e26;padding:7px 10px 9px;min-height:70px;flex:none;border-top:1px solid #d2b86c35}.repair-price{display:flex;justify-content:center;gap:9px;font-size:.75rem;color:var(--muted);margin-bottom:5px}.repair-price .missing{color:#ffb4a5}.repair-price .enough{color:#acd4bb}.repair-button{width:100%;font-size:.85rem;min-height:35px;padding:6px 8px}.vote-controls{display:flex;gap:5px}.vote-controls button{flex:1;font-size:.85rem;min-height:40px;padding:6px}.vote-controls .yes[aria-pressed=true]{background:#345746;border-color:#9ad0ac}.repair-area>p{font-size:.8rem;text-align:center;color:var(--muted);padding:7px 0}.resource-fly{position:fixed;z-index:60;pointer-events:none;font-size:1.15rem;padding:5px 9px;border:1px solid #deca8c88;border-radius:20px;background:#1d2935ed;color:#ffedbc;animation:resourcefly 1.1s ease-out forwards}.overlay{position:absolute;inset:0;z-index:80;background:#071018d9;display:flex;align-items:center;justify-content:center;backdrop-filter:blur(6px);padding:18px}.dialog{position:relative;width:min(680px,100%);max-height:95dvh;overflow:auto;text-align:center;border:1px solid #d6bf8170;border-radius:22px;background:linear-gradient(150deg,#313340,#14282c);padding:30px;box-shadow:0 20px 100px #0007}.dialog h2{font-size:2.5rem}.dialog>p:not(.eyebrow){line-height:1.5;color:#d2d6cb;margin:14px 0}.dialog>button{margin:7px}.quiet{font-size:.8rem}.final-portraits{display:flex;justify-content:center;gap:20px;margin:18px 0}.final-portraits .sprite{width:65px}.final-row{display:flex;justify-content:space-between;gap:12px;margin:7px 0;border-bottom:1px solid #ffffff12;padding:7px 0;font-size:.85rem}.final-row .personal-stock{flex-wrap:wrap}.victory{background:radial-gradient(ellipse at 50% 40%,#3c4e38bd,#08151be8)}#celebration{position:absolute;inset:0;pointer-events:none;width:100%;height:100%}.small-tabs{display:none}.no-motion *,.no-motion *::before,.no-motion *::after{animation:none!important;transition:none!important}.no-motion .repair-flash{display:none}.paused .scene *{animation-play-state:paused!important}.playing .game:fullscreen{height:100dvh}
@keyframes breathe{50%{transform:translateY(-5px) rotate(.6deg)}}@keyframes cast{40%{transform:translateY(-9px) rotate(-7deg);filter:drop-shadow(0 0 12px var(--accent))}100%{transform:none}}@keyframes float{to{transform:translate(16px,-38px);opacity:.25}}@keyframes mist{50%{transform:translateX(18%) scale(1.15);opacity:.5}}@keyframes spell{0%{transform:translate(0,0) scale(.4);opacity:0}30%{opacity:1}100%{bottom:62%;left:56%;transform:scale(1.2);opacity:0}}@keyframes repairflash{0%,100%{opacity:0;transform:scale(.5)}45%{opacity:1;transform:scale(1.5)}}@keyframes resourcefly{0%{opacity:0;transform:translate(-50%,0) scale(.6)}20%{opacity:1}100%{opacity:0;transform:translate(-50%,-100px) scale(1)}}
@media(min-width:1600px){.question{font-size:1.18rem}.answer{font-size:1.08rem;min-height:52px}.question-deck{height:310px}.question-meta>span,.feedback{font-size:.85rem}}
@media(max-height:740px) and (min-width:701px){.question-deck{height:230px;padding:6px 8px}.question{font-size:.9rem;min-height:3.4em;margin-bottom:5px}.answer{min-height:37px;font-size:.82rem}.question-meta{margin-bottom:2px}.feedback{font-size:.72rem;margin-top:3px;min-height:2.4em}.repair-area{min-height:64px;padding:5px 8px}.collected{padding:4px}.collected>span{display:none}.game-toolbar{min-height:54px;padding:6px 10px}.team-message{height:25px;padding:4px}.hero{max-height:105px;width:64px}.setup{padding:15px 22px}.intro{margin-bottom:12px}.intro>p:last-child{font-size:.85rem;margin-top:8px}.setup-settings{margin-bottom:12px;padding:8px 12px}.character-choice .sprite{height:65px;width:39px}.player-card{padding:10px}.setup-bottom{margin-top:12px}.player-card .keys{margin:3px 0 6px}}
@media(max-width:1100px){.game-actions{gap:3px}.game-actions button{padding:5px 7px;font-size:.72rem}.game-title strong{font-size:.95rem}.stock{gap:8px}.stock-item small{display:none}.game-toolbar{gap:8px}.setup{padding:20px}.character-choice .sprite{height:70px;width:42px}.characters{gap:3px}.character-choice span:last-child{font-size:.63rem}}
@media(max-width:700px){.site-header{padding:0 15px;font-size:.85rem}.site-header span{display:none}.setup{padding:20px 14px}.setup-settings{gap:12px}.player-setup{grid-template-columns:repeat(2,minmax(0,1fr))}.player-setup[data-count="1"]{grid-template-columns:1fr}.character-choice .sprite{height:76px;width:45px}.setup-bottom{flex-direction:column;align-items:stretch;gap:12px}.start{width:100%}.game-toolbar{flex-wrap:wrap;padding:6px 8px;gap:5px}.game-title{display:none}.stock{flex:1;justify-content:space-around}.stock .stock-item{font-size:.9rem}.game-actions{width:100%;justify-content:center}.small-tabs{display:flex;justify-content:center;gap:6px;background:#171f28;padding:4px}.small-tabs button{min-height:27px;padding:3px 8px;font-size:.76rem}.small-tabs button[aria-current=true]{border-color:var(--gold);background:#4c4431}.lanes{display:block}.lane{height:100%}.lane:not(.mobile-active){display:none}.question-deck{height:254px;padding:8px 12px}.question{font-size:1rem;min-height:3em}.answer{font-size:.95rem;min-height:42px}.feedback{font-size:.8rem}.hero{width:80px}.scene{min-height:80px}.collected{padding:4px}.collected>span{display:none}.repair-area{min-height:65px;padding:5px 12px}.dialog{padding:22px 16px}.final-row{flex-direction:column;gap:5px}.final-portraits{gap:8px}.final-portraits .sprite{width:48px}.team-message{height:auto;min-height:25px;font-size:.73rem;padding:4px 8px}}
.sprite.extra{background-size:500% 100%}
.character-choice span:last-child{font-size:.82rem}
.question-deck{position:relative;z-index:3}
.scene .world-title{max-width:70%}
.scene-label{z-index:3}
.game-actions .analytics-settings{display:inline-block;margin:0;color:var(--ink);text-decoration:none;border:1px solid var(--line);background:#202c34}
@media(min-width:701px) and (max-width:1100px){.lanes[data-count="4"] .answers.long-answers{grid-template-columns:1fr}.lanes[data-count="4"] .answers.long-answers .answer{min-height:36px}.character-choice span:last-child{font-size:.68rem}}
.question-deck{min-height:clamp(238px,34vh,310px)}
@media(max-height:740px) and (min-width:701px){.question-deck{min-height:230px}}
@media(max-width:700px){.question-deck{min-height:254px}}
.lanes[data-count="1"]{grid-template-columns:minmax(0,760px);justify-content:center;background:radial-gradient(ellipse,#233938,#0d171f)}
.ripple{display:none;position:absolute;left:44%;top:57%;width:55px;height:18px;border:1px solid #c8f5ff99;border-radius:50%;pointer-events:none;animation:ripple 3s ease-out infinite;mix-blend-mode:screen}
.ripple:nth-of-type(2){animation-delay:1s}.ripple:nth-of-type(3){animation-delay:2s}
.scene[data-world="math"][data-stage="2"] .ripple{display:block}
.scene[data-world="nature"][data-stage="2"] .mote{background:#b5eaba;box-shadow:0 0 12px #90e6ac;width:4px;height:4px}
@keyframes ripple{from{transform:scale(.2);opacity:.9}to{transform:scale(2);opacity:0}}
@media(prefers-reduced-motion:reduce){.hero,.mist,.mote{animation:none}}

/* Explicit resource identities and separate meanings for prices and totals. */
.hero{height:clamp(85px,17vh,180px);width:auto;max-height:calc(100% - 25px);aspect-ratio:.6}
.resource-symbol{display:inline-flex;width:22px;height:22px;flex:none;vertical-align:middle}.resource-symbol svg{display:block;width:100%;height:100%}
.warehouse{display:grid;gap:4px;justify-items:center}.warehouse>span{font-size:.64rem;letter-spacing:.07em;color:#e2d6ac;white-space:nowrap}.stock{gap:15px}.stock .stock-item{display:grid;grid-template-columns:22px auto;column-gap:5px;row-gap:0}.stock .stock-item strong{font-size:1.05rem}.stock .stock-item small{display:block;grid-column:2;font-size:.72rem;color:#d5ded8}
.lane-income{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 10px;background:#2d3c35;border-bottom:1px solid #91b49c44;min-height:34px;flex:none}.lane-income>span:first-child{font-size:.73rem;color:#e2e9e1}.lane-income .stock-item{display:flex;gap:4px;white-space:nowrap}.lane-income small{display:inline;font-size:.78rem;color:#f1eddc}.lane-income strong{color:#d4ebaf;font-size:.95rem}.lane-income .resource-symbol{width:21px;height:21px}
.collected{padding:5px 8px 6px}.collected>span{display:block!important;font-size:.64rem;letter-spacing:.045em;margin-bottom:4px;color:#d9d8c9}.personal-stock{gap:8px;justify-content:space-around}.personal-stock .stock-item{display:grid;grid-template-columns:17px auto;gap:0 3px}.personal-stock .resource-symbol{width:17px;height:17px}.personal-stock strong{font-size:.83rem;line-height:18px}.personal-stock small{display:block;grid-column:1 / -1;font-size:.64rem;color:#abbcb8;text-align:center}
.repair-area{padding:6px 8px 7px;min-height:0}.repair-area>.repair-caption{padding:0;margin-bottom:3px;font-size:.72rem;font-weight:800;color:#efdb9e;text-align:left}.repair-table{border-collapse:collapse;width:100%;font-size:.75rem;line-height:1.15;table-layout:fixed;margin-bottom:3px}.repair-table th,.repair-table td{text-align:center;padding:2px 1px}.repair-table th:first-child{width:37px;text-align:left;font-size:.68rem}.repair-table thead th{font-size:.66rem;color:#c9d7d2;font-weight:600}.repair-table .resource-symbol{width:15px;height:15px;margin-right:2px}.repair-table tbody tr:first-child{background:#e3c88412;font-weight:800}.repair-table tbody th{color:#d1d7cd}.repair-table .enough{color:#bcdebd}.repair-table .missing{color:#ffc2af}.repair-area>.repair-deficit{padding:0;margin-bottom:4px;font-size:.68rem;line-height:1.2;color:#dad4bf;text-align:left}.repair-button{min-height:33px;font-size:.8rem}.stage-badge{font-size:.7rem;white-space:normal;max-width:135px;text-align:right}.scene .world-title{max-width:58%}.setup-income{font-size:.76rem;margin-top:10px;color:#bfcfbd;display:flex;gap:6px;flex-wrap:wrap;align-items:center}.setup-income .stock-item{gap:4px}.setup-income .stock-item small{display:block;font-size:.76rem}.resource-fly{display:flex}.resource-fly .stock-item{display:flex;gap:5px}.resource-fly small{font-size:.8rem;color:#fff0bf}.final-row .personal-stock{min-width:260px}
@media(max-width:1100px){.stock{gap:8px}.warehouse>span{font-size:.59rem}.lane-income{padding:4px 7px;gap:4px}.lane-income>span:first-child{font-size:.65rem}.lane-income small{font-size:.7rem}.repair-table thead th{font-size:.61rem}.repair-table .resource-symbol{width:13px;height:13px;margin-right:1px}}
@media(max-height:800px) and (min-width:701px){.collected{padding:3px 6px}.personal-stock .stock-item{display:flex;gap:2px}.personal-stock small{font-size:.57rem}.personal-stock strong{font-size:.75rem}.personal-stock .resource-symbol{width:14px;height:14px}.collected>span{font-size:.6rem;margin-bottom:2px}.lane-income{min-height:29px}.repair-table .resource-symbol{display:none}.repair-table th,.repair-table td{padding:1px}.repair-area>.repair-caption{font-size:.66rem}.repair-area>.repair-deficit{font-size:.62rem}.repair-button{min-height:30px;font-size:.72rem}.question-deck{min-height:210px}.game-toolbar{min-height:62px}.scene{min-height:72px}}
@media(max-width:700px){.warehouse{width:100%}.warehouse>span{font-size:.65rem}.stock{width:100%;justify-content:space-around}.stock .stock-item small{font-size:.68rem}.lane-income{min-height:32px}.lane-income>span:first-child{font-size:.75rem}.lane-income small{font-size:.8rem}.collected{padding:4px 10px}.personal-stock .stock-item{display:flex;gap:4px}.personal-stock small{font-size:.68rem}.repair-table th:first-child{width:45px}.repair-table thead th{font-size:.71rem}.repair-table .resource-symbol{width:16px;height:16px}.repair-table{font-size:.85rem}.final-row .personal-stock{min-width:0}.stage-badge{max-width:150px}}
@media(max-height:800px) and (min-width:701px){.game-toolbar{padding-top:6px;padding-bottom:6px}.question-deck{padding:6px 8px}.question{min-height:3em;margin-bottom:6px;font-size:.9rem}.feedback{min-height:2.2em;margin-top:4px;font-size:.72rem}.question-meta{margin-bottom:3px}.scene{min-height:90px}}

