:root {
  color-scheme: dark;
  --bg: #090d16;
  --panel: #111827;
  --panel-soft: #172033;
  --panel-strong: #202a3d;
  --line: #344056;
  --line-soft: rgba(148, 163, 184, 0.26);
  --text: #f8fafc;
  --muted: #9aa5b5;
  --gold: #f2c94c;
  --green: #39d98a;
  --blue: #5cc8ff;
}

* {
  box-sizing: border-box;
}

/* iOS tap highlight */
button, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(92, 200, 255, 0.16), transparent 32rem),
    linear-gradient(180deg, #090d16 0%, #0c1220 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 34px 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: max(34px, env(safe-area-inset-bottom));
}

.home-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: calc(100vh - 68px);
  text-align: center;
}

.brand {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 950;
}

.brand.small {
  margin: 0;
  font-size: 1rem;
}

h1 {
  margin-bottom: 32px;
  font-size: clamp(3.8rem, 11vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mode-panel {
  width: min(760px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.86);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.mode-panel h2 {
  margin: 8px 0 22px;
  color: #d9e2ee;
  font-size: 1.15rem;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.formation-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}

.formation-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.formation-grid button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a1120;
  color: var(--muted);
  font-weight: 950;
}

.formation-grid button.active {
  border-color: var(--gold);
  background: rgba(242, 201, 76, 0.16);
  color: var(--gold);
}

.mode-card {
  display: grid;
  gap: 12px;
  justify-items: start;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e1524;
  text-align: left;
}

.mode-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mode-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--gold);
  color: #17120a;
  font-weight: 950;
}

.primary-button,
.spin-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--gold);
  color: #17120a;
  font-weight: 950;
}

.primary-button.alt {
  background: var(--blue);
  color: #07111c;
}

/* Daily Challenge banner */
.daily-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(760px, 100%);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(57, 217, 138, 0.35);
  border-radius: 10px;
  background: rgba(57, 217, 138, 0.07);
}

.daily-info .eyebrow {
  color: var(--green);
}

.daily-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.daily-play-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--green);
  color: #051a10;
  font-weight: 950;
  font-size: 0.9rem;
  white-space: nowrap;
}

.daily-play-btn:disabled {
  background: var(--panel-strong);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: default;
  opacity: 1;
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 680px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-links a,
.footer-links button {
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--text);
}

.footer-links span {
  color: var(--line);
}

.footer-disclaimer {
  margin: 0;
  line-height: 1.5;
  font-size: 0.76rem;
}

.link-button {
  padding: 0;
  background: transparent;
  color: #d9e2ee;
  font-weight: 800;
}

.game-screen {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(420px, 620px);
  justify-content: center;
  align-items: start;
  gap: 28px;
  max-width: 1240px;
  margin: 0 auto;
}

.draft-panel,
.lineup-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.9);
}

.draft-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.game-topbar,
.round-meta,
.draw-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-weight: 850;
}

.back-button {
  padding: 0 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
  font-size: 1.4rem;
}

.round-meta {
  padding: 2px 2px 0;
}

.round-meta strong,
.round-meta span {
  color: #d9e2ee;
  font-weight: 900;
}

.slot-machine {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px),
    #0a1120;
}

.slot-window {
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 2px solid #2d3a52;
  border-radius: 8px;
  background: #050914;
}

.slot-window.slot-team { border-color: rgba(242, 201, 76, 0.55); }
.slot-window.slot-era  { border-color: rgba(92, 200, 255, 0.45); }

.slot-value {
  font-size: clamp(2.6rem, 8vw, 4.5rem);
  font-weight: 950;
  line-height: 0.95;
}

.slot-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spin-button {
  align-self: stretch;
  min-width: 92px;
}

.spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.slot-machine.spinning .slot-window {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(242, 201, 76, 0.32), 0 0 28px rgba(242, 201, 76, 0.16);
}

/* Draw bar — chips + inline rerolls */
.draw-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e1524;
}

.draw-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.draw-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 800;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-club {
  background: rgba(242, 201, 76, 0.12);
  border: 1px solid rgba(242, 201, 76, 0.4);
  color: var(--gold);
}

.chip-era {
  background: rgba(92, 200, 255, 0.12);
  border: 1px solid rgba(92, 200, 255, 0.35);
  color: var(--blue);
}

.draw-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
}

.reroll-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.reroll-btn span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(242, 201, 76, 0.16);
  color: var(--gold);
  font-size: 0.75rem;
}

.draw-count {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  align-self: center;
}

