:root {
  --bg: #15292a; --panel: rgba(18, 32, 33, 0.88); --panel2: rgba(36, 56, 57, 0.92); --line: rgba(255, 255, 255, 0.14);
  --ink: #f2f6f3; --muted: #b9c9c4; --teal: #3fb6a8; --mint: #7ed957; --gold: #ffd23f; --warn: #ff9a3c; --red: #e0533d; --pink: #ff4fa3; --mud: #8a7458;
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom); --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.touch { -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; margin: 0 1px; }
body.touch .key-only, body:not(.touch) .touch-only { display: none; }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--bg); z-index: 50; }
#loading b { font-size: 38px; font-weight: 900; letter-spacing: 2px; } #loading span { color: var(--muted); }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.health { position: absolute; top: max(8px, var(--sat)); left: 50%; transform: translateX(-50%); text-align: center; background: var(--panel); border-radius: 14px; padding: 3px 16px 5px; border: 2px solid var(--c, var(--mud)); min-width: 150px; }
.health small { display: block; font-size: 9.5px; letter-spacing: 2.5px; color: var(--muted); font-weight: 800; }
.health b { display: block; font-size: 34px; line-height: 1; font-weight: 900; color: var(--c, var(--ink)); font-variant-numeric: tabular-nums; transition: color 0.5s; }
.health span { display: block; font-size: 11.5px; font-weight: 800; color: var(--c); text-transform: uppercase; letter-spacing: 1px; }
.health em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); } .health em.ok { color: var(--mint); }
.health.rise { animation: pulse 0.6s; } @keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(126, 217, 87, 0.5); } }
.clock { position: absolute; top: max(8px, var(--sat)); left: max(10px, var(--sal)); background: var(--panel); border-radius: 12px; padding: 5px 10px; min-width: 170px; max-width: 230px; }
.clock span { font-size: 12px; color: var(--muted); font-weight: 800; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sunbar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ffcf8a, #ffe9a6, #ff9a3c); margin: 4px 0; overflow: hidden; } .sunbar u { display: block; height: 100%; width: 0; background: rgba(0, 0, 0, 0.55); margin-left: auto; }
.clock b { font-size: 15px; font-variant-numeric: tabular-nums; }
.topr { position: absolute; top: max(8px, var(--sat)); right: max(10px, var(--sar)); display: flex; gap: 6px; align-items: center; }
.chip-s { background: var(--panel); border-radius: 10px; padding: 5px 9px; font-weight: 900; font-size: 14px; display: flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums; } .chip-s i { font-style: normal; color: var(--gold); }
.chip-s.flash { animation: pulse 0.6s; } #h-reel-c.empty { opacity: 0.45; }
.pause { width: 38px; height: 34px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); pointer-events: auto; }
#minimap { position: absolute; top: calc(max(8px, var(--sat)) + 96px); left: 50%; transform: translateX(-50%); width: 300px; height: 44px; border-radius: 8px; background: rgba(10, 18, 18, 0.55); border: 1px solid var(--line); }
.bars { position: absolute; left: max(10px, var(--sal)); top: calc(max(8px, var(--sat)) + 68px); display: flex; flex-direction: column; gap: 5px; background: var(--panel); border-radius: 12px; padding: 7px 10px; }
.bar { display: flex; align-items: center; gap: 7px; } .bar i { font-style: normal; font-size: 14px; width: 18px; } .bar b { font-size: 12px; font-weight: 900; min-width: 34px; }
.bar span { width: 110px; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); overflow: hidden; display: block; } .bar u { display: block; height: 100%; width: 0; background: #e3dccb; transition: width 0.15s; }
.bar.body u { background: var(--mint); } .bar.body.low u { background: var(--red); } .bar.team u { background: var(--gold); }
.bar.sack.full span { box-shadow: 0 0 0 2px var(--warn); animation: alarm 0.8s infinite; } @keyframes alarm { 50% { box-shadow: 0 0 0 4px rgba(255, 154, 60, 0.6); } }
.prompt { position: absolute; left: 50%; bottom: calc(max(12px, var(--sab)) + 10px); transform: translateX(-50%); background: rgba(242, 246, 243, 0.95); color: #15292a; border-radius: 12px; padding: 6px 14px; font-weight: 900; font-size: 14.5px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.prompt kbd { border-color: rgba(0, 0, 0, 0.3); }
.toast { position: absolute; left: 50%; top: calc(max(8px, var(--sat)) + 128px); transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 14px; font-weight: 800; font-size: 14px; max-width: min(520px, 80vw); text-align: center; }
.toast.good { border-color: var(--mint); } .toast.bad { border-color: var(--red); }
#marks .mk { position: absolute; transform: translate(-50%, -100%); text-align: center; font-weight: 900; font-size: 12px; text-shadow: 0 1px 3px #000; white-space: nowrap; }
#marks .mk b { display: inline-block; background: var(--red); color: #fff; border-radius: 99px; padding: 1px 8px; font-size: 13px; box-shadow: 0 0 0 2px #fff; }
#marks .mk.calm b { background: var(--teal); } #marks .mk.gold b { background: var(--gold); color: #222; }
#marks .mk i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); margin-top: 3px; overflow: hidden; } #marks .mk i u { display: block; height: 100%; background: var(--red); }
.feed { position: absolute; right: max(10px, var(--sar)); top: calc(max(8px, var(--sat)) + 52px); width: 250px; background: #0c0c0c; border: 3px solid #333; border-radius: 22px; padding: 10px 10px 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.feed .fh { display: flex; justify-content: space-between; align-items: baseline; font-weight: 900; } .feed .fh b { font-size: 20px; color: var(--pink); } .feed .fh span { font-size: 11px; color: #aaa; }
.feed .viral { color: var(--gold); font-weight: 900; font-size: 12px; letter-spacing: 1px; }
.feed .cm { font-size: 12.5px; padding: 5px 0; border-top: 1px solid #222; animation: slide 0.3s both; } .feed .cm em { font-style: normal; color: #8fb3ff; font-weight: 800; margin-right: 4px; }
@keyframes slide { from { opacity: 0; transform: translateY(6px); } }
.tpad { display: none; }
body.touch.playing .tpad { display: block; }
.stick { position: absolute; left: calc(max(14px, var(--sal)) + 8px); bottom: calc(max(14px, var(--sab)) + 6px); width: 124px; height: 124px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.3); pointer-events: auto; touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); border: 2px solid rgba(255, 255, 255, 0.6); }
.tb { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.55); font-weight: 900; font-size: 13px; letter-spacing: 0.5px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.tb small { font-size: 9px; letter-spacing: 1px; }
.tb.act { right: calc(max(14px, var(--sar)) + 10px); bottom: calc(max(14px, var(--sab)) + 14px); width: 92px; height: 92px; background: rgba(63, 182, 168, 0.6); }
.tb.build { right: calc(max(14px, var(--sar)) + 112px); bottom: calc(max(14px, var(--sab)) + 6px); width: 74px; height: 74px; background: rgba(255, 210, 63, 0.55); color: #222; font-size: 12px; }
.tb.reel { right: calc(max(14px, var(--sar)) + 64px); bottom: calc(max(14px, var(--sab)) + 114px); width: 56px; height: 56px; background: rgba(255, 79, 163, 0.5); font-size: 18px; }
.tb.on { filter: brightness(1.4); transform: scale(1.06); } .tb.dim { opacity: 0.45; }
body.touch .prompt { bottom: calc(max(14px, var(--sab)) + 136px); }
#rotate { display: none; position: fixed; inset: 0; z-index: 40; background: var(--bg); flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px; }
#rotate b { font-size: 54px; } #rotate p { font-size: 17px; max-width: 280px; }
@media (orientation: portrait) and (pointer: coarse) { body.playing #rotate, body.paused #rotate { display: flex; } }

/* ------------------------------------------------------------ Rok-Tok */
#talk { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px max(16px, var(--sab)); background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.5)); }
.talk-card { background: #f6efdc; color: #2a1d14; border-radius: 16px; padding: 12px 14px; width: min(620px, 100%); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 3px var(--warn); }
.talk-card .kicker { color: #b5552b; } .talk-card h3 { margin: 2px 0 8px; font-size: 18px; font-weight: 900; }
.talk-opts { display: grid; gap: 6px; } .talk-opts button { text-align: left; background: #fff; border: 2px solid #e6d9b8; border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 14.5px; color: #2a1d14; }
.talk-opts button:hover { border-color: var(--warn); } .talk-opts button kbd { margin-right: 6px; }
.talk-timer { height: 5px; border-radius: 3px; background: #e6d9b8; margin-top: 8px; overflow: hidden; } .talk-timer u { display: block; height: 100%; background: var(--warn); width: 100%; }

/* ------------------------------------------------------------ screens */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.screen { position: absolute; inset: 0; display: none; pointer-events: auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: max(16px, var(--sat)) max(16px, var(--sar)) max(16px, var(--sab)) max(16px, var(--sal)); background: rgba(12, 24, 24, 0.5); }
.screen.active { display: flex; } .screen > * { margin: auto; }
#title.screen { background: linear-gradient(90deg, rgba(12, 24, 24, 0.9) 0%, rgba(12, 24, 24, 0.55) 46%, rgba(12, 24, 24, 0) 100%); gap: 24px; align-items: center; }
.t-main { max-width: 520px; width: 100%; margin: auto auto auto clamp(0px, 5vw, 80px); }
.kicker { color: var(--gold); letter-spacing: 1.4px; text-transform: uppercase; font-size: 12px; font-weight: 800; margin: 0; }
.logo { margin: 6px 0 10px; font-size: clamp(54px, 8.5vw, 100px); line-height: 0.92; font-weight: 900; letter-spacing: 1px; color: #f2f6f3; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45); }
.logo span { color: var(--teal); text-shadow: 0 0 30px rgba(63, 182, 168, 0.45); }
.lead { color: #e6eeea; font-size: 15.5px; line-height: 1.5; margin: 0 0 16px; }
.challenge:empty { display: none; } .challenge { background: rgba(255, 210, 63, 0.14); border: 1px solid rgba(255, 210, 63, 0.5); padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; }
.menu { display: flex; flex-direction: column; gap: 8px; } .menu .row { display: flex; gap: 8px; } .menu .row button { flex: 1; }
.menu button, .buttons button { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 17px; font-weight: 800; text-align: left; }
.menu button:hover, .buttons button:hover { border-color: var(--teal); }
.menu button:disabled { opacity: 0.5; }
button.primary { background: linear-gradient(90deg, #3fb6a8, #7ed957) !important; color: #0e2420 !important; border-color: transparent !important; }
button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; color: var(--muted); }
.disclaimer { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.45; } .disclaimer a { color: var(--muted); }
.t-side { width: 320px; max-width: 100%; margin: auto clamp(0px, 4vw, 60px) auto auto; display: flex; flex-direction: column; gap: 10px; } .t-side > div:empty { display: none; }
.rr-board { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; width: 100%; max-width: 760px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet.wide { max-width: 1000px; } .sheet.narrow { max-width: 440px; }
.sheet header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; } .sheet header h2 { flex: 1; }
.sheet h2 { margin: 0; font-size: 26px; font-weight: 900; } .sheet h4 { margin: 14px 0 8px; font-size: 12.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); } .sheet h4 small { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 700; }
.wallet { font-weight: 900; font-size: 17px; }
.daylist { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.dayc { text-align: left; border-radius: 12px; padding: 10px; border: 1px solid var(--line); background: linear-gradient(170deg, rgba(63, 182, 168, 0.22), rgba(0, 0, 0, 0.2)); min-height: 124px; display: flex; flex-direction: column; gap: 3px; }
.dayc small { color: var(--gold); font-weight: 900; font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; } .dayc b { font-size: 14.5px; line-height: 1.2; } .dayc span { font-size: 11.5px; color: var(--muted); }
.dayc .st { margin-top: auto; color: var(--gold); letter-spacing: 2px; } .dayc:disabled { opacity: 0.45; }
.dayc.free { background: linear-gradient(170deg, rgba(255, 79, 163, 0.25), rgba(0, 0, 0, 0.2)); }
.ups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.up { text-align: left; display: grid; grid-template-columns: 30px 1fr auto; column-gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.up i { font-style: normal; font-size: 22px; grid-row: span 2; } .up b { font-size: 14px; } .up small { grid-column: 2; color: var(--muted); font-size: 11.5px; } .up span { grid-row: 1; grid-column: 3; font-weight: 900; color: var(--gold); white-space: nowrap; }
.up.own { border-color: var(--mint); } .up.own span { color: var(--mint); } .up:disabled:not(.own) { opacity: 0.5; }
.target { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; margin-top: 6px; line-height: 1.5; } .target b { color: var(--mint); } .target ul { margin: 4px 0 0; padding-left: 18px; }
.big { width: 100%; margin-top: 14px; padding: 14px !important; font-size: 19px !important; text-align: center !important; border-radius: 12px; font-weight: 900; border: 0; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); } .srow input[type=range] { flex: 1; max-width: 170px; accent-color: var(--teal); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-weight: 800; font-size: 13.5px; } .chip.on { background: var(--teal); color: #0e2420; border-color: var(--teal); }
.help { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .help p { font-size: 14px; line-height: 1.5; color: #e6eeea; margin: 0 0 10px; }
.res-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .ba figure { margin: 0; position: relative; } .ba img { width: 100%; border-radius: 10px; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: #0b1414; }
.ba figcaption { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, 0.6); border-radius: 6px; padding: 2px 7px; font-size: 11.5px; font-weight: 900; } .ba figcaption b { color: var(--c, #fff); }
.rh { margin: 0 0 4px; font-size: 28px; font-weight: 900; line-height: 1.1; } .stars { color: var(--gold); font-size: 26px; letter-spacing: 4px; }
.goals { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13.5px; } .goals li { padding: 2px 0; color: var(--muted); } .goals li.ok { color: var(--mint); }
.kv { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.kv li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; color: var(--muted); } .kv li b { color: var(--ink); }
.diary { margin-top: 12px; background: #f6efdc; color: #3a2a1c; border-radius: 10px; padding: 10px 14px; font-family: Georgia, serif; font-style: italic; font-size: 14.5px; line-height: 1.5; box-shadow: inset 0 0 0 1px #e6d9b8; }
.diary b { font-style: normal; font-family: Nunito, sans-serif; font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: #b5552b; display: block; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: sticky; bottom: -20px; background: var(--panel); padding: 6px 0; } .buttons button { flex: 1 1 130px; text-align: center; }
.e-board:empty { display: none; } .e-board { margin: 12px 0 0; }
.reelnote { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

@media (max-width: 1000px) { .daylist { grid-template-columns: repeat(5, 1fr); } .ups { grid-template-columns: repeat(2, 1fr); } }
@media (max-height: 460px) {
  .health { padding: 2px 12px 3px; min-width: 120px; } .health b { font-size: 24px; } .health small { font-size: 8.5px; } .health em { font-size: 10.5px; } .health span { font-size: 10px; }
  .clock { min-width: 120px; max-width: 160px; padding: 4px 8px; } .clock span { font-size: 10.5px; } .clock b { font-size: 12.5px; } .sunbar { margin: 2px 0; height: 5px; }
  .chip-s { padding: 3px 7px; font-size: 12px; } .pause { width: 32px; height: 28px; }
  #minimap { top: calc(max(8px, var(--sat)) + 40px); left: auto; right: max(10px, var(--sar)); transform: none; width: 200px; height: 30px; }
  .feed { top: calc(max(6px, var(--sat)) + 112px) !important; }
  .bars { top: calc(max(8px, var(--sat)) + 60px); padding: 5px 8px; gap: 3px; } .bar span { width: 70px; height: 7px; } .bar b { font-size: 11px; min-width: 28px; }
  .stick { width: 100px; height: 100px; } .stick i { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .tb.act { width: 78px; height: 78px; } .tb.build { width: 62px; height: 62px; right: calc(max(14px, var(--sar)) + 96px); font-size: 11px; } .tb.reel { width: 48px; height: 48px; bottom: calc(max(14px, var(--sab)) + 96px); right: calc(max(14px, var(--sar)) + 56px); }
  body.touch .prompt { bottom: calc(max(10px, var(--sab)) + 6px); font-size: 12.5px; padding: 5px 10px; max-width: calc(100vw - 340px); overflow: hidden; text-overflow: ellipsis; }
  .toast { top: calc(max(6px, var(--sat)) + 96px); font-size: 12.5px; padding: 5px 10px; max-width: 50vw; }
  .feed { width: 200px; top: calc(max(6px, var(--sat)) + 40px); padding: 7px; } .feed .cm { font-size: 11px; padding: 3px 0; } .feed .fh b { font-size: 16px; }
  #title.screen { gap: 14px; } .logo { font-size: 50px; } .lead { font-size: 13px; margin-bottom: 10px; line-height: 1.4; } .menu button { padding: 8px 14px; font-size: 15px; } .menu { gap: 6px; } .disclaimer { margin-top: 8px; font-size: 11px; }
  .t-side { width: 260px; } .t-side .rr-board { max-height: 62vh; overflow: auto; }
  .sheet { padding: 12px 14px; } .sheet h2 { font-size: 21px; } .daylist { grid-template-columns: repeat(9, 1fr); gap: 5px; } .dayc { min-height: 82px; padding: 6px; } .dayc b { font-size: 12px; } .dayc span { display: none; } .ups { grid-template-columns: repeat(4, 1fr); gap: 5px; } .up { padding: 5px 7px; } .up small { display: none; }
  .help p { font-size: 12.5px; } .rh { font-size: 20px; } .kv { font-size: 12.5px; margin-top: 6px; } .diary { font-size: 12.5px; padding: 7px 10px; }
  .talk-card { padding: 8px 10px; } .talk-card h3 { font-size: 15px; margin-bottom: 5px; } .talk-opts { grid-template-columns: repeat(3, 1fr); } .talk-opts button { font-size: 12px; padding: 6px 8px; }
}
@media (max-width: 760px) { .help { grid-template-columns: 1fr; } .res-top { grid-template-columns: 1fr; } }
@media (orientation: landscape) and (max-height: 460px) { .help { grid-template-columns: repeat(3, 1fr); } .res-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 640px) and (orientation: portrait) {
  #title.screen { flex-direction: column; align-items: stretch; background: linear-gradient(180deg, rgba(12, 24, 24, 0.2), rgba(12, 24, 24, 0.9) 38%); }
  .t-main { margin: 30vh 0 0; } .t-side { width: 100%; margin: 0; } .daylist { grid-template-columns: repeat(3, 1fr); } .ups { grid-template-columns: 1fr; }
}
@media (max-height: 460px) {
  .buttons { bottom: -12px; padding: 4px 0 6px; } .buttons button { padding: 8px 10px; font-size: 14.5px; flex-basis: 110px; }
  .ba img { aspect-ratio: 16 / 8; }
}
@media (max-height: 300px) {
  .stick { width: 86px; height: 86px; } .stick i { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .bars { gap: 2px; padding: 4px 7px; } .bar span { height: 6px; } .bar i { font-size: 12px; }
  .tb.act { width: 70px; height: 70px; } .tb.build { width: 56px; height: 56px; right: calc(max(14px, var(--sar)) + 86px); } .tb.reel { width: 44px; height: 44px; bottom: calc(max(14px, var(--sab)) + 84px); }
}

/* ------------------------------------------------------------ the endless game: level bar, shop, cards, report */
.health .lv { margin-top: 2px; } .health .lv em { display: block; font-style: normal; font-size: 11px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.health .lv span { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; margin: 2px auto 0; width: 120px; } .health .lv u { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #7ed957); transition: width 0.3s; }
.hb { height: 34px; min-width: 38px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); pointer-events: auto; font-weight: 900; font-size: 15px; padding: 0 9px; }
.hb.shop { background: rgba(255, 210, 63, 0.9); color: #222; border-color: transparent; } .hb.speed.on { background: var(--teal); color: #0e2420; }
.hb.ping { animation: pulse 0.9s 3; }
.obj { position: absolute; left: max(10px, var(--sal)); top: calc(max(8px, var(--sat)) + 160px); max-width: 260px; background: rgba(255, 210, 63, 0.92); color: #2a2208; border-radius: 10px; padding: 5px 10px; font-weight: 800; font-size: 12.5px; display: flex; gap: 6px; align-items: baseline; }
.obj i { font-style: normal; } .obj b { margin-left: auto; white-space: nowrap; font-size: 12px; }
.obj.done { animation: pulse 0.6s 2; background: var(--mint); }
.report { position: absolute; left: 50%; top: calc(max(8px, var(--sat)) + 150px); transform: translateX(-50%); width: min(440px, 80vw); background: rgba(246, 239, 220, 0.97); color: #2a1d14; border-radius: 14px; padding: 10px 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4); pointer-events: auto; font-size: 13.5px; }
.report h4 { margin: 0 0 4px; font-size: 15px; font-weight: 900; } .report ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; } .report li { display: flex; justify-content: space-between; } .report li b.neg { color: #b5172b; } .report li b.pos { color: #1f7a3a; }
.report .rb { display: flex; gap: 6px; margin-top: 7px; } .report .rb button { flex: 1; border: 0; border-radius: 99px; padding: 6px 10px; font-weight: 900; background: #2a1d14; color: #f6efdc; font-size: 12.5px; } .report .rb button.lite { background: #e6d9b8; color: #2a1d14; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; } .tabs button { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-weight: 900; font-size: 14px; } .tabs button.on { background: var(--gold); color: #222; border-color: var(--gold); } .tabs button.new::after { content: ' •'; color: var(--pink); }
.rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.it { text-align: left; display: grid; grid-template-columns: 30px 1fr auto; column-gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.it i { font-style: normal; font-size: 22px; grid-row: span 2; } .it b { font-size: 14px; } .it small { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; line-height: 1.3; } .it > span { grid-row: 1; grid-column: 3; font-weight: 900; color: var(--gold); white-space: nowrap; font-size: 13px; }
.it.own { border-color: var(--mint); } .it.own > span { color: var(--mint); } .it.lock { opacity: 0.5; } .it.lock > span { color: var(--muted); } .it:disabled:not(.own):not(.lock) { opacity: 0.6; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 8px; } .note b { color: var(--ink); }
.crewlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; } .crewlist span { background: rgba(255, 255, 255, 0.07); border-radius: 99px; padding: 4px 6px 4px 10px; font-size: 13px; font-weight: 800; display: flex; gap: 6px; align-items: center; } .crewlist button { border: 0; background: rgba(255, 255, 255, 0.12); border-radius: 99px; width: 22px; height: 22px; font-size: 11px; }
.news { display: grid; gap: 8px; } .clip { background: #f6efdc; color: #2a1d14; border-radius: 6px; padding: 10px 14px; font-family: Georgia, serif; box-shadow: inset 0 0 0 1px #e6d9b8; } .clip small { font-family: Nunito, sans-serif; font-weight: 900; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #b5552b; } .clip h5 { margin: 2px 0; font-size: 17px; line-height: 1.2; } .clip p { margin: 0; font-size: 13.5px; font-style: italic; } .clip.town { background: #e8eef0; box-shadow: inset 0 0 0 1px #c8d6da; }
.card { text-align: center; } .card .kicker { margin-bottom: 4px; } .card h2 { font-size: 28px; } .card .unl { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0; } .card .unl span { background: rgba(255, 210, 63, 0.15); border: 1px solid rgba(255, 210, 63, 0.5); border-radius: 99px; padding: 5px 11px; font-weight: 800; font-size: 13.5px; }
.card .town { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; } .card .bonus { color: var(--mint); font-weight: 900; margin: 8px 0 0; }
.paper { background: #f3ead2; color: #20170f; border-radius: 4px; padding: 16px 18px; text-align: left; font-family: Georgia, 'Times New Roman', serif; box-shadow: 0 2px 0 #d8cba8, 0 14px 40px rgba(0, 0, 0, 0.5); transform: rotate(-1deg); }
.paper .mast { font-family: Georgia, serif; font-weight: 900; font-size: 22px; letter-spacing: 1px; border-bottom: 3px double #20170f; padding-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; } .paper .mast small { font-size: 11px; font-weight: 400; font-style: italic; }
.paper h3 { font-size: 24px; line-height: 1.15; margin: 10px 0 6px; } .paper p { font-size: 14.5px; line-height: 1.45; margin: 0; columns: 2; column-gap: 16px; } .paper .photo { height: 70px; border-radius: 2px; margin: 8px 0; background: linear-gradient(180deg, #8a9aa0, #6b5d48 60%, #4a4033); filter: grayscale(1) contrast(1.1); position: relative; } .paper .photo::after { content: '🧍‍♂️🛍️'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 30px; filter: grayscale(1); }
.paper.chat { transform: none; background: #e7ffdb; font-family: Nunito, sans-serif; } .paper.chat .mast { border-bottom: 0; font-size: 15px; color: #1f6b45; } .paper.chat p { columns: 1; } .paper.chat .photo { display: none; }
@media (max-width: 1000px) { .rows { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .rows { grid-template-columns: 1fr; } .paper p { columns: 1; } }
@media (max-height: 460px) {
  .health .lv em { font-size: 9.5px; } .health .lv span { width: 96px; height: 4px; }
  .hb { height: 28px; min-width: 32px; font-size: 13px; padding: 0 6px; }
  .obj { top: calc(max(8px, var(--sat)) + 76px); left: auto; right: max(10px, var(--sar)); max-width: 200px; font-size: 11px; padding: 3px 8px; }
  .report { top: calc(max(6px, var(--sat)) + 124px); max-height: calc(100vh - 140px); overflow: auto; font-size: 11.5px; padding: 6px 10px; width: min(380px, 56vw); } .report h4 { font-size: 13px; } .report .rb button { padding: 4px 8px; font-size: 11.5px; }
  .rows { grid-template-columns: repeat(3, 1fr); gap: 5px; } .it { padding: 5px 7px; } .it small { display: none; } .it b { font-size: 12.5px; } .tabs button { padding: 4px 10px; font-size: 12.5px; }
  .card h2 { font-size: 21px; } .paper { padding: 10px 12px; } .paper h3 { font-size: 18px; margin: 6px 0 4px; } .paper p { font-size: 12.5px; } .paper .photo { height: 40px; margin: 4px 0; } .paper .mast { font-size: 16px; }
}

@media (max-width: 760px) {
  #h-reel-c { display: none; } .chip-s { padding: 3px 6px; font-size: 11.5px; gap: 3px; } .topr { gap: 4px; }
  .hb { min-width: 30px; padding: 0 5px; }
}

/* ------------------------------------------------------------ shop v2: cards, select then buy, badges */
.badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--pink); color: #fff; font-style: normal; font-size: 11px; font-weight: 900; line-height: 18px; padding: 0 4px; box-shadow: 0 0 0 2px #15292a; animation: pop 0.4s; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } }
.hb.shop { position: relative; }
.tabs button { position: relative; } .tabs .badge { top: -7px; right: -5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-bottom: 8px; }
.sc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 12px 8px 10px; border-radius: 16px; border: 2px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)); transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; overflow: hidden; }
.sc:hover { transform: translateY(-2px); }
.sc .ic { font-size: 34px; line-height: 1.1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3)); }
.sc b { font-size: 14px; line-height: 1.15; } .sc .lv { font-size: 11px; font-weight: 900; color: var(--gold); letter-spacing: 0.5px; } .sc .lvbar { display: flex; gap: 3px; } .sc .lvbar i { width: 12px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); } .sc .lvbar i.on { background: var(--gold); }
.sc .st { font-size: 12px; color: var(--muted); font-weight: 800; } .sc .st em { font-style: normal; color: var(--mint); }
.sc .pr { margin-top: 4px; padding: 4px 12px; border-radius: 99px; font-weight: 900; font-size: 13.5px; background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.sc.afford { border-color: rgba(126, 217, 87, 0.6); } .sc.afford .pr { background: linear-gradient(180deg, #8fe36a, #4cb63a); color: #10260b; box-shadow: 0 3px 0 #2d7a22; }
.sc.own { border-color: rgba(63, 182, 168, 0.6); background: linear-gradient(180deg, rgba(63, 182, 168, 0.22), rgba(63, 182, 168, 0.05)); } .sc.own .pr { background: none; color: var(--teal); }
.sc.lock { opacity: 0.55; filter: grayscale(0.7); } .sc.lock .pr { background: none; font-size: 11.5px; }
.sc.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35), 0 10px 24px rgba(0, 0, 0, 0.35); transform: translateY(-3px) scale(1.02); }
.sc .new { position: absolute; top: 9px; right: -24px; transform: rotate(35deg); background: var(--pink); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: 1px; padding: 2px 26px; }
.sc.info .pr { background: rgba(255, 210, 63, 0.15); color: var(--gold); }
.detail { position: sticky; bottom: -20px; margin: 4px -20px -20px; padding: 12px 20px 16px; background: rgba(10, 22, 22, 0.97); border-top: 2px solid var(--gold); border-radius: 0 0 16px 16px; display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 14px; align-items: center; animation: up 0.18s ease-out; }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.detail .ic { font-size: 44px; grid-row: span 2; text-align: center; } .detail h3 { margin: 0; font-size: 19px; font-weight: 900; } .detail p { margin: 0; font-size: 13.5px; color: #dfe8e4; line-height: 1.35; } .detail p em { font-style: normal; color: var(--mint); font-weight: 900; }
.detail .acts { grid-row: span 2; grid-column: 3; display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.detail .buy { border: 0; border-radius: 14px; padding: 12px 18px; font-size: 17px; font-weight: 900; background: linear-gradient(180deg, #8fe36a, #4cb63a); color: #10260b; box-shadow: 0 4px 0 #2d7a22; }
.detail .buy:active { transform: translateY(3px); box-shadow: 0 1px 0 #2d7a22; } .detail .buy:disabled { background: rgba(255, 255, 255, 0.12); color: var(--muted); box-shadow: none; }
.detail .cancel { border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 6px; color: var(--muted); font-weight: 800; }
.sheet .wallet b.bump { animation: pop 0.4s; display: inline-block; }

/* ------------------------------------------------------------ juice: floating numbers, coins, celebration, stamina */
.bar.stam u { background: #5fd4ff; } .bar.stam.run u { background: #ffd23f; }
#floats { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fl { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 15px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 8px rgba(0, 0, 0, 0.4); white-space: nowrap; animation: floatUp 1.1s ease-out forwards; }
.fl.kg { color: #c9ff9e; } .fl.rs { color: #ffd23f; font-size: 17px; } .fl.crew { color: #8fe8ff; font-size: 13px; } .fl.big { font-size: 22px; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
#coins { position: fixed; inset: 0; pointer-events: none; z-index: 30; } .coin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #ffd23f 45%, #d99a0b); box-shadow: 0 0 0 2px #b77a06, 0 2px 4px rgba(0, 0, 0, 0.4); font-size: 12px; font-weight: 900; color: #8a5a00; text-align: center; line-height: 22px; }
.chip-s.bump { animation: pop 0.35s; }
#celebrate { position: fixed; inset: 0; z-index: 28; pointer-events: none; display: flex; align-items: center; justify-content: center; }
#celebrate canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#celebrate .rays { position: absolute; left: 50%; top: 50%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; background: repeating-conic-gradient(rgba(255, 210, 63, 0.22) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 6s linear infinite, raysIn 0.5s ease-out; -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%); }
@keyframes spin { to { transform: rotate(360deg); } } @keyframes raysIn { from { opacity: 0; transform: scale(0.3); } }
#celebrate .cel-t { position: relative; text-align: center; animation: celIn 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
#celebrate small { display: block; font-size: 26px; font-weight: 900; letter-spacing: 6px; color: #fff; text-shadow: 0 3px 0 #b5552b, 0 0 30px rgba(255, 140, 0, 0.8); }
#celebrate b { display: block; font-size: 150px; line-height: 1; font-weight: 900; color: #ffd23f; text-shadow: 0 8px 0 #b77a06, 0 0 60px rgba(255, 210, 63, 0.8); -webkit-text-stroke: 3px #7a4a00; }
#celebrate span { display: block; font-size: 24px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); margin-top: 6px; }
#celebrate.out .cel-t { animation: celOut 0.35s ease-in forwards; } #celebrate.out .rays { animation: celOut 0.35s ease-in forwards; }
@keyframes celIn { from { transform: scale(0.2) rotate(-12deg); opacity: 0; } } @keyframes celOut { to { transform: scale(1.4); opacity: 0; } }
.lift { position: absolute; transform: translate(-50%, -100%); width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(0, 0, 0, 0.45) 0); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.lift::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: rgba(15, 35, 36, 0.9); } .lift i { position: relative; font-style: normal; }
@media (max-height: 460px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; } .sc { padding: 7px 5px 6px; border-radius: 12px; } .sc .ic { font-size: 24px; } .sc b { font-size: 12px; } .sc .st { font-size: 10.5px; } .sc .pr { padding: 2px 8px; font-size: 11.5px; margin-top: 2px; }
  .detail { grid-template-columns: 40px 1fr auto; padding: 8px 14px 10px; margin: 4px -14px -12px; } .detail .ic { font-size: 30px; } .detail h3 { font-size: 15px; } .detail p { font-size: 11.5px; } .detail .buy { padding: 8px 12px; font-size: 14px; } .detail .acts { min-width: 120px; gap: 4px; } .detail .cancel { padding: 3px; font-size: 12px; }
  #celebrate b { font-size: 90px; } #celebrate small { font-size: 18px; } #celebrate span { font-size: 16px; }
}
@media (max-height: 300px) { .bars { display: grid; grid-template-columns: auto auto; column-gap: 8px; row-gap: 3px; } .bar span { width: 50px; } .bar b { min-width: 0; } }

/* ------------------------------------------------------------ sign-up nudges (guests only) */
.nudge { margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; color: #e6eeea; background: rgba(255, 210, 63, 0.12); border: 1px solid rgba(255, 210, 63, 0.4); border-radius: 10px; padding: 8px 12px; }
.nudge button, .lv-nudge button, .rp-nudge button { border: 0; background: none; padding: 0; font: inherit; font-weight: 900; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lv-nudge { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.rp-nudge { margin: 6px 0 0; font-size: 12.5px; font-weight: 800; color: #5a3b14; } .rp-nudge button { color: #b5552b; }
@media (max-height: 460px) { .nudge { margin-top: 8px; font-size: 11.5px; padding: 5px 9px; } .lv-nudge { margin-top: 6px; font-size: 11.5px; } .rp-nudge { font-size: 11px; } }
