/* ---------- LOBBY ---------- */
#lobby.on { display: flex; align-items: center; justify-content: center; padding-bottom: 14px; }
#lobby .lobby-copy { position: relative; z-index: 2; width: min(1000px, 94vw); text-align: center; display: grid; justify-items: center; gap: 14px; }
.season { padding: 5px 12px; font-size: 13px; color: var(--ink); background: var(--leaf); border: 3px solid #000; box-shadow: 0 4px 0 rgba(0, 0, 0, .4); letter-spacing: .08em; cursor: pointer; }
.season:hover { filter: brightness(1.08); }
.title { display: flex; gap: .12em; font-size: clamp(64px, 11vw, 128px); line-height: 1; color: var(--gold); letter-spacing: .02em;
  text-shadow: 0 .05em 0 var(--gold2), 0 .1em 0 #6b3f07, 0 .14em 0 #000, 0 .2em 28px rgba(0, 0, 0, .7); }
.title span:last-child { color: #ffe08a; }
.tag { max-width: 520px; font-size: 18px; line-height: 1.55; color: var(--cream); text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .9); }
.tag em { font-style: normal; color: var(--gold); }
.lobby-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.btn-gold.big { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { filter: brightness(1.12); } }
.lobby-stats { display: flex; gap: 10px; margin-top: 4px; }
.lobby-stats div { min-width: 120px; padding: 8px 12px; background: rgba(18, 12, 6, .82); border: 3px solid #000; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); }
.lobby-stats small { display: block; color: var(--sand); font-size: 12px; }
.lobby-stats b { font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.tierbar { position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(780px, 94vw); display: flex; background: rgba(18, 12, 6, .86); cursor: pointer; }
.tierbar div { flex: 1; position: relative; padding: 8px 6px 7px; text-align: center; border-right: 2px solid rgba(0, 0, 0, .5); }
.tierbar div:last-child { border-right: 0; }
.tierbar div::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.tierbar b { display: block; font-size: 14px; color: var(--c); }
.tierbar span { font-size: 12px; color: var(--sand); }

/* ---------- DRAW CHAMBER ---------- */
.chamber::after { content: ''; position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(55% 45% at 50% 62%, rgba(255, 190, 90, .16), transparent 70%),
  linear-gradient(rgba(8, 10, 5, .55), rgba(8, 10, 5, .7)); }
.chamber .glow { position: absolute; z-index: 1; width: 44vmin; height: 44vmin; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255, 186, 70, .32), rgba(255, 140, 30, .07) 45%, transparent 70%); animation: torch 2.4s ease-in-out infinite alternate; }
.chamber .g1 { left: 10%; top: -6%; }
.chamber .g2 { right: -10%; bottom: 0; animation-delay: -1.2s; background: radial-gradient(circle, rgba(140, 220, 120, .18), transparent 65%); }
@keyframes torch { 0% { opacity: .55; transform: scale(.94); } 100% { opacity: 1; transform: scale(1.06); } }
.motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .75; background-image:
  radial-gradient(2px 2px at 12% 30%, #f9e27a, transparent), radial-gradient(2px 2px at 68% 58%, #c9f58a, transparent), radial-gradient(1.5px 1.5px at 38% 78%, #f9e27a, transparent),
  radial-gradient(2px 2px at 84% 22%, #f9e27a, transparent), radial-gradient(1.5px 1.5px at 52% 40%, #c9f58a, transparent), radial-gradient(2px 2px at 24% 64%, #f9e27a, transparent);
  background-size: 420px 420px; animation: motes 24s linear infinite; }
@keyframes motes { to { background-position: 160px -420px; } }

.chamber-body { position: relative; z-index: 3; height: 100%; max-width: 1080px; margin: 0 auto; padding: 22px 18px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center; }
.chamber-left { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.cocoon-stage { position: relative; width: min(260px, 50vw); aspect-ratio: 5/6; display: grid; place-items: center; }
.cocoon { position: relative; z-index: 2; width: 62%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .55)) drop-shadow(0 0 22px rgba(255, 214, 120, .35)); animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes breathe { 50% { transform: translateY(-7px) scale(1.02, .99); } }
.cocoon-stage.shake .cocoon { animation: shake .45s steps(6) infinite; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-4px, 1px) rotate(-3deg); } 40% { transform: translate(4px, -1px) rotate(3deg); } 60% { transform: translate(-3px, 0) rotate(-2deg); } 80% { transform: translate(3px, 1px) rotate(2deg); } }
.cocoon-stage.spawn .cocoon { animation: spawn .65s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes spawn { from { transform: translateY(-70px) scale(.5); opacity: 0; } }
.cocoon-stage.gone .cocoon { animation: gone .35s ease-in forwards; }
@keyframes gone { to { opacity: 0; transform: scale(1.25); filter: blur(4px) brightness(2); } }
.silk { position: absolute; z-index: 1; top: -8%; width: 2px; height: 48%; background: linear-gradient(rgba(255, 250, 230, .0), rgba(255, 250, 230, .55)); transform-origin: top; }
.silk.s1 { left: 47%; } .silk.s2 { left: 40%; height: 40%; transform: rotate(8deg); opacity: .6; } .silk.s3 { left: 56%; height: 42%; transform: rotate(-9deg); opacity: .6; }
.cradle { position: absolute; z-index: 1; bottom: 2%; left: 18%; right: 18%; height: 16%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); }
.lede { max-width: 360px; text-align: center; font-size: 14px; line-height: 1.55; color: #e3d2a6; text-shadow: 0 2px 0 #000; }
.supply { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 10px; max-width: min(360px, 90vw); text-align: center; font-size: 13px; color: var(--sand); text-shadow: 0 1px 0 #000; }
.supply i { flex: 1; height: 8px; background: rgba(0, 0, 0, .55); border: 2px solid #000; }
.supply u { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--leaf) 0 6px, #5f9c33 6px 8px); }
.supply b { color: var(--gold); white-space: nowrap; }
.carts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 440px; }
.cart { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 2px var(--c); }
.cart i { width: 12px; height: 12px; background: var(--c); border: 2px solid #000; }
.cart b { font-size: 13px; color: var(--c); }
.cart span { font-size: 12px; color: var(--cream); opacity: .85; }

.altar { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; background: linear-gradient(#33240f, #1f150a); }
.altar::before { content: ''; position: absolute; left: -3px; right: -3px; top: -12px; height: 10px; background: repeating-linear-gradient(90deg, var(--leaf) 0 14px, var(--moss2) 14px 28px); border: 3px solid #000; border-bottom: 0; }
.seal { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.seal .disc { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a37a4a, #5c3a1c 70%); box-shadow: inset 0 0 0 4px rgba(0, 0, 0, .25), 0 4px 0 #2b170a; }
.seal .disc span { width: 22px; height: 22px; background: #2b170a; clip-path: polygon(30% 0, 70% 0, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%, 30% 100%, 30% 70%, 0 70%, 0 30%, 30% 30%); }
.seal[data-s='yes'] .disc { background: radial-gradient(circle at 35% 30%, #c6f08a, #4f8a25 70%); box-shadow: 0 0 22px rgba(150, 220, 90, .55), 0 4px 0 #24410e; }
.seal[data-s='yes'] .disc span { clip-path: polygon(14% 52%, 30% 36%, 44% 52%, 76% 18%, 92% 34%, 44% 84%); }
.seal[data-s='busy'] .disc { animation: spin 1s linear infinite; }
.seal b { display: block; font-size: 16px; }
.seal small { display: block; font-size: 12px; color: var(--sand); margin-top: 3px; line-height: 1.4; }
.seal[data-s='yes'] b { color: #c6f08a; }
.ladder { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ladder h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .16em; color: var(--gold); }
.step { width: var(--w); min-width: 170px; display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; color: var(--ink); font-size: 13px; background: linear-gradient(#d9bd7c, #b39352); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); border: 2px solid #000; transition: .2s; }
.step b { font-weight: 700; }
.step.done { opacity: .4; text-decoration: line-through; }
.step.now { background: linear-gradient(#ffe07a, #f2a922); box-shadow: 0 0 18px rgba(255, 190, 60, .5), inset 0 -3px 0 rgba(0, 0, 0, .2); transform: scale(1.04); }
.qty { display: flex; align-items: center; justify-content: center; gap: 18px; }
.hg { width: 46px; height: 46px; border: 0; color: var(--ink); font-size: 24px; font-weight: 700; background: var(--gold); clip-path: polygon(0 0, 100% 0, 72% 50%, 100% 100%, 0 100%, 28% 50%); transition: transform .15s; }
.hg:active { transform: scale(.9) rotate(180deg); }
.qn { text-align: center; min-width: 80px; }
.qn b { display: block; font-size: 34px; line-height: 1; color: var(--gold); text-shadow: 0 3px 0 #000; }
.qn small { color: var(--sand); }
.qty-quick { display: flex; justify-content: center; gap: 8px; }
.qty-quick button { padding: 5px 12px; font-size: 13px; color: var(--sand); background: rgba(0, 0, 0, .4); border: 2px solid #000; }
.qty-quick button.on { color: var(--ink); background: var(--sand); }
.quote { text-align: center; font-size: 14px; color: var(--cream); min-height: 20px; }
.quote b { color: var(--gold); }
.break { width: 100%; padding: 16px; font-size: 22px; letter-spacing: .3em; }
.fine { text-align: center; font-size: 11px; color: var(--sand); opacity: .8; }
/* cocoons sealed earlier and not yet opened: a reminder under the cocoon, never over the hatch button */
.seal-pill { display: none; gap: 10px; align-items: center; padding: 8px 16px; font-size: 13px; color: var(--ink); background: var(--leaf); white-space: nowrap; cursor: pointer; }
.seal-pill.show { display: flex; animation: pillIn .25s ease-out both; }
@keyframes pillIn { from { opacity: 0; transform: translateY(6px); } }
.seal-pill.exp { background: var(--amber); }

/* ---------- SHEETS (colony, fuse) ---------- */
.paper::after { content: ''; position: absolute; inset: 0; background: rgba(8, 10, 5, .72); pointer-events: none; }
.sheet { position: relative; z-index: 2; height: calc(100% - 36px); max-width: 1180px; margin: 18px auto; display: flex; flex-direction: column; background: linear-gradient(#2a1d0f, #1a1209); width: calc(100% - 28px); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 16px 18px 12px; border-bottom: 3px solid #000; }
.sheet-head small { color: var(--gold); letter-spacing: .16em; font-size: 12px; }
.sheet-head h2 { font-size: 26px; margin: 2px 0 4px; }
.sheet-head p { font-size: 14px; color: var(--sand); max-width: 560px; line-height: 1.5; }
.sheet > .grid { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 22px; align-content: start; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #6b5434 transparent; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: flex; border: 2px solid #000; background: rgba(0, 0, 0, .4); }
.board-tabs { margin: 6px 0 10px; width: max-content; max-width: 100%; }
.seg.board-tabs button { padding: 6px 16px; }
.seg button { padding: 6px 10px; font-size: 13px; border: 0; background: none; color: var(--sand); border-right: 2px solid #000; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.on { color: var(--ink); background: var(--c, var(--gold)); }
.seg button i { font-style: normal; opacity: .75; margin-left: 4px; }
select { padding: 6px 8px; font-size: 13px; background: #120c06; border: 2px solid #000; color: var(--cream); }

.fuse-sheet .altar-row { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px; border-bottom: 3px solid #000; flex-wrap: wrap; background: radial-gradient(60% 120% at 50% 50%, rgba(255, 190, 90, .1), transparent); }
.slots { display: flex; gap: 12px; }
.slot { width: 112px; aspect-ratio: 3/4.3; display: grid; place-items: center; border: 3px dashed rgba(216, 195, 154, .45); color: var(--sand); font-size: 13px; background: rgba(0, 0, 0, .3); }
.slot .card { width: 100%; pointer-events: none; }
.slot.filled { border: 0; }
.arrow { font-size: 30px; color: var(--gold); text-shadow: 0 3px 0 #000; }
.fuse-out { width: 112px; aspect-ratio: 3/4.3; display: grid; place-items: center; text-align: center; padding: 10px; border: 3px solid var(--c, #6b5434); background: radial-gradient(circle, color-mix(in srgb, var(--c, #6b5434) 35%, transparent), rgba(0, 0, 0, .45) 70%); font-size: 13px; color: var(--sand); line-height: 1.5; }
.fuse-out b { display: block; color: var(--c, var(--sand)); font-size: 18px; }
.fuse-out .rate { display: block; font-style: normal; font-size: 20px; color: var(--cream); }
.fuse-note { margin: 6px 0 0; font-size: 12px; color: var(--sand); text-align: center; }
.fuse-sheet.fusing .slot .card { animation: suck .9s ease-in forwards; }
@keyframes suck { to { transform: translateX(var(--tx, 0)) scale(.2) rotate(200deg); opacity: 0; filter: brightness(3); } }

/* ---------- BATTLE ---------- */
#battle.on { display: flex; flex-direction: column; gap: 8px; padding: calc(var(--top) + var(--sat) + 6px) 14px calc(12px + var(--dock) + var(--sab)); background: #142010 url(../assets/marsh-map.png) center/cover; }
#battle::before { background: rgba(8, 12, 6, .78); }
.battle-top { position: relative; z-index: 4; display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 8px 14px; background: rgba(22, 15, 8, .92); }
.battle-top small { color: var(--gold); letter-spacing: .12em; }
.battle-top h2 { font-size: 20px; margin: 1px 0; }
.battle-top p { font-size: 13px; color: var(--sand); max-width: 620px; line-height: 1.45; }
.battle-meta { display: flex; align-items: center; gap: 14px; flex: none; }
.pool-box { display: flex; align-items: center; gap: 10px; padding: 6px 12px; text-align: left; color: var(--cream); background: rgba(245, 192, 74, .1); border: 2px solid rgba(245, 192, 74, .55); box-shadow: inset 0 2px 0 rgba(255, 230, 160, .15); }
.pool-box:hover { background: rgba(245, 192, 74, .18); }
.pool-box .pi { width: 30px; height: 30px; }
.pool-box small { display: block; font-size: 11px; color: var(--sand); }
.pool-box b { display: block; font-size: 20px; line-height: 1.15; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #000; }
.cutoff { text-align: right; flex: none; }
.cutoff b { display: block; font-size: 24px; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #000; }
.map-wrap { position: relative; z-index: 3; flex: 1; min-height: 0; display: grid; place-items: center; container-type: size; }
.map { position: relative; width: min(100cqw, 100cqh * 16 / 9); aspect-ratio: 16/9; border: 3px solid #000; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.map img, .map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#lane-ui { position: absolute; inset: 0; }
.lane-tag { position: absolute; transform: translate(-50%, -50%); padding: 4px 8px; font-size: 12px; white-space: nowrap; color: var(--cream); background: rgba(16, 11, 5, .88); border: 2px solid #000; box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.lane-tag b { color: var(--gold); margin-right: 4px; }
.lane-tag em { font-style: normal; color: var(--leaf); }
.lane-slot { position: absolute; transform: translate(-50%, -50%); width: clamp(36px, 10%, 112px); aspect-ratio: 1; padding: 0; display: grid; place-items: center; border: 3px dashed rgba(255, 233, 170, .7); background: rgba(10, 8, 4, .55); color: var(--gold); font-size: 13px; text-align: center; line-height: 1.3; white-space: pre-line; animation: slotPulse 1.6s ease-in-out infinite; }
@keyframes slotPulse { 50% { border-color: var(--gold); box-shadow: 0 0 16px rgba(245, 192, 74, .5); } }
.lane-slot.filled { border: 3px solid var(--c); animation: none; background: rgba(10, 8, 4, .35); }
.lane-slot canvas { width: 100%; height: 100%; }
.lane-slot .mini { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); padding: 1px 6px; font-size: 11px; white-space: nowrap; color: var(--cream); background: rgba(0, 0, 0, .75); border: 2px solid #000; }
.lane-slot.locked { pointer-events: none; }
.lane-slot .plus { display: none; font-size: 22px; line-height: 1; }
.foe-slot { position: absolute; transform: translate(-50%, -50%); width: clamp(32px, 8.5%, 96px); aspect-ratio: 1; border: 3px solid var(--c); background: rgba(40, 10, 8, .5); }
.foe-slot canvas { width: 100%; height: 100%; transform: scaleX(-1); }
.clash { position: absolute; transform: translate(-50%, -50%); padding: 3px 9px; font-size: 14px; font-weight: 700; border: 2px solid #000; animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1) both; white-space: nowrap; }
.clash.win { background: var(--leaf); color: var(--ink); }
.clash.lose { background: var(--red); color: #fff; }
.clash.draw { background: var(--sand); color: var(--ink); }
@keyframes stampIn { from { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } }
.battle-bar { position: relative; z-index: 4; align-self: center; width: min(860px, 100%); display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: rgba(22, 15, 8, .92); flex-wrap: wrap; }
.battle-bar p { flex: 1; min-width: 200px; font-size: 14px; color: var(--sand); line-height: 1.45; }
.battle-bar p b { color: var(--gold); }
.battle-bar .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.lane-list { display: none; }
.lane-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; width: 100%; text-align: left; color: var(--cream); background: rgba(22, 15, 8, .9); border: 3px solid #000; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); }
.lane-row:disabled { color: var(--cream); cursor: default; }
.lane-row .thumb { width: 48px; height: 48px; display: grid; place-items: center; border: 2px dashed rgba(255, 233, 170, .6); color: var(--gold); font-size: 20px; background: rgba(0, 0, 0, .35); }
.lane-row .thumb.filled { border: 3px solid var(--c); }
.lane-row .thumb canvas { width: 100%; height: 100%; }
.lane-row b { display: block; font-size: 15px; }
.lane-row small { color: var(--sand); }
.lane-row em { font-style: normal; color: var(--leaf); }
.lane-row .go { font-size: 13px; color: var(--gold); }
.results { position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 2, .7); }
.results-card { width: min(640px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px; background: linear-gradient(#2a1d0f, #1a1209); border: 3px solid #000; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .1), 0 10px 40px rgba(0, 0, 0, .6); }
.results-card small { color: var(--gold); letter-spacing: .14em; }
.results-card h3 { font-size: 28px; margin: 4px 0 6px; color: var(--gold); }
.results-card .big { display: flex; gap: 12px; margin: 12px 0; }
.results-card .big div { flex: 1; padding: 10px; text-align: center; background: rgba(0, 0, 0, .4); border: 2px solid #000; }
.results-card .big b { display: block; font-size: 26px; color: var(--gold); }
.results-card .big span { font-size: 12px; color: var(--sand); }
.mlist { display: grid; gap: 6px; margin: 10px 0; }
.mrow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 10px; font-size: 13px; background: rgba(0, 0, 0, .3); border: 2px solid #000; }
.mrow .pips { display: flex; gap: 3px; }
.mrow .pips i { width: 12px; height: 12px; border: 2px solid #000; background: #555; }
.mrow .pips i.w { background: var(--leaf); } .mrow .pips i.l { background: var(--red); } .mrow .pips i.d { background: var(--sand); }
.board { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.board td, .board th { padding: 5px 8px; text-align: left; border-bottom: 2px solid rgba(0, 0, 0, .5); }
.board th { color: var(--sand); font-weight: 400; }
.board tr.me td { color: var(--gold); background: rgba(245, 192, 74, .1); }
.board.nowrap td, .board.nowrap th { white-space: nowrap; padding: 5px 6px; }
.board .tag-paid, .board .tag-nh { margin-left: 6px; padding: 0 4px; font-size: 11px; font-style: normal; white-space: nowrap; }
.board .tag-paid { color: var(--ink); background: var(--gold); }
.board .tag-nh { color: var(--sand); border: 1px solid rgba(240, 228, 200, .35); }
.prize-note { margin: 8px 0 0; font-size: 12px; color: var(--sand); }
.prize-note button { margin-left: 6px; }

/* ---------- REVEAL ---------- */
.reveal { position: fixed; z-index: 90; inset: 0; display: none; background: radial-gradient(55% 45% at 50% 44%, rgba(70, 50, 18, .96), rgba(14, 10, 5, .985) 70%), #0b0804; }
.reveal::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(2px 2px at 12% 30%, #f9e27a, transparent), radial-gradient(1.5px 1.5px at 68% 58%, #c9f58a, transparent), radial-gradient(2px 2px at 84% 22%, #f9e27a, transparent), radial-gradient(1.5px 1.5px at 32% 76%, #f9e27a, transparent); background-size: 380px 380px; animation: motes 20s linear infinite; }
.reveal.on { display: block; animation: screenIn .3s ease-out; }
.reveal canvas#fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.res { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; opacity: 0; pointer-events: none; transition: opacity .35s; padding: 20px; }
.res.show { opacity: 1; pointer-events: auto; }
.res-k { font-size: 15px; color: var(--cream); opacity: .85; letter-spacing: .1em; }
.res-card { width: min(250px, 62vw); }
.res-card .card { width: 100%; animation: cardIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes cardIn { from { transform: scale(.6) rotateY(80deg); opacity: 0; } }
.res-n { font-size: clamp(30px, 8vw, 48px); letter-spacing: .1em; color: var(--c); text-shadow: 0 0 24px var(--c), 0 4px 0 rgba(0, 0, 0, .6); animation: stamp .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.res[data-r='4'] .res-n { background: linear-gradient(90deg, #ffe17a, #2fe0c6, #ffe17a); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: stamp .6s cubic-bezier(.2, 1.6, .4, 1) both, shine 2s linear infinite; }
@keyframes stamp { from { transform: scale(2.4); opacity: 0; } }
.res-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.summary { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 18px; }
.summary.show { display: flex; animation: screenIn .3s; }
.summary h3 { font-size: 28px; color: var(--gold); text-shadow: 0 3px 0 #000; }
.summary .grid { width: min(900px, 100%); max-height: 62dvh; overflow: auto; padding: 6px; }
.reveal.shake { animation: rshake .5s steps(8); }
@keyframes rshake { 25% { transform: translate(-6px, 3px); } 50% { transform: translate(5px, -4px); } 75% { transform: translate(-3px, -2px); } }

/* ---------- RULES ---------- */
.rules h4 { margin: 16px 0 6px; color: var(--gold); font-size: 16px; }
.rules p, .rules li { font-size: 14px; line-height: 1.6; color: var(--cream); }
.rules ul { margin: 0; padding-left: 20px; }
.rules table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules td, .rules th { padding: 5px 8px; border-bottom: 2px solid rgba(0, 0, 0, .5); text-align: left; }
.rules th { color: var(--sand); font-weight: 400; }
.rules .warn { margin-top: 14px; padding: 10px 12px; font-size: 13px; color: #ffd9b0; background: rgba(255, 154, 60, .12); border: 2px solid rgba(255, 154, 60, .5); line-height: 1.55; }
.rules .reset { margin-top: 14px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .tag { font-size: 15px; }
  .lobby-stats div { min-width: 0; flex: 1; }
  .tierbar { bottom: 10px; }
  .tierbar span { display: none; }
  .chamber-body { gap: 18px; padding: 12px 14px; }
  .cocoon-stage { width: min(190px, 28vw); }
  .lede { font-size: 12.5px; }
  .altar { padding: 14px; gap: 10px; }
  .step { padding: 5px 10px; font-size: 12px; }
  .sheet { margin: 10px auto; height: calc(100% - 20px); width: calc(100% - 16px); }
  .sheet-head { padding: 12px; }
  .sheet-head h2 { font-size: 21px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .grid.small { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .fuse-sheet .altar-row { gap: 10px; padding: 10px; }
  .slots { gap: 8px; }
  .slot, .fuse-out { width: 72px; font-size: 11px; }
  .fuse-out { padding: 6px; line-height: 1.35; }
  .fuse-out b { font-size: 15px; }
  .fuse-out .rate { font-size: 16px; }
  .arrow { font-size: 22px; }
  .sheet-head p { font-size: 12.5px; }
  #battle.on { padding: calc(var(--top) + var(--sat) + 4px) 8px calc(10px + var(--dock) + var(--sab)); gap: 6px; }
  #battle.on { overflow-y: auto; }
  .map-wrap { flex: none; container-type: inline-size; }
  .map { width: min(100cqw, (100dvh - var(--top) - var(--dock) - var(--sat) - var(--sab) - 230px) * 16 / 9); min-width: min(100cqw, 300px); }
  .lane-list { position: relative; z-index: 3; display: grid; gap: 6px; flex: 1; min-height: 0; overflow: auto; align-content: start; }
  .lane-tag, .lane-slot .mini { display: none; }
  .battle-top { padding: 6px 10px; }
  .battle-top p { display: none; }
  .battle-top h2 { font-size: 17px; }
  .cutoff b { font-size: 19px; }
  .battle-meta { gap: 8px; }
  .pool-box { padding: 4px 8px; gap: 6px; }
  .pool-box .pi { width: 22px; height: 22px; }
  .pool-box b { font-size: 15px; }
  .pool-box #pot-n { font-size: 10px; }
  .lane-tag { font-size: 10px; padding: 2px 5px; }
  .lane-slot { font-size: 10px; border-width: 2px; }
  .lane-slot .tap { display: none; }
  .lane-slot .plus { display: block; }
  .lane-slot .mini { font-size: 9px; bottom: -18px; }
  .battle-bar { padding: 10px; gap: 10px; }
  .battle-bar p { font-size: 12.5px; }
}

/* ---------- polish ---------- */
.walkers { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
#lobby .motes { z-index: 1; opacity: .6; }
.rooms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 10px; margin-top: 6px; }
.room { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; text-align: left; color: var(--cream); background: rgba(18, 12, 6, .72); border: 3px solid #000;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .1), inset 0 -4px 0 rgba(0, 0, 0, .35), 0 6px 0 rgba(0, 0, 0, .35); transition: transform .12s, background .12s; }
.room:hover { transform: translateY(-3px); background: rgba(40, 28, 12, .86); }
.room { padding: 14px 16px; }
.room b { font-size: 19px; }
.room.primary { background: linear-gradient(rgba(255, 215, 105, .95), rgba(232, 160, 30, .95)); color: var(--ink); animation: pulse 2.2s ease-in-out infinite; }
.room.primary b { color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.room.primary small { color: #4a3210; }
.head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.sm .pi { width: 16px; height: 16px; }
.room b { display: block; font-size: 17px; color: var(--gold); }
.room small { display: block; margin-top: 2px; font-size: 12px; color: var(--sand); }
.sealbar { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; opacity: 0; transition: opacity .25s; }
.sealbar.on { opacity: 1; }
.sealbar .pips { display: flex; gap: 8px; }
.sealbar .pips i { width: 20px; height: 20px; background: rgba(0, 0, 0, .55); border: 3px solid #000; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); transition: .2s; }
.sealbar .pips i.lit { background: var(--gold); box-shadow: 0 0 14px var(--gold), inset 0 3px 0 rgba(255, 255, 255, .5); transform: scale(1.12); }
.sealbar small { font-size: 12px; color: var(--sand); text-shadow: 0 1px 0 #000; }
.cocoon-stage { --g: 0; }
.cocoon-stage .cocoon { filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .55)) drop-shadow(0 0 calc(22px + var(--g) * 18px) rgba(255, 214, 120, calc(.35 + var(--g) * .2))); }
button.card { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .15s ease-out; }
button.card:hover { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px); }
button.card:hover .holo { animation: none; background-position: var(--hx, 50%) 0; }
.res[data-r='0'] .res-n, .res[data-r='1'] .res-n { font-size: clamp(22px, 5vw, 32px); }
.res[data-r='2'] .res-n { font-size: clamp(26px, 6.5vw, 40px); }
.foe-name { position: absolute; transform: translate(-50%, -50%); padding: 2px 8px; font-size: 12px; color: #fff; background: rgba(120, 30, 20, .9); border: 2px solid #000; white-space: nowrap; z-index: 2; }
.clash-burst { position: absolute; transform: translate(-50%, -50%); width: 9%; aspect-ratio: 1; pointer-events: none; background: radial-gradient(circle, rgba(255, 245, 190, .95) 0 18%, rgba(255, 190, 80, .55) 30%, transparent 62%); animation: burst .5s ease-out forwards; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(.2); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@media (max-width: 860px) {
  .rooms { grid-template-columns: repeat(2, 1fr); width: min(620px, 100%); gap: 8px; }
  .room { min-width: 0; flex-direction: column; text-align: center; gap: 6px; padding: 10px 8px; }
  .pi.lg { width: 32px; height: 32px; }
  .title { font-size: clamp(56px, 13vw, 100px); }
}
@media (max-width: 560px) {
  .rooms { grid-template-columns: 1fr 1fr; width: 100%; }
  .room small { font-size: 11px; line-height: 1.35; }
  .room { flex-direction: row; text-align: left; gap: 8px; padding: 8px 10px; }
  #lobby .lobby-copy { gap: 10px; }
  .lobby-actions .btn.big { padding: 12px 18px; font-size: 17px; }
}

/* ---------- NEST ---------- */
.fuse-class { display: grid; gap: 6px; justify-items: center; }
.fuse-class small { color: var(--sand); font-size: 12px; }
.fuse-class .warn-s { color: var(--amber); }
.fuse-class .ok-s { color: var(--leaf); }
.fuse-class .seg button:disabled { opacity: .4; cursor: default; }
.lvbox { display: grid; gap: 4px; min-width: 180px; }
.wallet-res { display: flex; gap: 10px; }
.wallet-res span { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(0, 0, 0, .45); border: 3px solid #000; }
.wallet-res b { font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.wallet-res small { color: var(--sand); }
.nest-body { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(280px, 1fr) 1.6fr; gap: 14px; padding: 14px 18px 20px; align-items: start; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #6b5434 transparent; }
.nest-col { display: grid; gap: 12px; min-width: 0; }
.nroom { display: grid; gap: 10px; padding: 12px 14px; background: rgba(0, 0, 0, .32); border: 3px solid #000; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .06); min-width: 0; }
.nroom-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nroom-h b { font-size: 17px; color: var(--gold); }
.nroom-h small, .nroom small { color: var(--sand); font-size: 12px; }
.nroom.soon { opacity: .6; }
.nroom .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.sm { padding: 7px 12px; font-size: 14px; }
.meter { position: relative; height: 20px; background: rgba(0, 0, 0, .55); border: 2px solid #000; }
.meter i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, var(--gold2) 8px 10px); transition: width .4s steps(8); }
.meter em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000; }
.meter.thin { height: 16px; }
.meter.thin i { background: repeating-linear-gradient(90deg, var(--leaf) 0 8px, #5f9c33 8px 10px); }
.thumb { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex: none; background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, transparent), rgba(0, 0, 0, .4) 70%); border: 2px solid var(--c); }
.thumb canvas { width: 100%; height: 100%; }
.thumb.sm { width: 32px; height: 32px; }
.thumb .lv { position: absolute; right: -4px; bottom: -6px; padding: 0 3px; font-size: 10px; font-style: normal; color: var(--ink); background: var(--leaf); border: 2px solid #000; }
.slots-row { display: flex; gap: 8px; flex-wrap: wrap; }
.gslot { width: 64px; display: grid; justify-items: center; gap: 4px; padding: 6px 4px; color: var(--sand); background: rgba(0, 0, 0, .35); border: 2px dashed rgba(216, 195, 154, .5); }
.gslot.filled { border: 2px solid var(--leaf); }
.gslot .plus { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; color: var(--gold); }
.gslot small { font-size: 11px; }
.trip-seg { width: fit-content; max-width: 100%; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 2px; scrollbar-width: thin; }
.ant-tile { display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-align: left; color: var(--cream); background: rgba(0, 0, 0, .35); border: 2px solid #000; }
.ant-tile:hover { background: rgba(60, 42, 18, .6); }
.ant-tile.on { border-color: var(--gold); background: rgba(245, 192, 74, .16); box-shadow: 0 0 12px rgba(245, 192, 74, .35); }
.ant-tile b { display: block; font-size: 13px; }
.ant-tile small { color: var(--sand); font-size: 11px; }
#picker-grid .ant-tile { width: 100%; }
.forecast { justify-content: space-between; }
.forecast p { flex: 1; min-width: 200px; font-size: 13px; color: var(--sand); line-height: 1.5; }
.forecast p b { color: var(--gold); }
.exp { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px; background: rgba(0, 0, 0, .3); border: 2px solid #000; }
.exp.done { border-color: var(--gold); box-shadow: 0 0 12px rgba(245, 192, 74, .3); }
.exp-ants { display: flex; gap: 3px; }
.exp-main { display: grid; gap: 4px; min-width: 0; }
.walking { color: var(--sand); animation: blink 1s steps(2) infinite; padding: 0 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; font-size: 13px; color: var(--sand); background: rgba(0, 0, 0, .5); border: 2px solid #000; }
.toggle i { width: 30px; height: 16px; position: relative; background: #3a2e1c; border: 2px solid #000; }
.toggle i::after { content: ''; position: absolute; left: 0; top: 0; width: 12px; height: 12px; background: var(--sand); transition: left .15s; }
.toggle.on { color: var(--ink); background: var(--leaf); }
.toggle.on i::after { left: 14px; background: var(--gold); }
.auto-opts { display: grid; gap: 6px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cream); }
.chk input { accent-color: var(--gold); width: 16px; height: 16px; }
.auto-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12px; color: var(--sand); max-height: 110px; overflow: auto; }
.auto-log time { color: var(--sky); margin-right: 6px; }
.loot-ev { margin: 6px 0; padding: 8px 10px; font-size: 13px; border: 2px solid #000; }
.loot-ev.dew { background: rgba(134, 220, 95, .18); color: #d4f5b8; }
.loot-ev.beetle { background: rgba(255, 107, 90, .16); color: #ffd2c8; }
.loot-ants { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.loot-ants div { display: flex; align-items: center; gap: 8px; font-size: 12px; }
@media (max-width: 860px) {
  .nest-body { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .nest-col.wide { order: -1; }
  .nest-sheet .sheet-head p { display: none; }
  .nest-sheet .sheet-head h2 { font-size: 19px; }
  .wallet-res b { font-size: 18px; }
  .tiles { grid-template-columns: 1fr 1fr; max-height: none; }
  .ant-tile { gap: 6px; padding: 5px 6px; }
}

@media (max-height: 720px) {
  .title { font-size: min(11vw, 13vh); }
  .tag { font-size: 15px; }
  #lobby .lobby-copy { gap: 10px; }
  .lobby-actions .btn.big { padding: 11px 18px; font-size: 17px; }
  .room { padding: 7px 10px; }
}

/* Title: phrases never break inside; English runs longer, so it is a little smaller. */
.title { flex-wrap: wrap; justify-content: center; column-gap: .28em; row-gap: .08em; }
.title span { white-space: nowrap; }
html[lang='en'] .title { font-size: clamp(46px, 10.5vw, 112px); }
html[lang='en'] .tag { max-width: 560px; }
@media (max-width: 480px) {
  #day-label { display: none; }
  .battle-top { padding: 6px 8px; }
}

/* Ambient motion canvases (js/ambient.js): native 384x216, scaled like the cover background. */
.ambient { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; opacity: 0; transition: opacity .4s; pointer-events: none; }
.ambient.live, .map-anim.live { opacity: 1; }
#lobby::before { z-index: 1; }
.map-anim { opacity: 0; transition: opacity .3s; }

/* Draw chamber on phones: one compact column, the hatch button stays on the first screen. */
@media (max-width: 640px) {
  .chamber-body { grid-template-columns: 1fr; gap: 10px; align-content: start; overflow: auto; padding: 8px 12px 16px; }
  .chamber-left { gap: 8px; }
  .cocoon-stage { width: min(118px, 32vw); }
  .sealbar { min-height: 0; }
  .sealbar:not(.on) { display: none; }
  .lede, .fine { display: none; }
  .supply { font-size: 12px; }
  .carts { gap: 4px; }
  .cart { padding: 2px 7px 2px 4px; }
  .cart b, .cart span { font-size: 11px; }
  .cart i { width: 9px; height: 9px; }
  .altar { padding: 12px; gap: 9px; }
  .altar::before { top: -9px; height: 7px; }
  .seal { gap: 10px; }
  .seal .disc { width: 40px; height: 40px; }
  .seal .disc span { width: 18px; height: 18px; }
  .seal b { font-size: 14px; }
  .ladder { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .ladder h4 { width: 100%; text-align: center; margin: 0; }
  .step { width: auto; min-width: 0; flex: 1; padding: 4px 8px; font-size: 11.5px; transform: none; flex-direction: column; align-items: center; gap: 1px; text-align: center; }
  .step span, .step b { white-space: nowrap; }
  .step span { font-size: 10.5px; opacity: .8; }
  .step.now { transform: none; }
  .qty { gap: 14px; }
  .hg { width: 38px; height: 38px; font-size: 20px; }
  .qn b { font-size: 28px; }
  .qty-quick { margin-top: -4px; }
  .break { padding: 13px; font-size: 20px; }
}

/* Season */
.season-link { margin-left: 8px; padding: 2px 8px; font-size: 12px; vertical-align: middle; color: var(--gold); background: rgba(245, 192, 74, .12); border: 2px solid rgba(245, 192, 74, .5); }
.season-big { display: flex; gap: 10px; margin: 12px 0; }
.season-big div { flex: 1; padding: 10px; text-align: center; background: rgba(0, 0, 0, .4); border: 2px solid #000; }
.season-big b { display: block; font-size: 26px; color: var(--gold); font-variant-numeric: tabular-nums; }
.season-big span { font-size: 12px; color: var(--sand); }
.season-line { margin: 6px 0; font-size: 13px; line-height: 1.55; color: var(--cream); }
.season-line b { color: var(--gold); font-weight: 400; }
.season-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.season-rules div { padding: 8px 12px; background: rgba(0, 0, 0, .3); border: 2px solid #000; }
.season-rules h4 { margin: 0 0 4px; font-size: 14px; color: var(--gold); }
.season-rules ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
@media (max-width: 560px) { .season-rules { grid-template-columns: 1fr; } .season-big b { font-size: 21px; } }

/* 蚁巢 token: campaign banner, buyback stats, holder perks */
.campaign { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; max-width: min(720px, 100%); padding: 6px 14px; font-size: 13px; color: var(--cream); text-decoration: none;
  background: linear-gradient(90deg, rgba(240, 185, 11, .22), rgba(20, 14, 7, .85) 40%, rgba(20, 14, 7, .85) 60%, rgba(240, 185, 11, .22)); border: 2px solid #f0b90b; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.campaign[hidden] { display: none; }
.campaign:hover { filter: brightness(1.1); }
.campaign b { color: #f0b90b; }
.campaign span { color: var(--cream); font-variant-numeric: tabular-nums; }
.campaign em { font-style: normal; color: var(--sand); font-size: 12px; }
.supply.burn b { color: #ff9a5c; }
.supply.burn small { color: var(--sand); font-size: 11px; }
.supply.burn i { display: none; }
.holder-row { width: 100%; padding: 7px 10px; font-size: 12.5px; text-align: center; color: var(--gold); background: rgba(245, 192, 74, .1); border: 2px dashed rgba(245, 192, 74, .5); }
.holder-row:hover { background: rgba(245, 192, 74, .18); }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 2px dashed rgba(255, 154, 60, .4); }
.demo-row small { color: var(--amber); width: 100%; }
.demo-row .btn.on { color: var(--ink); background: var(--gold); }
#holder .h4 { margin: 12px 0 4px; color: var(--gold); font-size: 15px; }
@media (max-width: 640px) { .campaign { font-size: 12px; padding: 5px 10px; } .campaign em { width: 100%; text-align: center; } .holder-row { font-size: 11.5px; padding: 5px 8px; } }

.quote .burn-note { display: block; margin-top: 2px; font-size: 11.5px; color: #ff9a5c; }
.quote .gift-note { display: block; margin-top: 2px; font-size: 11.5px; color: #86dc5f; }
.quote .nft-note { display: block; margin-top: 2px; font-size: 11.5px; color: var(--sand); }

.camp-count b { display: inline-block; margin: 2px 0 10px; padding: 4px 12px; font-size: 18px; color: #f0b90b; background: rgba(0, 0, 0, .4); border: 2px solid #000; }
.camp-pledge { margin-bottom: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.55; background: rgba(240, 185, 11, .12); border: 2px solid rgba(240, 185, 11, .6); }
.camp-pledge b { display: block; color: #f0b90b; margin-bottom: 2px; }
.camp-sec { padding: 7px 0; border-top: 2px solid rgba(0, 0, 0, .35); }
.camp-sec h4 { margin: 0 0 3px; font-size: 14px; color: var(--gold); }
.camp-sec p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--cream); }
.camp-note { margin-top: 10px; font-size: 12px; color: var(--sand); }
.camp-note a { color: var(--sky); }

.room-pool { display: block; margin: 2px 0 1px; font-style: normal; font-size: 16px; color: #f0b90b; text-shadow: 0 2px 0 #000; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .room-pool { font-size: 14px; } }

.usd { color: var(--sand); font-variant-numeric: tabular-nums; }
.pool-box .usd { display: block; font-size: 11px; color: #f7d488; }
.quote .usd { color: var(--sand); font-size: 12px; margin-left: 4px; }

/* New-player quest bar (lobby) */
.quest { position: absolute; z-index: 4; left: 50%; bottom: calc(16px + var(--sab)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px;
  background: rgba(26, 18, 9, .92); border: 3px solid #000; box-shadow: inset 0 0 0 2px var(--gold), 0 6px 0 rgba(0, 0, 0, .35); animation: questIn .4s ease-out; }
.quest[hidden] { display: none; }
@keyframes questIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.q-ico { width: 38px; height: 38px; display: grid; place-items: center; font-style: normal; font-size: 18px; font-weight: 700; color: var(--ink); background: var(--gold); border: 2px solid #000; }
.q-ico.done { background: var(--leaf); }
.q-ico.invite { background: var(--leaf); font-size: 24px; }
.q-main { display: grid; gap: 1px; min-width: 0; }
.q-main small { font-size: 11px; letter-spacing: .1em; color: var(--gold); }
.q-main b { font-size: 16px; color: var(--cream); }
.q-main span { font-size: 12px; color: var(--sand); line-height: 1.4; }
.q-dots { grid-column: 1 / -1; display: flex; gap: 4px; }
.q-dots i { flex: 1; height: 5px; background: rgba(255, 255, 255, .12); }
.q-dots i.on { background: var(--leaf); }
.q-dots i.now { background: var(--gold); }
.room.spot { outline: 3px solid var(--gold); outline-offset: 3px; animation: spot 1s ease-in-out infinite; }
@keyframes spot { 50% { outline-color: rgba(245, 192, 74, .25); } }
#lobby.on:has(.quest:not([hidden])) { padding-bottom: 110px; }
@media (max-width: 560px) { .quest { padding: 8px 10px; gap: 3px 8px; } .q-ico { width: 32px; height: 32px; font-size: 15px; } .q-main b { font-size: 14px; } .q-main span { font-size: 11px; } }

.room-pool .usd { font-style: normal; font-size: 12px; color: #f7d488; margin-left: 6px; }
@media (max-width: 560px) { .room-pool .usd { display: block; margin-left: 0; font-size: 11px; } }
@media (max-width: 560px) {
  .room { flex-direction: column; text-align: center; gap: 4px; padding: 8px 6px; }
  .room .pi.lg { width: 26px; height: 26px; }
  .room-pool { white-space: nowrap; font-size: 14px; }
}

/* Share dialog */
.share-img { display: block; width: 100%; height: auto; margin: 8px 0; border: 3px solid #000; image-rendering: auto; }
.share-text { font-size: 13px; line-height: 1.55; color: var(--cream); padding: 8px 10px; background: rgba(0, 0, 0, .35); border: 2px solid #000; user-select: text; -webkit-user-select: text; }
#share .res-acts { justify-content: flex-start; margin-top: 10px; }
#share .res-acts a { text-decoration: none; }

/* Risk notice and terms */
.terms-h { margin: 14px 0 6px; color: var(--gold); font-size: 15px; }
.terms-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.6; color: var(--cream); }
.terms-line { margin-top: 8px; text-align: center; font-size: 12px; color: var(--sand); }
button.link { padding: 0; border: 0; background: none; color: var(--sky); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; cursor: pointer; }

/* Battle header on phones: title + countdown on one row, the prize pool as a full-width row below. */
@media (max-width: 560px) {
  .battle-top { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
  .battle-meta { display: contents; }
  .battle-top > div:first-child { grid-column: 1; grid-row: 1; align-self: center; }
  .cutoff { grid-column: 2; grid-row: 1; }
  .pool-box { grid-column: 1 / -1; grid-row: 2; width: 100%; padding: 4px 8px; }
  .pool-box > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .pool-box small, .pool-box .usd, .pool-box #pot-n { display: inline; font-size: 11px; }
  .pool-box b { display: inline; font-size: 16px; }
  .battle-top h2 { white-space: nowrap; }
}

/* Red to-do dot on lobby cards */
.room { position: relative; }
.todo-dot { position: absolute; top: 8px; right: 8px; display: none; width: 12px; height: 12px; background: #ff4d3d; border: 2px solid #000; box-shadow: 0 0 10px rgba(255, 77, 61, .8); animation: todoPulse 1.4s ease-in-out infinite; }
.room.todo .todo-dot { display: block; }
@keyframes todoPulse { 50% { transform: scale(1.25); box-shadow: 0 0 16px rgba(255, 77, 61, 1); } }

/* paid hatch coin choice */
.pay { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pay .pay-until { flex-basis: 100%; text-align: center; font-size: 11px; }
.pay small { color: var(--sand); font-size: 12px; }
.pay-opt { position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 13px; color: var(--sand); background: rgba(0, 0, 0, .4); border: 2px solid #000; }
.pay-opt b { font-weight: 700; }
.pay-opt em { font-style: normal; font-size: 11px; padding: 0 4px; color: var(--ink); background: #86dc5f; }
.pay-opt.on { color: var(--ink); background: var(--sand); }
.quote .short-note { display: block; margin-top: 2px; font-size: 12px; color: #ff7a6b; }
.quote .short-note a, .fine .buy-link { color: var(--gold); text-decoration: underline; }

/* wallet choice */
.wallet-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.wallet-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; text-align: left; color: var(--cream); background: rgba(0, 0, 0, .4); border: 3px solid #000; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }
.wallet-opt b { color: var(--gold); font-size: 16px; }
.wallet-opt small { color: var(--sand); font-size: 12px; }
.wallet-opt:hover, .wallet-opt:focus-visible { background: rgba(245, 192, 74, .14); }
.wallet-phone { font-size: 12px; margin-top: 8px; }

/* named wallets (EIP-6963) and the wallet panel */
.wl-h { display: block; margin: 6px 0 -2px; color: var(--sand); font-size: 11px; letter-spacing: .12em; }
.wallet-opt { flex-direction: row; align-items: center; gap: 12px; }
.wallet-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet-opt small:empty { display: none; }
.wallet-opt:disabled { opacity: .7; cursor: progress; }
.wallet-opt.demo b { color: var(--sand); }
.wicon { flex: none; width: 30px; height: 30px; border-radius: 6px; image-rendering: auto; object-fit: contain; }
.wicon.blank { display: inline-block; background: rgba(255, 255, 255, .08); border: 2px dashed rgba(255, 255, 255, .2); }
.wicon.agentic { display: inline-grid; place-items: center; font-style: normal; font-weight: 700; color: #1a1209; background: #f0b90b; }
.chip.wallet .wicon { width: 18px; height: 18px; border-radius: 4px; margin-right: 6px; vertical-align: -4px; }
.chip.wallet .wicon.blank { display: none; }
.wallet-links .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.wallet-none { font-size: 12px; }
.acct-h { display: flex; align-items: center; gap: 10px; }
.acct-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 12px; }
.acct-addr code { padding: 4px 8px; color: var(--gold); background: rgba(0, 0, 0, .45); border: 2px solid #000; font-size: 14px; }
.acct-bal td.num { text-align: right; font-variant-numeric: tabular-nums; }
.acct-bal a { color: var(--gold); text-decoration: underline; font-size: 12px; }
.acct-bal .tag { color: #86dc5f; }
.invite-link code { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; }
.invite-rules { margin: 8px 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }

/* wallet list: compact rows, folded extras */
.wallet-list { gap: 8px; }
.wallet-opt { padding: 9px 12px; }
.wallet-opt b { font-size: 15px; }
.wicon { width: 26px; height: 26px; }
.wallet-more { display: flex; flex-direction: column; gap: 8px; }
.wallet-more[hidden] { display: none; }
.wallet-more-btn { align-self: flex-start; padding: 2px 0; font-size: 13px; color: var(--gold); text-decoration: underline; background: none; border: 0; }

/* scrollbars inside dialogs and panels: thin, dark track, gold thumb (no grey system bar) */
.modal, .chamber-body, .sheet, .grid { scrollbar-width: thin; scrollbar-color: #8a6a2a rgba(0, 0, 0, .25); }
.modal::-webkit-scrollbar, .chamber-body::-webkit-scrollbar, .sheet::-webkit-scrollbar, .grid::-webkit-scrollbar { width: 8px; height: 8px; }
.modal::-webkit-scrollbar-track, .chamber-body::-webkit-scrollbar-track, .sheet::-webkit-scrollbar-track, .grid::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); }
.modal::-webkit-scrollbar-thumb, .chamber-body::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb, .grid::-webkit-scrollbar-thumb { background: #8a6a2a; border: 2px solid #1a1209; }
.modal::-webkit-scrollbar-thumb:hover, .chamber-body::-webkit-scrollbar-thumb:hover, .sheet::-webkit-scrollbar-thumb:hover, .grid::-webkit-scrollbar-thumb:hover { background: var(--gold); }

.wicon.badge { display: inline-grid; place-items: center; font-style: normal; font-weight: 700; color: #fff; }
.wicon.badge.generic { color: var(--sand); background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .15); }
.wallet-opt.absent b { color: var(--sand); }
.wallet-opt.absent small { color: rgba(216, 195, 154, .7); }

/* connect dialog views: the list, or the Agentic QR (an author display rule must not beat [hidden]) */
.wallet-view[hidden], .wallet-list[hidden] { display: none; }
.back-link { display: inline-block; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--sand); background: none; border: 0; }
.back-link:hover { color: var(--gold); }
.agentic-h { display: flex; align-items: center; gap: 10px; }
.agentic .muted { margin-top: 6px; }
.agentic-wait { text-align: center; color: var(--sand); font-size: 13px; margin-top: 8px; }

/* current block on the hatch screen (moved out of the top bar) */
.block-line { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 2px 0 -2px; font-size: 12px; color: var(--sand); }
.block-line b { color: #7ec8ff; font-variant-numeric: tabular-nums; }
.block-line .dot { width: 6px; height: 6px; background: #86dc5f; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .block-line .dot, .seal-pill.show { animation: none; } }

/* Owner settings (wallet panel, publishing wallet only) */
.owner-panel { margin-top: 14px; text-align: left; }
.owner-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin: 8px 0 10px; }
.owner-form label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.owner-form label.wide { grid-column: 1 / -1; }
.owner-form small { color: var(--sand); font-size: 11px; }
.owner-form input { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 12px; padding: 6px 8px; color: var(--cream); background: var(--bark2); border: 2px solid var(--bark); border-radius: 0; }
.owner-form input:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.owner-panel .season-line { word-break: break-all; font-size: 12px; }
@media (max-width: 420px) { .owner-form { grid-template-columns: 1fr; } }
.owner-pays { margin-top: 14px; }
.pay-row { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--bark); }
.pay-row code { font-size: 11px; color: var(--cream); word-break: break-all; user-select: all; }
.pay-row.paid { opacity: .6; }
.pay-act { display: flex; gap: 6px; }
.pay-act input { flex: 1; min-width: 0; box-sizing: border-box; font: inherit; font-size: 12px; padding: 6px 8px; color: var(--cream); background: var(--bark2); border: 2px solid var(--bark); }
