:root {
  color-scheme: dark;
  --bg: #070913;
  --ink: #f8fbff;
  --muted: rgba(226, 235, 255, 0.66);
  --line: rgba(255, 255, 255, 0.16);
  --panel: rgba(8, 12, 25, 0.58);
  --cyan: #68e9ff;
  --pink: #ff5bd4;
  --gold: #ffd36e;
  --green: #7cffb0;
  --danger: #ff5d73;
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  touch-action: none;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

.game-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(18, 30, 44, 0.24), transparent 34%),
    linear-gradient(180deg, #000006, #02040a 54%, #000006);
}

.game-shell::before {
  content: "";
  position: absolute;
  inset: -4%;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 18%, rgba(0, 0, 0, 0.28) 42%, rgba(0, 0, 0, 0.74) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.52));
  pointer-events: none;
}

.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 52%, rgba(0, 0, 0, 0.48) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.16;
  pointer-events: none;
}

.pixi-root,
.pixi-root canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.brand-link {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  z-index: 24;
  transform: translateX(-50%);
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.hud {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 28px);
  left: 12px;
  right: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.hud-main {
  min-width: 0;
  text-align: center;
}

.stage-name {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

#score-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(24px, 7vw, 42px);
  font-weight: 900;
  line-height: 0.96;
  text-shadow: 0 0 22px rgba(104, 233, 255, 0.42);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 18px rgba(104, 233, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.stat-strip {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 82px);
  left: 50%;
  z-index: 20;
  display: grid;
  width: min(310px, calc(100vw - 42px));
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  transform: translateX(-50%);
  pointer-events: none;
  display: none;
}

.stat-strip div {
  min-width: 0;
  padding: 4px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  text-shadow: 0 0 12px rgba(104, 233, 255, 0.32);
}

.stat-strip span {
  display: block;
  color: rgba(225, 238, 255, 0.56);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-strip strong {
  display: block;
  margin-top: 1px;
  font-size: 14px;
  font-weight: 900;
}

.lumen-meter {
  position: fixed;
  top: calc(var(--board-y, 164px) - 18px);
  left: calc(var(--board-x, 58px) + 8px);
  z-index: 20;
  width: calc(var(--board-w, 270px) - 16px);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 24px rgba(104, 233, 255, 0.18);
  pointer-events: none;
}

#lumen-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--gold));
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.48);
  transition: width 0.16s ease;
}

.effect-hud {
  position: fixed;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: 78px;
  color: #fff;
  font-weight: 950;
  line-height: 0.92;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.86),
    0 0 16px rgba(104, 233, 255, 0.4);
  pointer-events: none;
}

.effect-hud-left {
  top: var(--effect-hud-y, 440px);
  left: var(--effect-hud-left-x, 7px);
  text-align: right;
  justify-items: end;
}

.effect-hud-right {
  top: var(--effect-hud-y, 440px);
  left: var(--effect-hud-right-x, calc(100vw - 84px));
  text-align: left;
  justify-items: start;
}

.effect-stat span {
  display: block;
  font-size: clamp(9px, 2.4vw, 16px);
  letter-spacing: 0;
}

.effect-stat strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(19px, 6vw, 32px);
  letter-spacing: 0;
}

.effect-stat b {
  font: inherit;
}

.max-ring {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow:
    inset 0 0 18px rgba(104, 233, 255, 0.34),
    0 0 18px rgba(255, 255, 255, 0.5),
    0 0 34px rgba(104, 233, 255, 0.42);
  color: rgba(255, 255, 255, 0.96);
  font-size: 13px;
}

.max-ring.is-ready {
  border-color: #fff;
  color: #fff;
  animation: max-pulse 0.9s ease-in-out infinite;
}

@keyframes max-pulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.45); }
}

.event-label {
  position: fixed;
  top: calc(max(10px, env(safe-area-inset-top)) + 146px);
  left: 50%;
  z-index: 22;
  width: min(360px, calc(100vw - 36px));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.42);
  opacity: 0;
  pointer-events: none;
}

