
:root {
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --primary: #0f172a;
  --primary-contrast: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 45%, #f1f5f9 100%);
  color: var(--text);
}
button, input { font: inherit; }
.app-shell { min-height: 100vh; padding: 16px; }
.container { width: 100%; max-width: 440px; margin: 0 auto; padding-bottom: 96px; }
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.hero-card { background: linear-gradient(180deg, #111827 0%, #0f172a 100%); color: #fff; }
.hero-card p { color: rgba(255,255,255,.75); }
.hero-top { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.hero-top h1 { margin:0; font-size:1.9rem; }
.hero-top p { margin:8px 0 0; font-size:.95rem; }
.hero-icon {
  width:56px; height:56px; border-radius:18px; display:grid; place-items:center;
  background:rgba(255,255,255,.1); font-size:28px;
}
h2 { font-size:1.15rem; margin:0 0 4px; }
.section-desc { margin:0 0 14px; color:var(--muted); font-size:.92rem; }
.stats-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.stat-pill {
  background: rgba(255,255,255,.82); border-radius:18px; padding:12px; color:var(--text); border:1px solid var(--line);
}
.stat-label { color:var(--muted); font-size:.78rem; }
.stat-value { margin-top:6px; font-size:1.2rem; font-weight:700; }
.mode-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.mode-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.mode-card {
  text-align:left; border:0; border-radius:18px; padding:14px; background:#f1f5f9; color:var(--text); cursor:pointer;
}
.mode-card.active { background:var(--primary); color:#fff; box-shadow:var(--shadow); }
.mode-title { display:flex; align-items:center; gap:8px; font-weight:700; margin-bottom:8px; }
.mode-desc { font-size:.8rem; opacity:.85; line-height:1.35; }
.row-between { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:.95rem; margin-bottom:10px; }
.badge { background:#e2e8f0; border-radius:999px; padding:6px 12px; font-weight:600; }
.progress {
  width:100%; height:12px; background:#e2e8f0; border-radius:999px; overflow:hidden; margin-bottom:14px;
}
.progress-bar { height:100%; width:0%; background:var(--primary); border-radius:999px; transition:width .2s ease; }
.multiplier-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.number-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.btn {
  border:0; min-height:48px; border-radius:18px; padding:0 14px; display:inline-flex;
  align-items:center; justify-content:center; gap:8px; cursor:pointer; width:100%;
}
.btn-primary { background:var(--primary); color:var(--primary-contrast); }
.btn-secondary { background:#e2e8f0; color:var(--text); }
.btn-outline { background:#fff; color:var(--text); border:1px solid var(--line); }
.btn.active { outline:2px solid #1e293b; }
.btn-wide { grid-column:span 2; }
.btn-full { width:100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.text-input {
  min-height:48px; width:100%; border-radius:18px; border:1px solid var(--line); background:#fff; padding:0 14px;
}
.checkout-setup { display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:14px; }
.checkout-box, .game-score-box { background:var(--card-soft); border-radius:18px; padding:18px; text-align:center; }
.checkout-box { margin-bottom:14px; }
.checkout-label, .checkout-help { color:var(--muted); font-size:.92rem; }
.checkout-value { font-size:3rem; font-weight:800; line-height:1.1; margin:6px 0; }
.game-top { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.coach-btn { min-height: 44px; }
.turn-inline-block { margin:0 0 12px; }
.turn-preview.compact {
  min-height:50px; border-radius:18px; background:var(--card-soft); border:1px solid var(--line); padding:8px;
}
.turn-preview-empty {
  min-height:32px; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:.9rem;
}
.turn-preview-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.turn-shot {
  min-height:34px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:.92rem; font-weight:700;
}
.turn-shot.filled { background:#fff; border:1px solid var(--line); color:var(--text); }
.turn-shot.empty { background:transparent; border:1px dashed rgba(15,23,42,.10); color:transparent; }
.turn-dots { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:12px; }
.turn-dot { width:10px; height:10px; border-radius:999px; background:#cbd5e1; transition:transform .18s ease, background .18s ease; }
.turn-dot.filled { background:#0f172a; transform:scale(1.18); }
.cricket-list {
  background:var(--card-soft); border-radius:18px; padding:10px; margin-bottom:14px;
}
.cricket-row {
  background:#fff; border:1px solid var(--line); border-radius:16px; padding:12px;
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
.cricket-row:last-child { margin-bottom:0; }
.cricket-name { font-weight:600; }
.cricket-marks { display:flex; gap:6px; font-size:18px; }
.mark-off { opacity:.2; }
.cricket-input-wrap { display:flex; flex-direction:column; gap:8px; }
.cricket-input-row { display:grid; width:100%; gap:8px; }
.thirds-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
.halves-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
.cricket-miss-btn { margin-top:8px; }
.empty-box { background:var(--card-soft); color:var(--muted); border-radius:18px; padding:14px; font-size:.92rem; }
.history-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.history-item { background:#f1f5f9; border-radius:16px; padding:12px; text-align:center; }
.history-label { font-size:.92rem; font-weight:700; }
.history-points { font-size:.76rem; color:var(--muted); margin-top:4px; }
.panel { display:none; }
.panel.active { display:block; }
.sticky-footer { position:sticky; bottom:12px; }
.footer-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.turn-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,.42); display:flex; align-items:center; justify-content:center;
  padding:18px; opacity:0; pointer-events:none; transition:opacity .18s ease; z-index:1000;
}
.turn-overlay.show { opacity:1; pointer-events:auto; }
.turn-overlay-card {
  width:min(100%,320px); background:#fff; border-radius:24px; padding:22px 18px; text-align:center;
  box-shadow:0 18px 40px rgba(15,23,42,.24); transform:scale(.88); opacity:.95;
}
.turn-overlay.show .turn-overlay-card { animation:turnPop .85s ease both; }
.turn-overlay-icon { font-size:34px; margin-bottom:8px; }
.turn-overlay-title { font-size:1.15rem; font-weight:800; }
.turn-overlay-labels { margin-top:10px; color:var(--muted); font-size:.95rem; line-height:1.45; }
.turn-overlay-score { margin-top:12px; font-size:1.4rem; font-weight:800; color:var(--text); }
.finish-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:18px; }
.one-button { grid-template-columns: 1fr; }
.coach-card { width: min(100%, 360px); }
.coach-subtitle { margin-top: 8px; color: var(--muted); font-size: .96rem; }
.coach-steps { margin-top: 16px; display: grid; gap: 10px; text-align: left; }
.coach-step {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start;
  background: var(--card-soft); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
}
.coach-step-index {
  width: 28px; height: 28px; border-radius: 999px; background: var(--primary); color: white;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
}
@keyframes turnPop {
  0% { transform:scale(.86) translateY(10px); opacity:0; }
  20% { transform:scale(1.03) translateY(0); opacity:1; }
  65% { transform:scale(1); opacity:1; }
  100% { transform:scale(.98); opacity:1; }
}
@media (min-width:520px) {
  .number-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .btn-wide { grid-column:span 1; }
  .game-top { grid-template-columns: 1fr auto; align-items: stretch; }
  .coach-btn { width: auto; min-width: 150px; }
}


.mode-menu {
  display: grid;
  gap: 10px;
}

.mode-menu .mode-card {
  width: 100%;
  padding: 14px 16px;
}

.mode-menu .mode-title {
  margin-bottom: 4px;
  gap: 0;
}


.mode-menu .mode-desc {
  opacity: 1;
  color: var(--muted);
}

.mode-menu .mode-card.active .mode-desc {
  color: rgba(255,255,255,.78);
}

@media (min-width: 520px) {
  .mode-menu {
    grid-template-columns: 1fr 1fr;
  }
}


.mode-header-card {
  padding: 14px 16px;
}

.training-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.training-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.training-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.training-header-text {
  min-width: 0;
}

.training-header-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.training-header-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  flex: 0 0 auto;
}

.training-menu-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
  opacity: 0;
  margin-top: 0;
}

.training-menu-wrap.open {
  max-height: 700px;
  opacity: 1;
  margin-top: 14px;
}

.mode-menu {
  display: grid;
  gap: 10px;
}

.mode-menu .mode-card {
  width: 100%;
  padding: 14px 16px;
}

.mode-menu .mode-title {
  margin-bottom: 4px;
  gap: 0;
}

.mode-menu .mode-desc {
  opacity: 1;
  color: var(--muted);
}

.mode-menu .mode-card.active .mode-desc {
  color: rgba(255,255,255,.78);
}

@media (min-width: 520px) {
  .mode-menu {
    grid-template-columns: 1fr 1fr;
  }
}
