:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #a9b8ce;
  --navy: #071426;
  --panel: rgba(7, 20, 38, 0.88);
  --panel-soft: rgba(13, 31, 54, 0.76);
  --line: rgba(255, 255, 255, 0.14);
  --red: #ff4d45;
  --orange: #ffb52e;
  --blue: #35a7ff;
  --green: #73e66d;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-right: max(14px, env(safe-area-inset-right));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
  --safe-left: max(14px, env(safe-area-inset-left));
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.platform-paused *,
.platform-paused *::before,
.platform-paused *::after {
  animation-play-state: paused !important;
  transition: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--ink);
  font-family: Inter, Manrope, "Arial Black", Arial, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

#game {
  position: fixed;
  inset: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  background: radial-gradient(circle at 50% 20%, #1b5f8e, #071426 70%);
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

#game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 16, 30, 0.04), rgba(4, 16, 30, 0.02) 55%, rgba(2, 10, 22, 0.38));
}

.is-hidden {
  display: none !important;
}

.screen,
.hud,
.desktop-hint,
.mobile-controls,
.modal,
.toast,
.goal-flash {
  position: absolute;
  z-index: 3;
}

.loading-screen {
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: radial-gradient(circle at 50% 40%, #153d62, #071426 70%);
  z-index: 20;
}

.loader-ball {
  font-size: clamp(58px, 10vw, 104px);
  filter: drop-shadow(0 16px 25px rgba(0, 0, 0, 0.45));
  animation: ball-bounce 0.9s cubic-bezier(.45,0,.55,1) infinite alternate;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .02em;
}

.loading-track,
.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
}

.loading-track {
  width: min(280px, 72vw);
}

.loading-track span,
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange));
  box-shadow: 0 0 18px rgba(255, 181, 46, .65);
  transition: width .35s ease;
}

.menu-screen {
  inset: 0;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(240px, 360px);
  grid-template-rows: auto auto;
  align-content: center;
  justify-content: space-between;
  gap: 30px 8vw;
  padding: clamp(26px, 5vw, 72px);
  padding-top: max(clamp(26px, 5vw, 72px), env(safe-area-inset-top));
  background: linear-gradient(90deg, rgba(3, 12, 24, .92) 0%, rgba(3, 12, 24, .68) 39%, rgba(3, 12, 24, .08) 72%);
}

.brand-lockup {
  align-self: end;
  max-width: 700px;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .65);
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--orange);
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 1000;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.brand-lockup h1 {
  margin: 0;
  font-size: clamp(42px, 6.6vw, 100px);
  line-height: .86;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.brand-lockup h1 span,
.brand-lockup h1 strong {
  display: block;
}

.brand-lockup h1 strong {
  color: var(--orange);
  font-size: .7em;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .18);
}

.brand-lockup p {
  max-width: 520px;
  margin: 20px 0 0;
  color: #d7e2ef;
  font-size: clamp(15px, 1.5vw, 21px);
  font-weight: 650;
  line-height: 1.35;
}

.menu-actions {
  grid-row: span 2;
  align-self: center;
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 28px;
  background: rgba(7, 20, 38, .76);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .36), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}

.button {
  min-height: 58px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: .025em;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

.button:hover,
.icon-button:hover,
.touch-button:hover,
.reward-card:hover,
.level-card:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
}

.button:active,
.icon-button:active,
.touch-button:active,
.reward-card:active,
.level-card:active {
  transform: translateY(1px) scale(.985);
}

.button.primary {
  color: #230909;
  background: linear-gradient(135deg, #ffb52e, #ff5a43);
  box-shadow: 0 14px 32px rgba(255, 94, 67, .32), inset 0 1px rgba(255,255,255,.45);
}

.button.secondary {
  background: linear-gradient(135deg, #208ddc, #2854ce);
  box-shadow: 0 14px 30px rgba(33, 107, 221, .26), inset 0 1px rgba(255,255,255,.3);
}

.button.glass {
  min-height: 50px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .11);
}

.button-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  font-size: 13px;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.progress-card {
  align-self: start;
  width: min(100%, 420px);
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(6, 20, 36, .74);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
}

.progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 900;
}

.progress-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
}

.hud {
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(112px, 1fr);
  align-items: start;
  gap: 14px;
  pointer-events: none;
}

.hud-card,
.scoreboard,
.hud-actions {
  pointer-events: auto;
}

