:root {
  --ad-h: 50px;
  --ink: #e8e2d4;
  --muted: #8aa4b5;
  --brass: #c8923a;
  --brass-deep: #8a5d1e;
  --cyan: #6ee0e8;
  --bg: #071422;
  --site-panel: #0d2131;
  --site-ink: #eee8d9;
  --site-muted: #9bb2bf;
  --site-gold: #e6c37a;
  --site-page-bg:
    radial-gradient(circle at 75% 12%, rgba(30, 119, 133, 0.28), transparent 30rem),
    linear-gradient(180deg, #071422, #091a28 62%, #06101a);
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Barlow, "Segoe UI", sans-serif;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}

html.is-desktop,
html.is-desktop body {
  background: #03080d;
}

html.is-desktop body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

html.is-desktop #app {
  position: relative;
  inset: auto;
  width: min(390px, calc(100vw - 48px), calc((100vh - 48px) * 9 / 19.5));
  height: auto;
  aspect-ratio: 9 / 19.5;
  max-height: calc(100vh - 48px);
  border-radius: 28px;
  box-shadow:
    0 0 0 8px #141414,
    0 0 0 10px #3a3224,
    0 22px 56px rgba(0, 0, 0, 0.55);
}

#promo-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: auto;
  z-index: 6;
  width: 100%;
  height: var(--ad-h, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #03080d;
  pointer-events: auto;
}

#promo-rail[hidden] {
  display: none !important;
}

#promo-host {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#support-notice {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  background: linear-gradient(90deg, #071422, #0d2a3d);
  color: var(--ink);
}

#support-notice[hidden] {
  display: none !important;
}

#support-notice p {
  min-width: 0;
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
}

#support-notice strong {
  display: block;
  color: #f0c776;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#support-help {
  min-height: 32px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: rgba(20, 17, 14, 0.75);
  color: var(--site-gold);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 360px) {
  #support-notice {
    gap: 6px;
    padding: 5px 6px;
  }

  #support-notice p {
    font-size: 10px;
  }

  #support-help {
    padding: 5px 7px;
    font-size: 10px;
    white-space: normal;
    max-width: 9.5em;
  }
}

.promo-house {
  width: min(320px, 100%);
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 45%;
  overflow: hidden;
  border: 1px solid #9a6b25;
  background: url("assets/snapsub-promo-mobile.webp?v=1") center / cover no-repeat;
  color: #f2ead8;
  font-family: "Barlow Condensed", sans-serif;
  text-decoration: none;
  box-shadow: inset 0 0 18px rgba(3, 10, 16, 0.5);
}

.promo-copy {
  min-width: 0;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 1px 3px #000;
}

.promo-copy small,
.promo-copy strong {
  display: block;
  white-space: nowrap;
}

.promo-copy small {
  margin-bottom: 3px;
  color: #79e4ec;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.promo-copy strong {
  font-size: 18px;
  letter-spacing: 0.04em;
}

.promo-cta {
  padding: 5px 6px;
  border: 1px solid #efc15c;
  border-radius: 4px;
  background: linear-gradient(#c98a28, #6f4212);
  color: #fff8df;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.promo-house:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.promo-frame {
  display: block;
  width: min(320px, 100%);
  height: 50px;
  overflow: hidden;
  background: #03080d;
}

.promo-frame img {
  display: block;
  width: 100%;
  height: 50px;
  object-fit: fill;
}

.promo-frame:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

#hud {
  position: absolute;
  top: var(--ad-h, 0px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 10px 22px 0;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.35);
}

#floor-hud {
  position: absolute;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}

#hull {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

#hull .hud-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

#hull-pips {
  display: flex;
  gap: 5px;
}

.pip {
  width: 26px;
  height: 11px;
  border-radius: 3px;
  background: #121820;
  border: 1px solid #6a5228;
  box-shadow: inset 0 1px 0 rgba(232, 198, 120, 0.12);
}

