/* =========================================================
   BREAK & RUN — billiards club UI
   ========================================================= */
:root {
  --bg: #060a08;
  --ink: #f1e9d6;
  --muted: #a4afa6;
  --muted-2: #6e7a71;
  --brass: #c9a45c;
  --brass-bright: #e8cd92;
  --brass-dim: rgba(201, 164, 92, 0.32);
  --line: rgba(226, 200, 148, 0.18);
  --line-soft: rgba(226, 200, 148, 0.09);
  --panel: rgba(12, 21, 17, 0.76);
  --panel-2: rgba(7, 13, 10, 0.88);
  --green: #0d5f4b;
  --danger: #d06851;
  --ok: #8fc3a0;
  --ui: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: Georgia, "Times New Roman", "Noto Serif", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
body { position: fixed; inset: 0; }
button, select, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(201, 164, 92, 0.35); color: #fff; }

.hidden { display: none !important; }

#app { position: fixed; inset: 0; }
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
  cursor: crosshair;
  background: #050907;
}

.vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 38%, rgba(0, 0, 0, 0.32) 72%, rgba(0, 0, 0, 0.68) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.24), transparent 16%, transparent 82%, rgba(0, 0, 0, 0.34));
}
.grain {
  position: absolute; inset: -20%; z-index: 3; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------------- screens / overlays ---------------- */
.screen {
  position: absolute; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: flex-start;
  padding: max(24px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}
.overlay {
  background:
    linear-gradient(100deg, rgba(4, 8, 6, 0.965) 0%, rgba(4, 8, 6, 0.88) 30%, rgba(4, 8, 6, 0.38) 62%, rgba(4, 8, 6, 0.62) 100%),
    radial-gradient(ellipse at 68% 42%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 70%);
  animation: overlayIn 0.5s var(--ease) both;
}
.modal-screen {
  justify-content: center;
  background: rgba(2, 5, 4, 0.62);
  backdrop-filter: blur(9px) saturate(0.9);
  -webkit-backdrop-filter: blur(9px) saturate(0.9);
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------------- loading ---------------- */
#loading {
  z-index: 300; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(26, 54, 43, 0.55) 0%, rgba(5, 10, 8, 0.98) 62%),
    #040806;
  flex-direction: column;
}
.loader-inner { display: flex; flex-direction: column; align-items: center; animation: fadeUp 0.7s var(--ease) both; }
.emblem {
  position: relative; width: 92px; height: 92px; border-radius: 50%; margin-bottom: 30px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, #2a2a2a 0%, #0c0c0c 55%, #000 100%);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.65), inset -8px -12px 26px rgba(0, 0, 0, 0.85), inset 5px 7px 14px rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(201, 164, 92, 0.3);
}
.emblem::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 1px solid rgba(201, 164, 92, 0.24);
  border-top-color: var(--brass);
  animation: spin 2.6s linear infinite;
}
.emblem::after {
  content: ""; position: absolute; width: 36px; height: 36px; border-radius: 50%;
  background: #f4efe2; box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.22);
}
.emblem span {
  position: relative; z-index: 2; font-family: var(--ui); font-weight: 800; font-size: 22px; color: #121212;
  transform: translateY(-0.5px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-brand {
  font-family: var(--display); font-size: 27px; letter-spacing: 0.22em; color: var(--ink);
  text-transform: uppercase;
}
.loader-brand i { color: var(--brass); font-size: 0.8em; }
.loader-sub {
  margin-top: 9px; font-size: 9.5px; letter-spacing: 0.42em; color: var(--muted);
}
.loader-track {
  width: 260px; height: 2px; margin-top: 44px; background: rgba(255, 255, 255, 0.08);
  overflow: hidden; position: relative;
}
#loading-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #8d6c35, var(--brass-bright), var(--brass));
  box-shadow: 0 0 16px rgba(232, 205, 146, 0.45);
  transition: width 0.35s var(--ease);
}
#loading-status {
  margin-top: 16px; font-size: 11px; color: var(--muted); letter-spacing: 0.08em;
}