.zone-veiler {
  position: fixed;
  inset: 0;
  z-index: 18;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle at 50% 50%, transparent 36%, rgba(104, 233, 255, 0.1) 58%, rgba(255, 91, 212, 0.12) 100%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

.screen-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 34%, rgba(104, 233, 255, 0.17), transparent 34%),
    linear-gradient(180deg, rgba(5, 7, 15, 0.34), rgba(5, 7, 15, 0.88));
  backdrop-filter: blur(10px);
}

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

.menu-lockup {
  width: min(420px, 92vw);
  text-align: center;
}

.kicker {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.menu-lockup h1 {
  margin: 0;
  font-size: clamp(42px, 13vw, 82px);
  font-weight: 950;
  line-height: 0.88;
  text-shadow:
    0 0 18px rgba(104, 233, 255, 0.5),
    0 0 48px rgba(255, 91, 212, 0.32);
}

.mode-grid {
  display: grid;
  width: min(430px, 94vw);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mode-card {
  min-height: 68px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 22, 0.58);
  text-align: left;
  backdrop-filter: blur(12px);
}

.mode-card:first-child {
  grid-column: 1 / -1;
}

.mode-card span,
.mode-card strong {
  display: block;
}

.mode-card span {
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  font-weight: 900;
}

.mode-card strong {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.mode-card.is-selected {
  border-color: rgba(104, 233, 255, 0.8);
  background:
    linear-gradient(135deg, rgba(104, 233, 255, 0.22), rgba(255, 91, 212, 0.16)),
    rgba(7, 10, 22, 0.72);
  box-shadow: 0 0 32px rgba(104, 233, 255, 0.24);
}

.menu-actions {
  display: flex;
  width: min(430px, 94vw);
  gap: 10px;
}

.primary-button,
.secondary-button,
.submit-row button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 950;
}

.primary-button {
  flex: 1.3;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  color: #050913;
  box-shadow: 0 0 28px rgba(104, 233, 255, 0.32);
}

.secondary-button {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.game-shell.is-menu-mode .brand-link,
.game-shell.is-menu-mode .hud,
.game-shell.is-menu-mode .stat-strip,
.game-shell.is-menu-mode .lumen-meter,
.game-shell.is-menu-mode .effect-hud,
.game-shell.is-menu-mode .touch-controls {
  opacity: 0;
  pointer-events: none;
}

.menu-screen {
  justify-content: flex-end;
  gap: clamp(12px, 2.4dvh, 22px);
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(0, 0, 6, 0.1) 0%, rgba(0, 0, 8, 0.18) 32%, rgba(0, 0, 8, 0.66) 74%, rgba(0, 0, 6, 0.92) 100%),
    radial-gradient(ellipse at 50% 42%, rgba(104, 233, 255, 0.16), transparent 42%),
    radial-gradient(ellipse at 50% 72%, rgba(255, 255, 255, 0.1), transparent 28%);
  backdrop-filter: blur(2px) brightness(0.92);
}

.menu-screen::before,
.menu-screen::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.menu-screen::before {
  inset: -8%;
  background:
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(255, 255, 255, 0.024) 38px 39px, transparent 39px 82px),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(104, 233, 255, 0.03) 16px 17px, transparent 17px 36px);
  opacity: 0.34;
  transform: rotate(-8deg) scale(1.08);
}

.menu-screen::after {
  left: -12vw;
  right: -12vw;
  bottom: clamp(164px, 22dvh, 260px);
  height: clamp(86px, 14dvh, 142px);
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.18) 47%, transparent 100%),
    repeating-linear-gradient(0deg, rgba(104, 233, 255, 0.02) 0 7px, rgba(255, 255, 255, 0.12) 7px 9px, rgba(104, 233, 255, 0.02) 9px 17px);
  filter: blur(1px);
  mix-blend-mode: screen;
  opacity: 0.64;
  transform: skewY(-5deg);
  animation: menu-light-sweep 7.5s ease-in-out infinite;
}

@keyframes menu-light-sweep {
  0%, 100% { transform: translateY(0) skewY(-5deg); opacity: 0.48; }
  46% { transform: translateY(-12px) skewY(-3deg); opacity: 0.76; }
}