.pip.is-on {
  background: linear-gradient(#7ae88a, #2f8a3a);
  border-color: #c4a056;
  box-shadow: 0 0 8px rgba(90, 220, 110, 0.35);
}

#hull[data-hp="5"] .pip.is-on {
  background: linear-gradient(#7ae88a, #2f8a3a);
  box-shadow: 0 0 8px rgba(90, 220, 110, 0.4);
}

#hull[data-hp="4"] .pip.is-on {
  background: linear-gradient(#e8e06a, #8a8218);
  box-shadow: 0 0 8px rgba(220, 200, 70, 0.4);
}

#hull[data-hp="3"] .pip.is-on {
  background: linear-gradient(#f0b15a, #c45a28);
  box-shadow: 0 0 8px rgba(226, 140, 50, 0.4);
}

#hull[data-hp="2"] .pip.is-on,
#hull[data-hp="1"] .pip.is-on {
  background: linear-gradient(#ff5a4a, #a01818);
  box-shadow: 0 0 8px rgba(226, 60, 40, 0.45);
  animation: hull-crit 0.52s steps(2, end) infinite;
}

#hull[data-hp="1"] .pip.is-on {
  background: linear-gradient(#ff3b2a, #6a0c0c);
  animation-duration: 0.36s;
}

#hull.is-hurt .pip.is-on {
  filter: brightness(1.45);
  animation: none;
}

@keyframes hull-warn {
  0%,
  100% {
    filter: brightness(1);
    box-shadow: 0 0 8px rgba(226, 60, 40, 0.28);
  }
  50% {
    filter: brightness(1.16);
    box-shadow: 0 0 11px rgba(226, 70, 48, 0.42);
  }
}

@keyframes hull-crit {
  0%,
  40% {
    filter: brightness(1.45);
    box-shadow: 0 0 14px rgba(255, 56, 40, 0.9);
  }
  50%,
  100% {
    filter: brightness(0.42);
    box-shadow: 0 0 4px rgba(90, 16, 12, 0.28);
  }
}

#dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  pointer-events: auto;
}

.hud-block {
  display: flex;
  flex-direction: column;
}

.hud-block.center {
  align-items: center;
}

.hud-block.right {
  align-items: flex-end;
}

.hud-label {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

#score,
#level,
#best {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 0.95;
}

#level {
  color: #e6c37a;
}

#best {
  color: var(--cyan);
  font-size: 28px;
}

#mute,
#settings-btn {
  position: static;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(200, 160, 70, 0.45);
  background: rgba(18, 16, 12, 0.55);
  color: #e6c37a;
  border-radius: 8px;
  font-size: 15px;
}

#mute.is-off {
  color: var(--muted);
  text-decoration: line-through;
}

#dev-toggle {
  position: absolute;
  top: calc(var(--ad-h, 0px) + 8px);
  right: 56px;
  z-index: 7;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #5dcf6e;
  background: rgba(13, 32, 18, 0.7);
  color: #9ef0a8;
  border-radius: 999px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.12em;
}

#dev {
  position: absolute;
  left: calc(12px + env(safe-area-inset-left));
  top: calc(64px + env(safe-area-inset-top));
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#dev button {
  min-width: 110px;
  min-height: 36px;
  border: 1px solid rgba(232, 226, 212, 0.28);
  background: rgba(7, 20, 34, 0.72);
  color: var(--ink);
  border-radius: 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
}

#dev button.is-on {
  border-color: #5dcf6e;
  color: #9ef0a8;
}

#fire,
#field {
  position: absolute;
  z-index: 4;
  width: 70px;
  height: 94px;
  border: 0;
  border-radius: 16px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  color: #e6c37a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 11px;
  line-height: 1;
}

#fire {
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  background-image: url("assets/fire-hud.png?v=40");
}

#field {
  left: calc(14px + env(safe-area-inset-left));
  bottom: calc(12px + env(safe-area-inset-bottom));
  background-image: url("assets/shield-hud.png?v=40");
}

#fire #ammo,
#field #field-ammo {
  margin: 0 0 1px;
  min-width: 2.1em;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #e6c37a;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.85);
}

#field.is-on {
  box-shadow: 0 0 16px rgba(94, 220, 120, 0.5);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(var(--ad-h, 0px) + 16px);
  background: linear-gradient(180deg, rgba(7, 20, 34, 0.18), rgba(7, 20, 34, 0.55));
  text-align: center;
}

.menu {
  background: linear-gradient(180deg, rgba(7, 20, 34, 0.12), rgba(7, 20, 34, 0.48));
  pointer-events: none;
  padding-bottom: calc(24px + 64px);
}

