/* Kabza UI: Indian truck-art signboards painted over a living farm. Portrait phones first. */
:root {
  --peacock: #0d3a44;
  --peacock-2: #12505c;
  --peacock-deep: #082830;
  --marigold: #f6b21b;
  --gold-hi: #fff0a6;
  --gold-lo: #b86a08;
  --chili: #d9352a;
  --chili-deep: #7c1712;
  --rani: #e5197d;
  --teal: #2fb7a8;
  --milk: #fbf3dc;
  --milk-dim: #bcd0cc;
  --mud: #1d120a;
  --mud-glass: rgba(24, 14, 7, .8);
  --display: "Yatra One", "Mukta", system-ui, sans-serif;
  --body: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --chev: repeating-linear-gradient(135deg, var(--chili) 0 14px, var(--marigold) 14px 28px, var(--milk) 28px 34px, var(--peacock-deep) 34px 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--mud); color: var(--milk); font-family: var(--body); font-size: 16px; line-height: 1.35;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
canvas#gl, canvas#ov { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#gl { touch-action: none; }
canvas#ov { pointer-events: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--milk); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
svg { display: block; }

.chev { height: 14px; background: var(--chev); box-shadow: 0 2px 0 var(--mud); flex: none; }

/* ---------- Danger ---------- */
#dangerFx {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 48%, rgba(217, 53, 42, .34) 78%, rgba(160, 14, 10, .78) 100%);
}

/* ---------- Painted logo ---------- */
.logo {
  position: relative; margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(66px, 20vw, 104px); line-height: 1.12; text-align: center; letter-spacing: .01em;
  color: var(--chili-deep); -webkit-text-stroke: 7px var(--mud);
  text-shadow: 2px 3px 0 var(--chili), 4px 6px 0 var(--chili), 6px 9px 0 var(--chili-deep), 8px 12px 0 var(--mud);
}
.logo::after {
  content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0; text-shadow: none;
  background: linear-gradient(180deg, #fffbd9 12%, #ffd84a 38%, #f6a312 56%, #ffe680 72%, #d97f0a 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Home ---------- */
.screen { position: fixed; inset: 0; }
#home {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; pointer-events: none;
  padding-top: var(--safe-t);
  background:
    linear-gradient(180deg, rgba(8, 40, 48, .62) 0, rgba(8, 40, 48, 0) 34%),
    linear-gradient(0deg, rgba(8, 24, 28, .72) 0, rgba(8, 24, 28, 0) 48%);
}
#home > * { pointer-events: auto; }

.hero { position: relative; display: flex; flex-direction: column; align-items: center; margin-top: 0; width: min(100%, 430px); padding: 0 16px; pointer-events: none !important; animation: swingIn .9s cubic-bezier(.2, 1.4, .4, 1) both; transform-origin: 50% 0; }
@keyframes swingIn { 0% { transform: translateY(-120%) rotate(-5deg); } 100% { transform: none; } }
.chains { display: flex; justify-content: space-between; width: 62%; height: 18px; }
.chains i { width: 5px; background: repeating-linear-gradient(180deg, var(--marigold) 0 4px, var(--gold-lo) 4px 7px, var(--mud) 7px 8px); }
.marquee {
  position: relative; width: 100%; padding: 8px 18px 10px; border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(47, 183, 168, .32), transparent 72%),
    linear-gradient(180deg, var(--peacock-2), var(--peacock-deep));
  box-shadow: inset 0 0 0 2px var(--mud), inset 0 0 0 5px var(--marigold), inset 0 0 0 7px var(--chili-deep), inset 0 0 0 8.5px var(--teal), 0 12px 26px rgba(0, 0, 0, .55);
}
.cn { position: absolute; width: 38px; height: 38px; pointer-events: none; }
.cn.tl { top: 8px; left: 8px; }
.cn.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.cn.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.cn.br { bottom: 8px; right: 8px; transform: scale(-1); }
.logo-sub {
  margin: -6px 0 2px; display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .22em; color: var(--milk); white-space: nowrap;
}
.logo-sub svg { width: 30px; height: 19px; flex: none; }
.tassels { display: flex; justify-content: space-around; width: 88%; margin-top: -2px; }
.tassels svg { width: 15px; height: 42px; transform-origin: 50% 0; animation: tassel 2.6s ease-in-out infinite; }
.tassels svg:nth-child(2) { animation-delay: -.5s; }
.tassels svg:nth-child(3) { animation-delay: -1.1s; }
.tassels svg:nth-child(4) { animation-delay: -1.6s; }
.tassels svg:nth-child(5) { animation-delay: -2.2s; }
@keyframes tassel { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

.dock {
  width: min(100%, 470px); display: flex; flex-direction: column; border-radius: 14px 14px 0 0; overflow: hidden;
  background: linear-gradient(180deg, var(--peacock), var(--peacock-deep));
  box-shadow: 0 -2px 0 var(--mud), 0 -5px 0 var(--marigold), 0 -7px 0 var(--mud), 0 -14px 30px rgba(0, 0, 0, .5);
  animation: dockIn .6s .1s cubic-bezier(.2, 1, .3, 1) both;
}
@keyframes dockIn { 0% { transform: translateY(100%); } 100% { transform: none; } }
.dock-in { padding: 12px 16px calc(10px + var(--safe-b)); display: grid; gap: 9px; }

.profile { display: grid; grid-template-columns: 50px minmax(0, 1fr) 44px; gap: 11px; align-items: center; }
.avatar {
  --rim: var(--marigold); width: 50px; height: 50px; border-radius: 50%; background-size: cover;
  box-shadow: 0 0 0 2px var(--mud), 0 0 0 4.5px var(--rim), 0 3px 8px 3px rgba(0, 0, 0, .4);
}
.who { min-width: 0; display: grid; gap: 3px; }
#nameInput {
  width: 100%; border: 0; border-bottom: 2px dashed rgba(251, 243, 220, .35); background: none; padding: 0 0 1px;
  font-family: var(--display); font-size: 21px; color: var(--milk); -webkit-user-select: text; user-select: text; border-radius: 0;
}
#nameInput::placeholder { color: var(--milk-dim); opacity: .75; }
.rank { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--marigold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.xp { flex: 1; min-width: 20px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px rgba(246, 178, 27, .35); overflow: hidden; }
.xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--chili), var(--marigold)); transition: width .9s cubic-bezier(.2, .9, .3, 1); }
.xp.big { height: 11px; border-radius: 6px; }