.new-draw-btn {
  border-color: var(--line-soft);
  color: var(--muted);
}

/* Streak */
.streak-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 12px;
  background: rgba(57, 217, 138, 0.2);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
  margin-left: 6px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: rgba(57, 217, 138, 0.12);
  border: 1px solid rgba(57, 217, 138, 0.3);
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 800;
}

/* Search bar */
.player-search {
  position: relative;
}

.player-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a1120;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.player-search input::placeholder { color: var(--muted); }
.player-search input:focus {
  outline: none;
  border-color: var(--gold);
}

.reroll-bar button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1524;
  color: #d9e2ee;
  font-weight: 900;
}

.reroll-bar span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 6px;
  background: rgba(242, 201, 76, 0.16);
  color: var(--gold);
}

.draw-summary {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e1524;
}

.draw-summary div {
  min-width: 0;
}

.draw-summary strong {
  display: block;
  margin-top: 4px;
}

.position-tabs {
  display: flex;
  gap: 8px;
}

.position-tabs button {
  min-height: 38px;
  min-width: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1524;
  color: var(--muted);
  font-weight: 950;
}

.position-tabs button.active {
  border-color: var(--gold);
  background: rgba(242, 201, 76, 0.16);
  color: var(--gold);
}

.player-list {
  display: grid;
  gap: 10px;
  max-height: 58vh;
  overflow: auto;
  padding-right: 4px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #0e1524;
}

.empty-state h2 {
  margin: 8px 0 0;
  color: #d9e2ee;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1422;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.player-row:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: #121b2d;
}

.player-main strong {
  display: block;
  font-size: 1.08rem;
}

.player-main span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 52px);
  gap: 6px;
}

.stat-grid span,
.hidden-stats {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-radius: 7px;
  background: #050914;
}

.stat-grid strong {
  color: var(--gold);
  font-size: 1.05rem;
}

.stat-grid em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
}

.hidden-stats {
  width: 130px;
  color: var(--muted);
  font-weight: 900;
}

.lineup-panel {
  overflow: hidden;
}

.pitch {
  position: relative;
  aspect-ratio: 1 / 1.12;
  min-height: 560px;
  overflow: visible;
  border-radius: 8px 8px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.028) 0 2px, transparent 2px 24px),
    linear-gradient(90deg, #13243d, #071226 52%, #13243d);
}

.pitch::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 3px solid rgba(148, 163, 184, 0.5);
  border-radius: 22px;
}

.pitch-mark {
  position: absolute;
  pointer-events: none;
}

.pitch-mark.center {
  width: 220px;
  height: 220px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(148, 163, 184, 0.32);
  border-radius: 50%;
}

.pitch-mark.box {
  left: 28%;
  right: 28%;
  height: 86px;
  border: 3px solid rgba(148, 163, 184, 0.36);
}

.pitch-mark.box.top {
  top: 18px;
  border-top: 0;
}

.pitch-mark.box.bottom {
  bottom: 18px;
  border-bottom: 0;
}

.lineup-slot {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 88px;
  min-height: 72px;
  padding: 8px;
  border: 3px dashed rgba(148, 163, 184, 0.5);
  border-radius: 8px;
  background: rgba(31, 41, 59, 0.72);
  color: rgba(248, 250, 252, 0.62);
  font-weight: 950;
  text-align: center;
}

.lineup-slot.filled {
  min-height: 96px;
  border-style: solid;
  border-color: rgba(248, 250, 252, 0.55);
  background: rgba(224, 231, 255, 0.15);
  color: var(--text);
}

.lineup-slot strong {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 5px;
  border-radius: 8px;
  background: #020617;
  color: var(--text);
  font-size: 1.15rem;
}

.lineup-slot span {
  font-size: 1.25rem;
}

.lineup-slot.filled span {
  font-size: 0.76rem;
  color: #d9e2ee;
}

.lineup-slot small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 84px;
  margin-top: 4px;
  overflow: hidden;
  color: #d9e2ee;
  font-size: 0.62rem;
  line-height: 1.2;
}

.lineup-meta {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #0e1524;
}

.lineup-meta h2 {
  margin: 0 0 8px;
}

.lineup-meta p {
  margin: 0;
  color: var(--muted);
}

.result-panel {
  padding: 20px;
  border: 1px solid rgba(242, 201, 76, 0.45);
  border-radius: 8px;
  background: #0e1524;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.result-panel h2 {
  margin: 6px 0 0;
  color: var(--gold);
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.92;
}