.menu button,
.menu .best-line,
.menu .hint,
.menu h1,
.menu h2,
.menu .kicker,
.menu .board-actions,
.menu .player-chip {
  pointer-events: auto;
}

.menu .best-line {
  background: rgba(7, 20, 34, 0.55);
  padding: 6px 18px;
  border-radius: 999px;
}

.overlay[hidden],
#hud[hidden],
#hull[hidden],
#fire[hidden],
#field[hidden],
#dev[hidden],
#dev-toggle[hidden],
#promo-rail[hidden],
#settings[hidden],
#board[hidden],
#join[hidden],
#signin[hidden],
#leave[hidden],
#local-top[hidden],
#rotate[hidden] {
  display: none !important;
}

.kicker {
  margin: 0 0 8px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cyan);
  font-size: 13px;
}

h1,
h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1 {
  font-size: clamp(64px, 12vw, 110px);
  line-height: 0.85;
}

#title-wordmark {
  display: block;
  width: min(84vw, 560px);
  height: auto;
  max-height: 20vh;
  object-fit: contain;
  margin: 0 auto;
  transform: translateX(-10px);
  filter: drop-shadow(0 6px 10px rgba(3, 10, 16, 0.72))
    drop-shadow(0 2px 3px rgba(3, 10, 16, 0.45));
}

h2 {
  font-size: clamp(72px, 16vw, 120px);
  line-height: 0.85;
}

.best-line {
  margin: 14px 0 28px;
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 16px;
}

button.best-line {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  box-shadow: none;
  outline: none;
  background: rgba(7, 20, 34, 0.55);
  font: inherit;
  color: inherit;
  cursor: pointer;
}

#local-top {
  z-index: 7;
  justify-content: flex-start;
  padding-top: calc(var(--ad-h, 0px) + 36px);
  background: none;
  pointer-events: auto;
}

#local-top .kicker {
  text-shadow: 0 2px 10px rgba(3, 10, 16, 0.8);
}

#local-top-player {
  margin: 0 0 8px;
}

#local-top-list {
  list-style: none;
  margin: 8px 0 18px;
  padding: 0;
  width: min(220px, 72%);
}

#local-top-list li {
  display: grid;
  grid-template-columns: 2em 1fr;
  gap: 16px;
  padding: 3px 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-shadow: 0 2px 8px rgba(3, 10, 16, 0.75);
}

#local-top-list li span:first-child {
  color: #e6c37a;
  text-align: left;
}

#local-top-list li span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#local-top-list li.is-empty {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

#local-top-close {
  margin-top: 8px;
}

#dive,
#retry,
#home {
  width: 176px;
  height: 58px;
  padding: 0;
  border: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: transparent;
  font-size: 0;
}

#dive {
  background-image: url("assets/dive-button.png?v=36");
}

#retry {
  background-image: url("assets/again-button.png?v=45");
}

#home {
  margin-top: 12px;
  background-image: url("assets/home-button.png?v=45");
}

.ghost {
  margin-top: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(232, 226, 212, 0.28);
}

.pill {
  margin-top: 0;
  box-sizing: border-box;
  min-height: 42px;
  min-width: min(230px, 86vw);
  padding: 10px 18px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: rgba(20, 17, 14, 0.75);
  color: var(--site-gold, #e6c37a);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

#settings {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 20, 34, 0.55);
  pointer-events: auto;
}

.settings-card {
  width: min(300px, 84%);
  max-height: 90%;
  overflow-y: auto;
  padding: 18px 18px 16px;
  border: 1px solid #6a5228;
  border-radius: 14px;
  background: #14110e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-card h3 {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 20px;
  color: #e6c37a;
}

.vol-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
}

.vol-row input[type="range"] {
  width: 100%;
  accent-color: #c8923a;
}

#leave-switch,
#leave-unlink,
#leave-remove,
#leave-close,
#board-close,
#join-close,
#join-signin,
#signin-close,
#signin-back,
#join-submit,
#join-verify button[type="submit"],
#otp-send,
#signin-form button[type="submit"],
#signin-verify button[type="submit"] {
  width: 100%;
  margin-top: 0;
  min-height: 40px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #2a2218;
  color: #e6c37a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#signin-close,
#signin-back {
  border-color: rgba(232, 226, 212, 0.28);
  background: transparent;
  color: var(--ink);
}