.crop-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--milk-dim); }
.crop-head em { font-family: var(--display); font-style: normal; font-size: 18px; letter-spacing: 0; text-transform: none; color: var(--marigold); }
#crops { display: flex; gap: 9px; overflow-x: auto; padding: 5px 5px 7px; margin: -5px -5px -7px; scrollbar-width: none; scroll-snap-type: x proximity; position: relative; }
#crops::-webkit-scrollbar { display: none; }
.crop {
  --rim: var(--marigold); position: relative; flex: none; width: 56px; height: 56px; border-radius: 10px; background-size: cover; scroll-snap-align: center;
  box-shadow: 0 0 0 2px var(--mud), inset 0 -10px 14px rgba(0, 0, 0, .3); transition: transform .18s cubic-bezier(.2, 1.6, .4, 1), box-shadow .15s;
}
.crop.sel { transform: translateY(-3px) scale(1.06); box-shadow: 0 0 0 2px var(--mud), 0 0 0 4.5px var(--rim), 0 7px 12px rgba(0, 0, 0, .45); }
.crop.locked { filter: grayscale(.85) brightness(.6); }
.crop svg { position: absolute; left: 50%; top: 42%; width: 20px; height: 20px; transform: translate(-50%, -50%); color: var(--milk); }
.crop small { position: absolute; left: 0; right: 0; bottom: 2px; font-size: 11px; font-weight: 800; text-align: center; color: var(--milk); }