/* ---------------- menu ---------------- */
#menu { align-items: center; }
.menu-wrap {
  width: min(560px, 92vw); padding-left: clamp(0px, 3vw, 48px);
  animation: fadeUp 0.7s var(--ease) 0.05s both;
}
.menu-brand { margin-bottom: 40px; }
.brand-kicker {
  font-size: 9.5px; letter-spacing: 0.36em; color: var(--brass);
  display: flex; align-items: center; gap: 14px;
}
.brand-kicker::before { content: ""; width: 28px; height: 1px; background: var(--brass-dim); }
.menu-brand h1 {
  margin: 16px 0 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(48px, 7vw, 82px); line-height: 0.94; letter-spacing: 0.02em;
  text-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
}
.menu-brand h1 span { color: var(--brass); font-style: italic; }
.menu-tagline {
  margin: 22px 0 0; max-width: 370px; font-size: 13px; line-height: 1.65;
  color: var(--muted); letter-spacing: 0.02em;
}
.menu-actions { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); }
.menu-row { display: flex; gap: 10px; margin-top: 2px; }
.menu-row .btn { flex: 1; }
#menu-resume { margin-top: 4px; width: min(340px, 100%); }
.menu-foot {
  display: flex; gap: 26px; margin-top: 46px; font-size: 8.5px; letter-spacing: 0.25em;
  color: var(--muted-2);
}

/* ---------------- buttons ---------------- */
.btn {
  position: relative; overflow: hidden; cursor: pointer;
  padding: 15px 24px; border-radius: 2px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(23, 37, 30, 0.92), rgba(10, 18, 14, 0.92));
  color: var(--ink); font-size: 11px; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase; text-align: center;
  transition: border-color 0.22s, background 0.22s, transform 0.22s, box-shadow 0.22s;
}
.btn:hover { border-color: rgba(201, 164, 92, 0.55); background: linear-gradient(160deg, rgba(31, 48, 39, 0.96), rgba(14, 24, 19, 0.96)); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.btn-primary {
  border: 1px solid rgba(255, 233, 187, 0.5);
  background: linear-gradient(135deg, #e2c186 0%, #bf994f 55%, #a9813b 100%);
  color: #171207; font-weight: 800;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transition: transform 0.7s var(--ease);
}
.btn-primary:hover { background: linear-gradient(135deg, #eed09a, #cba75e 55%, #b38c45); border-color: #ffe9bb; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-ghost { background: rgba(8, 14, 11, 0.35); border-color: var(--line-soft); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-ico { margin-right: 8px; color: #6b5223; font-size: 10px; }

/* ---------------- topbar ---------------- */
#topbar {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 26px 34px;
  background: linear-gradient(to bottom, rgba(3, 7, 5, 0.72), rgba(3, 7, 5, 0));
  pointer-events: none;
  animation: fadeUp 0.55s var(--ease) both;
}
#topbar > * { pointer-events: auto; }
.brand-small {
  font-family: var(--display); font-size: 17px; letter-spacing: 0.19em; color: var(--ink);
  white-space: nowrap; padding-top: 7px;
}
.brand-small i { color: var(--brass); }
.brand-small span { display: block; font-family: var(--ui); font-size: 7.5px; letter-spacing: 0.4em; color: var(--muted-2); margin-top: 4px; }

.players { display: flex; align-items: center; gap: 9px; }
.player-card {
  min-width: 156px; padding: 10px 15px 11px;
  border: 1px solid var(--line-soft); border-radius: 2px;
  background: linear-gradient(150deg, rgba(15, 27, 21, 0.78), rgba(6, 12, 9, 0.7));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.player-card.is-active {
  border-color: rgba(201, 164, 92, 0.55);
  background: linear-gradient(150deg, rgba(32, 48, 38, 0.88), rgba(9, 17, 13, 0.82));
  box-shadow: 0 0 0 1px rgba(201, 164, 92, 0.08), 0 14px 36px rgba(0, 0, 0, 0.3);
}
.player-head { display: flex; align-items: center; gap: 8px; }
.player-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); transition: all 0.3s;
}
.is-active .player-dot { background: var(--brass-bright); box-shadow: 0 0 9px rgba(232, 205, 146, 0.85); }
.player-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 125px;
}
.player-group {
  margin-top: 5px; padding-left: 13px; font-size: 8.5px; letter-spacing: 0.13em;
  color: var(--muted-2); text-transform: uppercase; white-space: nowrap;
}
.is-active .player-group { color: var(--brass); }
.vs { font-family: var(--display); font-style: italic; font-size: 11px; color: var(--muted-2); padding: 0 2px; }

.icon-actions { display: flex; gap: 6px; align-items: center; padding-top: 2px; }
.icon-btn {
  position: relative;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; border-radius: 50%; background: rgba(10, 18, 14, 0.5);
  color: rgba(219, 225, 216, 0.72); transition: all 0.2s;
}
.icon-btn:hover { color: var(--brass-bright); border-color: var(--line); background: rgba(20, 33, 26, 0.8); }
.icon-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg .wave { opacity: 0.85; }
.icon-btn.muted { color: var(--muted-2); }
.icon-btn.muted::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 1px;
  background: var(--danger); transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------------- ball tracker ---------------- */
#ball-tracker {
  position: absolute; z-index: 25; left: 24px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px; width: 148px;
  animation: fadeUp 0.6s var(--ease) both;
}
.tracker-row { border-left: 1px solid var(--line-soft); padding-left: 11px; transition: border-color 0.3s, opacity 0.3s; }
.tracker-row.is-current { border-left-color: var(--brass); }
.tracker-row.is-mine { opacity: 1; }
.tracker-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 8px; letter-spacing: 0.19em; color: var(--muted); text-transform: uppercase;
}
.tracker-label b { font-size: 9.5px; color: var(--brass-bright); font-weight: 600; }
.tracker-balls { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; max-width: 136px; }

