/* Outfit (SIL OFL, assets/fonts/OFL.txt), bundled so the game works offline
   from the first launch and inside the native apps. One variable file per subset. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../assets/fonts/outfit-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../assets/fonts/outfit-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/*
 * Arabic letters come from Alexandria (geometric Kufi-style, variable 100–900, SIL OFL),
 * registered under the same family name so every font stack in CSS and on canvas
 * picks it up for Arabic only. Latin text and digits stay in Outfit.
 */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../assets/fonts/alexandria-arabic-wght-normal.woff2) format('woff2');
  /* Alexandria draws noticeably larger than Outfit at the same size: match their weight on the line */
  size-adjust: 88%;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

:root {
  --bg: #05061a;
  --ink: #f4f5ff;
  --ink-2: rgba(234, 236, 255, 0.68);
  --ink-3: rgba(234, 236, 255, 0.42);
  --glass: rgba(18, 20, 48, 0.62);
  --line: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.18);
  --cyan: #36e2ff;
  --pink: #ff4fa3;
  --violet: #9b7bff;
  --gold: #ffe27a;
  --mint: #6dffc1;
  --red: #ff4d6d;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  /* Left and right insets: the notch and rounded corners when a phone is on its side */
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#safe-probe {
  position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

#ui { position: fixed; inset: 0; pointer-events: none; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(var(--st) + 14px) calc(var(--sr) + 20px) calc(var(--sb) + 18px) calc(var(--sl) + 20px);
  opacity: 0; visibility: hidden;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s 0.4s;
}
.screen.active {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1), visibility 0s;
}
#hud.active { pointer-events: none; }
#hud .icon-btn { pointer-events: auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; width: 100%; max-width: 560px; margin: 0 auto;
}
.bar-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: 0.02em; }

.icon-btn {
  width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.15s ease, background 0.2s;
}
.icon-btn:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.12); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  font-weight: 600; font-size: 15px;
}
.pill svg, .star-ico { width: 16px; height: 16px; fill: var(--gold); stroke: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-2);
  font-size: 17px; font-weight: 600; letter-spacing: 0.01em;
  transition: transform 0.14s ease, background 0.2s, box-shadow 0.3s;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn:active { transform: scale(0.96); }