.menu-screen .menu-lockup {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 28px));
  margin-top: clamp(70px, 11dvh, 120px);
  margin-bottom: auto;
  text-align: center;
}

.menu-archerlab-link {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 4, 12, 0.36);
  color: rgba(235, 250, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.menu-screen .kicker {
  margin: 0 0 8px;
  color: rgba(221, 250, 255, 0.86);
  font-size: clamp(10px, 2.6vw, 13px);
  font-weight: 950;
  letter-spacing: 0.18em;
  text-shadow:
    0 0 9px rgba(104, 233, 255, 0.72),
    0 0 24px rgba(104, 233, 255, 0.34);
}

.menu-screen .menu-lockup h1 {
  margin: 0;
  color: rgba(252, 255, 255, 0.98);
  font-size: clamp(56px, 16vw, 112px);
  font-weight: 950;
  line-height: 0.82;
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.86),
    0 0 24px rgba(104, 233, 255, 0.72),
    0 0 58px rgba(45, 217, 255, 0.42),
    0 0 94px rgba(255, 91, 212, 0.28);
}

.menu-screen .menu-actions {
  position: relative;
  z-index: 1;
  width: min(444px, calc(100vw - 24px));
}

.menu-screen .menu-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 2px;
}

.menu-screen .primary-button,
.menu-screen .secondary-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 6px;
  letter-spacing: 0;
  text-decoration: none;
  isolation: isolate;
}

.menu-screen .primary-button {
  border: 1px solid rgba(220, 252, 255, 0.78);
  background:
    linear-gradient(90deg, rgba(235, 252, 255, 0.98) 0%, rgba(125, 237, 255, 0.9) 47%, rgba(62, 196, 255, 0.72) 100%),
    rgba(6, 14, 24, 0.84);
  color: #020713;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.44),
    inset 0 -16px 30px rgba(0, 69, 92, 0.18),
    0 0 18px rgba(255, 255, 255, 0.24),
    0 0 52px rgba(104, 233, 255, 0.42);
}

.menu-screen .primary-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 48%, transparent 58%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 9px);
  opacity: 0.42;
  transform: translateX(-110%);
  animation: menu-button-scan 3.8s ease-in-out infinite;
}

.menu-screen .secondary-button {
  flex: initial;
  border-color: rgba(170, 225, 255, 0.25);
  background:
    linear-gradient(90deg, rgba(6, 18, 28, 0.78), rgba(4, 7, 15, 0.68)),
    rgba(0, 0, 0, 0.46);
  color: rgba(238, 251, 255, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -18px 32px rgba(104, 233, 255, 0.05),
    0 0 24px rgba(104, 233, 255, 0.14);
}

.menu-screen .secondary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(104, 233, 255, 0.16), transparent 34%, rgba(255, 255, 255, 0.08) 66%, transparent),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(255, 255, 255, 0.04) 9px 10px, transparent 10px 19px);
  opacity: 0.72;
}

.menu-screen .primary-button::after,
.menu-screen .secondary-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0.72;
  transform: translateY(-50%) rotate(45deg);
}

.button-index,
.button-copy {
  position: relative;
  z-index: 1;
}

.button-index {
  display: grid;
  width: 38px;
  height: 26px;
  place-items: center;
  border-right: 1px solid currentColor;
  font-size: 12px;
  font-weight: 950;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.button-copy {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 950;
  text-transform: uppercase;
}

.menu-screen .primary-button:active,
.menu-screen .secondary-button:active {
  transform: translateY(1px) scale(0.995);
  filter: brightness(1.12);
}

@media (hover: hover) and (pointer: fine) {
  .menu-screen .primary-button:hover,
  .menu-screen .secondary-button:hover {
    filter: brightness(1.12);
  }
}

@keyframes menu-button-scan {
  0%, 44%, 100% { transform: translateX(-112%); opacity: 0; }
  52% { opacity: 0.52; }
  68% { transform: translateX(112%); opacity: 0; }
}

.compact-screen h2 {
  margin: 0;
  font-size: 42px;
}

.result-screen {
  justify-content: flex-start;
  padding-top: max(74px, calc(env(safe-area-inset-top) + 74px));
  overflow-y: auto;
  touch-action: pan-y;
}

.result-head {
  width: min(430px, 94vw);
  text-align: center;
}

.result-head span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.result-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(30px, 9vw, 54px);
  line-height: 1;
}