.result-grade-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.result-grade {
  display: block;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gold);
  color: #17120a;
  font-size: 1.6rem;
  font-weight: 950;
  text-align: center;
  line-height: 1.3;
}

.result-grade.stats-triggered {
  background: var(--blue);
}

.result-grade.iq-perfect {
  background: var(--green);
}

.iq-perfect-msg {
  color: var(--green);
  font-size: 1rem;
  display: block;
  margin-bottom: 4px;
}

.result-label-badge {
  display: block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-panel > p {
  margin: 10px 0 16px;
  color: #d9e2ee;
  font-size: 0.88rem;
}

/* Squad result list */
.squad-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.sr-row {
  display: grid;
  grid-template-columns: 32px 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--panel-soft);
}

.sr-pos {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.sr-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0;
  flex-shrink: 0;
}

.sr-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sr-info strong {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sr-info span {
  font-size: 0.68rem;
  color: var(--muted);
}

.sr-stats {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.sr-stats span {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
}

.sr-stats strong {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.sr-stats em {
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Team totals */
.team-totals {
  display: flex;
  gap: 16px;
  padding: 10px 8px;
  border-top: 1px solid var(--line-soft);
  margin-bottom: 16px;
}

.team-totals span {
  font-size: 0.8rem;
  color: var(--muted);
}

.team-totals strong {
  color: var(--text);
  font-weight: 800;
  margin-right: 4px;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.result-actions button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--gold);
  color: #17120a;
  font-weight: 950;
  flex: 1;
}

.result-actions .share-btn {
  background: #1e3050;
  color: var(--text);
  border: 1px solid var(--line);
}

/* Share modal */
.share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
}

.share-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e1524;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.share-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.share-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.share-preview {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #090d16;
}

.share-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.share-caption {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.share-btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: opacity 120ms ease;
}

.share-btn-social:active { opacity: 0.8; }

.share-btn-social.whatsapp { background: #25d366; color: #fff; }
.share-btn-social.twitter  { background: #000; color: #fff; border: 1px solid #333; }
.share-btn-social.download { background: var(--panel-strong); color: var(--text); border: 1px solid var(--line); }
.share-btn-social.copylink { background: var(--panel-strong); color: var(--text); border: 1px solid var(--line); }

.modal-backdrop,
.position-picker {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(10px);
}

.modal,
.picker-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1524;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
}

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

.modal h2,
.picker-card h2 {
  margin: 12px 0 18px;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1.05;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.how-to-grid div {
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0a1120;
}

.how-to-grid h3 {
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.how-to-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.picker-card {
  width: min(420px, 100%);
}

.picker-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.picker-options button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  font-weight: 950;
}

.picker-note {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 1020px) {
  .game-screen {
    grid-template-columns: 1fr;
  }
  /* Draft panel stays on top on mobile — pitch below */
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .mode-grid,
  .how-to-grid {
    grid-template-columns: 1fr;
  }

  .slot-machine {
    grid-template-columns: 1fr 1fr;
  }

  .spin-button {
    grid-column: 1 / -1;
    min-height: 52px;
  }

  /* Keep draw-summary as 3 columns on mobile */
  .draw-summary {
    gap: 8px;
  }

  /* Touch target sizes */
  .position-tabs button {
    min-height: 44px;
    flex: 1;
  }

  .reroll-bar button {
    min-height: 44px;
  }

  .player-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .player-list {
    max-height: 44vh;
  }

  .pitch {
    min-height: 460px;
  }

  .lineup-slot {
    width: 68px;
    min-height: 60px;
  }

  .lineup-slot.filled {
    min-height: 74px;
  }

  .lineup-slot strong {
    width: 40px;
    height: 40px;
    font-size: 0.94rem;
  }

  .lineup-slot small {
    display: none;
  }

  /* Result screen on small phones */
  .sr-row {
    grid-template-columns: 26px 28px 1fr auto;
    gap: 6px;
    padding: 6px;
  }

  .sr-stats {
    gap: 6px;
  }

  .sr-stats strong {
    font-size: 0.82rem;
  }

  .team-totals {
    gap: 10px;
    font-size: 0.75rem;
  }
}

/* Touch active states (replaces hover on mobile) */
@media (hover: none) {
  .player-row:hover {
    transform: none;
    border-color: var(--line-soft);
    background: #0d1422;
  }

  .player-row:active {
    border-color: var(--gold);
    background: #121b2d;
  }

  .primary-button:active {
    opacity: 0.85;
  }
}