.btn.primary {
  border: 0;
  background: linear-gradient(120deg, #36e2ff 0%, #9b7bff 52%, #ff4fa3 100%);
  background-size: 200% 100%;
  color: #0a0820;
  box-shadow: 0 14px 40px -12px rgba(155, 123, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: sheen 6s ease-in-out infinite;
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: #ff8094; }
.btn.icon-only { width: 54px; padding: 0; flex: 0 0 auto; }
.btn.icon-only svg { width: 22px; height: 22px; }

@keyframes sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.btn.big {
  width: 100%; min-height: 78px; border-radius: 24px; gap: 16px;
  font-size: 22px;
}
.btn.big::after {
  content: ''; position: absolute; inset: -6px; border-radius: 30px;
  border: 2px solid rgba(155, 123, 255, 0.55);
  animation: halo 2.2s ease-out infinite; pointer-events: none;
}
@keyframes halo { 0% { opacity: 0.9; transform: scale(0.96); } 100% { opacity: 0; transform: scale(1.08); } }
.play-ico { width: 30px; height: 30px; fill: #0a0820; stroke: none; }
.btn-stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.btn-stack b { font-size: 26px; font-weight: 800; letter-spacing: 0.02em; }
.btn-stack small { font-size: 13px; font-weight: 600; opacity: 0.7; letter-spacing: 0.04em; }

/* ---------- Home ---------- */
#home { align-items: center; }
.logo {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; min-height: 0;
}
.logo-text {
  margin: 0; display: flex; align-items: center; gap: 0.22em;
  font-size: clamp(52px, 17vw, 92px); font-weight: 800; letter-spacing: 0.08em; line-height: 1;
  background: linear-gradient(100deg, #fff 0%, #cfe9ff 30%, #ffd6ef 60%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 7s ease-in-out infinite;
  filter: drop-shadow(0 6px 30px rgba(155, 123, 255, 0.45));
}
.logo-dot {
  width: 0.2em; height: 0.2em; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold), 0 0 40px rgba(255, 226, 122, 0.6);
  animation: dotpulse 2.4s ease-in-out infinite;
}
@keyframes dotpulse { 0%, 40%, 60%, 100% { transform: scale(0.7); opacity: 0.6; } 50% { transform: scale(1.25); opacity: 1; } }
.tagline { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500; text-align: center; text-wrap: balance; }

.logo-mark { position: relative; width: min(66vw, 300px); height: 70px; margin-bottom: 18px; }
.lm-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.lm-gate {
  position: absolute; left: 50%; top: 8px; bottom: 8px; width: 3px; margin-left: -1.5px; border-radius: 3px;
  background: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.8);
  animation: gateflash 2.4s linear infinite;
}
.lm-bar {
  position: absolute; top: 10px; bottom: 10px; width: 12px; margin-left: -6px; border-radius: 8px;
  background: var(--cyan); box-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(54, 226, 255, 0.5);
  animation: barslide 2.4s ease-in-out infinite alternate;
}
.lm-burst {
  position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  border-radius: 50%; border: 2px solid var(--gold); opacity: 0;
  animation: burst 2.4s linear infinite;
}
@keyframes barslide { from { left: 0%; } to { left: 100%; } }
@keyframes gateflash {
  0%, 44%, 58%, 100% { background: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, 0.7); }
  50% { background: var(--gold); box-shadow: 0 0 24px var(--gold), 0 0 60px var(--gold); }
}
@keyframes burst {
  0%, 49% { opacity: 0; transform: scale(0.2); }
  50% { opacity: 1; transform: scale(0.3); }
  70% { opacity: 0; transform: scale(1.4); }
  100% { opacity: 0; }
}

.home-menu {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 14px;
  padding-bottom: 6px;
}
.row { display: flex; gap: 14px; }
.btn.tile {
  flex: 1; min-height: 70px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  padding: 0 18px;
}
.tile-label { font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tile-val { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; }
.row .btn.tile { padding: 0 14px; min-width: 0; }
.row .tile-val { font-size: clamp(14px, 4.4vw, 18px); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Long words (MALABARES, QUOTIDIEN) and Japanese labels: shrink to fit, never break mid-word */
.row .tile-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(10.5px, 3.4vw, 13px); letter-spacing: clamp(0.02em, 0.4vw, 0.08em); }
.best-line { text-align: center; color: var(--ink-3); font-size: 14px; letter-spacing: 0.06em; }
.best-line b { color: var(--ink); font-weight: 700; margin-left: 4px; }

.btn.wide {
  width: 100%; min-height: 62px; justify-content: flex-start; gap: 14px; padding: 0 18px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255, 226, 122, 0.12), rgba(255, 79, 163, 0.1) 60%, rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 226, 122, 0.28);
}
.btn.wide .btn-stack b { font-size: 20px; }
.duo-ico { width: 28px; height: 28px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 226, 122, 0.6)); }
.wide-tag {
  margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; color: var(--gold);
  background: rgba(255, 226, 122, 0.12); border: 1px solid rgba(255, 226, 122, 0.3);
}