.cta {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 62px; border-radius: 12px; margin-top: 2px;
  background: linear-gradient(180deg, #ffe680 0, var(--marigold) 42%, #e68a0a 100%); color: var(--mud);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(120, 60, 0, .45), 0 0 0 2px var(--mud), 0 6px 0 2px var(--chili-deep), 0 11px 20px rgba(0, 0, 0, .45);
  font-family: var(--display); font-size: 30px; transition: transform .08s, box-shadow .08s; margin-bottom: 6px;
}
.cta svg { width: 30px; height: 30px; flex: none; }
.cta b { font-weight: 400; line-height: 1; padding-top: 5px; }
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(120, 60, 0, .45), 0 0 0 2px var(--mud), 0 1px 0 2px var(--chili-deep); }
.shine { position: absolute; top: 0; bottom: 0; left: -40%; width: 26%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent); transform: skewX(-18deg); animation: shine 3.6s ease-in-out infinite; }
@keyframes shine { 0%, 62% { left: -40%; } 100% { left: 130%; } }

.cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cta2 {
  display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 6px 10px; border-radius: 10px; text-align: left; min-width: 0;
  background: linear-gradient(180deg, rgba(47, 183, 168, .24), rgba(0, 0, 0, .22));
  box-shadow: inset 0 0 0 2px rgba(246, 178, 27, .75), 0 3px 0 var(--mud); transition: transform .08s;
}
.cta2 svg { width: 28px; height: 24px; flex: none; color: var(--marigold); }
.cta2 span { display: block; font-weight: 800; font-size: 14.5px; line-height: 1.15; min-width: 0; }
.cta2 small { display: block; font-weight: 400; font-size: 12px; color: var(--milk-dim); margin-top: 2px; }
.cta2:hover { background: linear-gradient(180deg, rgba(47, 183, 168, .38), rgba(0, 0, 0, .15)); }
.cta2:active { transform: translateY(2px); }
.foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--milk-dim); }
.foot em { font-family: var(--display); font-style: normal; color: var(--marigold); white-space: nowrap; }

/* ---------- HUD ---------- */
#hud {
  position: fixed; inset: 0; pointer-events: none;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l));
  display: flex; flex-direction: column; justify-content: space-between;
}
.plate { background: var(--mud-glass); border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(246, 178, 27, .55), 0 3px 8px rgba(0, 0, 0, .35); }
.hud-top { display: grid; grid-template-columns: 164px minmax(0, 1fr) 44px; gap: 8px; align-items: start; }
#board { --rows: 5; position: relative; list-style: none; margin: 0; padding: 0; height: calc(var(--rows) * 23px + 10px); transition: height .25s; font-variant-numeric: tabular-nums; overflow: hidden; }
#board li {
  position: absolute; left: 5px; right: 7px; top: 5px; height: 23px; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 6px; align-items: center;
  font-size: 13.5px; font-weight: 600; transition: transform .35s cubic-bezier(.3, 1.3, .5, 1);
}
#board i { width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
#board span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board b { font-weight: 600; }
#board li.me { color: var(--marigold); font-weight: 800; }
#board li.me b { font-weight: 800; }