#final-score {
  display: block;
  font-size: 36px;
}

.submit-row {
  display: grid;
  width: min(430px, 94vw);
  grid-template-columns: 1fr 104px;
  gap: 8px;
}

.submit-row input {
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  outline: 0;
  background: rgba(6, 9, 20, 0.72);
  color: #fff;
  font-size: 16px;
}

.submit-row button {
  background: var(--gold);
  color: #15100a;
}

.submit-status {
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.ranking-list {
  display: grid;
  width: min(430px, 94vw);
  gap: 6px;
}

.rank-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.rank-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row span:first-child {
  color: var(--gold);
  font-weight: 950;
}

.rank-row span:last-child {
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.touch-controls {
  position: fixed;
  right: auto;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  left: 50%;
  z-index: 21;
  width: min(390px, calc(100vw - 20px));
  display: grid;
  grid-template-columns: 1.64fr 1.42fr 0.82fr 0.82fr;
  grid-template-rows: 14px 52px;
  gap: 6px;
  pointer-events: auto;
  transform: translateX(-50%);
  user-select: none;
  touch-action: none;
}

.touch-controls.is-custom-position {
  right: auto;
  bottom: auto;
  transform: none;
}

.control-drag-handle {
  grid-column: 1 / -1;
  justify-self: center;
  width: 58px;
  height: 12px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 18px 50%, rgba(255, 255, 255, 0.86) 0 2px, transparent 2.6px),
    radial-gradient(circle at 29px 50%, rgba(255, 255, 255, 0.86) 0 2px, transparent 2.6px),
    radial-gradient(circle at 40px 50%, rgba(255, 255, 255, 0.86) 0 2px, transparent 2.6px),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 18px rgba(104, 233, 255, 0.22);
  cursor: grab;
  opacity: 0.88;
  touch-action: none;
}

.touch-controls.is-dragging .control-drag-handle {
  cursor: grabbing;
  opacity: 1;
  filter: brightness(1.25);
}

.touch-controls button {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.035), 0 8px 24px rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.94);
  font-size: 24px;
  font-weight: 950;
  backdrop-filter: blur(14px);
  touch-action: none;
}

.touch-controls [data-action="drop"],
.touch-controls .drop-key {
  background: linear-gradient(135deg, rgba(104, 233, 255, 0.74), rgba(255, 91, 212, 0.72));
  color: #050913;
  font-size: 22px;
}

.touch-controls [data-action="rotate"] {
  font-size: 27px;
}

.touch-controls [data-action="left"],
.touch-controls [data-action="right"] {
  font-size: 26px;
}

.touch-controls button:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(1.25);
}

@media (hover: hover) and (pointer: fine) and (min-width: 980px) {
  .touch-controls {
    display: none;
  }

  .hud {
    top: 22px;
    right: auto;
    left: 24px;
    width: 330px;
  }

  .brand-link {
    top: 22px;
  }

  .stat-strip {
    top: 94px;
    left: 24px;
    width: 330px;
    transform: none;
  }

  .lumen-meter {
    top: calc(var(--board-y, 96px) + var(--board-h, 600px) + 16px);
    left: var(--board-x, 512px);
    width: var(--board-w, 340px);
  }

  .event-label {
    top: 28px;
    width: 460px;
    font-size: 22px;
  }
}

@media (max-height: 720px) and (orientation: portrait) {
  .hud {
    top: calc(max(8px, env(safe-area-inset-top)) + 22px);
  }

  .stat-strip {
    top: calc(max(8px, env(safe-area-inset-top)) + 72px);
  }

  .lumen-meter {
    top: calc(max(8px, env(safe-area-inset-top)) + 116px);
  }

  .event-label {
    top: calc(max(8px, env(safe-area-inset-top)) + 128px);
    font-size: 14px;
  }

  .touch-controls {
    width: min(374px, calc(100vw - 16px));
    grid-template-rows: 12px 46px;
    gap: 5px;
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  }
}