.hud-card {
  justify-self: start;
  min-width: 220px;
  padding: 11px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  border-radius: 16px;
  background: rgba(7, 20, 38, .76);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.hud-card small {
  grid-column: span 2;
  color: var(--orange);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hud-card b { font-size: 22px; }
.hud-card span { color: #d9e5f2; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.scoreboard {
  display: grid;
  grid-template-columns: 98px minmax(90px, 126px) 98px;
  min-height: 72px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .84);
  border-radius: 18px;
  background: rgba(4, 13, 25, .88);
  box-shadow: 0 12px 34px rgba(0,0,0,.36);
}

.team {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 950;
}

.team b { font-size: 36px; line-height: 1; }
.team-red { background: linear-gradient(135deg, #eb3437, #8e1524); }
.team-blue { background: linear-gradient(135deg, #1688d3, #164896); }

.match-clock {
  display: grid;
  place-content: center;
  text-align: center;
}

.match-clock span { font-size: 23px; font-weight: 1000; font-variant-numeric: tabular-nums; }
.match-clock small { color: var(--muted); font-size: 9px; font-weight: 800; }

.hud-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
}

.icon-button,
.touch-button {
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(5, 18, 34, .78);
  box-shadow: 0 10px 24px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  transition: transform .14s ease, filter .14s ease;
}

.icon-button { width: 52px; height: 52px; border-radius: 16px; font-size: 21px; font-weight: 1000; }
.reward-pulse { animation: reward-pulse 2.4s ease-in-out infinite; }

.desktop-hint {
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  padding: 10px 15px;
  border-radius: 14px;
  background: rgba(5, 17, 31, .64);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-weight: 800;
}

.desktop-hint span { display: flex; align-items: center; gap: 5px; }
.desktop-hint em { color: var(--muted); font-style: normal; }
kbd { min-width: 25px; padding: 4px 6px; text-align: center; border-radius: 6px; background: rgba(255,255,255,.13); border-bottom: 2px solid rgba(255,255,255,.2); font: 800 10px/1 Arial; }

.mobile-controls {
  left: var(--safe-left);
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  justify-content: space-between;
  pointer-events: none;
}

.control-cluster { display: flex; gap: 12px; pointer-events: auto; }
.touch-button { width: clamp(62px, 16vw, 82px); height: clamp(62px, 16vw, 82px); border-radius: 50%; font-size: clamp(22px, 6vw, 32px); touch-action: none; }
.jump-button { background: rgba(24, 117, 188, .82); }
.kick-button { color: #321600; background: linear-gradient(135deg, rgba(255,203,67,.96), rgba(255,92,57,.94)); }
.touch-button.is-active { transform: scale(.91); filter: brightness(1.25); }

.modal {
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(2, 9, 18, .72);
  backdrop-filter: blur(12px);
  z-index: 10;
  overflow: auto;
}

.modal-panel {
  width: min(100%, 920px);
  max-height: min(88vh, 820px);
  overflow: auto;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(14, 35, 60, .97), rgba(5, 17, 32, .98));
  box-shadow: 0 35px 90px rgba(0, 0, 0, .52), inset 0 1px rgba(255,255,255,.08);
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-header h2,
.pause-panel h2,
.result-panel h2,
.ad-panel h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.close-button {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.1);
  cursor: pointer;
  font-size: 28px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding-right: 4px;
}

.level-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  text-align: left;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(45,111,167,.68), rgba(15,43,75,.86));
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  transition: transform .14s ease, filter .14s ease;
}

.level-card b { font-size: 24px; }
.level-card span { font-size: 10px; line-height: 1.2; font-weight: 850; color: #dce9f6; }
.level-card small { color: var(--orange); font-weight: 900; }
.level-card.is-current { box-shadow: 0 0 0 2px var(--orange); }
.level-card.is-locked { opacity: .42; filter: grayscale(.8); cursor: not-allowed; }

.compact-panel { max-width: 620px; }

.leaderboard-list { display: grid; gap: 9px; }
.leaderboard-entry { display: grid; grid-template-columns: 42px 44px 1fr auto; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 14px; background: rgba(255,255,255,.07); }
.leaderboard-entry.is-player { box-shadow: inset 0 0 0 2px var(--orange); background: rgba(255,181,46,.11); }
.leaderboard-entry .rank { color: var(--orange); font-size: 18px; font-weight: 1000; }
.leaderboard-entry img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; background: rgba(255,255,255,.12); }
.leaderboard-entry .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 850; }
.leaderboard-entry .points { font-size: 18px; font-weight: 1000; font-variant-numeric: tabular-nums; }
.leaderboard-note,.empty-state { color: var(--muted); font-size: 12px; line-height: 1.5; }

.settings-list { display: grid; gap: 12px; }
.settings-list label,
.settings-row { min-height: 64px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 15px; background: rgba(255,255,255,.06); font-weight: 900; }
.settings-row b { color: var(--orange); text-align: right; }
.settings-list select { min-height: 40px; min-width: 140px; padding: 0 12px; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: #102b49; }
.toggle { min-width: 96px; min-height: 42px; padding: 5px 10px 5px 6px; display: flex; align-items: center; gap: 9px; color: #081823; border-radius: 99px; background: var(--green); cursor: pointer; }
.toggle span { width: 31px; height: 31px; border-radius: 50%; background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.toggle.is-off { color: #fff; background: #536276; }
.toggle.is-off span { order: 2; }
.how-to { margin-top: 18px; padding: 16px; border-left: 4px solid var(--orange); border-radius: 8px 14px 14px 8px; background: rgba(255,181,46,.08); }
.how-to h3 { margin: 0 0 6px; }
.how-to p { margin: 0; color: #d2dfed; line-height: 1.5; }

.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.reward-card { min-height: 240px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; text-align: center; border-radius: 22px; color: #fff; background: linear-gradient(145deg, rgba(41,103,159,.72), rgba(13,39,70,.9)); border: 1px solid rgba(255,255,255,.15); cursor: pointer; transition: transform .15s ease, filter .15s ease; }
.reward-card:nth-child(2) { background: linear-gradient(145deg, rgba(201,93,34,.78), rgba(89,30,34,.9)); }
.reward-card:nth-child(3) { background: linear-gradient(145deg, rgba(50,137,108,.78), rgba(14,59,62,.9)); }
.reward-icon { font-size: 46px; }
.reward-card b { font-size: 20px; }
.reward-card small { min-height: 50px; color: #d9e5f1; line-height: 1.35; }
.reward-card em { margin-top: 8px; padding: 9px 12px; border-radius: 10px; color: #071426; background: #fff; font-size: 11px; font-style: normal; font-weight: 1000; text-transform: uppercase; }

.pause-panel,.result-panel,.ad-panel { max-width: 500px; text-align: center; }
.pause-panel p,.result-panel p,.ad-panel p { color: var(--muted); line-height: 1.45; }
.pause-panel .button,.result-panel .button { width: 100%; margin-top: 10px; }
.modal-emoji,.result-icon { display: block; margin-bottom: 14px; font-size: 66px; filter: drop-shadow(0 13px 20px rgba(0,0,0,.35)); }
.result-score { margin: 18px 0; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 38px; }
.result-score b { width: 76px; height: 70px; display: grid; place-items: center; border-radius: 15px; background: rgba(255,255,255,.09); }

.ad-warning { background: rgba(2,8,16,.88); }
.ad-panel { overflow: hidden; }
.ad-badge { display: inline-grid; place-items: center; width: 48px; height: 28px; margin-bottom: 16px; border-radius: 7px; color: #071426; background: var(--orange); font-size: 12px; font-weight: 1000; letter-spacing: .12em; }
.ad-countdown { height: 6px; margin-top: 20px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.1); }
.ad-countdown span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg,var(--orange),var(--red)); animation: ad-countdown 2s linear forwards; transform-origin: left; }

.toast {
  left: 50%;
  bottom: 105px;
  min-width: min(340px, calc(100vw - 40px));
  max-width: 520px;
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(4, 15, 28, .93);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 15px 35px rgba(0,0,0,.36);
  text-align: center;
  font-weight: 850;
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 25;
}
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }

.goal-flash {
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(72px, 17vw, 210px);
  font-weight: 1000;
  letter-spacing: -.05em;
  text-transform: uppercase;
  text-shadow: 0 10px 0 rgba(0,0,0,.18), 0 25px 65px rgba(0,0,0,.45);
  opacity: 0;
  transform: scale(.4) rotate(-8deg);
  pointer-events: none;
  z-index: 8;
}
.goal-flash.is-visible { animation: goal-pop 1.15s cubic-bezier(.2,.75,.2,1) both; }

@keyframes ball-bounce { to { transform: translateY(-26px) rotate(20deg); } }
@keyframes reward-pulse { 0%,100% { box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 0 rgba(255,181,46,.45); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 0 0 10px rgba(255,181,46,0); } }
@keyframes ad-countdown { to { transform: scaleX(0); } }
@keyframes goal-pop { 0% { opacity: 0; transform: scale(.4) rotate(-8deg); } 22%,65% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(1.25); } }

@media (hover: none), (pointer: coarse) {
  .desktop-hint { display: none !important; }
  .mobile-controls:not(.is-hidden) { display: flex; }
}

@media (hover: hover) and (pointer: fine) {
  .desktop-hint:not(.is-hidden) { display: flex; }
  .mobile-controls { display: none !important; }
}

@media (max-width: 900px) {
  .menu-screen { grid-template-columns: minmax(0,1fr) minmax(230px, 300px); gap: 22px 4vw; padding: 32px; }
  .brand-lockup h1 { font-size: clamp(42px, 7.7vw, 70px); }
  .menu-actions { padding: 16px; }
  .button { min-height: 52px; }
  .level-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .hud { grid-template-columns: 90px 1fr 94px; }
  .hud-card { min-width: 0; width: 90px; grid-template-columns: 1fr; padding: 9px; }
  .hud-card small,.hud-card span { display: none; }
  .scoreboard { justify-self: center; grid-template-columns: 74px minmax(76px,98px) 74px; min-height: 60px; }
  .team b { font-size: 30px; }
  .team span { display: none; }
  .icon-button { width: 48px; height: 48px; border-radius: 13px; }
}

@media (max-width: 680px) {
  .menu-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    align-content: end;
    gap: 14px;
    padding: 22px var(--safe-right) calc(var(--safe-bottom) + 4px) var(--safe-left);
    background: linear-gradient(180deg, rgba(2,10,20,.06) 0%, rgba(2,10,20,.34) 35%, rgba(2,10,20,.96) 65%);
  }
  .brand-lockup { align-self: auto; min-width: 0; }
  .brand-lockup h1 { font-size: clamp(38px, 12vw, 62px); }
  .brand-lockup p { margin-top: 10px; font-size: 14px; }
  .eyebrow { margin-bottom: 6px; }
  .menu-actions { grid-row: auto; min-width: 0; gap: 9px; padding: 12px; border-radius: 20px; }
  .button { min-height: 48px; border-radius: 13px; }
  .button.glass { min-width: 0; min-height: 44px; padding-inline: 8px; gap: 6px; font-size: 11px; }
  .progress-card { display: none; }
  .hud { gap: 7px; grid-template-columns: 43px 1fr 85px; }
  .hud-card { width: 43px; min-height: 45px; place-items: center; border-radius: 12px; }
  .hud-card b { font-size: 17px; }
  .scoreboard { grid-template-columns: 52px minmax(69px,84px) 52px; min-height: 48px; border-radius: 13px; border-width: 1px; }
  .team { padding: 0 5px; }
  .team b { font-size: 25px; }
  .match-clock span { font-size: 17px; }
  .match-clock small { display: none; }
  .hud-actions { gap: 5px; }
  .icon-button { width: 40px; height: 40px; font-size: 17px; }
  .modal { place-items: end center; padding: var(--safe-top) 0 0; }
  .modal-panel { width: 100%; max-height: 88dvh; border-radius: 24px 24px 0 0; padding: 20px var(--safe-right) calc(var(--safe-bottom) + 20px) var(--safe-left); }
  .modal-header h2 { font-size: 29px; }
  .level-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
  .level-card { min-height: 100px; padding: 11px; border-radius: 14px; }
  .reward-grid { grid-template-columns: 1fr; }
  .reward-card { min-height: 126px; display: grid; grid-template-columns: 55px 1fr; grid-template-rows: auto auto auto; text-align: left; justify-items: start; gap: 3px 12px; padding: 14px; }
  .reward-icon { grid-row: span 3; font-size: 40px; }
  .reward-card small { min-height: 0; }
  .reward-card em { margin-top: 5px; }
  .pause-panel,.result-panel,.ad-panel { border-radius: 24px 24px 0 0; }
  .toast { bottom: calc(var(--safe-bottom) + 94px); }
}

@media (max-width: 900px) {
  .desktop-hint { display: none !important; }
  .mobile-controls:not(.is-hidden) { display: flex !important; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .menu-screen { grid-template-columns: minmax(280px,1fr) minmax(240px,320px); grid-template-rows: auto; align-items: center; padding: 18px 28px; gap: 26px; }
  .brand-lockup { align-self: center; }
  .brand-lockup h1 { font-size: clamp(38px, 8.5vh, 62px); }
  .brand-lockup p { display: none; }
  .menu-actions { grid-row: auto; padding: 12px; gap: 8px; }
  .menu-actions .button { min-height: 44px; }
  .progress-card { display: none; }
  .hud { top: 8px; }
  .scoreboard { min-height: 50px; }
  .hud-card { min-height: 50px; padding-block: 6px; }
  .desktop-hint { bottom: 8px; padding-block: 7px; }
  .touch-button { width: 58px; height: 58px; font-size: 22px; }
  .modal-panel { max-height: 94vh; padding: 18px 22px; }
  .modal-header { margin-bottom: 13px; }
  .modal-header h2 { font-size: 28px; }
  .level-card { min-height: 88px; }
  .reward-card { min-height: 180px; padding: 14px; }
  .reward-icon { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Broadcast match identity */
:root {
  --ink: #f7f0df;
  --muted: #aeb9c5;
  --navy: #07131f;
  --panel: rgba(7, 18, 29, .94);
  --red: #dc3b35;
  --orange: #f1b43c;
  --blue: #287daf;
  --line: rgba(247, 240, 223, .22);
}

.asset-icon {
  display: inline-block;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  background: url("./assets/ui-icons.webp") no-repeat;
  background-size: 300% 300%;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.28));
}
.icon-play { background-position: 0 0; }
.icon-levels { background-position: 50% 0; }
.icon-settings { background-position: 0 50%; }
.icon-reward { background-position: 50% 50%; }
.icon-pause { background-position: 100% 50%; }
.icon-time { background-position: 0 100%; }
.icon-power { background-position: 50% 100%; }
.icon-shield { background-position: 100% 100%; }

#game::after {
  background:
    linear-gradient(90deg, rgba(4,12,20,.28), transparent 28%, transparent 72%, rgba(4,12,20,.2)),
    linear-gradient(180deg, rgba(4,12,20,.01), transparent 58%, rgba(2,8,14,.28));
}

.loading-screen {
  background: #07131f;
}
.loader-ball {
  width: clamp(82px, 11vw, 126px);
  height: clamp(82px, 11vw, 126px);
  font-size: 0;
}
.loading-track,
.progress-track,
.ad-countdown {
  border-radius: 0;
}
.loading-track span,
.progress-track span,
.ad-countdown span {
  border-radius: 0;
  background: var(--orange);
  box-shadow: none;
}

.menu-screen {
  grid-template-columns: minmax(320px, 620px) minmax(270px, 360px);
  gap: 32px clamp(42px, 8vw, 140px);
  padding: clamp(28px, 5vw, 76px);
  background: linear-gradient(90deg, rgba(4,13,22,.94) 0%, rgba(4,13,22,.78) 40%, rgba(4,13,22,.05) 78%);
}
.brand-lockup {
  text-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.eyebrow {
  margin-bottom: 12px;
  color: var(--orange);
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: .28em;
}
.brand-lockup h1,
.modal-header h2,
.pause-panel h2,
.result-panel h2,
.ad-panel h2 {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", Arial, sans-serif;
  font-weight: 800;
}
.brand-lockup h1 {
  max-width: 720px;
  font-size: clamp(52px, 7.2vw, 108px);
  line-height: .84;
  letter-spacing: -.025em;
}
.brand-lockup h1 strong {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 5px 14px 7px 11px;
  color: #101417;
  background: var(--orange);
  font-size: .58em;
  letter-spacing: .015em;
  -webkit-text-stroke: 0;
  text-shadow: none;
  transform: skewX(-5deg);
}
.brand-lockup p {
  max-width: 470px;
  margin-top: 18px;
  padding-left: 15px;
  border-left: 3px solid var(--red);
  color: #d9dee3;
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 750;
}

.menu-actions {
  grid-row: span 2;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.button {
  min-height: 58px;
  justify-content: flex-start;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.button.primary {
  color: #151515;
  border-color: #ffd473;
  background: var(--orange);
}
.button.secondary {
  color: #fff;
  border-left: 5px solid #55a8d4;
  background: #14344d;
}
.button.glass {
  min-height: 52px;
  background: rgba(7,19,31,.9);
  border-color: rgba(255,255,255,.2);
}
.button::after {
  content: "›";
  margin-left: auto;
  font-size: 24px;
  line-height: 1;
  opacity: .7;
}
.button-row {
  gap: 8px;
}
.button-row .button {
  padding-inline: 14px;
  font-size: 11px;
  letter-spacing: .035em;
}
.button-icon {
  width: 45px;
  height: 45px;
  border-radius: 0;
  background-color: transparent;
}
.button.glass .asset-icon {
  width: 34px;
  height: 34px;
}
.progress-card {
  width: min(100%, 470px);
  padding: 13px 15px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.18);
  border-left: 5px solid var(--orange);
  background: rgba(6,17,28,.84);
  backdrop-filter: blur(8px);
}

.hud {
  top: var(--safe-top);
  grid-template-columns: minmax(165px,1fr) auto minmax(105px,1fr);
  gap: 12px;
}
.hud-card {
  min-width: 220px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.22);
  border-left: 5px solid var(--orange);
  border-radius: 3px;
  background: rgba(5,15,25,.88);
  backdrop-filter: blur(7px);
}
.hud-card small { color: var(--orange); }
.scoreboard {
  min-height: 62px;
  grid-template-columns: 88px minmax(102px,132px) 88px;
  border: 1px solid rgba(247,240,223,.75);
  border-radius: 3px;
  background: rgba(5,15,25,.94);
  box-shadow: 0 7px 18px rgba(0,0,0,.32);
}
.team-red { background: #a9272c; }
.team-blue { background: #17648d; }
.team b { font-family: Impact, Arial Black, sans-serif; font-size: 34px; }
.match-clock span { font-family: Impact, Arial Black, sans-serif; letter-spacing: .04em; }
.hud-actions { gap: 7px; }
.icon-button {
  width: 49px;
  height: 49px;
  padding: 4px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(5,15,25,.9);
  box-shadow: 0 7px 18px rgba(0,0,0,.28);
  backdrop-filter: blur(7px);
}
.icon-button .asset-icon { width: 42px; height: 42px; }
.reward-pulse { animation: reward-ticket 2.2s ease-in-out infinite; }

.desktop-hint {
  gap: 14px;
  padding: 8px 12px;
  border-radius: 2px;
  border-left: 3px solid var(--orange);
  background: rgba(5,15,25,.82);
}
kbd {
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.25);
  border-bottom-width: 3px;
  background: #14283b;
}
.touch-button {
  border: 2px solid rgba(255,255,255,.4);
  background: rgba(5,15,25,.82);
  box-shadow: 0 6px 0 rgba(0,0,0,.3);
}
.jump-button { background: rgba(28,106,150,.9); }
.kick-button { background: rgba(185,61,38,.92); }
.kick-button .asset-icon { width: 76%; height: 76%; }

.modal {
  background: rgba(2,8,13,.78);
  backdrop-filter: blur(8px) saturate(.75);
}
.modal-panel {
  border: 1px solid rgba(247,240,223,.24);
  border-top: 5px solid var(--orange);
  border-radius: 5px;
  background: rgba(7,18,29,.98);
  box-shadow: 14px 18px 0 rgba(0,0,0,.2), 0 30px 80px rgba(0,0,0,.46);
}
.modal-header {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.modal-header h2,
.pause-panel h2,
.result-panel h2,
.ad-panel h2 {
  letter-spacing: .015em;
}
.close-button {
  width: 48px;
  height: 48px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,.2);
  background: #172737;
}
.level-grid { gap: 8px; }
.level-card {
  min-height: 108px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.17);
  border-bottom: 3px solid #287daf;
  background: #10283a;
}
.level-card.is-current {
  border-color: var(--orange);
  box-shadow: inset 5px 0 0 var(--orange);
}
.level-card b { font-family: Impact, Arial Black, sans-serif; letter-spacing: .04em; }
.leaderboard-entry,
.settings-list label {
  border-radius: 3px;
  border-left: 3px solid #287daf;
  background: #102334;
}
.avatar-fallback {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #101417;
  background: var(--orange);
  font-weight: 1000;
}
.settings-list select { border-radius: 2px; }
.toggle { border-radius: 3px; }
.toggle span { border-radius: 2px; }
.how-to { border-radius: 0; }

.reward-panel { width: min(100%, 1020px); }
.reward-grid { gap: 10px; }
.reward-card {
  position: relative;
  min-height: 250px;
  padding: 18px;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.17);
  border-bottom: 4px solid #3a91be;
  background: #10283a;
  overflow: hidden;
}
.reward-card:nth-child(2) { border-bottom-color: #e5673f; background: #30211d; }
.reward-card:nth-child(3) { border-bottom-color: #d8b04f; background: #172b2d; }
.reward-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 7px;
  background: var(--orange);
}
.reward-icon {
  width: 88px;
  height: 88px;
  margin-bottom: 2px;
  font-size: 0;
}
.reward-card b {
  font-family: Impact, Arial Black, sans-serif;
  font-size: 25px;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.reward-card small {
  min-height: 58px;
  color: #bdc7d0;
  font-size: 12px;
  line-height: 1.45;
}
.reward-card em {
  width: 100%;
  margin-top: auto;
  padding: 11px 12px;
  border-radius: 2px;
  color: #161616;
  background: var(--orange);
  letter-spacing: .07em;
  text-align: center;
}

.pause-panel,
.result-panel,
.ad-panel {
  max-width: 560px;
  text-align: left;
  border-left: 8px solid var(--orange);
}
.pause-panel p,
.result-panel p,
.ad-panel p { max-width: 430px; }
.pause-panel .button,
.result-panel .button { justify-content: center; }
.modal-emoji,
.result-icon {
  width: 104px;
  height: 104px;
  margin: -8px 0 12px;
  font-size: 0;
}
.result-icon.is-silver { filter: grayscale(.86) brightness(1.15) drop-shadow(0 5px 8px rgba(0,0,0,.28)); }
.result-score { justify-content: flex-start; }
.result-score b {
  border-radius: 2px;
  border-bottom: 4px solid var(--orange);
  background: #152a3d;
}
.ad-badge { border-radius: 2px; }
.toast { border-radius: 2px; border-left: 4px solid var(--orange); }

@keyframes reward-ticket {
  0%,100% { border-color: rgba(255,255,255,.25); transform: translateY(0); }
  50% { border-color: var(--orange); transform: translateY(-2px); }
}

@media (max-width: 900px) {
  .menu-screen { grid-template-columns: minmax(0,1fr) minmax(250px,310px); }
  .hud { grid-template-columns: 74px 1fr 92px; }
  .hud-card { width: 74px; min-width: 0; }
  .scoreboard { grid-template-columns: 68px minmax(78px,104px) 68px; }
}

@media (max-width: 680px) {
  .menu-screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    padding: 58px var(--safe-right) calc(var(--safe-bottom) + 4px) var(--safe-left);
    background: linear-gradient(180deg, rgba(2,8,14,.03), rgba(2,8,14,.28) 32%, rgba(2,8,14,.96) 63%);
  }
  .menu-screen::before { top: 18px; padding-left: var(--safe-left); }
  .brand-lockup h1 { font-size: clamp(42px, 12.8vw, 66px); }
  .brand-lockup h1 strong { margin-top: 7px; }
  .brand-lockup p { margin-top: 10px; }
  .menu-actions { grid-row: auto; }
  .button { min-height: 49px; }
  .button-icon { width: 39px; height: 39px; }
  .hud { grid-template-columns: 39px 1fr 79px; gap: 5px; }
  .hud-card { width: 39px; padding: 6px; border-left-width: 3px; }
  .scoreboard { grid-template-columns: 49px minmax(66px,82px) 49px; min-height: 46px; }
  .icon-button { width: 37px; height: 37px; padding: 2px; }
  .icon-button .asset-icon { width: 33px; height: 33px; }
  .modal-panel {
    border-radius: 0;
    border-left-width: 1px;
    border-right-width: 1px;
    box-shadow: 0 -14px 44px rgba(0,0,0,.45);
  }
  .reward-grid { grid-template-columns: 1fr; }
  .reward-card {
    min-height: 124px;
    grid-template-columns: 74px 1fr;
    grid-template-rows: auto auto auto;
    gap: 2px 13px;
    padding: 12px;
  }
  .reward-icon { width: 70px; height: 70px; margin: 0; grid-row: span 3; }
  .reward-card b { font-size: 20px; }
  .reward-card small { min-height: 0; }
  .reward-card em { width: auto; margin-top: 5px; padding: 8px 10px; }
  .pause-panel,.result-panel,.ad-panel { border-left: 6px solid var(--orange); }
}

@media (max-height: 560px) and (orientation: landscape) {
  .menu-screen { padding-block: 16px; grid-template-columns: minmax(280px,1fr) minmax(240px,320px); }
  .menu-screen::before { display: none; }
  .brand-lockup h1 { font-size: clamp(39px, 9vh, 62px); }
  .reward-card { min-height: 166px; }
  .reward-icon { width: 58px; height: 58px; }
}

/* Generated championship key art and input-driven main-menu parallax. */
.menu-screen {
  --menu-shift-x: 0px;
  --menu-shift-y: 0px;
  overflow: hidden;
  background: transparent;
}
.menu-backdrop {
  position: absolute;
  z-index: 0;
  inset: -5%;
  background: #12395d url("./assets/menu-hero.webp") center center / cover no-repeat;
  transform: translate3d(var(--menu-shift-x), var(--menu-shift-y), 0) scale(1.06);
  transition: transform .16s cubic-bezier(.2,.7,.2,1);
  will-change: transform;
  pointer-events: none;
}
.menu-screen::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,11,20,.94) 0%, rgba(3,11,20,.75) 38%, rgba(3,11,20,.12) 72%),
    linear-gradient(180deg, rgba(2,8,14,.05), rgba(2,8,14,.34));
}
.menu-screen::before { z-index: 3; }
.menu-screen > :not(.menu-backdrop) {
  position: relative;
  z-index: 2;
}

.login-button {
  width: 100%;
  margin-top: 12px;
  color: #111820;
  border-color: #ffd36d;
  background: var(--orange);
}
.login-button > span:last-child {
  display: grid;
  gap: 2px;
  text-align: left;
}
.login-button b { font-size: 15px; text-transform: uppercase; }
.login-button small { color: rgba(17,24,32,.72); font-size: 11px; font-weight: 800; text-transform: none; letter-spacing: .02em; }
.login-button:disabled { opacity: .55; cursor: wait; }

.boost-vfx {
  position: absolute;
  z-index: 11;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.boost-vfx.effect-time {
  background: radial-gradient(circle at 50% 14%, rgba(96,220,255,.76), transparent 33%);
  animation: boost-time-flash 1.05s ease-out both;
}
.boost-vfx.effect-power {
  background: radial-gradient(circle at 28% 68%, transparent 0 12%, rgba(255,122,34,.38) 22%, transparent 48%);
  animation: boost-power-flash 1.05s ease-out both;
}
.boost-vfx.effect-shield,
.boost-vfx.effect-shield-hit {
  background: radial-gradient(circle at 9% 58%, rgba(85,224,255,.58), rgba(85,224,255,.1) 19%, transparent 36%);
  animation: boost-shield-flash 1.05s ease-out both;
}
#matchTime.time-boosted { animation: time-added 1s cubic-bezier(.2,.8,.2,1); }

@keyframes boost-time-flash {
  0% { opacity: 0; transform: scale(.92); }
  22% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.08); }
}
@keyframes boost-power-flash {
  0% { opacity: 0; filter: saturate(1); }
  24% { opacity: 1; filter: saturate(1.8); }
  100% { opacity: 0; filter: saturate(1); }
}
@keyframes boost-shield-flash {
  0% { opacity: 0; transform: translateX(-5%) scale(.82); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateX(2%) scale(1.12); }
}
@keyframes time-added {
  0%,100% { color: #fff; transform: scale(1); text-shadow: none; }
  35% { color: #8ee9ff; transform: scale(1.35); text-shadow: 0 0 24px #50d8ff; }
}

@media (max-width: 680px) {
  .menu-backdrop { background-position: 58% 28%; transform: translate3d(var(--menu-shift-x), var(--menu-shift-y), 0) scale(1.1); }
  .menu-screen::after {
    background: linear-gradient(180deg, rgba(2,8,14,.03), rgba(2,8,14,.22) 31%, rgba(2,8,14,.97) 62%);
  }
  .login-button { min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-backdrop { transition: none; transform: scale(1.06); }
  .boost-vfx, #matchTime.time-boosted { animation: none !important; }
}

/* Combat hearts and hit feedback. */
.team {
  position: relative;
  padding-bottom: 15px;
}
.health-meter {
  --health-clip: 0%;
  display: block;
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 62px;
  height: 18px;
  transform: translateX(-50%);
  pointer-events: none;
}
.team .health-meter { display: block; }
.health-meter i {
  position: absolute;
  inset: 0;
  display: block;
  background: url("./assets/health-hearts.webp") center / contain no-repeat;
}
.health-empty { filter: grayscale(1) brightness(.32); opacity: .48; }
.health-full {
  clip-path: inset(0 var(--health-clip) 0 0);
  filter: drop-shadow(0 1px 3px rgba(255,222,90,.5));
  transition: clip-path .22s ease;
}
.health-meter.is-hit { animation: hearts-hit .48s cubic-bezier(.2,.8,.2,1); }
.health-meter.is-hit::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(255,238,165,.88);
  border-radius: 50%;
  animation: heart-ring .45s ease-out both;
}
.hit-vfx {
  position: absolute;
  z-index: 12;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.hit-vfx.player-hit {
  background: radial-gradient(circle at 22% 58%, rgba(255,76,62,.55), rgba(255,76,62,.08) 20%, transparent 42%);
  animation: player-hit-flash .42s ease-out both;
}
.hit-vfx.rival-hit {
  background: radial-gradient(circle at 78% 58%, rgba(77,199,255,.5), rgba(77,199,255,.07) 20%, transparent 42%);
  animation: rival-hit-flash .42s ease-out both;
}
@keyframes hearts-hit {
  0%,100% { transform: translateX(-50%) scale(1); filter: brightness(1); }
  28% { transform: translateX(-50%) scale(1.32) rotate(-5deg); filter: brightness(1.65); }
  55% { transform: translateX(-50%) scale(.9) rotate(3deg); }
}
@keyframes heart-ring { from { opacity: 1; transform: scale(.45); } to { opacity: 0; transform: scale(1.35); } }
@keyframes player-hit-flash { 0% { opacity: 0; transform: translateX(-3%); } 28% { opacity: 1; } 100% { opacity: 0; transform: translateX(2%); } }
@keyframes rival-hit-flash { 0% { opacity: 0; transform: translateX(3%); } 28% { opacity: 1; } 100% { opacity: 0; transform: translateX(-2%); } }

/* ImageGen touch-control atlas. */
.mobile-controls {
  box-sizing: border-box;
  padding-inline: clamp(8px, 2vw, 18px);
  gap: clamp(10px, 4vw, 34px);
}
.control-cluster { gap: clamp(6px, 1.5vw, 12px); flex: 0 0 auto; }
.touch-button,
.jump-button,
.kick-button {
  width: clamp(62px, 16vmin, 88px);
  height: clamp(62px, 16vmin, 88px);
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.mobile-control-icon {
  display: block;
  width: 100%;
  height: 100%;
  background: url("./assets/mobile-controls.webp") no-repeat;
  background-size: 400% 100%;
  filter: drop-shadow(0 7px 8px rgba(0,0,0,.42));
}
.control-left { background-position: 0 50%; }
.control-right { background-position: 33.333% 50%; }
.control-jump { background-position: 66.667% 50%; }
.control-kick { background-position: 100% 50%; }
.touch-button.is-active .mobile-control-icon { filter: brightness(1.25) drop-shadow(0 3px 5px rgba(0,0,0,.4)); }

@media (max-width: 680px) {
  .team .health-meter { display: block; }
  .health-meter { width: 46px; height: 13px; bottom: 2px; }
  .team { padding-bottom: 11px; }
  .team > span:not(.health-meter) { display: none; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .team .health-meter { display: block; }
  .mobile-controls {
    left: max(4px, env(safe-area-inset-left));
    right: max(4px, env(safe-area-inset-right));
    bottom: max(4px, env(safe-area-inset-bottom));
    padding-inline: clamp(4px, 1.5vw, 12px);
  }
  .control-cluster { gap: clamp(4px, 1vw, 8px); }
  .touch-button,
  .jump-button,
  .kick-button {
    width: clamp(42px, 14vh, 56px);
    height: clamp(42px, 14vh, 56px);
  }
  .health-meter { width: 46px; height: 13px; }
  .team { padding-bottom: 10px; }
}

/* YouTube can present very wide, short viewports on phones and tablets.
   Keep every control inside that frame. */
@media (orientation: landscape) and (max-height: 700px) {
  :root {
    --safe-top: max(7px, env(safe-area-inset-top));
    --safe-right: max(8px, env(safe-area-inset-right));
    --safe-bottom: max(8px, env(safe-area-inset-bottom));
    --safe-left: max(8px, env(safe-area-inset-left));
  }

  #game { min-height: 0; }

  .menu-screen {
    grid-template-columns: minmax(0, 1fr) minmax(185px, min(42vw, 320px));
    grid-template-rows: 1fr;
    align-content: stretch;
    align-items: center;
    gap: clamp(12px, 3.5vw, 44px);
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  }
  .menu-screen::before,
  .brand-lockup p,
  .progress-card { display: none; }
  .brand-lockup { align-self: center; }
  .eyebrow { margin-bottom: 6px; font-size: 9px; }
  .brand-lockup h1 {
    max-width: 100%;
    font-size: clamp(26px, 8.6vh, 54px);
    line-height: .86;
  }
  .brand-lockup h1 strong { margin-top: 5px; padding: 3px 9px 5px 7px; }
  .menu-actions {
    grid-row: auto;
    align-self: center;
    min-width: 0;
    gap: 5px;
  }
  .menu-actions .button { min-height: 42px; padding-inline: 12px; font-size: 11px; }
  .menu-actions .button.glass { min-height: 39px; }
  .menu-actions .button-icon { width: 34px; height: 34px; }
  .menu-actions .button.glass .asset-icon { width: 28px; height: 28px; }
  .button-row { gap: 5px; }
  .button-row .button { padding-inline: 8px; font-size: 9px; }

  .hud {
    top: var(--safe-top);
    left: var(--safe-left);
    right: var(--safe-right);
    grid-template-columns: 58px 1fr 84px;
    gap: 6px;
  }
  .hud-card {
    width: 58px;
    min-width: 0;
    min-height: 45px;
    padding: 5px;
    grid-template-columns: 1fr;
    place-items: center;
  }
  .hud-card small,
  .hud-card span { display: none; }
  .hud-card b { font-size: 18px; }
  .scoreboard {
    justify-self: center;
    grid-template-columns: 58px minmax(76px, 92px) 58px;
    min-height: 46px;
  }
  .team { padding: 0 5px 10px; }
  .team b { font-size: 26px; }
  .team > span:not(.health-meter),
  .match-clock small { display: none; }
  .match-clock span { font-size: 18px; }
  .team .health-meter { display: block; width: 45px; height: 12px; bottom: 2px; }
  .hud-actions { gap: 5px; }
  .icon-button { width: 40px; height: 40px; padding: 2px; }
  .icon-button .asset-icon { width: 35px; height: 35px; }

  .mobile-controls {
    left: var(--safe-left);
    right: var(--safe-right);
    bottom: max(12px, env(safe-area-inset-bottom));
    padding-inline: 2px;
    gap: 8px;
    z-index: 7;
  }
  .control-cluster { gap: clamp(4px, 1vw, 7px); }
  .touch-button,
  .jump-button,
  .kick-button {
    width: clamp(52px, 16vh, 66px);
    height: clamp(52px, 16vh, 66px);
  }
  .toast { bottom: max(68px, calc(env(safe-area-inset-bottom) + 60px)); }

  .modal {
    place-items: center;
    padding: 6px max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left));
    overflow: hidden;
  }
  .modal-panel {
    width: min(100%, 1020px);
    max-height: calc(100vh - 12px);
    max-height: calc(100svh - 12px);
    padding: 10px 14px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .modal-header {
    position: sticky;
    z-index: 4;
    top: -10px;
    margin-bottom: 8px;
    padding: 7px 0 8px;
    background: rgba(7, 18, 29, .99);
  }
  .modal-header .eyebrow { margin-bottom: 4px; }
  .modal-header h2,
  .pause-panel h2,
  .result-panel h2,
  .ad-panel h2 { font-size: clamp(22px, 6vh, 31px); }
  .close-button { width: 48px; height: 48px; font-size: 23px; }

  .level-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    padding-right: 0;
  }
  .level-card { min-height: 72px; gap: 4px; padding: 8px 9px; }
  .level-card b { font-size: 19px; }
  .level-card span { font-size: 9px; }
  .level-card small { font-size: 10px; }

  .leaderboard-list { gap: 5px; }
  .leaderboard-entry {
    grid-template-columns: 28px 32px 1fr auto;
    min-height: 42px;
    gap: 6px;
    padding: 5px 8px;
  }
  .leaderboard-entry img,
  .avatar-fallback { width: 30px; height: 30px; }
  .leaderboard-entry .rank,
  .leaderboard-entry .points { font-size: 15px; }
  .leaderboard-note { margin: 8px 0; font-size: 11px; }
  .login-button { min-height: 43px; padding-block: 5px; }

  .reward-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 7px;
  }
  .reward-card {
    min-height: 142px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 9px;
  }
  .reward-icon { width: 48px; height: 48px; margin: 0; }
  .reward-card b { font-size: 17px; }
  .reward-card small {
    min-height: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .reward-card em { width: 100%; margin-top: auto; padding: 7px 8px; font-size: 9px; }

  .settings-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .settings-list label { min-height: 48px; padding: 7px 9px; }
  .settings-list select { min-height: 34px; min-width: 110px; }
  .toggle { min-height: 36px; }
  .how-to { max-height: 112px; margin-top: 7px; padding: 8px 10px; overflow: auto; }
  .how-to p { font-size: 11px; line-height: 1.35; }

  .compact-panel,
  .pause-panel,
  .result-panel,
  .ad-panel { max-width: 620px; }
  .pause-panel,
  .result-panel,
  .ad-panel { padding: 12px 16px; }
  .pause-panel p,
  .result-panel p,
  .ad-panel p { margin: 7px 0; font-size: 12px; line-height: 1.3; }
  .modal-emoji,
  .result-icon { width: 50px; height: 50px; margin: 0 0 5px; }
  .result-score { margin: 7px 0; gap: 9px; font-size: 25px; }
  .result-score b { width: 52px; height: 45px; }
  .pause-panel .button,
  .result-panel .button { min-height: 39px; margin-top: 5px; }
  .ad-badge { margin-bottom: 7px; }
  .ad-countdown { margin-top: 9px; }
}

@media (orientation: landscape) and (max-height: 700px) and (max-width: 560px) {
  .menu-screen { grid-template-columns: minmax(0, 1fr) minmax(174px, 46vw); gap: 8px; }
  .brand-lockup h1 { font-size: clamp(23px, 8vh, 38px); }
  .menu-actions .button { min-height: 38px; font-size: 9px; }
  .menu-actions .button-icon { width: 30px; height: 30px; }
  .button-row .button { padding-inline: 5px; font-size: 8px; }
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-list { grid-template-columns: 1fr; }
}

.icon-button,
.close-button {
  min-width: 48px;
  min-height: 48px;
}

.reward-card:disabled,
.close-button:disabled {
  opacity: .55;
  cursor: wait;
  filter: grayscale(.45);
}

@media (orientation: portrait) and (max-width: 360px) {
  .hud {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "score score"
      "level actions";
    gap: 4px;
  }
  .level-chip { grid-area: level; width: 48px; min-width: 48px; min-height: 48px; }
  .scoreboard {
    grid-area: score;
    width: min(100%, 250px);
    grid-template-columns: minmax(48px, 1fr) minmax(76px, 92px) minmax(48px, 1fr);
  }
  .hud-actions { grid-area: actions; }
  .mobile-controls {
    left: max(4px, env(safe-area-inset-left));
    right: max(4px, env(safe-area-inset-right));
    gap: 4px;
  }
  .control-cluster { gap: 4px; }
  .touch-button,
  .jump-button,
  .kick-button {
    width: 54px;
    height: 54px;
  }
}

@media (min-width: 480px) and (max-width: 680px) and (min-aspect-ratio: 1/1) and (max-height: 700px) {
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reward-card { min-height: 156px; }
  .reward-card:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 1100px), (max-height: 700px) {
  .team { justify-content: center; }
  .team > span:not(.health-meter) { display: none; }
}

@media (min-width: 1101px) and (min-height: 701px) {
  .scoreboard { grid-template-columns: 118px minmax(102px, 132px) 118px; }
}
