:root {
  --ink: #2a1a14;
  --night: #1d120e;
  --cream: #fff8ea;
  --sun: #ffd23f;
  --sun-deep: #e8a90c;
  --blue: #1380e0;
  --red: #e8452f;
  --green: #2fae5f;
  --muted: #cbb8a6;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); color: var(--cream); font-family: var(--font); overscroll-behavior: none; }
body { position: fixed; inset: 0; user-select: none; -webkit-user-select: none; touch-action: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.hidden { display: none !important; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------- buttons */
.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 54px; padding: 12px 18px; border-radius: 18px; font-weight: 900; font-size: 18px; letter-spacing: 0.3px; color: var(--ink); background: var(--cream); box-shadow: 0 5px 0 #00000055; transition: transform 0.06s, box-shadow 0.06s; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #00000055; }
.btn small { font-size: 12px; font-weight: 700; opacity: 0.85; letter-spacing: 0; }
.btn.primary { background: var(--sun); box-shadow: 0 5px 0 var(--sun-deep); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--sun-deep); }
.btn.big { min-height: 72px; font-size: 28px; }
.btn.throw { background: var(--cream); }
.btn.daily { background: var(--red); color: #fff; box-shadow: 0 5px 0 #a82a1a; }
.btn.friends { background: var(--blue); color: #fff; box-shadow: 0 5px 0 #0b56a0; }
.btn.ghost { background: #ffffff1c; color: var(--cream); box-shadow: 0 5px 0 #00000040; backdrop-filter: blur(6px); font-size: 15px; min-height: 48px; }
.btn.small { min-height: 42px; font-size: 14px; padding: 8px 14px; border-radius: 14px; }
.btn.wa { background: #25d366; color: #06311a; box-shadow: 0 5px 0 #128c4a; }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: #2a1a14b8; display: grid; place-items: center; backdrop-filter: blur(6px); }
.icon-btn svg { width: 22px; height: 22px; fill: var(--cream); stroke: var(--cream); }
.icon-btn.off svg { opacity: 0.35; }
.icon-btn.off .wave { display: none; }
.pill { height: 44px; padding: 0 14px; border-radius: 14px; background: #2a1a14b8; font-weight: 800; font-size: 13px; backdrop-filter: blur(6px); }

/* ------------------------------------------------------------------- home */
.home { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 16px calc(10px + var(--safe-b)); background: radial-gradient(120% 90% at 50% 40%, #2a1a1466 0%, #1d120ee6 100%); overflow-y: auto; touch-action: pan-y; }
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.toggles { display: flex; gap: 8px; }
.coin-chip { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 14px; background: #2a1a14b8; font-weight: 900; backdrop-filter: blur(6px); }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b8, var(--sun) 45%, var(--sun-deep)); box-shadow: inset 0 0 0 2px #b8860b; display: inline-block; flex: none; }
.home-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; max-width: 380px; margin: 0 auto; padding: 12px 0; }
.logo { position: relative; margin: 0; font-size: clamp(54px, 17vw, 88px); line-height: 0.86; font-weight: 900; letter-spacing: -2px; text-align: center; color: var(--cream); text-shadow: 0 5px 0 var(--ink), 0 10px 24px #00000080; transform: rotate(-3deg); }
.logo span { display: inline-block; }
.logo span:first-child { color: var(--sun); }
.logo .de { font-size: 0.42em; letter-spacing: 0; color: var(--cream); transform: translateY(-0.5em) rotate(-6deg); background: var(--red); padding: 0.1em 0.4em 0.16em; border-radius: 0.4em; text-shadow: none; box-shadow: 0 3px 0 var(--ink); }
.logo span:last-of-type { display: block; }
.logo-ball { position: absolute; right: -0.12em; top: 0.02em; width: 0.42em; height: 0.42em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #f1e7d0 55%, #cdbf9f); box-shadow: inset 0 0 0 3px var(--ink), 0 6px 0 #00000040; animation: bounce 1.1s infinite cubic-bezier(0.3, 0, 0.7, 1) alternate; }
@keyframes bounce { from { transform: translateY(-0.35em); } to { transform: translateY(0.1em); } }
.tagline { margin: 14px 0 12px; font-size: 16px; font-weight: 700; color: var(--cream); text-align: center; text-shadow: 0 2px 6px #000000a0; }
.menu { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.best { margin: 12px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); min-height: 18px; text-align: center; }
.credit { margin: 0 auto; max-width: 420px; text-align: center; font-size: 11px; line-height: 1.45; color: #cbb8a6cc; }

/* -------------------------------------------------------------------- HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-left { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.hearts { display: flex; gap: 4px; min-height: 22px; }
.heart { width: 22px; height: 20px; background: #ff5a6e; clip-path: path("M11 20 C-6 8 3 -3 11 5 C19 -3 28 8 11 20Z"); filter: drop-shadow(0 2px 0 #00000055); }
.heart.gone { background: #00000066; }
.score { display: flex; align-items: baseline; gap: 8px; font-size: 34px; font-weight: 900; line-height: 1; text-shadow: 0 3px 0 var(--ink), 0 0 12px #00000060; font-variant-numeric: tabular-nums; }
.combo { font-size: 18px; color: var(--ink); background: var(--sun); border-radius: 10px; padding: 3px 8px; text-shadow: none; box-shadow: 0 3px 0 var(--sun-deep); }
.combo.pop { animation: pop 0.25s; }
@keyframes pop { 50% { transform: scale(1.4) rotate(-6deg); } }
.hud-mid { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.chip { background: #2a1a14c9; border-radius: 12px; padding: 6px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; backdrop-filter: blur(6px); }
.chip b { color: var(--sun); font-size: 15px; }
.meter { width: 96px; height: 7px; border-radius: 4px; background: #2a1a14c9; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--sun), var(--red)); transition: width 0.3s; }
.hud-right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.emotes { display: flex; gap: 4px; }
.emotes button { width: 36px; height: 36px; border-radius: 12px; background: #2a1a14b8; font-size: 18px; }
.call { position: absolute; top: calc(84px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 14px; font-weight: 900; font-size: 14px; letter-spacing: 0.4px; white-space: nowrap; pointer-events: none; background: var(--cream); color: var(--ink); box-shadow: 0 3px 0 #00000055; }
.call.high { background: #ff4d6d; color: #fff; }
.call small { font-weight: 700; opacity: 0.85; margin-left: 6px; letter-spacing: 0; }
.banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: clamp(44px, 12vw, 96px); font-weight: 900; color: var(--sun); text-shadow: 0 5px 0 var(--ink), 0 0 30px #00000080; pointer-events: none; opacity: 0; }
.banner.show { animation: banner 0.9s both; }
.banner.small { font-size: clamp(20px, 5.5vw, 34px); color: var(--cream); top: 24%; }
.banner.small.show { animation: banner 2.4s both; }
@keyframes banner { 0% { opacity: 0; transform: scale(0.5); } 12% { opacity: 1; transform: scale(1.12); } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.06); } }
.toast { position: absolute; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 10px 16px; border-radius: 14px; font-weight: 800; font-size: 14px; box-shadow: 0 6px 20px #00000080; z-index: 30; max-width: 90vw; text-align: center; }

/* ------------------------------------------------------------------ touch */
.touch { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px calc(18px + var(--safe-b)); pointer-events: none; }
.stick { width: 132px; height: 132px; border-radius: 50%; background: #2a1a1470; border: 3px solid #fff8ea55; display: grid; place-items: center; pointer-events: auto; touch-action: none; }
.stick-knob { width: 58px; height: 58px; border-radius: 50%; background: var(--cream); box-shadow: 0 4px 0 #00000055; }
.touch-buttons { display: flex; align-items: flex-end; gap: 12px; pointer-events: auto; }
.act { width: 104px; height: 104px; border-radius: 50%; background: var(--sun); color: var(--ink); font-weight: 900; font-size: 17px; box-shadow: 0 6px 0 var(--sun-deep); touch-action: none; }
.act.alt { width: 82px; height: 82px; background: #ff4d6d; color: #fff; box-shadow: 0 6px 0 #b3203c; font-size: 14px; }
.act.down { transform: translateY(5px); box-shadow: 0 1px 0 #00000055; }

/* ------------------------------------------------------------------ sheet */
.backdrop { position: absolute; inset: 0; background: #1d120ea8; display: flex; align-items: flex-end; justify-content: center; z-index: 20; backdrop-filter: blur(3px); }
.sheet { width: 100%; max-width: 480px; max-height: 92%; overflow-y: auto; background: var(--cream); color: var(--ink); border-radius: 26px 26px 0 0; padding: 22px 18px calc(20px + var(--safe-b)); touch-action: pan-y; animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1); user-select: text; -webkit-user-select: text; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) and (min-height: 560px) { .backdrop { align-items: center; } .sheet { border-radius: 26px; } }
.sheet h2 { margin: 0 0 4px; font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }
.sheet p { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: #5d4638; }
.sheet .btn { box-shadow: 0 5px 0 #00000030; }
.sheet .btn.primary { box-shadow: 0 5px 0 var(--sun-deep); }
.sheet .btn.plain { background: #2a1a1414; }
.sheet .btn.wa { box-shadow: 0 5px 0 #128c4a; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.close { width: 40px; height: 40px; border-radius: 12px; background: #2a1a1414; font-size: 18px; font-weight: 900; flex: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.field { width: 100%; height: 52px; border-radius: 16px; border: 2.5px solid var(--ink); background: #fff; padding: 0 14px; font-size: 18px; font-weight: 800; outline: none; }
.field:focus { border-color: var(--blue); }
.field.code { text-transform: uppercase; letter-spacing: 4px; text-align: center; }
.label { font-size: 12px; font-weight: 900; letter-spacing: 0.8px; text-transform: uppercase; color: #7a5f4e; margin: 6px 0 -4px; }
.error { color: var(--red); font-weight: 800; font-size: 14px; min-height: 20px; margin: 0; }
.divider { text-align: center; font-size: 12px; font-weight: 800; color: #7a5f4e; margin: 4px 0; }
.big-code { font-size: 46px; font-weight: 900; letter-spacing: 8px; text-align: center; background: var(--ink); color: var(--sun); border-radius: 18px; padding: 10px 4px 10px 12px; margin: 8px 0 10px; user-select: all; -webkit-user-select: all; }
.people { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.person { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: #2a1a140f; font-weight: 800; font-size: 15px; }
.person.me { background: #ffd23f66; }
.person .rank { font-weight: 900; color: #7a5f4e; }
.person .tag { font-size: 11px; font-weight: 900; padding: 3px 7px; border-radius: 8px; background: var(--ink); color: var(--cream); text-transform: uppercase; letter-spacing: 0.4px; }
.person .tag.t { background: var(--red); }
.person .pts { font-variant-numeric: tabular-nums; }
.person .pts small { color: #7a5f4e; font-weight: 700; margin-left: 6px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: #2a1a140f; font-weight: 800; }
.stepper div { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: var(--cream); font-size: 20px; font-weight: 900; }
.stepper b { min-width: 18px; text-align: center; font-size: 18px; }
.result-score { font-size: 64px; font-weight: 900; line-height: 1; text-align: center; margin: 6px 0 2px; letter-spacing: -2px; }
.result-tag { text-align: center; font-weight: 900; color: var(--red); min-height: 22px; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: #2a1a140f; border-radius: 14px; padding: 9px 4px; text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 900; }
.stat span { font-size: 10.5px; font-weight: 800; color: #7a5f4e; text-transform: uppercase; letter-spacing: 0.3px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #2a1a1414; border-radius: 16px; padding: 5px; margin: 10px 0 12px; }
.tabs button { height: 40px; border-radius: 12px; background: transparent; font-weight: 900; font-size: 14px; color: #7a5f4e; }
.tabs button.on { background: var(--ink); color: var(--cream); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.card { background: #fff; border: 2.5px solid #2a1a141f; border-radius: 18px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.card.on { border-color: var(--ink); background: #ffd23f40; }
.card canvas { width: 84px; height: 84px; }
.card b { font-size: 13px; line-height: 1.15; min-height: 30px; display: grid; place-items: center; }
.card .btn { min-height: 38px; font-size: 13px; padding: 6px 8px; border-radius: 12px; flex-direction: row; gap: 5px; }
.card .btn .coin { width: 16px; height: 16px; }
.pack { margin-top: 14px; border-radius: 18px; padding: 14px; background: linear-gradient(135deg, #fff3b8, var(--sun)); border: 2.5px solid var(--ink); }
.pack h3 { margin: 0 0 2px; font-size: 18px; font-weight: 900; }
.pack p { margin: 0 0 10px; }
.how { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; padding: 0; list-style: none; counter-reset: how; }
.how li { counter-increment: how; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; font-size: 15px; font-weight: 700; line-height: 1.35; }
.how li::before { content: counter(how); width: 34px; height: 34px; border-radius: 12px; background: var(--ink); color: var(--sun); display: grid; place-items: center; font-weight: 900; }
.keys { font-size: 12.5px !important; color: #7a5f4e !important; }
.note { font-size: 13px; font-weight: 800; text-align: center; color: #7a5f4e; margin: 0 0 10px; }

@media (max-height: 520px) {
  .home-main { flex-direction: row; max-width: 760px; gap: 28px; }
  .home-main .logo { font-size: 58px; }
  .tagline, .credit, .best { display: none; }
  .btn.big { min-height: 54px; font-size: 22px; }
  .act { width: 84px; height: 84px; } .act.alt { width: 68px; height: 68px; }
  .stick { width: 112px; height: 112px; }
}
@media (prefers-reduced-motion: reduce) { .logo-ball, .banner.show, .sheet { animation-duration: 0.01s; } }

/* ------------------------------------------------------------------ polish */
.wipe { position: absolute; inset: 0; z-index: 40; pointer-events: none; background: var(--sun); clip-path: circle(0% at 50% 50%); }
.wipe.go { animation: wipe 0.5s cubic-bezier(0.6, 0, 0.3, 1) both; }
@keyframes wipe { from { clip-path: circle(150% at 50% 50%); } to { clip-path: circle(0% at 50% 50%); } }
.home:not(.hidden) .logo { animation: logo-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes logo-in { from { transform: rotate(-12deg) scale(0.4); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
.home:not(.hidden) .tagline, .home:not(.hidden) .menu > * { animation: rise-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.home:not(.hidden) .tagline { animation-delay: 0.15s; }
.home:not(.hidden) .menu > :nth-child(1) { animation-delay: 0.2s; }
.home:not(.hidden) .menu > :nth-child(2) { animation-delay: 0.27s; }
.home:not(.hidden) .menu > :nth-child(3) { animation-delay: 0.34s; }
.home:not(.hidden) .menu > :nth-child(4) { animation-delay: 0.41s; }
.home:not(.hidden) .menu > :nth-child(5) { animation-delay: 0.48s; }
@keyframes rise-in { from { transform: translateY(26px) scale(0.96); opacity: 0; } }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, #ffffff99, transparent); transform: skewX(-18deg); animation: sheen 3.2s infinite; }
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.heart { transition: background 0.2s; }
.heart.break { animation: heart-break 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes heart-break { 0% { transform: scale(1.9) rotate(-18deg); background: #fff; } 40% { transform: scale(0.7) rotate(10deg); background: #ff5a6e; } 100% { transform: scale(1); } }
.hearts.last .heart:not(.gone) { animation: heart-beat 0.7s infinite; }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 18% { transform: scale(1.3); } 36% { transform: scale(1); } 54% { transform: scale(1.18); } }
.score b { display: inline-block; transform-origin: left center; }
.score b.bump, .result-score.bump { animation: bump 0.3s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes bump { 40% { transform: scale(1.22); color: var(--sun); } }
.result-score.bump { color: var(--ink); }
.call:not(.hidden) { animation: call-in 0.22s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes call-in { from { transform: translateX(-50%) scale(0.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.sheet .stat { animation: rise-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.sheet .stat:nth-child(2) { animation-delay: 0.08s; } .sheet .stat:nth-child(3) { animation-delay: 0.16s; } .sheet .stat:nth-child(4) { animation-delay: 0.24s; }
.card { transition: transform 0.12s, border-color 0.12s; }
.card:active { transform: scale(0.97); }
.act { transition: transform 0.05s; }
@media (prefers-reduced-motion: reduce) { .wipe.go, .home .logo, .home .menu > *, .btn.primary::after, .heart.break, .hearts.last .heart { animation: none !important; } }

.card .trait { font-size: 11px; line-height: 1.25; color: #7a5f4e; font-weight: 700; min-height: 42px; }
.card b { min-height: 0; }
.card canvas { width: 96px; height: 96px; }

.home:not(.hidden) .menu > :nth-child(6) { animation-delay: 0.55s; }
.mission { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 14px; background: #2a1a140f; font-weight: 800; font-size: 14.5px; line-height: 1.3; }
.mission i { width: 30px; height: 30px; border-radius: 10px; border: 2.5px solid #2a1a1455; display: grid; place-items: center; font-style: normal; font-weight: 900; }
.mission.done { background: #2fae5f2e; } .mission.done i { background: var(--green); border-color: var(--green); color: #fff; }
.mission span.pay { display: flex; align-items: center; gap: 4px; font-weight: 900; } .mission .coin { width: 16px; height: 16px; }
.board { display: flex; flex-direction: column; gap: 5px; margin: 8px 0 12px; }
.board .row-b { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #2a1a140f; font-weight: 800; font-size: 14.5px; }
.board .row-b.me { background: #ffd23f77; } .board .row-b b { color: #7a5f4e; } .board .row-b:nth-child(1) b { color: #c98a00; }
.board .row-b span:last-child { font-variant-numeric: tabular-nums; }
.gains { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 12px; }
.gains div { background: #2fae5f2e; border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 13.5px; }
.call.two { background: #7b3ff2; color: #fff; } .call.curve { background: var(--blue); color: #fff; }

.act.alt.pass { width: 70px; height: 70px; background: var(--blue); box-shadow: 0 6px 0 #0b56a0; font-size: 12.5px; }
.touch-buttons { gap: 8px; }
@media (max-height: 520px) { .act.alt.pass { width: 58px; height: 58px; } }
.stick { flex: none; }
/* Three throw buttons need the room: everything gets a little smaller for the thrower. */
.touch:has(#actPass:not(.hidden)) .stick { width: 108px; height: 108px; }
.touch:has(#actPass:not(.hidden)) .stick-knob { width: 48px; height: 48px; }
.touch:has(#actPass:not(.hidden)) .act:not(.alt) { width: 90px; height: 90px; font-size: 16px; }
.touch:has(#actPass:not(.hidden)) .act.alt { width: 66px; height: 66px; font-size: 13px; }
.touch:has(#actPass:not(.hidden)) .act.alt.pass { width: 60px; height: 60px; font-size: 12px; }

.act.alt.grab { background: #12a594; box-shadow: 0 6px 0 #0a6e63; }
.board .caught { font-weight: 800; color: #0a6e63; margin-left: 6px; }

/* ---------------------------------------------------- the other games */
.logo.one { font-size: clamp(40px, 12.5vw, 76px); letter-spacing: -1px; color: var(--sun); line-height: 1; padding: 0 8px; }
.hud-left .status { font-size: 20px; font-weight: 900; text-shadow: 0 3px 0 var(--ink); line-height: 1.1; }
.hud-left .status.bad { color: #ff7a8a; } .hud-left .status.good { color: #8ff0b0; }
.bar { width: 120px; height: 10px; border-radius: 6px; background: #2a1a14c9; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--sun); }
.bar.low i { background: #ff5a6e; }
.chip.big { font-size: 24px; padding: 6px 16px; } .chip.big b { font-size: 26px; } .chip.hot { background: var(--red); } .chip.hot b { color: #fff; }
.seg { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: #2a1a140f; font-weight: 800; }
.seg div { display: flex; gap: 4px; } .seg button { min-width: 44px; height: 38px; padding: 0 10px; border-radius: 12px; background: #2a1a1418; font-weight: 900; }
.seg button.on { background: var(--ink); color: var(--cream); }

@media (max-width: 480px) { .emotes button:nth-child(n+3) { display: none; } }

/* ---------------------------------------------------------------- library */
a.pill { display: inline-flex; align-items: center; text-decoration: none; color: var(--cream); }
body.lib-body { touch-action: auto; user-select: auto; -webkit-user-select: auto; }
.library { position: absolute; inset: 0; overflow-y: auto; padding: calc(12px + var(--safe-t)) 16px calc(28px + var(--safe-b)); background: radial-gradient(120% 70% at 50% 0%, #6b3a22 0%, #2a1a14 55%, var(--night) 100%); }
.library > * { max-width: 980px; margin-left: auto; margin-right: auto; }
.lib-top { display: flex; justify-content: space-between; align-items: center; }
.lib-logo { margin: 18px auto 0; text-align: center; font-weight: 900; line-height: 0.88; letter-spacing: -1.5px; transform: rotate(-2deg); text-shadow: 0 5px 0 var(--ink), 0 10px 24px #00000080; animation: logo-in 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.lib-logo span { display: block; font-size: clamp(40px, 11vw, 84px); }
.lib-logo span:first-child { color: var(--sun); } .lib-logo span:last-child { color: var(--cream); font-size: clamp(30px, 8.4vw, 64px); }
.lib-tag { text-align: center; font-weight: 700; font-size: 16px; margin: 14px auto 16px; color: var(--cream); }
.lib-room { display: block; text-align: center; text-decoration: none; font-weight: 900; color: var(--ink); background: var(--sun); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; box-shadow: 0 5px 0 var(--sun-deep); max-width: 520px; }
.lib-me, .lib-join { max-width: 520px; margin-bottom: 18px; }
.lib-me label, .lib-join label { display: block; font-size: 12px; font-weight: 900; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.library .field { color: var(--ink); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-bottom: 26px; }
.lib-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--cream); border-radius: 22px; overflow: hidden; box-shadow: 0 6px 0 #00000055; transition: transform 0.12s; animation: rise-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.lib-card:nth-child(2) { animation-delay: 0.07s; } .lib-card:nth-child(3) { animation-delay: 0.14s; } .lib-card:nth-child(4) { animation-delay: 0.21s; }
.lib-card:hover { transform: translateY(-4px); } .lib-card:active { transform: translateY(3px); }
.lib-card canvas { width: 100%; aspect-ratio: 16 / 9; display: block; }
.lib-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lib-card h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.lib-card .lib-sub { margin: 0; font-weight: 900; color: var(--red); font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.lib-card p { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: #5d4638; }
.lib-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 800; color: #7a5f4e; }
.lib-card-foot .btn { width: auto; min-width: 96px; pointer-events: none; }

@media (min-width: 640px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .lib-grid { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 430px) { .home-top .coin-chip { padding: 0 10px 0 8px; } .home-top .pill { padding: 0 10px; } .home-top { gap: 4px; } .home-top .toggles { gap: 5px; } }

/* Three touch buttons on the newer games: everything a little smaller so the stick keeps its room. */
.touch:has(#actC:not(.hidden)) .stick { width: 108px; height: 108px; }
.touch:has(#actC:not(.hidden)) .stick-knob { width: 48px; height: 48px; }
.touch:has(#actC:not(.hidden)) .act:not(.alt) { width: 90px; height: 90px; font-size: 15px; }
.touch:has(#actC:not(.hidden)) .act.alt { width: 66px; height: 66px; font-size: 12.5px; }
.touch:has(#actC:not(.hidden)) .act.alt.pass { width: 60px; height: 60px; font-size: 12px; }

/* Guests see the host's settings but cannot change them. */
.locked { pointer-events: none; opacity: 0.75; display: flex; flex-direction: column; gap: 10px; }
