/* ============================================================
   FAST CRICKET VR — STYLE (v4.0.0)
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --bg-0: #050810;
  --bg-1: #0a0e22;
  --bg-2: #11193a;
  --bg-3: #182758;
  --fg-1: #ffffff;
  --fg-2: #c7d2eb;
  --fg-3: #94a3b8;
  --fg-4: #7d8fc0;
  --accent: #7af0ff;
  --accent-2: #00d9ff;
  --warn: #ffd84d;
  --bad: #ff4d4d;
  --good: #6ee0ff;
  --ok: #18d65a;
}

html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Roboto', system-ui, sans-serif;
}

#canvas { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

kbd {
  background: #1a2243; color: var(--fg-1);
  padding: 2px 7px; border-radius: 5px;
  border: 1px solid #2d3a72;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
}

/* ============ SPLASH ============ */
#splash {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #0e1530 0%, #050810 75%);
}
.splash-inner { text-align: center; max-width: 460px; }
.splash-logo {
  font-size: 88px; line-height: 1; margin-bottom: 12px;
  filter: drop-shadow(0 0 28px rgba(122,240,255,0.4));
}
.splash-title {
  font-size: 56px; letter-spacing: 4px;
  margin: 0 0 6px; font-weight: 900;
  background: linear-gradient(90deg, #7af0ff 0%, #4dffd9 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.splash-subtitle {
  color: var(--fg-3); letter-spacing: 3px; font-size: 14px;
  margin-bottom: 32px;
}
.splash-progress { margin-top: 30px; }
.splash-bar {
  width: 100%; height: 8px; background: #1a2243; border-radius: 5px;
  overflow: hidden; margin-bottom: 12px;
}
#splashFill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #00d9ff, #7af0ff);
  transition: width 0.3s ease;
}
#splashStatus { color: var(--fg-3); font-size: 13px; }
.splash-continue {
  margin-top: 20px;
  background: linear-gradient(135deg, #00d9ff, #4dffd9);
  color: #050810; border: 0; padding: 12px 30px;
  border-radius: 30px; font-weight: 700; font-size: 16px;
  cursor: pointer; box-shadow: 0 8px 28px rgba(0,217,255,0.45);
}
.splash-version {
  position: absolute; bottom: 22px; right: 22px;
  color: var(--fg-3); font-size: 12px; letter-spacing: 1px;
}

/* ============ HANDEDNESS PROMPT ============ */
#handednessPrompt {
  position: fixed; inset: 0; z-index: 28;
  background: radial-gradient(circle at 50% 30%, #0a0e22 0%, #050810 80%);
  display: flex; align-items: center; justify-content: center;
}
.hand-card {
  background: linear-gradient(160deg, #0e1530, #182758);
  border: 1px solid #2d3a72;
  border-radius: 18px; padding: 36px 40px;
  max-width: 620px; width: 92%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  text-align: center;
}
.hand-icon { font-size: 56px; margin-bottom: 8px; }
.hand-title {
  margin: 0 0 8px; letter-spacing: 4px; font-weight: 900;
  background: linear-gradient(90deg, #7af0ff, #4dffd9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hand-sub { color: var(--fg-3); font-size: 14px; line-height: 1.55; }
.hand-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin-top: 24px;
}
.hand-opt {
  background: #11193a; color: var(--fg-1); border: 2px solid #2d3a72;
  border-radius: 14px; padding: 22px 14px; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hand-opt:hover { transform: translateY(-3px); border-color: var(--accent); }
.hand-opt-mark { font-size: 34px; }
.hand-opt-label { font-weight: 800; letter-spacing: 2px; }
.hand-opt-hint  { color: var(--fg-3); font-size: 12px; }

/* ============ LANDING ============ */
#landing {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: stretch; justify-content: center;
  background: radial-gradient(circle at 50% 0%, #0e1530 0%, #050810 75%);
  overflow-y: auto;
}
.landing-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 1180px;
  display: flex; flex-direction: column;
  padding: 28px 32px 80px;
}
.landing-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 26px; font-weight: 800;
}
.brand-mark { font-size: 36px; }
.brand-text {
  background: linear-gradient(90deg, #7af0ff, #4dffd9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text sup { font-size: 12px; vertical-align: super; }
.brand-tag { color: var(--fg-3); font-size: 12px; letter-spacing: 1.5px; }

/* ----- Tabs ----- */
.tab-nav {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; padding-bottom: 6px;
  border-bottom: 1px solid #1a2243;
}
.tab-btn {
  background: transparent; color: var(--fg-3);
  border: 1px solid transparent; padding: 9px 16px;
  border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: color 0.12s, border-color 0.12s;
}
.tab-btn:hover { color: var(--fg-1); }
.tab-btn.active {
  color: var(--fg-1);
  border-color: var(--accent);
  background: rgba(122,240,255,0.05);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ----- Hero ----- */
.hero-card {
  background: linear-gradient(160deg, #0e1530, #182758);
  border: 1px solid #2d3a72; border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.hero-title {
  margin: 0 0 6px; font-size: 30px; letter-spacing: 1px;
  background: linear-gradient(90deg, #7af0ff, #4dffd9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--fg-3); font-size: 14px; line-height: 1.55; }
.section-title {
  margin: 0 0 8px; letter-spacing: 1.5px;
  background: linear-gradient(90deg, #7af0ff, #4dffd9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-sub { color: var(--fg-3); font-size: 13px; line-height: 1.55; }

/* ----- Config grid ----- */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin-top: 18px;
}
.config-grid.basics { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) {
  .config-grid, .config-grid.basics { grid-template-columns: 1fr; }
}
.cfg {
  background: #0e1530; border: 1px solid #1a2243;
  border-radius: 14px; padding: 12px 14px;
}
.cfg-wide { grid-column: 1 / -1; }
.cfg-label {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--fg-2);
  margin-bottom: 8px;
}
.cfg-tag {
  color: var(--fg-4); font-size: 11px; font-weight: 500;
  letter-spacing: 0.5px;
}
.cfg-options { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-opt {
  background: #11193a; color: var(--fg-2);
  border: 1px solid #2d3a72; border-radius: 9px;
  padding: 8px 12px; cursor: pointer;
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color 0.12s, background 0.12s;
}
.cfg-opt:hover { border-color: var(--accent); }
.cfg-opt.active {
  background: linear-gradient(135deg, #00d9ff 0%, #4dffd9 100%);
  color: #050810; border-color: transparent;
}
.cfg-icon { font-size: 16px; }
.mode-select .cfg-opt { padding: 12px 18px; font-size: 14px; }

.mode-sub { background: #0a1330; }
.sub-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-top: 8px;
}
@media (max-width: 700px) { .sub-row { grid-template-columns: 1fr; } }
.sub-label {
  color: var(--fg-3); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 6px;
}

/* Sliders */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 5px; background: #2d3a72; border-radius: 4px;
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent);
  cursor: pointer; box-shadow: 0 0 10px rgba(122,240,255,0.5);
}
.slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 0;
}
.slider-val {
  min-width: 64px; text-align: right; font-weight: 700;
  color: var(--accent); font-size: 14px;
}

/* Toggle switch */
.toggle-label {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.toggle-label input { display: none; }
.toggle-switch {
  width: 38px; height: 22px; border-radius: 12px;
  background: #2d3a72; position: relative;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.toggle-label input:checked + .toggle-switch {
  background: var(--accent);
}
.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

.check-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 760px) { .check-grid { grid-template-columns: 1fr 1fr; } }
.chk {
  display: inline-flex; align-items: center; gap: 6px;
  background: #11193a; border: 1px solid #2d3a72;
  border-radius: 8px; padding: 7px 10px; cursor: pointer;
  font-size: 13px;
}
.chk input { accent-color: var(--accent); }

.hand-quick {
  display: flex; align-items: center; gap: 10px;
  color: var(--fg-2); font-weight: 600;
}
.btn-mini {
  background: #11193a; color: var(--fg-2);
  border: 1px solid #2d3a72; border-radius: 7px;
  padding: 5px 9px; cursor: pointer; font-size: 12px;
}

/* ----- Main CTA ----- */
.cta-row {
  display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
  border: 0; border-radius: 12px;
  padding: 13px 22px; font-weight: 800; letter-spacing: 1px;
  font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.12s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #00d9ff, #4dffd9);
  color: #050810;
  box-shadow: 0 12px 36px rgba(0,217,255,0.45);
}
.btn-secondary {
  background: #11193a; color: var(--fg-1);
  border: 1px solid #2d3a72;
}
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-2px); }
.btn-icon { font-size: 20px; }

.best-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-top: 20px;
}
.best-card {
  background: #0a1330; border: 1px solid #1a2243;
  border-radius: 12px; padding: 14px 18px;
}
.best-label {
  color: var(--fg-4); letter-spacing: 1.5px; font-size: 11px;
  font-weight: 700; margin-bottom: 4px;
}
.best-value {
  font-size: 26px; font-weight: 900;
  color: var(--accent);
}

/* ============ HUD ============ */
#hud {
  position: fixed; inset: 0; z-index: 12;
  pointer-events: none;
}
.hud-top {
  position: absolute; top: 18px; left: 18px; right: 18px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.hud-stack { display: flex; flex-wrap: wrap; gap: 8px; }
.hud-tile {
  background: rgba(10,14,34,0.7);
  border: 1px solid rgba(45,58,114,0.7);
  border-radius: 12px;
  padding: 8px 12px; min-width: 68px;
  backdrop-filter: blur(6px);
}
.hud-tile.primary {
  background: linear-gradient(135deg, rgba(0,217,255,0.18), rgba(77,255,217,0.15));
  border-color: var(--accent);
}
.hud-tile-label {
  color: var(--fg-4); letter-spacing: 1.5px;
  font-size: 10px; font-weight: 700;
}
.hud-tile-value {
  font-size: 20px; font-weight: 900; color: var(--fg-1);
}
.hud-status {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.hud-mode-tag {
  background: rgba(10,14,34,0.7);
  border: 1px solid #2d3a72; border-radius: 9px;
  padding: 5px 10px; color: var(--fg-2);
  letter-spacing: 1.5px; font-size: 11px; font-weight: 700;
}
.hud-target {
  background: var(--warn); color: #050810;
  border-radius: 9px; padding: 5px 10px;
  font-weight: 800; letter-spacing: 1.5px; font-size: 12px;
}
.hud-state-pill {
  background: rgba(122,240,255,0.18); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 16px;
  padding: 6px 14px; font-weight: 800; letter-spacing: 2px;
  font-size: 12px;
}
.last6-row {
  display: flex; gap: 4px; margin-top: 4px;
}
.last6-pill {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #1a2243; color: #ffffff;
  font-weight: 800; font-size: 13px;
}
.last6-pill.last6-w { background: var(--bad); }
.last6-pill.last6-six { background: var(--warn); color: #050810; }
.last6-pill.last6-four { background: var(--good); color: #050810; }
.last6-pill.last6-empty { background: #11193a; color: #3a4a78; }

.hit-feedback {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
  font-size: 80px; font-weight: 900;
  color: var(--accent); opacity: 0; transition: opacity 0.3s;
}
.time-bonus {
  position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%);
  color: var(--warn); font-weight: 800; opacity: 0; transition: opacity 0.3s;
}
.calib-feedback {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  background: rgba(24,214,90,0.18); color: var(--ok);
  border: 1px solid var(--ok); border-radius: 14px;
  padding: 8px 16px; font-weight: 800; letter-spacing: 1.5px;
}

.pause-overlay {
  position: absolute; inset: 0; pointer-events: auto;
  background: rgba(5,8,16,0.55);
  display: flex; align-items: center; justify-content: center;
}
.pause-card {
  background: linear-gradient(160deg, #0e1530, #182758);
  border: 1px solid var(--accent);
  border-radius: 18px; padding: 32px 40px; text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}
.pause-icon { font-size: 48px; color: var(--accent); }
.pause-text {
  font-size: 28px; letter-spacing: 4px; font-weight: 900;
  margin-top: 8px;
}
.pause-hint { color: var(--fg-3); margin-top: 8px; font-size: 13px; }
.pause-actions {
  display: flex; gap: 12px; margin-top: 20px; justify-content: center;
}

.calib-offer {
  position: absolute; inset: 0; pointer-events: auto;
  background: rgba(5,8,16,0.55);
  display: flex; align-items: center; justify-content: center;
}
.calib-offer-card {
  background: linear-gradient(160deg, #0e1530, #182758);
  border: 1px solid var(--accent);
  border-radius: 18px; padding: 32px 40px; text-align: center;
  max-width: 520px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}
.calib-offer-icon { font-size: 48px; color: var(--accent); }
.calib-offer-title {
  font-size: 24px; letter-spacing: 3px; font-weight: 900; margin-top: 8px;
}
.calib-offer-body {
  color: var(--fg-3); font-size: 14px; line-height: 1.55; margin-top: 14px;
}
.calib-offer-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }

.calib-overlay {
  position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  pointer-events: auto;
}
.calib-banner {
  background: rgba(10,14,34,0.85);
  border: 1px solid var(--accent);
  border-radius: 16px; padding: 20px 28px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}
.calib-icon { font-size: 32px; color: var(--accent); }
.calib-title { font-size: 20px; letter-spacing: 3px; font-weight: 900; margin-top: 6px; }
.calib-hint { color: var(--fg-3); font-size: 13px; margin-top: 10px; max-width: 420px; }
.calib-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

/* ============ Game Over ============ */
#gameOver {
  position: fixed; inset: 0; z-index: 18;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,16,0.85);
}
.go-card {
  background: linear-gradient(160deg, #0e1530, #182758);
  border: 1px solid var(--accent);
  border-radius: 18px; padding: 32px 40px; text-align: center;
  max-width: 560px; width: 92%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.go-banner { display: flex; justify-content: center; }
.go-out-stamp {
  background: var(--bad); color: #050810;
  padding: 8px 20px; border-radius: 30px;
  letter-spacing: 4px; font-weight: 900;
}
.go-final {
  margin-top: 18px;
}
.go-final-label {
  color: var(--fg-3); font-size: 12px;
  letter-spacing: 2.5px; font-weight: 700;
}
.go-final-value {
  font-size: 64px; font-weight: 900; color: var(--accent);
}
.go-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 18px;
}
.go-stat {
  background: #0a1330; border: 1px solid #1a2243;
  border-radius: 12px; padding: 12px 8px;
}
.go-stat-v { font-size: 22px; font-weight: 900; color: var(--fg-1); }
.go-stat-l { color: var(--fg-4); font-size: 11px; letter-spacing: 1.5px; font-weight: 700; }

.go-dismissal {
  margin-top: 18px; padding: 10px 14px;
  background: #200d12; border: 1px solid #ff4d4d40;
  color: var(--bad); border-radius: 12px;
  font-weight: 800; letter-spacing: 1.5px;
}
.go-newbest {
  margin-top: 14px; padding: 10px 14px;
  background: rgba(255,216,77,0.12); border: 1px solid #ffd84d50;
  color: var(--warn); border-radius: 12px;
  font-weight: 800; letter-spacing: 1.5px;
}
.go-actions {
  display: flex; gap: 12px; margin-top: 22px; justify-content: center;
}

/* ============ ADV / SETTINGS ============ */
.adv-section {
  background: #0a1330; border: 1px solid #1a2243;
  border-radius: 14px; padding: 14px 18px;
  margin-top: 14px;
}
.adv-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.adv-section-head h3 { margin: 0; color: var(--fg-1); }
.adv-section-tag { color: var(--fg-4); font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.adv-section .cfg { background: #11193a; }

.instruction-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 14px;
}
@media (max-width: 700px) { .instruction-grid { grid-template-columns: 1fr; } }
.instr-block {
  background: #0a1330; border: 1px solid #1a2243;
  border-radius: 14px; padding: 14px 18px;
}
.instr-block.wide { grid-column: 1 / -1; }
.instr-block h3 { margin: 0 0 8px; color: var(--accent); }
.instr-list { margin: 0; padding-left: 18px; color: var(--fg-3); font-size: 13px; line-height: 1.7; }
.instr-list li { margin-bottom: 4px; }

.credit-body { color: var(--fg-3); font-size: 13px; line-height: 1.55; }
.credit-body a { color: var(--accent); text-decoration: none; }
.credit-body a:hover { text-decoration: underline; }

.landing-footer {
  margin-top: 20px; text-align: center;
  color: var(--fg-4); font-size: 11px; letter-spacing: 1.5px;
}