#leave-remove {
  border-color: #8f463d;
  background: #3a1b18;
  color: #ffb0a6;
}

#settings-close,
#settings-board,
#settings-join,
#settings-link,
#settings-switch,
#settings-forget,
#settings-out,
#settings-reset-local {
  width: 100%;
  margin-top: 0;
  min-height: 40px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #2a2218;
  color: #e6c37a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#settings-reset-local {
  border-color: #8f463d;
  background: #3a1b18;
  color: #ffb0a6;
}

.settings-note {
  margin: 0;
  color: #7ee0a8;
  font-size: 12px;
  line-height: 1.3;
}

.settings-stat {
  margin: -4px 0 4px;
  color: var(--cyan);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.settings-action-group,
.panel-actions-stack,
.over-account-actions {
  display: grid;
  gap: 8px;
}

.settings-action-group {
  margin-top: 4px;
}

.settings-data-group {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(106, 82, 40, 0.65);
}

#settings-close {
  margin-top: 4px;
}

.panel-actions-stack {
  margin-top: 12px;
}

.panel-actions-stack button,
.over-account-actions button {
  width: 100%;
  margin: 0;
}

.board-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.board-actions .pill,
.board-actions .ghost {
  margin-top: 0;
}

.board-actions .ghost {
  min-height: 42px;
  min-width: min(230px, 86vw);
  padding: 10px 18px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 15px;
}

.over-account-actions {
  width: min(230px, 86vw);
  margin-top: 12px;
}

.over-account-actions .pill,
.over-account-actions .ghost {
  min-width: 0;
  width: 100%;
}

#board,
#join,
#signin,
#leave {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#leave {
  background: rgba(7, 20, 34, 0.62);
}

.board-card {
  width: min(340px, 90%);
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 16px 16px 14px;
  border: 1px solid #6a5228;
  border-radius: 14px;
  background: #14110e;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: #c8923a #0c1014;
}

.board-card::-webkit-scrollbar {
  width: 8px;
}

.board-card::-webkit-scrollbar-track {
  background: #0c1014;
  border-radius: 8px;
}

.board-card::-webkit-scrollbar-thumb {
  background: #c8923a;
  border-radius: 8px;
}

.board-card::-webkit-scrollbar-thumb:hover {
  background: #e6c37a;
}

#board .board-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.board-card h3,
.join-card h3 {
  margin: 8px 0 8px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 20px;
  color: #e6c37a;
}

#board-logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  margin: 0 auto 4px;
}

.join-mark {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 4px;
}

.board-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.board-note a,
.board-card a {
  color: var(--cyan);
  text-decoration: underline;
}

.board-note a:hover,
.board-card a:hover {
  color: #9aecf0;
}

.board-error {
  margin: 0 0 8px;
  color: #ff8a7a;
  font-size: 13px;
}

#board-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin: 0 0 12px;
  text-align: left;
}

#board-search label {
  display: grid;
  gap: 4px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

#board-search input,
#board-search button {
  min-height: 40px;
}

#board-search input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #0c1014;
  color: var(--ink);
  font-size: 15px;
}

#board-search button {
  margin: 0;
  padding: 0 12px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #2a2218;
  color: #e6c37a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#board-list {
  list-style: none;
  flex: 1 1 auto;
  min-height: 120px;
  margin: 0 0 12px;
  padding: 0 4px 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #c8923a #0c1014;
}

#board-list::-webkit-scrollbar {
  width: 8px;
}

#board-list::-webkit-scrollbar-track {
  background: #0c1014;
  border-radius: 8px;
}

#board-list::-webkit-scrollbar-thumb {
  background: #6a5228;
  border-radius: 8px;
  border: 1px solid #8a6a32;
}

#board-list::-webkit-scrollbar-thumb:hover {
  background: #c8923a;
}

#board .board-card > :not(#board-list) {
  flex-shrink: 0;
}

#board-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 2.2em;
  gap: 4px 8px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(200, 160, 70, 0.16);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.name-icon {
  --icon: 22px;
  display: inline-block;
  width: var(--icon);
  height: var(--icon);
  margin-right: 6px;
  flex: 0 0 var(--icon);
  border-radius: 50%;
  background-image: url("assets/name-icons.png?v=2");
  background-repeat: no-repeat;
  background-size: calc(var(--icon) * 8) calc(var(--icon) * 4);
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(232, 226, 212, 0.12);
}