.mini-ball {
  position: relative; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; font-size: 7.5px; font-weight: 800; color: #17140e;
  background: var(--ball-color, #eee);
  box-shadow: inset -3px -4px 5px rgba(0, 0, 0, 0.38), inset 2px 2px 4px rgba(255, 255, 255, 0.5), 0 2px 5px rgba(0, 0, 0, 0.35);
  transition: opacity 0.35s, filter 0.35s, transform 0.35s;
}
.mini-ball::before { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.mini-ball.stripe::before {
  background: linear-gradient(to bottom, #f3efe4 0 25%, var(--ball-color) 25% 75%, #f3efe4 75% 100%);
}
.mini-ball i {
  position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%;
  background: #f5f1e6; display: grid; place-items: center; font-style: normal;
  font-size: 6.5px; line-height: 1; letter-spacing: -0.02em;
}
.mini-ball.potted { opacity: 0.14; filter: grayscale(1) brightness(0.75); transform: scale(0.9); }

/* ---------------- toasts ---------------- */
#toast-center {
  position: absolute; z-index: 80; top: 96px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none;
}
.toast {
  padding: 9px 18px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); background: rgba(7, 14, 10, 0.88); border: 1px solid var(--line);
  border-left: 2px solid var(--brass); backdrop-filter: blur(12px);
  animation: toastIn 0.32s var(--ease) both;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.toast.foul { border-left-color: var(--danger); color: #f3cabf; }
.toast.ok { border-left-color: var(--ok); color: #d9eddd; }
.toast.out { animation: toastOut 0.35s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- bottom HUD ---------------- */
#play-hud {
  position: absolute; z-index: 25; left: 24px; right: 24px; bottom: max(22px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 176px minmax(240px, 1fr) 300px;
  gap: 22px; align-items: end; pointer-events: none;
  animation: fadeUp 0.6s var(--ease) both;
}
#play-hud > * { pointer-events: auto; }
.panel {
  background: linear-gradient(155deg, rgba(18, 31, 24, 0.93), rgba(6, 12, 9, 0.9));
  border: 1px solid rgba(201, 164, 92, 0.24); border-radius: 2px;
  backdrop-filter: blur(14px) saturate(1.05); -webkit-backdrop-filter: blur(14px) saturate(1.05);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
.hud-left { padding: 12px 13px 10px; justify-self: start; }
.spin-head, .power-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 8px; letter-spacing: 0.21em; color: var(--muted); text-transform: uppercase;
}
.mini-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-soft);
  background: transparent; color: var(--muted-2); cursor: pointer; font-size: 11px; line-height: 1;
  transition: all 0.2s;
}
.mini-btn:hover { color: var(--brass-bright); border-color: var(--brass-dim); }
#spin-widget {
  display: block; width: 152px; height: 152px; margin: 9px auto 3px;
  cursor: crosshair; touch-action: none;
}
.spin-hint {
  text-align: center; font-size: 8px; letter-spacing: 0.16em; color: var(--muted);
  text-transform: uppercase; padding-bottom: 2px;
}
.hud-center {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding-bottom: 20px; pointer-events: none; justify-self: center; max-width: 100%;
}
.status-chip {
  padding: 6px 14px; font-size: 8.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brass-bright); border: 1px solid rgba(201, 164, 92, 0.28);
  background: rgba(6, 12, 9, 0.72); backdrop-filter: blur(8px); white-space: nowrap;
  transition: color 0.3s, border-color 0.3s;
}
.status-chip.warn { color: #f0c2b5; border-color: rgba(208, 104, 81, 0.35); }
.hint {
  font-size: 10px; color: rgba(220, 226, 216, 0.8); letter-spacing: 0.06em; text-align: center;
  line-height: 1.5; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.hud-right { padding: 13px 15px 11px; justify-self: end; width: 300px; }
.power-head b { font-family: var(--display); font-size: 15px; font-weight: 400; color: var(--brass-bright); letter-spacing: 0.04em; }
.power-track {
  position: relative; height: 11px; margin-top: 10px; overflow: hidden;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(201, 164, 92, 0.3);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
}
.power-fill {
  position: relative; height: 100%; width: 0%;
  background: linear-gradient(90deg, #427965 0%, #b0a05b 48%, var(--brass-bright) 78%, #e06c4d 100%);
  box-shadow: 0 0 16px rgba(232, 205, 146, 0.22);
  transition: width 0.06s linear;
}
.power-fill::after {
  content: ""; position: absolute; right: 0; top: -2px; bottom: -2px; width: 12px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45));
  filter: blur(2px);
}
.power-ticks { position: absolute; inset: 0; pointer-events: none; }
.power-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0, 0, 0, 0.35); }
.power-foot {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-size: 7.5px; letter-spacing: 0.19em; color: var(--muted);
}
#aim-note {
  position: absolute; z-index: 24; left: 50%; bottom: 7px; transform: translateX(-50%);
  font-size: 8.5px; letter-spacing: 0.13em; color: rgba(180, 190, 182, 0.48);
  white-space: nowrap; pointer-events: none;
}