#goal { padding: 4px 10px 8px; min-width: 0; }
.goal-row { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
#pct { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.15; color: var(--marigold); text-shadow: 2px 2px 0 var(--chili-deep); }
#bigha { font-size: 12.5px; color: var(--milk-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
#clock { font-weight: 800; font-size: 15px; }
#clock.late { color: #ff6a55; animation: throb .6s ease-in-out infinite alternate; }
@keyframes throb { to { transform: scale(1.14); } }
#bar { position: relative; height: 10px; border-radius: 5px; background: rgba(251, 243, 220, .16); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
#fill { display: block; height: 100%; width: 0; border-radius: 5px; background: repeating-linear-gradient(115deg, var(--marigold) 0 9px, #ffd262 9px 18px); box-shadow: 0 0 8px rgba(246, 178, 27, .7); transition: width .3s; }
#bar u { position: absolute; right: 0; top: -3px; bottom: -3px; width: 3px; border-radius: 2px; background: var(--chili); box-shadow: 0 0 0 1px var(--mud); }

.hud-btns { display: flex; flex-direction: column; gap: 8px; }
.hbtn {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 9px; background: var(--mud-glass); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px rgba(246, 178, 27, .55), 0 3px 8px rgba(0, 0, 0, .35); color: var(--milk);
}
.hbtn svg { width: 21px; height: 21px; }
.hbtn.soft { background: rgba(0, 0, 0, .28); }
.hbtn:active { transform: scale(.93); }

#feed { position: absolute; left: 0; right: 0; top: calc(158px + var(--safe-t)); display: grid; gap: 4px; justify-items: center; padding: 0 16px; font-weight: 600; font-size: 14.5px; text-align: center; }
#feed div { background: var(--mud-glass); border-radius: 5px; padding: 1px 11px; animation: feedIn .22s ease-out, fadeout 3.4s forwards; }
#feed div.good { color: var(--marigold); font-weight: 800; }
@keyframes feedIn { from { transform: translateY(-8px); } }
@keyframes fadeout { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }

#hint {
  position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); text-align: center;
  padding: 5px 16px; border-radius: 9px; font-weight: 800; font-size: 16px; background: var(--mud-glass); color: var(--milk); box-shadow: inset 0 0 0 1.5px var(--marigold);
  animation: hintBob 1.1s ease-in-out infinite alternate;
}
#hint.alert { background: var(--chili-deep); box-shadow: inset 0 0 0 1.5px #ff8d7c; }
@keyframes hintBob { to { transform: translate(-50%, -5px); } }

#announce { position: absolute; left: 0; right: 0; top: 29%; display: grid; place-items: center; pointer-events: none; padding: 0 10px; }
.ann {
  font-family: var(--display); text-align: center; line-height: 1.1; color: var(--gold-hi); paint-order: stroke fill;
  -webkit-text-stroke: 7px var(--mud);
  text-shadow: 0 3px 0 var(--chili), 0 6px 0 var(--chili-deep), 0 9px 16px rgba(0, 0, 0, .55);
  animation: slam 1.5s cubic-bezier(.2, 1.5, .4, 1) both;
}
.ann.small { font-size: clamp(25px, 7vw, 36px); }
.ann.big { font-size: clamp(38px, 11vw, 62px); }
.ann.deva { font-size: clamp(48px, 15vw, 82px); }
.ann.huge { font-size: clamp(48px, 15vw, 88px); color: #fff; }
@keyframes slam {
  0% { transform: scale(2.3) rotate(-4deg); opacity: 0; }
  14% { transform: scale(.94) rotate(-1.5deg); opacity: 1; }
  22% { transform: scale(1.03) rotate(-1.5deg); }
  78% { transform: scale(1) rotate(-1.5deg); opacity: 1; }
  100% { transform: scale(1.04) translateY(-16px) rotate(-1.5deg); opacity: 0; }
}

#roomTag {
  position: absolute; right: calc(62px + var(--safe-r)); top: calc(78px + var(--safe-t)); pointer-events: auto; cursor: pointer; display: flex; gap: 6px; align-items: center;
  padding: 2px 9px; border-radius: 6px; font-size: 13px; background: var(--mud-glass); box-shadow: inset 0 0 0 1.5px rgba(246, 178, 27, .55);
}
#roomTag b { color: var(--marigold); letter-spacing: .1em; }
#roomTag svg { width: 13px; height: 13px; }