/* ---------- Language ---------- */
.lang-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 16px; font-weight: 600;
}
.lang-row select {
  appearance: none; -webkit-appearance: none; font: 600 15px var(--font); color: var(--ink);
  padding: 9px 34px 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); max-width: 60%;
  background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaecff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
}
.lang-row select option { color: #111; }
[dir='rtl'] .lang-row select { padding: 9px 14px 9px 34px; background-position: left 10px center; }

/* Arabic letters join: tracking would pull them apart, and capitals don't exist */
:lang(ar) * { letter-spacing: normal !important; }
/* Arabic letters rise and fall further than Latin: give stacked labels room */
:lang(ar) .btn-stack { line-height: 1.45; gap: 2px; }
:lang(ar) .duo-title, :lang(ar) .res-title, :lang(ar) .pass-name, :lang(ar) .hcard h3 { line-height: 1.35; }
:lang(ar) .hcard p, :lang(ar) .hmodes li span, :lang(ar) .htips li, :lang(ar) .mode-desc { line-height: 1.7; }
/* Japanese and Chinese have no capitals either; keep their tracking modest */
:lang(ja) .card-kicker, :lang(zh-Hans) .card-kicker, :lang(ja) .tagline, :lang(zh-Hans) .tagline { letter-spacing: 0.08em; }

/* Right-to-left: mirror arrows, keep split screens physical (side 0 is always left/top) */
[dir='rtl'] #lv-back svg, [dir='rtl'] #hp-back svg, [dir='rtl'] #tg-back svg, [dir='rtl'] #pt-back svg { transform: scaleX(-1); }
[dir='rtl'] .duo-modal, [dir='rtl'] #duo { direction: ltr; }
/* The wordmark is a logo, not text: IN · SYNC in every language */
[dir='rtl'] .logo-mark, [dir='rtl'] .logo-text { direction: ltr; }
[dir='rtl'] .duo-res { direction: rtl; }
[dir='rtl'] .htips li { padding-left: 0; padding-right: 18px; }
[dir='rtl'] .htips li::before { left: auto; right: 4px; }
[dir='rtl'] .hstep { right: auto; left: 14px; }
[dir='rtl'] .wide-tag { margin-left: 0; margin-right: auto; }
[dir='rtl'] .toggle-text, [dir='rtl'] .btn-stack { align-items: flex-start; text-align: right; }
[dir='rtl'] body.solo-land .hud-bottom { left: auto; right: calc(20px + var(--sr)); }
[dir='rtl'] body.solo-land .hint { text-align: right; }

/* ---------- Share ---------- */
.share-card { gap: 12px; }
.share-preview {
  position: relative; width: min(100%, calc(46vh * 0.8)); aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden;
  background: rgba(3, 4, 14, 0.5); border: 1px solid var(--line-2); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.8);
}
.share-preview img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s; }
.share-preview img.on { opacity: 1; }
.share-wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--ink-3); }
.share-wait:empty { display: none; }
.share-text { font-size: 13px; color: var(--ink-2); text-align: center; line-height: 1.4; max-width: 320px; overflow-wrap: anywhere; }
.share-row { margin-top: 0; }
.challenge-card { gap: 10px; text-align: center; }
.challenge-card .ch-icon { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.7); }
.challenge-card .ch-goal { font-size: 46px; font-weight: 800; line-height: 1.05; background: linear-gradient(120deg, #36e2ff, #9b7bff 50%, #ff4fa3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.challenge-card p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.challenge-card p b { color: var(--ink); }
.party-card .card-actions .btn.icon-only, .results-card .card-actions .btn.icon-only { flex: 0 0 54px; }

/* ---------- How to play ---------- */
.help {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  width: 100%; max-width: 560px; margin: 14px auto 0; padding: 4px 2px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.hcard {
  position: relative; padding: 18px; border-radius: 24px;
  background: rgba(16, 18, 44, 0.62); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.hcard:nth-child(2) { animation-delay: 60ms; }
.hcard:nth-child(3) { animation-delay: 120ms; }
.hcard h3 { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.hcard p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.hcard p:last-child { margin-bottom: 0; }
.hcard b { color: var(--ink); font-weight: 700; }
.hstep {
  position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink-3);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.hcard canvas { display: block; width: 100%; margin: -4px 0 10px; border-radius: 16px; background: rgba(3, 4, 14, 0.35); }
.hero-demo { aspect-ratio: 16 / 10; }
.meter-demo { aspect-ratio: 16 / 7; }
.duet-demo { aspect-ratio: 2 / 1; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.hdemo { margin: 0; border-radius: 18px; overflow: hidden; background: rgba(3, 4, 14, 0.35); border: 1px solid color-mix(in srgb, var(--c, #fff) 25%, transparent); }
.hdemo canvas { aspect-ratio: 1; margin: 0; border-radius: 0; background: none; }
.hdemo figcaption { display: flex; flex-direction: column; gap: 1px; padding: 0 12px 11px; }
.hdemo figcaption b { color: var(--c, #fff); font-size: 15px; }
.hdemo figcaption span { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.tiers span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px;
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.tiers b { color: var(--c) !important; font-size: 13px; }
.hmodes, .htips { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hmodes li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.hmodes li b { font-size: 15px; }
.hmodes li span, .htips li { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.htips li { padding-left: 18px; position: relative; }
.htips li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
#hp-play { width: 100%; min-height: 58px; flex: 0 0 auto; }

/* A Flow HUD in miniature: the timer drains, a heart is lost, the streak chip pops */
.hfuse { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 16px; background: rgba(3, 4, 14, 0.35); }
.hfuse-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; display: flex; justify-content: center; }
.hfuse-bar i { display: block; height: 100%; border-radius: 3px; background: var(--cyan); animation: hfuse 5s linear infinite; }
@keyframes hfuse { 0% { width: 100%; background: var(--cyan); } 62% { background: var(--cyan); } 66% { background: var(--red); } 80%, 100% { width: 0; background: var(--red); } }
.hfuse-hearts { display: flex; gap: 3px; }
.hfuse-hearts .heart { width: 18px; height: 18px; }
.hfuse-hearts .heart:last-child { animation: hheart 5s ease infinite; }
@keyframes hheart { 0%, 79% { fill: var(--red); transform: none; } 82% { transform: scale(1.4); } 88%, 100% { fill: rgba(255, 255, 255, 0.14); filter: none; transform: none; } }
.hfuse-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.hfuse-chip .mult { padding: 2px 8px; border-radius: 999px; font-weight: 800; background: linear-gradient(120deg, var(--gold), #ffb36b); color: #241400; animation: hchip 5s ease infinite; }
@keyframes hchip { 0%, 26% { transform: none; } 31% { transform: scale(1.3); } 38%, 100% { transform: none; } }
@media (max-width: 360px) { .hfuse-chip { display: none; } }

/* ---------- Together ---------- */
.topbar-spacer { width: 46px; height: 46px; }
.modes {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  width: 100%; max-width: 560px; margin: 18px auto 0; padding: 4px 2px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.mode {
  --c: #fff;
  position: relative; display: flex; align-items: flex-start; gap: 16px; text-align: left;
  padding: 18px; border-radius: 24px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(16, 18, 44, 0.62) 60%);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 0.14s ease;
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.mode:nth-child(2) { animation-delay: 60ms; }
.mode:nth-child(3) { animation-delay: 120ms; }
.mode:active { transform: scale(0.97); }
.mode-icon {
  width: 56px; height: 56px; border-radius: 18px; flex: 0 0 auto; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c);
  box-shadow: 0 0 26px -6px var(--c);
}
.mode-icon svg { width: 34px; height: 34px; stroke-width: 2.2; }
.mode-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mode-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mode-name { font-size: 22px; font-weight: 800; }
.mode-tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c); white-space: nowrap; }
[dir='rtl'] .mode { text-align: right; }
.mode-desc { font-size: 15px; color: var(--ink-2); line-height: 1.35; }
.mode-best { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.mode-best:empty { display: none; }
.mode-best b { color: var(--ink); }
.together-foot { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.toggle-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.toggle-text small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.toggle-text small.warn { color: var(--gold); }
.modes-note { margin: 0; text-align: center; font-size: 13px; color: var(--ink-3); }

/* ---------- Party ---------- */
.party-setup {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  width: 100%; max-width: 480px; margin: 14px auto 0; padding: 4px 2px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.players { display: flex; flex-direction: column; gap: 8px; }
.player {
  --c: #fff;
  display: flex; align-items: center; gap: 12px; padding: 0 8px 0 16px; height: 56px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  animation: rise 0.35s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.player:focus-within { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); flex: 0 0 auto; }
.player input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink);
  font: 600 17px var(--font); -webkit-user-select: text; user-select: text; touch-action: manipulation;
}
.pdel { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-3); }
.pdel:active { background: rgba(255, 255, 255, 0.08); }
.pdel svg { width: 18px; height: 18px; }
.add-player { min-height: 48px; border-style: dashed; color: var(--ink-2); background: transparent; }
.add-player svg { width: 18px; height: 18px; }
.add-player[disabled] { opacity: 0.35; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.seg button { height: 44px; border-radius: 13px; font-size: 18px; font-weight: 700; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.seg button.on { background: linear-gradient(120deg, var(--cyan), var(--violet)); color: #0a0820; }
.party-start { width: 100%; max-width: 480px; margin: 10px auto 0; min-height: 60px; font-size: 19px; font-weight: 800; }

.party-card { gap: 10px; }
.pass-to { font-size: 16px; color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.pass-name {
  font-size: clamp(40px, 12vw, 56px); font-weight: 800; line-height: 1; color: var(--c); text-align: center; word-break: break-word;
  text-shadow: 0 0 30px color-mix(in srgb, var(--c) 70%, transparent);
  animation: starpop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
.pass-sub { font-size: 14px; color: var(--ink-3); text-align: center; }
.board { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; max-height: 40vh; overflow-y: auto; touch-action: pan-y; }
.brow {
  --c: #fff;
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid transparent;
  animation: rise 0.4s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.brow.cur { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); }
.brank { width: 22px; font-weight: 800; color: var(--ink-3); text-align: center; }
.brow i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.bname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow b { font-variant-numeric: tabular-nums; }
.brow.first { background: linear-gradient(120deg, rgba(255, 226, 122, 0.16), rgba(255, 255, 255, 0.04)); }
.brow.first .brank { color: var(--gold); }
.party-card .res-big { font-size: 56px; }

/* ---------- Split screen ---------- */
#duo.active { pointer-events: none; }
.duo-pause {
  position: absolute; left: 10px; top: 50%; margin-top: -20px; width: 40px; height: 40px; border-radius: 13px;
  pointer-events: auto; background: rgba(10, 12, 30, 0.7);
}
.duo-pause svg { width: 18px; height: 18px; }
.duo-modal { flex-direction: column; align-items: stretch; justify-content: stretch; padding: 0; }
.duo-half { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 20px; }
.duo-half.top { padding-top: calc(var(--st) + 12px); }
.duo-half.bottom { padding-bottom: calc(var(--sb) + 12px); }
body.ftf .duo-half.top .duo-res { rotate: 180deg; }
/* Landscape: players sit side by side, so halves go left and right and nothing is flipped */
body.duo-land .duo-pause { left: 50%; top: calc(var(--st) + 10px); margin: 0 0 0 -20px; }
body.duo-land .duo-modal { flex-direction: row; align-items: center; }
body.duo-land .duo-half { padding: 16px; }
body.duo-land .duo-half.top { padding-left: calc(var(--sl) + 16px); }
body.duo-land .duo-half.bottom { padding-right: calc(var(--sr) + 16px); }
body.duo-land .duo-half.top .duo-res { rotate: none; }
body.duo-land .duo-mid { flex-direction: column; width: 130px; padding: 0; order: 0; }
body.duo-land .duo-mid .btn.icon-only { flex: 0 0 54px; width: 100%; }
.duo-mid { display: flex; gap: 10px; width: 100%; max-width: 380px; margin: 0 auto; padding: 0 20px; }
.duo-mid .btn { flex: 1; }
.duo-mid .btn.icon-only { flex: 0 0 54px; }
.duo-res {
  --c: #fff;
  width: 100%; max-width: 380px; border-radius: 26px; padding: 16px 18px;
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line-2));
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 24px 70px -20px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  translate: 0 18px; scale: 0.96;
  transition: translate 0.5s cubic-bezier(0.2, 1.3, 0.3, 1), scale 0.5s cubic-bezier(0.2, 1.3, 0.3, 1);
}
.duo-res.win { box-shadow: 0 0 0 1px var(--c), 0 0 50px -10px var(--c), 0 24px 70px -20px rgba(0, 0, 0, 0.7); }
.modal.active .duo-res { translate: 0 0; scale: 1; }
.duo-title { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.05; }
.duo-res.win .duo-title { color: var(--c); text-shadow: 0 0 24px color-mix(in srgb, var(--c) 60%, transparent); }
.duo-big { font-size: 44px; }
.duo-res .res-stats { margin-top: 2px; }
.duo-res .res-stats div { padding: 8px 4px; }
.duo-res .res-badge { display: block; padding: 4px 12px; font-size: 11px; }
.duo-res .res-stats span { white-space: nowrap; }

/* ---------- Levels ---------- */
.worlds {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; overscroll-behavior: contain;
  width: 100%; max-width: 560px; margin: 14px auto 0;
  padding: 4px 2px 24px;
  display: flex; flex-direction: column; gap: 14px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent 100%);
}
.world {
  --c: #fff;
  position: relative;
  border-radius: 24px;
  padding: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), rgba(16, 18, 44, 0.6) 55%);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.world.locked { filter: saturate(0.2); opacity: 0.55; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.world-head { display: flex; align-items: center; gap: 14px; }
.world-icon {
  width: 52px; height: 52px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  box-shadow: 0 0 24px -6px var(--c);
}
.world-icon svg { width: 32px; height: 32px; stroke-width: 2.2; }
.world-info { flex: 1; min-width: 0; }
.world-name { font-size: 20px; font-weight: 700; }
.world-desc { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.world-stars { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.world-stars svg { width: 15px; height: 15px; fill: var(--gold); stroke: none; }
.world-stars .lock-ico { fill: none; stroke: var(--ink-2); }
.lvl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.lvl {
  position: relative; aspect-ratio: 1 / 1.08; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 19px; font-weight: 700;
  transition: transform 0.14s ease;
}
.lvl:active { transform: scale(0.92); }
.lvl.done { background: color-mix(in srgb, var(--c) 12%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.lvl.next { border-color: var(--c); box-shadow: 0 0 0 0 var(--c); animation: nextpulse 1.8s ease-out infinite; }
@keyframes nextpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.lvl.locked { color: var(--ink-3); }
.lvl.locked svg { width: 16px; height: 16px; stroke: var(--ink-3); }
.mini-stars { display: flex; gap: 1px; }
.mini-stars svg { width: 10px; height: 10px; fill: rgba(255, 255, 255, 0.16); stroke: none; }
.mini-stars svg.on { fill: var(--gold); filter: drop-shadow(0 0 3px rgba(255, 226, 122, 0.8)); }

/* ---------- HUD ---------- */
.hud-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px;
  width: 100%; max-width: 620px; margin: 0 auto;
}
.hud-center { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.hud-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); min-height: 15px; }
.hud-score {
  font-size: 42px; font-weight: 800; line-height: 1.05; min-height: 1.05em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(155, 123, 255, 0.55);
}
.hud-score.bump { animation: bump 0.32s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
.hud-combo {
  margin-top: 4px; min-height: 26px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  opacity: 0; transition: opacity 0.25s;
}
.hud-combo.on { opacity: 1; }
.hud-combo .mult {
  padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: linear-gradient(120deg, var(--gold), #ffb36b); color: #241400;
  box-shadow: 0 0 18px rgba(255, 226, 122, 0.5);
}
.hud-combo.pop .mult { animation: bump 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.hud-right { display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding-top: 12px; }
.heart { width: 24px; height: 24px; fill: var(--red); stroke: none; filter: drop-shadow(0 0 6px rgba(255, 77, 109, 0.7)); transition: transform 0.3s, opacity 0.3s, fill 0.3s; }
.heart.lost { fill: rgba(255, 255, 255, 0.14); filter: none; animation: heartlost 0.5s ease; }
.heart.gain { animation: heartgain 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes heartlost { 0% { transform: scale(1.4); fill: var(--red); } 60% { transform: scale(0.7) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes heartgain { 0% { transform: scale(0.2); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
.prog { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 120px; }
.prog i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); transition: background 0.3s, transform 0.3s; }
.prog i.cur { background: rgba(255, 255, 255, 0.5); transform: scale(1.2); }

.hud-bottom { margin-top: auto; display: flex; justify-content: center; }
.hint {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
  text-align: center; max-width: 340px;
}
.hint.on { opacity: 1; transform: none; }
.hint-tag {
  font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--hc, #fff) 16%, transparent);
  color: var(--hc, #fff);
  border: 1px solid color-mix(in srgb, var(--hc, #fff) 35%, transparent);
}
.hint-tag.fresh { animation: fresh 1.2s ease-in-out 2; }
@keyframes fresh { 50% { box-shadow: 0 0 22px var(--hc); } }
.hint-text { font-size: 16px; color: var(--ink-2); font-weight: 500; }

/* ---------- Modals ---------- */
.modal {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--st) + 20px) calc(var(--sr) + 20px) calc(var(--sb) + 20px) calc(var(--sl) + 20px);
  background: rgba(3, 4, 14, 0.5);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.modal { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }
/* Centre when it fits, scroll from the top when it doesn't (short screens, 8-player boards) */
.modal:not(.duo-modal) { align-items: flex-start; }
.modal:not(.duo-modal) > .card { margin: auto 0; flex: 0 0 auto; }
.modal.active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 0.3s ease, visibility 0s; }
.card {
  width: 100%; max-width: 380px;
  border-radius: 30px; padding: 26px 22px 22px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.5s cubic-bezier(0.2, 1.3, 0.3, 1);
}
.modal.active .card { transform: none; }
.card-kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.card-actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.card-actions .btn { flex: 1; }
.card-actions .btn.icon-only { flex: 0 0 54px; }
.card-actions.col { flex-direction: column; }

.toggles { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.toggles.compact { flex-direction: row; }
.toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
  font-size: 16px; font-weight: 600;
}
.toggle[hidden] { display: none; }
.toggle i { width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); position: relative; transition: background 0.25s; flex: 0 0 auto; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1); }
.toggle.on i { background: linear-gradient(120deg, var(--cyan), var(--violet)); }
.toggle.on i::after { transform: translateX(18px); }
.toggles.compact .toggle { padding: 12px 14px; font-size: 14px; gap: 10px; }
.toggles.compact .toggle i { width: 38px; height: 22px; }
.toggles.compact .toggle i::after { width: 16px; height: 16px; }
.toggles.compact .toggle.on i::after { transform: translateX(16px); }

.offset { width: 100%; padding: 12px 14px 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.offset-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.stepper button { width: 36px; height: 36px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); font-size: 20px; font-weight: 700; color: var(--ink); }
.stepper button:active { background: rgba(255, 255, 255, 0.16); }
.stepper b { min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; }
.offset-tip { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offset-tip:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.offset-tip b { color: var(--ink); }
.offset-tip button { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #061022; background: linear-gradient(120deg, var(--cyan), var(--violet)); }
.stats-mini { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-mini div { text-align: center; padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.stats-mini b { display: block; font-size: 18px; }
.stats-mini span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.st-links { display: flex; justify-content: center; gap: 4px 18px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.st-links a { color: var(--ink-3); text-decoration: none; padding: 6px 2px; }
.st-links a:hover, .st-links a:focus-visible { color: var(--ink); }
.modal:focus { outline: none; }
.btn:focus-visible, .icon-btn:focus-visible, .toggle:focus-visible, .mode:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- Results ---------- */
.results-card { gap: 10px; }
.res-title { margin: 0; font-size: 26px; font-weight: 800; }
.res-stars { display: flex; gap: 10px; margin: 4px 0; }
.res-stars:empty { display: none; }
.res-stars svg { width: 52px; height: 52px; fill: rgba(255, 255, 255, 0.12); stroke: none; }
.res-stars svg:nth-child(2) { transform: translateY(-10px); width: 60px; height: 60px; }
.res-stars svg.on { animation: starpop 0.55s cubic-bezier(0.3, 1.7, 0.5, 1) both; fill: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 226, 122, 0.85)); }
.res-stars svg:nth-child(2).on { animation-name: starpop2; }
@keyframes starpop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes starpop2 { 0% { transform: translateY(-10px) scale(0) rotate(-40deg); } 100% { transform: translateY(-10px) scale(1) rotate(0); } }
.res-big {
  font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, #d9ccff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px rgba(155, 123, 255, 0.5));
}
.res-label { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); margin-top: -4px; }
.res-badge {
  display: none;
  padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(120deg, var(--gold), #ffb36b); color: #241400;
  font-weight: 800; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 0 0 24px rgba(255, 226, 122, 0.55);
}
.res-badge.on { display: block; animation: starpop 0.6s cubic-bezier(0.3, 1.7, 0.5, 1) 0.3s both; }
.res-stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.res-stats div { padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); text-align: center; }
.res-stats b { display: block; font-size: 19px; font-weight: 700; }
.res-stats span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.res-insight { font-size: 14px; color: var(--ink-2); text-align: center; min-height: 18px; }
.res-insight b { color: var(--ink); }

@media (min-height: 760px) {
  .hud-score { font-size: 48px; }
}
@media (max-height: 760px) {
  .duo-res { gap: 4px; padding: 12px 16px; }
  .duo-title { font-size: 22px; }
  .duo-big { font-size: 38px; }
  .duo-res .res-label { display: none; }
  .duo-res .res-stats div { padding: 6px 4px; }
  .duo-res .res-stats b { font-size: 17px; }
}
@media (max-height: 640px) {
  .duo-big { font-size: 34px; }
  .duo-res .res-insight { display: none; }
  .logo-mark { height: 50px; margin-bottom: 6px; }
  .btn.big { min-height: 66px; }
  .res-big { font-size: 52px; }
  .card { padding: 20px 18px 18px; gap: 10px; }
}
/* Phone on its side: the hint moves into the empty column left of the field */
body.solo-land .hud-bottom { position: absolute; left: calc(20px + var(--sl)); bottom: calc(var(--sb) + 16px); margin: 0; }
body.solo-land .hint { align-items: flex-start; text-align: left; max-width: max(120px, var(--side)); }
body.solo-land .hint-text { font-size: 14px; }

/* Very narrow phones: keep the Together button, tiles, tagline and card buttons on one line */
@media (max-width: 350px) {
  .tagline { font-size: 14px; letter-spacing: 0.1em; }
  .row { gap: 10px; }
  .row .btn.tile { padding: 0 10px; }
  .row .tile-label { letter-spacing: 0; }
  .card-actions .btn { padding: 0 10px; font-size: 15px; gap: 6px; }
  .btn.wide { gap: 10px; padding: 0 14px; }
  .btn.wide .btn-stack { min-width: 0; }
  .btn.wide .btn-stack small { font-size: 12px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .btn.wide .duo-ico { flex: 0 0 auto; }
  .wide-tag { font-size: 10px; padding: 4px 7px; letter-spacing: 0.04em; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .hfuse-bar i, .hfuse-hearts .heart, .hfuse-chip .mult { animation-duration: 10s; }
  .btn.primary, .logo-text, .btn.big::after { animation: none; }
}