/* ---------------- modals ---------------- */
.modal {
  width: min(700px, 94vw); max-height: min(86vh, 820px); overflow: auto;
  padding: 28px 30px 24px; border-radius: 3px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(19, 33, 25, 0.96), rgba(6, 12, 9, 0.97)),
    var(--panel-2);
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.65);
  animation: fadeUp 0.38s var(--ease) both;
  scrollbar-width: thin; scrollbar-color: rgba(201, 164, 92, 0.35) transparent;
}
.modal.wide { width: min(780px, 94vw); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.modal-kicker { font-size: 8px; letter-spacing: 0.3em; color: var(--brass); text-transform: uppercase; }
.modal h2 {
  margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 39px;
  line-height: 1; letter-spacing: 0.01em; color: var(--ink);
}
.modal .icon-btn { flex: none; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 26px; }
.setting label { display: block; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 1px;
  background: rgba(255, 255, 255, 0.035); color: var(--ink); outline: none;
  font-size: 12px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select:focus-visible { border-color: var(--brass); }
.range-wrap { display: flex; align-items: center; gap: 12px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 2px;
  background: rgba(255, 255, 255, 0.12); outline: none; border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--brass-bright); border: 2px solid #171208; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(201, 164, 92, 0.4), 0 2px 8px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%; background: var(--brass-bright);
  border: 2px solid #171208; cursor: pointer;
}
.range-wrap span { min-width: 40px; text-align: right; font-size: 11px; color: var(--brass-bright); font-variant-numeric: tabular-nums; }
.check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 11px; color: var(--muted); letter-spacing: 0.03em;
}
.check input { accent-color: var(--brass); width: 14px; height: 14px; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.modal-actions.center { justify-content: center; }
.fineprint { margin-top: 16px; font-size: 9px; color: var(--muted-2); letter-spacing: 0.04em; }
.help-cols { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 32px; }
.help-cols h3 {
  margin: 0 0 14px; font-family: var(--display); font-weight: 400; font-size: 17px;
  color: var(--brass-bright); letter-spacing: 0.03em;
}
.help-cols p { margin: 0 0 12px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.help-cols b { color: var(--ink); font-weight: 600; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.keys li { display: flex; align-items: baseline; gap: 12px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
kbd {
  flex: none; min-width: 64px; padding: 3px 7px; text-align: center;
  font-family: var(--ui); font-size: 9px; letter-spacing: 0.06em; color: var(--brass-bright);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.035); white-space: nowrap;
}
.muted { color: var(--muted-2) !important; }
.gameover { text-align: center; padding: 44px 36px 32px; max-width: 480px; }
.go-kicker { font-size: 8px; letter-spacing: 0.34em; color: var(--brass); }
.gameover h2 { font-size: 58px; margin-top: 14px; }
.gameover p { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.go-stats { display: flex; justify-content: center; gap: 30px; margin: 26px 0 4px; }
.go-stats div { min-width: 78px; }
.go-stats b { display: block; font-family: var(--display); font-size: 26px; font-weight: 400; color: var(--brass-bright); }
.go-stats span { font-size: 8px; letter-spacing: 0.17em; color: var(--muted-2); text-transform: uppercase; }
.gameover .modal-actions { justify-content: center; margin-top: 30px; }

#debug-hud {
  position: absolute; z-index: 200; right: 12px; bottom: 12px;
  font: 10px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #9bb8a6; background: rgba(0, 0, 0, 0.55); padding: 7px 10px; white-space: pre;
  border: 1px solid rgba(255, 255, 255, 0.08); pointer-events: none;
}

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  #play-hud { grid-template-columns: 160px 1fr 260px; gap: 16px; }
  .hud-right { width: 260px; }
  #spin-widget { width: 132px; height: 132px; }
  .hud-left { padding: 10px 10px 8px; }
  #ball-tracker { width: 132px; }
  .mini-ball { width: 19px; height: 19px; }
}

@media (max-width: 860px) {
  .screen { padding: 22px; }
  #topbar { padding: 12px 14px 26px; }
  .brand-small { display: none; }
  .players { gap: 6px; }
  .player-card { min-width: 0; padding: 8px 11px; }
  .player-name { font-size: 9.5px; max-width: 92px; }
  .player-group { font-size: 7.5px; padding-left: 13px; }
  .icon-actions { gap: 2px; }
  .icon-btn { width: 30px; height: 30px; }
  #ball-tracker { display: none; }
  #play-hud { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); grid-template-columns: 138px 1fr 200px; gap: 10px; }
  .hud-right { width: 200px; padding: 10px 12px; }
  .hud-center { padding-bottom: 8px; }
  .hint { display: none; }
  .status-chip { font-size: 7.5px; padding: 5px 10px; }
  #spin-widget { width: 118px; height: 118px; }
  .hud-left { padding: 9px; }
  #aim-note { display: none !important; }
  .menu-wrap { padding-left: 0; }
  .modal { padding: 24px 22px; }
  .help-cols { grid-template-columns: 1fr; gap: 20px; }
  #menu { background: linear-gradient(180deg, rgba(4, 8, 6, 0.86), rgba(4, 8, 6, 0.7) 45%, rgba(4, 8, 6, 0.95)); }
  .menu-foot { margin-top: 30px; }
}

@media (max-width: 620px) {
  .screen { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .menu-wrap { width: 100%; padding-bottom: 10px; }
  .menu-brand { margin-bottom: 26px; }
  .menu-brand h1 { font-size: clamp(44px, 14vw, 62px); }
  .menu-tagline { margin-top: 14px; font-size: 12px; }
  .menu-actions, #menu-resume { width: 100%; }
  .menu-foot { display: none; }
  .players { flex: 1; justify-content: center; }
  .player-card { flex: 1; max-width: 152px; }
  .vs { display: none; }
  .icon-actions .icon-btn:nth-child(1), .icon-actions .icon-btn:nth-child(3) { display: none; }
  #play-hud { grid-template-columns: 1fr 1.3fr; grid-template-areas: "left right"; align-items: end; }
  .hud-left { grid-area: left; width: 128px; justify-self: start; }
  .hud-right { grid-area: right; width: 100%; justify-self: stretch; }
  .hud-center { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 10px); padding: 0; }
  .status-chip { background: rgba(5, 11, 8, 0.72); }
  #spin-widget { width: 108px; height: 108px; }
  .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .modal { max-height: 92vh; padding: 22px 18px; }
  .modal h2 { font-size: 32px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1; min-width: 130px; }
  .gameover { padding: 34px 20px 24px; }
  .gameover h2 { font-size: 44px; }
  .go-stats { gap: 18px; }
  .toast { font-size: 9px; max-width: 88vw; text-align: center; }
  #toast-center { top: 82px; width: 100%; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .menu-brand h1 { font-size: 44px; }
  .menu-brand { margin-bottom: 20px; }
  .menu-tagline { display: none; }
  .menu-actions { flex-direction: row; flex-wrap: wrap; width: min(520px, 60vw); }
  .menu-actions .btn { flex: 1 1 140px; }
  .menu-row { width: 100%; }
  #menu { align-items: center; }
  .menu-wrap { width: min(640px, 70vw); }
  .modal { max-height: 94vh; }
  #ball-tracker { display: none; }
}

@media (pointer: coarse) {
  .btn { padding: 17px 22px; }
  .icon-btn { width: 38px; height: 38px; }
  .mini-btn { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Online lobby */
.online-badge {
  margin-left: 14px;
  padding: 5px 9px;
  border: 1px solid rgba(201, 164, 92, 0.35);
  border-radius: 1px;
  color: var(--brass-bright);
  background: rgba(9, 18, 13, 0.62);
  font-family: var(--ui);
  font-size: 8px;
  letter-spacing: 0.22em;
  white-space: nowrap;
}
.online-panel { width: min(820px, 94vw); }
.online-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.online-col { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.online-lobby-col { min-height: 180px; border-left: 1px solid var(--line-soft); padding-left: 28px; }
.online-field { display: flex; flex-direction: column; gap: 7px; }
.online-field > span {
  font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2);
}
.online-field input,
.online-join input {
  width: 100%; box-sizing: border-box; padding: 11px 12px;
  border: 1px solid var(--line-soft); border-radius: 1px;
  background: rgba(255, 255, 255, 0.035); color: var(--ink);
  outline: none; font-size: 12px; letter-spacing: 0.03em;
}
.online-field input:focus-visible,
.online-join input:focus-visible { border-color: var(--brass); }
.online-field input::placeholder,
.online-join input::placeholder { color: rgba(222, 214, 195, 0.32); }
.online-join { display: flex; gap: 8px; }
.online-join .btn { flex: none; padding-left: 18px; padding-right: 18px; }
.online-join input { text-transform: uppercase; letter-spacing: 0.22em; font-size: 15px; }
.online-divider {
  display: flex; align-items: center; gap: 10px; margin: 3px 0;
  color: var(--muted-2); font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase;
}
.online-divider::before, .online-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line-soft);
}
.online-room {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 16px; color: var(--muted-2); font-size: 8px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.online-room b {
  color: var(--brass-bright); font-family: var(--ui); font-size: 20px;
  letter-spacing: 0.16em; font-weight: 500;
}
.online-room .mini-btn { margin-left: auto; width: auto; padding: 5px 8px; font-size: 8px; letter-spacing: 0.08em; }
.online-players { display: flex; flex-direction: column; gap: 7px; min-height: 74px; }
.online-player {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.025);
  font-size: 11px; color: var(--muted);
}
.online-player.is-self { border-color: rgba(201, 164, 92, 0.32); background: rgba(201, 164, 92, 0.055); }
.online-player-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brass); flex: none; }
.online-player-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.online-player-ready { font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.online-player-ready.is-ready { color: #9fcc9b; }
.online-empty { padding: 16px 0; font-size: 10px; color: var(--muted-2); }
.online-actions { display: flex; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.online-actions .btn { flex: 1; min-width: 110px; }
.online-status {
  margin-top: 20px; padding: 10px 12px; border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025); color: var(--muted);
  font-size: 10.5px; letter-spacing: 0.03em; line-height: 1.5;
}
.online-status.is-error { border-left-color: #b86b5a; color: #e5a696; }
.online-status.is-ok { border-left-color: #92b98c; color: #c4dfc0; }
@media (max-width: 720px) {
  .online-grid { grid-template-columns: 1fr; gap: 22px; }
  .online-lobby-col { border-left: 0; border-top: 1px solid var(--line-soft); padding-left: 0; padding-top: 20px; }
  .online-badge { display: none; }
}