.player-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: -12px 0 18px;
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 18px;
  max-width: 100%;
  flex-wrap: wrap;
}

.player-medal {
  display: inline-block;
  max-width: 28px;
  max-height: 28px;
  margin-left: 3px;
  object-fit: contain;
  vertical-align: middle;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.player-chip[hidden] {
  display: none !important;
}

#settings-player {
  margin: 0 0 14px;
  justify-content: flex-start;
}

#board-status .name-icon {
  margin-right: 8px;
}

#board-list .board-rank {
  flex: 0 0 1.15em;
  text-align: right;
}

#board-list .board-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#board-list .board-name .name-icon {
  margin-right: 0;
}

#board-list .board-medals {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  gap: 2px;
  min-height: 20px;
}

#board-list .board-medals .player-medal {
  margin-left: 0;
  max-width: 20px;
  max-height: 20px;
}

#board-list .board-player-name {
  min-width: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#board-list .board-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.otp-show {
  margin: 0 0 12px;
  padding: 10px 8px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #0c1014;
  color: #e6c37a;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 22px;
}

#otp-form,
#join-form,
#join-verify,
#signin-form,
#signin-verify {
  display: grid;
  gap: 8px;
  text-align: left;
}

#join-form[hidden],
#join-verify[hidden],
#signin-form[hidden],
#signin-verify[hidden] {
  display: none !important;
}

#otp-form label,
#join-form label,
#join-verify label,
#signin-form label,
#signin-verify label {
  display: grid;
  gap: 4px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

#otp-form input,
#join-form input,
#join-verify input,
#signin-form input,
#signin-verify input {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: #0c1014;
  color: var(--ink);
  font-size: 15px;
}

#rotate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #071422;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 22px;
}

button {
  cursor: pointer;
}

button:active {
  transform: scale(0.97);
}

body.is-portrait #hud {
  padding: 8px 14px 0;
}

body.is-portrait #score,
body.is-portrait #level,
body.is-portrait #best {
  font-size: 28px;
}

body.is-portrait #best {
  font-size: 22px;
}

body.is-portrait #floor-hud {
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

body.is-portrait .pip {
  width: 20px;
  height: 9px;
}

body.is-portrait #mute,
body.is-portrait #settings-btn {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

body.is-portrait #dev-toggle {
  top: calc(var(--ad-h, 0px) + 6px);
  right: 54px;
}

body.is-portrait #dev {
  top: calc(104px + env(safe-area-inset-top));
}

body.is-portrait #fire,
body.is-portrait #field {
  width: 52px;
  height: 70px;
  padding-bottom: 7px;
  bottom: calc(6px + env(safe-area-inset-bottom));
}

body.is-portrait #fire {
  right: 8px;
}

body.is-portrait #field {
  left: 8px;
}

body.is-portrait #fire #ammo,
body.is-portrait #field #field-ammo {
  font-size: 10px;
  min-width: 1.8em;
}

body.is-portrait h1 {
  font-size: clamp(52px, 18vw, 88px);
}

body.is-portrait #title-wordmark {
  width: min(88vw, 480px);
  max-height: 16vh;
  transform: translateX(-8px);
}

body.is-portrait h2 {
  font-size: clamp(56px, 20vw, 96px);
}

body.is-portrait #dive,
body.is-portrait #retry,
body.is-portrait #home {
  width: min(176px, 62vw);
  height: calc(min(176px, 62vw) * 0.33);
}

body.is-portrait .hint {
  font-size: 13px;
  padding: 0 16px;
}

body.is-portrait .menu {
  padding-bottom: calc(var(--floor-h, 64px) + 28px);
}

/* OBrien Games shell design; gameplay geometry remains unchanged. */
.overlay {
  background:
    radial-gradient(circle at 75% 12%, rgba(30, 119, 133, 0.22), transparent 24rem),
    linear-gradient(180deg, rgba(7, 20, 34, 0.34), rgba(9, 26, 40, 0.68) 62%, rgba(6, 16, 26, 0.78));
}