.hud-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; position: relative; }
#miniWrap {
  width: 108px; height: 108px; padding: 5px; flex: none; border-radius: 9px;
  background: repeating-linear-gradient(135deg, var(--chili) 0 7px, var(--marigold) 7px 14px, var(--milk) 14px 17px, var(--peacock-deep) 17px 24px);
  box-shadow: 0 0 0 2px var(--mud), 0 5px 12px rgba(0, 0, 0, .45);
}
#mini { display: block; width: 100%; height: 100%; border-radius: 5px; box-shadow: 0 0 0 2px var(--mud); image-rendering: pixelated; }
#powers { position: absolute; left: 118px; bottom: 2px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.pw { padding: 1px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 800; animation: feedIn .2s ease-out; box-shadow: 0 0 0 1.5px var(--mud); }
.pw.diesel { background: var(--chili); color: var(--milk); }
.pw.shield { background: #2bbcd6; color: var(--mud); }

.action-btns { display: flex; align-items: flex-end; gap: 11px; }
.round-btn {
  pointer-events: auto; position: relative; display: grid; place-items: center; align-content: center; gap: 0; border-radius: 50%; width: 62px; height: 62px; touch-action: none;
  background: radial-gradient(circle at 50% 30%, var(--peacock-2), var(--peacock-deep)); color: var(--milk);
  box-shadow: 0 0 0 2px var(--mud), 0 0 0 4px var(--marigold), 0 0 0 6px var(--mud), 0 7px 12px rgba(0, 0, 0, .5);
  transition: transform .08s;
}
.round-btn svg { width: 25px; height: 25px; }
.round-btn small { font-size: 10px; font-weight: 800; letter-spacing: .08em; line-height: 1; margin-top: 1px; }
.round-btn:active { transform: scale(.91); }
.round-btn.turbo { width: 86px; height: 86px; background: radial-gradient(circle at 50% 30%, #5b5148, #231a13); box-shadow: 0 0 0 2px var(--mud), 0 7px 14px rgba(0, 0, 0, .55); }
.round-btn.turbo .ic { width: 35px; height: 35px; color: #978c80; }
.round-btn.turbo small { font-size: 11.5px; color: #b8ada0; }
.round-btn.turbo .ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; }
.ring circle { fill: none; stroke-width: 7; stroke: rgba(0, 0, 0, .55); }
#turboRing { stroke: var(--marigold); stroke-dasharray: 289; stroke-dashoffset: 289; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.round-btn.turbo.ready { background: radial-gradient(circle at 50% 30%, #ff6d3d, var(--chili-deep)); animation: ready 1.1s ease-in-out infinite alternate; }
.round-btn.turbo.ready .ic { color: var(--gold-hi); }
.round-btn.turbo.ready small { color: var(--milk); }
.round-btn.turbo.on { background: radial-gradient(circle at 50% 30%, #fff0a6, var(--marigold)); }
.round-btn.turbo.on .ic, .round-btn.turbo.on small { color: var(--mud); }
@keyframes ready { to { box-shadow: 0 0 0 2px var(--mud), 0 0 22px 7px rgba(255, 110, 50, .7); } }

/* ---------- Dialogs ---------- */
#sheetWrap, #result { display: grid; place-items: center; padding: calc(14px + var(--safe-t)) 14px calc(14px + var(--safe-b)); overflow-y: auto; background: rgba(6, 22, 26, .6); }
#sheetWrap { position: fixed; inset: 0; z-index: 5; animation: fadeBg .18s ease-out; }
@keyframes fadeBg { from { opacity: 0; } }
.sheet, .res-card {
  position: relative; width: min(100%, 420px); overflow: hidden; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0, rgba(47, 183, 168, .22), transparent 60%), linear-gradient(180deg, var(--peacock), var(--peacock-deep));
  box-shadow: inset 0 0 0 2px var(--mud), inset 0 0 0 4.5px var(--marigold), 0 0 0 2px var(--mud), 10px 14px 0 rgba(10, 5, 0, .45);
  animation: popIn .32s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes popIn { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.sheet .cn, .res-card .cn { top: 20px; }
.sheet-in, .res-in { padding: 14px 20px 18px; display: grid; gap: 11px; position: relative; }
h2 { margin: 0; padding: 4px 28px 0; text-align: center; font-family: var(--display); font-weight: 400; font-size: clamp(32px, 9vw, 42px); line-height: 1.12; color: var(--marigold); text-shadow: 2px 2px 0 var(--chili), 4px 4px 0 var(--peacock-deep); text-wrap: balance; }
.res-title.sad { color: #ff9b86; }
.lead { margin: 0; text-align: center; font-size: 16.5px; line-height: 1.4; text-wrap: pretty; color: var(--milk); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > * { flex: 1 1 130px; }
.go {
  min-height: 52px; padding: 7px 16px 3px; border-radius: 10px; font-family: var(--display); font-size: 23px; line-height: 1.1; color: var(--mud);
  background: linear-gradient(180deg, #ffe680, var(--marigold) 50%, #e68a0a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .7), 0 0 0 2px var(--mud), 0 4px 0 2px var(--chili-deep); margin-bottom: 4px; transition: transform .08s;
}
.go:hover { filter: brightness(1.06); }
.go:active { transform: translateY(3px); }
.alt { min-height: 50px; padding: 7px 14px; border-radius: 10px; font-weight: 800; box-shadow: inset 0 0 0 2px var(--milk-dim); }
.alt:hover { background: rgba(255, 255, 255, .08); }
.alt:active { transform: translateY(2px); }
.choice { display: grid; gap: 0; width: 100%; padding: 8px 14px; border-radius: 10px; text-align: left; background: rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 2px rgba(246, 178, 27, .4); }
.choice b { font-family: var(--display); font-weight: 400; font-size: 23px; color: var(--marigold); line-height: 1.25; }
.choice span { font-size: 14.5px; color: var(--milk-dim); }
.choice:hover, .choice.sel { background: rgba(47, 183, 168, .22); box-shadow: inset 0 0 0 2px var(--marigold); }
.or { text-align: center; font-size: 13px; color: var(--milk-dim); }
.field { width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 9px; border: 0; background: rgba(0, 0, 0, .34); box-shadow: inset 0 0 0 2px rgba(246, 178, 27, .5); -webkit-user-select: text; user-select: text; min-width: 0; }
.field.code { font-family: var(--display); font-size: 24px; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 52px; height: 28px; border-radius: 15px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 2px var(--milk-dim); position: relative; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--milk-dim); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), background .15s; }
.switch input:checked + i { background: var(--chili); box-shadow: inset 0 0 0 2px var(--marigold); }
.switch input:checked + i::after { transform: translateX(24px); background: var(--gold-hi); }
.switch input:focus-visible + i { outline: 3px solid var(--milk); outline-offset: 2px; }
.seg { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg-l { font-weight: 600; }
.seg-l.mt { margin-bottom: -5px; font-size: 14px; color: var(--milk-dim); }
.seg-b { display: flex; border-radius: 9px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(246, 178, 27, .5); }
.seg-b button { padding: 7px 13px; min-height: 40px; font-weight: 600; }
.seg-b button.sel { background: var(--marigold); color: var(--mud); font-weight: 800; }
.load-bar { width: min(70vw, 260px); height: 10px; border-radius: 6px; background: rgba(0, 0, 0, .4); overflow: hidden; box-shadow: 0 0 0 2px var(--mud), 0 0 0 3.5px var(--marigold); margin: 2px auto; }
.load-bar i, .load-bar.in-sheet::before { content: ""; display: block; height: 100%; width: 40%; background: repeating-linear-gradient(135deg, var(--chili) 0 8px, var(--marigold) 8px 16px); animation: loadSlide 1s ease-in-out infinite alternate; }
@keyframes loadSlide { from { transform: translateX(-30%); } to { transform: translateX(180%); } }

/* ---------- Result ---------- */
#result { position: fixed; inset: 0; z-index: 4; background: rgba(6, 22, 26, .42); }
.stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.stat { display: flex; flex-direction: column; padding: 5px 2px 4px; border-radius: 8px; background: rgba(0, 0, 0, .28); min-width: 0; }
.stat dd { order: 1; margin: 0; font-family: var(--display); font-size: 23px; color: var(--marigold); line-height: 1.25; }
.stat dt { order: 2; font-size: 11.5px; color: var(--milk-dim); line-height: 1.15; }
.xp-block:empty { display: none; }
.xp-block { display: grid; gap: 4px; }
.xp-line { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.xp-line b { color: var(--marigold); font-weight: 800; }
.level-up, .record { text-align: center; font-family: var(--display); font-size: 21px; color: var(--gold-hi); animation: slamSoft .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes slamSoft { from { transform: scale(1.7); opacity: 0; } }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.pod-chip { position: relative; width: 58px; height: 58px; border-radius: 50%; background-size: cover; box-shadow: 0 0 0 2px var(--mud), 0 0 0 4px var(--marigold); }
.pod-chip svg { position: absolute; left: 50%; top: -22px; width: 30px; height: 30px; transform: translateX(-50%); color: var(--marigold); filter: drop-shadow(0 2px 0 var(--mud)); }
.p1 .pod-chip { width: 72px; height: 72px; }
.pod-name { margin-top: 7px; font-weight: 800; font-size: 14px; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod.mine .pod-name { color: var(--marigold); }
.pod-pct { font-size: 13.5px; color: var(--milk-dim); font-variant-numeric: tabular-nums; }
.pod-bar { width: 100%; margin-top: 4px; display: grid; place-items: center; border-radius: 7px 7px 0 0; font-family: var(--display); font-size: 25px; color: var(--mud); background: var(--milk-dim); height: 42px; }
.p1 .pod-bar { height: 68px; background: linear-gradient(180deg, #ffe680, var(--marigold)); }
.p3 .pod-bar { height: 30px; background: #d59767; font-size: 20px; }
.wait { margin: 0; text-align: center; font-weight: 600; color: var(--milk-dim); font-variant-numeric: tabular-nums; }

/* ---------- Loading, transitions, toast ---------- */
#loading {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, var(--peacock-2), var(--peacock-deep) 72%); transition: opacity .55s;
}
#loading.gone { opacity: 0; pointer-events: none; }
#loadText { margin: 0; font-size: 17px; color: var(--milk); }
#wipe { position: fixed; inset: -10% -60%; z-index: 15; pointer-events: none; background: var(--chev); background-size: auto; transform: translateX(-120%) skewX(-12deg); }
#wipe.go { animation: wipe .76s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes wipe { 0% { transform: translateX(-120%) skewX(-12deg); } 45%, 55% { transform: translateX(0) skewX(-12deg); } 100% { transform: translateX(120%) skewX(-12deg); } }
#toast {
  position: fixed; left: 50%; bottom: calc(160px + var(--safe-b)); z-index: 12; transform: translate(-50%, 16px); max-width: calc(100% - 32px); width: max-content; padding: 6px 15px;
  border-radius: 9px; font-weight: 600; text-align: center; background: var(--mud); box-shadow: 0 0 0 2px var(--marigold); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Bigger screens ---------- */
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  #home { align-items: flex-start; padding-left: 4vw; justify-content: flex-start; gap: 8px; background: linear-gradient(90deg, rgba(8, 28, 32, .72), rgba(8, 28, 32, 0) 58%); }
  .hero, .dock { width: 470px; }
  .dock { border-radius: 14px; margin-top: auto; margin-bottom: 3vh; }
  .hud-top { grid-template-columns: 210px minmax(0, 420px) 1fr; }
  .hud-btns { justify-self: end; }
  #feed { top: calc(60px + var(--safe-t)); }
  #miniWrap { width: 164px; height: 164px; }
  #powers { left: 176px; }
  #roomTag { right: 66px; top: 12px; }
}
@media (max-width: 500px) {
  #bigha { visibility: hidden; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .chains { height: 6px; }
  .logo { font-size: 64px; }
  .tassels { display: none; }
  .dock-in { gap: 7px; }
  .cta { min-height: 54px; font-size: 26px; }
  .cta2 { min-height: 48px; }
  .foot { display: none; }
}
@media (max-width: 360px) {
  .hud-top { grid-template-columns: 136px minmax(0, 1fr) 42px; }
  #bigha { display: none; }
  #board li { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero, .dock, .tassels svg, .shine, .sheet, .res-card, #hint, .ann { animation: none !important; }
  .ann { opacity: 1; }
  #fill, .xp i { transition: none; }
}