.menu {
  background:
    radial-gradient(circle at 75% 12%, rgba(30, 119, 133, 0.18), transparent 22rem),
    linear-gradient(180deg, rgba(7, 20, 34, 0.2), rgba(9, 26, 40, 0.56) 62%, rgba(6, 16, 26, 0.68));
}

#local-top {
  background:
    radial-gradient(circle at 75% 12%, rgba(30, 119, 133, 0.24), transparent 22rem),
    linear-gradient(180deg, rgba(7, 20, 34, 0.52), rgba(9, 26, 40, 0.78) 62%, rgba(6, 16, 26, 0.86));
}

#settings,
#leave {
  background: rgba(6, 16, 26, 0.78);
}

#board,
#join,
#signin {
  background: var(--site-page-bg);
}

#board .board-card,
#join .board-card,
#signin .board-card {
  background: rgba(13, 33, 49, 0.78);
  box-shadow: none;
}

.settings-card,
.board-card {
  border-color: rgba(106, 82, 40, 0.72);
  border-radius: 10px;
  background: rgba(13, 33, 49, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
  color: var(--site-ink);
}

.settings-card h3,
.board-card h3,
.join-card h3 {
  color: var(--site-gold);
}

.board-note,
.vol-row {
  color: var(--site-muted);
}

.menu .best-line {
  border: 1px solid rgba(106, 82, 40, 0.55);
  background: rgba(13, 33, 49, 0.72);
  color: var(--cyan);
}

.pill,
#settings-close,
#settings-board,
#settings-join,
#settings-link,
#settings-switch,
#settings-forget,
#settings-out,
#leave-switch,
#leave-unlink,
#leave-close,
#board-close,
#join-close,
#join-signin,
#signin-close,
#signin-back,
#otp-send {
  border-color: #6a5228;
  border-radius: 8px;
  background: rgba(20, 17, 14, 0.75);
  color: var(--site-gold);
  font-weight: 800;
}

#settings-close,
#join-submit,
#join-verify button[type="submit"],
#signin-form button[type="submit"],
#signin-verify button[type="submit"] {
  border-color: var(--brass);
  background: var(--brass);
  color: #071422;
}

.ghost,
#signin-close,
#signin-back {
  border-color: rgba(238, 232, 217, 0.28);
  background: transparent;
  color: var(--site-ink);
}

#settings-reset-local,
#leave-remove {
  border-color: #8f463d;
  background: #3a1b18;
  color: #ffb0a6;
}

#board-search input,
#join-form input,
#join-verify input,
#signin-form input,
#signin-verify input {
  border-color: #6a5228;
  background: rgba(7, 20, 34, 0.86);
  color: var(--site-ink);
}

#board-search input:focus-visible,
#join-form input:focus-visible,
#join-verify input:focus-visible,
#signin-form input:focus-visible,
#signin-verify input:focus-visible,
.settings-card button:focus-visible,
.board-card button:focus-visible,
.pill:focus-visible,
.ghost:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

#board-search button {
  border-color: #6a5228;
  background: rgba(20, 17, 14, 0.75);
  color: var(--site-gold);
}

#board-list li,
#local-top-list li {
  color: var(--site-ink);
}

#rotate {
  background:
    radial-gradient(circle at 75% 12%, rgba(30, 119, 133, 0.28), transparent 24rem),
    linear-gradient(180deg, #071422, #091a28 62%, #06101a);
  color: var(--site-gold);
}

#board-btn,
#join-btn,
#link-btn,
#switch-btn,
#unlink-btn,
#over-join,
#over-link,
#over-switch,
#over-unlink,
#join-signin,
#join-close,
#leave-switch,
#leave-unlink,
#leave-close,
#settings-board,
#settings-join,
#settings-link,
#settings-switch {
  min-height: 42px;
  min-width: min(230px, 86vw);
  padding: 10px 18px;
  border: 1px solid #6a5228;
  border-radius: 8px;
  background: rgba(20, 17, 14, 0.75);
  color: var(--site-gold);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-actions-stack #leave-switch,
.panel-actions-stack #leave-unlink,
.panel-actions-stack #leave-close,
.settings-action-group #settings-board,
.settings-action-group #settings-join,
.settings-action-group #settings-link,
.settings-action-group #settings-switch {
  min-width: 0;
  width: 100%;
}

#otp-send:disabled {
  opacity: 0.72;
  cursor: wait;
}
