:root {
  color-scheme: light;
  --ink: #19312e;
  --muted: #63736f;
  --paper: #fffdf8;
  --canvas: #f5efe5;
  --surface: #ffffff;
  --primary: #173f3a;
  --primary-2: #245f56;
  --accent: #e6604d;
  --gold: #f4c95d;
  --line: #dedbd2;
  --success: #278567;
  --danger: #bd3e37;
  --shadow: 0 12px 38px rgba(23, 63, 58, 0.11);
  --radius: 12px;
  --font-scale: 1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  font-size: calc(16px * var(--font-scale));
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(244, 201, 93, 0.24), transparent 28rem),
    radial-gradient(circle at -10% 70%, rgba(230, 96, 77, 0.11), transparent 28rem),
    var(--canvas);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

body.game-active {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.game-active .page {
  opacity: 1;
  transform: none;
  animation: none;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 46px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--primary);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  margin-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(23, 63, 58, 0.22);
  font-weight: 900;
}

.brand-logo-mini {
  width: 74px;
  height: 46px;
  margin: -5px -5px -5px -8px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

h1 {
  max-width: 690px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 10vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(1rem, 2.8vw, 1.15rem);
}

.hero {
  display: grid;
  align-content: center;
  min-height: calc(100dvh - 135px);
  padding: 5vh 0 10vh;
}

.hero-logo {
  width: min(84vw, 460px);
  height: auto;
  margin: 0 0 4px -2.5%;
  filter: drop-shadow(0 10px 24px rgba(63, 5, 70, 0.22));
}

.hero-title span {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}

.hero-title span::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 7px;
  border-radius: 99px;
  background: var(--gold);
  content: "";
  transform: rotate(-1.5deg);
}

.hero-actions {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  margin-top: 24px;
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn:active {
  transform: translateY(2px) scale(0.99);
}

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.5;
}

.btn-primary {
  color: white;
  background: var(--primary);
  box-shadow: 0 9px 20px rgba(23, 63, 58, 0.2);
}

.btn-primary:hover {
  background: var(--primary-2);
}

.btn-accent {
  color: white;
  background: var(--accent);
  box-shadow: 0 9px 20px rgba(230, 96, 77, 0.25);
}

.btn-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
}

.btn-danger {
  color: var(--danger);
  background: #fff0ee;
}

.btn-large {
  min-height: 62px;
  padding: 16px 22px;
  border-radius: 8px;
  font-size: 1.08rem;
}

.icon-btn {
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-size: 1.15rem;
}

.page {
  padding-bottom: 30px;
  animation: page-in 220ms ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin-bottom: 5px;
  font-size: clamp(2rem, 8vw, 3.7rem);
}

.card {
  border: 1px solid rgba(30, 71, 65, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.setup-layout {
  display: grid;
  gap: 18px;
}

.setup-section {
  padding: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.choice {
  position: relative;
  display: grid;
  min-height: 100px;
  align-content: start;
  padding: 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: #f5f3ec;
  cursor: pointer;
  text-align: left;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: #eef7f4;
  box-shadow: inset 0 0 0 2px white;
}

.choice strong {
  margin-bottom: 5px;
}

.choice small {
  color: var(--muted);
  line-height: 1.3;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.segment {
  position: relative;
}

.segment input {
  position: absolute;
  opacity: 0;
}

.segment span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  font-weight: 800;
}

.segment input:checked + span {
  border-color: var(--primary);
  color: white;
  background: var(--primary);
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field > span {
  font-size: 0.86rem;
  font-weight: 800;
}

.field input,
.field select {
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.setup-toggle {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.game-mode-choice {
  position: relative;
  display: grid;
  grid-template-columns: minmax(125px, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  min-height: 178px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(5, 18, 30, 0.08);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.game-mode-choice:hover {
  transform: translateY(-2px);
}

.game-mode-choice.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow);
}

.game-mode-art {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 18px;
  background: #e9f2ef;
}

.game-mode-art.game-tetris {
  grid-template-columns: 34px 14px minmax(68px, 1fr);
  gap: 4px;
  padding: 8px;
  background:
    linear-gradient(rgba(85, 217, 202, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 217, 202, 0.08) 1px, transparent 1px),
    #10192d;
  background-size: 18px 18px;
}

.game-mode-art.game-classic {
  padding: 8px;
}

.game-mode-art.game-lms {
  padding: 10px;
  background:
    radial-gradient(circle at 50% 105%, rgba(255, 108, 55, 0.46), transparent 46%),
    linear-gradient(145deg, #351412, #7f1d1d);
}

.classic-ticket-mini {
  display: grid;
  width: min(100%, 230px);
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding: 10px;
  border: 3px solid #173f3a;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 8px 0 rgba(23, 63, 58, 0.15);
}

.classic-ticket-mini i {
  display: grid;
  min-height: 25px;
  place-items: center;
  border-radius: 4px;
  color: #19312e;
  background: #e3e9e6;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
}

.classic-ticket-mini i.called {
  color: white;
  background: #e6604d;
}

.lms-ticket-mini {
  display: grid;
  width: min(100%, 230px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 12px;
  border: 3px solid #ffb14a;
  border-radius: 9px;
  background: #fff9ed;
  box-shadow: 0 0 0 4px rgba(255, 76, 48, 0.2), 0 10px 28px rgba(20, 2, 1, 0.42);
}

.lms-ticket-mini i {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #6e1b12;
  background: #ffd477;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 950;
}

.lms-ticket-mini i.burned {
  color: #987d79;
  background: #302725;
  text-decoration: line-through;
  opacity: 0.58;
}

.lms-ticket-mini b {
  grid-column: 1 / -1;
  color: #c12b1c;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.mode-colour-card {
  width: 34px;
  height: 64px;
  border: 3px solid white;
  border-radius: 10px;
  background: #55d9ca;
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.24);
}

.mode-arrow {
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.mode-board-mini {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 5px;
  border: 1px solid #52617a;
  border-radius: 8px;
  background: #17223a;
}

.mode-board-mini i {
  display: grid;
  min-height: 22px;
  place-items: center;
  border-radius: 3px;
  color: white;
  background: #7b61a8;
  font-size: 0.48rem;
  font-style: normal;
  font-weight: 900;
}

.mode-board-mini i.region-1 { background: #d28b31; }
.mode-board-mini i.region-2 { background: #2f80a3; }
.mode-board-mini i.region-3 { background: #bf4f82; }

.mode-board-mini i.target {
  color: #082925;
  background: #55d9ca;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.game-mode-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 16px 18px 17px;
}

.mode-kicker {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-mode-copy strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.game-mode-copy small {
  min-height: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.mode-status {
  width: max-content;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 4px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--paper));
  font-size: 0.72rem;
  font-weight: 900;
}

.game-mode-choice.selected .mode-status {
  color: white;
  background: var(--primary);
}

.game-mode-carousel {
  position: relative;
  display: grid;
  width: min(100%, 720px);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.game-mode-slide {
  overflow: hidden;
  min-width: 0;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent), var(--shadow);
}

.game-mode-visual {
  position: relative;
  display: grid;
  height: clamp(190px, 42vw, 290px);
  place-items: center;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.98), rgba(239, 240, 228, 0.9) 70%),
    var(--paper);
}

.game-mode-slide.game-tetris .game-mode-visual {
  background:
    linear-gradient(rgba(23, 63, 58, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 63, 58, 0.05) 1px, transparent 1px),
    #f7f7ed;
  background-size: 22px 22px;
}

.game-mode-slide.game-lms .game-mode-visual {
  background:
    radial-gradient(circle at 50% 110%, rgba(255, 139, 48, 0.72), transparent 48%),
    linear-gradient(145deg, #2d110d, #7f1d1d 62%, #b53620);
}

.game-mode-visual > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.game-mode-carousel .game-mode-copy {
  justify-items: center;
  gap: 6px;
  padding: 15px 20px 17px;
  text-align: center;
}

.game-mode-carousel .game-mode-copy h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.8vw, 1.7rem);
  line-height: 1.1;
}

.game-mode-carousel .game-mode-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.game-mode-carousel .mode-status {
  margin-top: 4px;
  color: white;
  background: var(--primary);
}

.game-mode-arrow {
  position: absolute;
  z-index: 2;
  top: calc(clamp(190px, 42vw, 290px) / 2 - 36px);
  display: grid;
  width: 48px;
  height: 72px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 5px 14px rgba(5, 18, 30, 0.1);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 950;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.game-mode-arrow.previous {
  left: 12px;
}

.game-mode-arrow.next {
  right: 12px;
}

.game-mode-arrow:hover,
.game-mode-arrow:focus-visible {
  color: white;
  background: var(--primary);
  transform: translateY(-2px);
}

.game-mode-dots {
  display: flex;
  grid-column: 1;
  justify-content: center;
  gap: 7px;
}

.game-mode-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: width 160ms ease, background 160ms ease;
}

.game-mode-dots i.active {
  width: 22px;
  border-radius: 4px;
  background: var(--primary);
}

.lms-carousel-art {
  position: relative;
  display: grid;
  width: min(88%, 390px);
  height: 100%;
  place-items: center;
}

.lms-carousel-flame {
  position: absolute;
  right: 3%;
  bottom: -18%;
  font-size: clamp(7rem, 23vw, 11rem);
  filter: drop-shadow(0 0 18px rgba(255, 193, 61, 0.72));
  opacity: 0.8;
  transform: rotate(7deg);
}

.lms-carousel-ticket {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: clamp(16px, 4vw, 26px);
  border: 4px solid #ffbe55;
  border-radius: 10px;
  background: #fff9ed;
  box-shadow: 0 0 0 6px rgba(255, 76, 48, 0.22), 0 18px 34px rgba(20, 2, 1, 0.5);
}

.lms-carousel-ticket i {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #6e1b12;
  background: #ffd477;
  font-size: clamp(0.65rem, 2.6vw, 1.05rem);
  font-style: normal;
  font-weight: 950;
}

.lms-carousel-ticket i.burned {
  color: #aa8f8b;
  background: #302725;
  text-decoration: line-through;
  opacity: 0.68;
}

.lms-carousel-ticket b {
  grid-column: 1 / -1;
  color: #c12b1c;
  font-size: clamp(0.72rem, 2.6vw, 1rem);
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.setup-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tetris-format-stats,
.lms-format-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tetris-format-stats strong,
.lms-format-stats strong {
  display: grid;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary) 7%, var(--paper));
  font-size: 0.7rem;
  line-height: 1.25;
}

.tetris-format-stats span,
.lms-format-stats span {
  color: var(--ink);
  font-size: 1.25rem;
}

.stage-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.stage-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--primary);
  font-size: 0.8rem;
  font-weight: 900;
}

.stage-actions {
  display: flex;
  gap: 4px;
}

.stage-actions button {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: #f0eee8;
  cursor: pointer;
}

.setup-footer {
  position: sticky;
  z-index: 5;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  background: rgba(245, 239, 229, 0.84);
  backdrop-filter: blur(14px);
}

.setup-footer .btn {
  width: 100%;
}

/* Line roster */
.line-builder-page {
  max-width: 840px;
  margin: 0 auto;
}

.line-builder-card {
  display: grid;
  gap: 18px;
}

.line-builder-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.line-builder-summary > div {
  display: grid;
}

.line-builder-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.line-builder-summary strong {
  font-size: 2.2rem;
  line-height: 1;
}

.line-builder-summary strong small {
  color: var(--muted);
  font-size: 0.9rem;
}

.line-builder-summary p,
.line-roster-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.line-add-toolbar {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(130px, auto);
  align-items: end;
  justify-content: start;
  gap: 10px;
}

.line-add-toolbar .btn {
  min-height: 48px;
}

.line-roster {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-roster-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 38px;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 6px;
  background: var(--paper);
}

.line-number-badge {
  align-self: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.line-roster-row .field {
  gap: 4px;
}

.line-roster-row .field label {
  color: var(--muted);
  font-size: 0.7rem;
}

.line-roster-row .field label small {
  font-weight: 600;
}

.line-roster-row .field input {
  min-height: 40px;
}

.line-remove {
  display: grid;
  width: 38px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
}

.line-roster-empty {
  padding: 30px 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  text-align: center;
}

.line-builder-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.line-builder-footer > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.line-builder-footer .btn {
  width: auto;
}

/* Game */
.game-shell {
  width: 100%;
  max-width: 1500px;
  padding: max(10px, env(safe-area-inset-top)) 10px max(16px, env(safe-area-inset-bottom));
}

.game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.target-bar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.78);
}

.target-bar span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.target-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(145px, 0.92fr);
  gap: 9px;
  height: calc(100dvh - 225px);
  min-height: 390px;
}

.tickets-panel {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.tickets-panel {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 9px;
  padding-right: 2px;
}

.board-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 9px;
  border: 1px solid rgba(23, 63, 58, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.now-card {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 8px 9px;
  overflow: hidden;
  border-radius: 9px;
  color: white;
  background: var(--primary);
}

.now-copy small {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.now-number {
  font-size: clamp(2.2rem, 10vw, 3.5rem);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.previous-wrap {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.previous-wrap small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.previous-ball {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.recent-row {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
  overflow: hidden;
}

.recent-ball {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: #ece9e1;
  font-size: 0.6rem;
  font-weight: 850;
}

.ball-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.ball-board:not(.tetris-ball-board) {
  --board-rows: 18;
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: repeat(var(--board-rows), minmax(0, 1fr));
  gap: 2px 4px;
}

.ball-board:not(.tetris-ball-board)[data-ball-count="75"] {
  --board-rows: 15;
}

.ball-board:not(.tetris-ball-board) .ball {
  width: auto;
  max-width: 100%;
  height: 100%;
  justify-self: center;
  aspect-ratio: 1;
}

.ball {
  display: grid;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #9caaa6;
  background: #e7e9e5;
  font-size: clamp(0.58rem, 2.6vw, 0.82rem);
  font-weight: 850;
}

.ball.called {
  color: white;
  background: var(--primary);
}

.ball.latest {
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(244, 201, 93, 0.3);
  animation: pop 280ms ease-out;
}

@keyframes pop {
  0% { transform: scale(0.55); }
  70% { transform: scale(1.12); }
}

.ticket {
  --ticket-color: var(--accent);
  position: relative;
  padding: 10px 8px 9px 13px;
  overflow: hidden;
  border: 1px solid rgba(23, 63, 58, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(23, 63, 58, 0.08);
}

.ticket::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: var(--ticket-color);
  content: "";
}

.ticket.winner {
  box-shadow: 0 0 0 3px var(--ticket-color), 0 10px 28px rgba(23, 63, 58, 0.18);
}

.ticket.one-away {
  border-color: color-mix(in srgb, var(--gold) 82%, #9b6a00);
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 72%, transparent),
    0 0 22px color-mix(in srgb, var(--gold) 58%, transparent);
  animation: one-away-glow 1.25s ease-in-out infinite alternate;
}

.ticket.one-away::before {
  background: var(--gold);
}

.ticket.one-away .progress-text {
  padding: 2px 5px;
  border-radius: 4px;
  color: #503700;
  background: var(--gold);
  font-weight: 950;
}

.ticket.lms-ticket .ticket-number.marked:not(.blank) {
  color: #8d7772;
  background: #342d2b;
  box-shadow: inset 0 0 0 1px #6f5650;
  text-decoration: line-through;
  opacity: 0.5;
}

.ticket.lms-danger {
  border-color: #ff543f;
  background: color-mix(in srgb, #ff3d2e 11%, var(--paper));
  box-shadow: 0 0 0 2px rgba(255, 67, 45, 0.78), 0 0 26px rgba(255, 54, 30, 0.72);
  animation: lms-danger-glow 0.82s ease-in-out infinite alternate;
}

.ticket.lms-danger::before {
  background: #ff3d2e;
}

.ticket.lms-danger::after {
  position: absolute;
  top: -2px;
  right: 5px;
  content: "🔥";
  filter: drop-shadow(0 2px 4px rgba(132, 18, 0, 0.55));
  font-size: 1.25rem;
  transform-origin: 50% 100%;
  animation: lms-flame 0.48s ease-in-out infinite alternate;
}

.ticket.lms-danger .ticket-head {
  padding-right: 25px;
}

.ticket.lms-danger .progress-text {
  padding: 2px 5px;
  border-radius: 4px;
  color: white;
  background: #d92d20;
  font-weight: 950;
}

.ticket.lms-danger .ticket-number:not(.marked):not(.blank) {
  color: #7e180f;
  background: #ffd4bd;
  box-shadow: inset 0 0 0 2px #ff5a3c;
}

.ticket.lms-out {
  filter: grayscale(1);
  opacity: 0.36;
}

.ticket.lms-out .progress-text {
  color: #76251e;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes lms-danger-glow {
  from { box-shadow: 0 0 0 2px rgba(255, 67, 45, 0.66), 0 0 14px rgba(255, 54, 30, 0.4); }
  to { box-shadow: 0 0 0 3px rgba(255, 147, 55, 0.92), 0 0 32px rgba(255, 42, 18, 0.82); }
}

@keyframes lms-flame {
  from { transform: rotate(-7deg) scale(0.9); }
  to { transform: rotate(7deg) scale(1.12); }
}

@keyframes one-away-glow {
  from {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 62%, transparent),
      0 0 12px color-mix(in srgb, var(--gold) 35%, transparent);
  }
  to {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 88%, transparent),
      0 0 28px color-mix(in srgb, var(--gold) 72%, transparent);
  }
}

.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 3px 7px;
  font-size: 0.71rem;
}

.ticket-head strong {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.ticket-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ticket-color);
}

.progress-text {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.ticket-grid {
  display: grid;
  gap: 2px;
}

.ticket-grid.cols-9 {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

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

.ticket-number {
  display: grid;
  min-width: 0;
  aspect-ratio: 1.1;
  place-items: center;
  border-radius: 5px;
  color: var(--ink);
  background: #f1efe8;
  font-size: clamp(0.55rem, 2.6vw, 0.84rem);
  font-weight: 850;
}

.ticket-number.blank {
  color: transparent;
  background: transparent;
}

.ticket-number.marked {
  color: white;
  background: var(--ticket-color);
  animation: mark-in 240ms ease-out;
}

.ticket-number.free {
  color: var(--primary);
  background: #dceee9;
  font-size: 0.52rem;
}

.ticket-row-complete {
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px var(--gold);
}

.tickets-panel.shape-players-panel {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(15, minmax(0, 1fr));
  gap: 3px;
  overflow: hidden;
}

.shape-player {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(48px, auto) minmax(0, 1fr) 25px;
  align-items: center;
  gap: 5px;
  padding: 2px 5px 2px 9px;
  border-radius: 8px;
}

.shape-player .ticket-head,
.shape-player .shape-player-body {
  display: contents;
}

.shape-player .ticket-head strong {
  grid-row: 1;
  grid-column: 1;
  margin: 0;
  font-size: 0.58rem;
  white-space: nowrap;
}

.shape-player .ticket-head .progress-text {
  grid-row: 1;
  grid-column: 3;
  font-size: 0.52rem;
  text-align: right;
}

.player-colour-swatch {
  display: block;
  grid-row: 1;
  grid-column: 2;
  width: 100%;
  min-height: 15px;
  border: 1px solid color-mix(in srgb, var(--ticket-color) 78%, white);
  border-radius: 5px;
  background: var(--ticket-color);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.tetris-panel .now-card {
  min-height: 78px;
  margin-bottom: 5px;
  padding: 10px;
}

.tetris-panel .recent-row {
  margin-bottom: 4px;
}

.ball-board.tetris-ball-board {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
}

.ball-board.tetris-ball-board .tetris-ball {
  min-height: 25px;
  aspect-ratio: 1.05;
  border: 1px solid color-mix(in srgb, var(--block-color) 46%, #10182b);
  border-radius: 3px;
  color: color-mix(in srgb, var(--block-color) 45%, white);
  background: color-mix(in srgb, var(--block-color) 48%, #17223a);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
}

.ball-board.tetris-ball-board .tetris-ball.shape-target {
  border-width: 2px;
  color: white;
  background: color-mix(in srgb, var(--block-color) 74%, #17223a);
}

.ball-board.tetris-ball-board .tetris-ball.called {
  color: #081819;
  background: var(--block-color);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 9px color-mix(in srgb, var(--block-color) 45%, transparent);
}

.ball-board.tetris-ball-board .tetris-ball.latest {
  color: #111;
  background: white;
  box-shadow: 0 0 0 3px var(--block-color), inset 0 -4px 0 rgba(0, 0, 0, 0.16);
}

@keyframes mark-in {
  from { transform: rotate(-12deg) scale(0.45); }
}

.game-controls {
  position: fixed;
  z-index: 20;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(9px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 10px;
  background: rgba(245, 239, 229, 0.88);
  box-shadow: 0 10px 35px rgba(23, 63, 58, 0.2);
  backdrop-filter: blur(16px);
}

.game-controls .btn {
  min-height: 55px;
  padding: 10px 13px;
}

.game-controls .auto-control {
  min-width: 76px;
}

.control-menu {
  position: fixed;
  z-index: 30;
  right: 12px;
  bottom: 82px;
  left: 12px;
  display: grid;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.control-menu[hidden] {
  display: none;
}

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

.auto-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
}

/* Settings / guide / summary */
.content-stack {
  display: grid;
  gap: 12px;
}

.content-stack > .page-header {
  margin-bottom: 0;
}

.settings-card {
  padding: 15px 16px;
}

.settings-card h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.settings-grid {
  display: grid;
  gap: 0;
}

.settings-grid > .field,
.settings-grid > .toggle-row {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.settings-grid > :first-child {
  border-top: 0;
}

.settings-grid .field input:not([type="range"]),
.settings-grid .field select,
.settings-grid .field .btn {
  min-height: 42px;
  border-radius: 5px;
}

.toggle-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toggle-copy {
  display: grid;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 0.75rem;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: #c9cfcc;
  cursor: pointer;
  pointer-events: none;
  transition: background 150ms ease;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 50px;
  align-items: center;
  gap: 12px;
}

.range-row input {
  width: 100%;
  accent-color: var(--primary);
}

.guide-grid {
  display: grid;
  gap: 12px;
  counter-reset: guide;
}

.guide-step {
  position: relative;
  padding: 18px 18px 18px 68px;
  counter-increment: guide;
}

.guide-step::before {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--primary);
  content: counter(guide);
  font-weight: 900;
}

.guide-step p {
  margin-bottom: 0;
  color: var(--muted);
}

.summary-hero {
  padding: 28px 20px;
  color: white;
  background: var(--primary);
}

.summary-brand-logo {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin: -8px 0 16px;
  border-radius: 8px;
}

.summary-hero h1 {
  margin-bottom: 7px;
  font-size: clamp(2.1rem, 9vw, 4rem);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat {
  padding: 17px;
}

.stat small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-weight: 750;
}

.stat strong {
  font-size: 1.15rem;
}

.win-list {
  display: grid;
  gap: 8px;
}

.win-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.win-row .ticket-dot {
  width: 12px;
  height: 12px;
}

.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

/* Modal and toast */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(11, 25, 23, 0.52);
  backdrop-filter: blur(5px);
  animation: fade-in 150ms ease;
}

.modal {
  width: min(100%, 480px);
  max-height: min(88vh, 700px);
  padding: 24px;
  overflow: auto;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 25px 70px rgba(6, 20, 18, 0.35);
  animation: modal-in 200ms ease-out;
}

.modal-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-size: 1.6rem;
}

.modal.win-modal {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.modal.win-modal::before {
  position: absolute;
  inset: -35% -20% auto;
  height: 180px;
  background: repeating-conic-gradient(var(--gold) 0 10deg, transparent 10deg 20deg);
  content: "";
  opacity: 0.18;
}

.win-identities {
  position: relative;
  display: grid;
  gap: 7px;
  margin: 10px 0 16px;
}

.win-identity {
  display: grid;
  gap: 2px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--winner-color, var(--accent));
  border-radius: 7px;
  background: color-mix(in srgb, var(--winner-color, var(--accent)) 8%, var(--paper));
  text-align: left;
}

.win-identities:has(.win-identity:only-child) .win-identity {
  padding: 17px 18px;
  text-align: center;
}

.win-identity strong {
  font-size: clamp(1.35rem, 7vw, 2.15rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.win-identity span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 850;
}

.win-result-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.modal-actions.one {
  grid-template-columns: 1fr;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { transform: translateY(20px) scale(0.98); }
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 750;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

body.high-contrast {
  --ink: #111;
  --muted: #333;
  --paper: #fff;
  --canvas: #f4f4f4;
  --primary: #003c35;
  --accent: #b92d1c;
  --line: #777;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 759px) {
  .game-grid {
    height: calc(100dvh - 170px);
    min-height: 0;
  }
}

@media (min-width: 760px) {
  .game-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-mode-choice {
    grid-template-columns: 1fr;
    min-height: 270px;
  }

  .game-mode-art {
    min-height: 132px;
  }

  .game-mode-art.game-tetris {
    grid-template-columns: 48px 24px minmax(104px, 138px);
    gap: 8px;
    padding: 18px;
  }

  .game-mode-art.game-classic {
    padding: 18px;
  }

  .mode-colour-card {
    width: 46px;
    height: 74px;
  }

  .mode-arrow {
    font-size: 1.45rem;
  }

  .game-mode-copy small {
    min-height: 3.8em;
  }

  .shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .hero {
    padding-left: 5vw;
  }

  .setup-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .setup-section.wide {
    grid-column: 1 / -1;
  }

  .setup-footer .btn {
    width: auto;
    min-width: 240px;
  }

  .game-shell {
    padding: 15px 18px 18px;
  }

  .game-grid {
    grid-template-columns: minmax(390px, 1.2fr) minmax(330px, 0.8fr);
    height: calc(100dvh - 210px);
    gap: 14px;
  }

  .board-panel {
    padding: 13px;
  }

  .ball-board {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 5px;
  }

  .ball-board:not(.tetris-ball-board) {
    --board-rows: 9;
  }

  .ball-board:not(.tetris-ball-board)[data-ball-count="75"] {
    --board-rows: 8;
  }

  .tickets-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ticket-number {
    font-size: clamp(0.72rem, 1.45vw, 0.92rem);
  }

  .summary-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .guide-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-backdrop {
    place-items: center;
  }
}

@media (min-width: 1100px) {
  .game-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ball-board {
    grid-template-columns: repeat(15, minmax(0, 1fr));
  }

  .ball-board:not(.tetris-ball-board) {
    --board-rows: 6;
  }

  .ball-board:not(.tetris-ball-board)[data-ball-count="75"] {
    --board-rows: 5;
  }

  .game-grid {
    grid-template-columns: minmax(620px, 1.45fr) minmax(430px, 0.75fr);
  }

  .tickets-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .game-mode-carousel {
    gap: 6px;
  }

  .game-mode-arrow {
    top: 59px;
    width: 38px;
    height: 62px;
  }

  .game-mode-visual {
    height: 180px;
    padding: 0;
  }

  .game-mode-carousel .game-mode-copy {
    padding: 13px 12px 15px;
  }

  .shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .setup-section {
    padding: 16px;
  }

  .choice {
    padding: 12px;
  }

  .game-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(126px, 0.88fr);
  }

  .board-panel {
    padding: 7px;
  }

  .now-card {
    min-height: 74px;
    padding: 7px;
  }

  .ball-board {
    gap: 3px;
  }

  .ticket {
    padding-right: 5px;
  }

  .game-controls .auto-control {
    min-width: 64px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

@media (min-width: 391px) and (max-width: 520px) {
  .game-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.8fr);
  }

  .ticket:not(.shape-player) {
    padding-top: 7px;
    padding-bottom: 6px;
  }

  .ticket:not(.shape-player) .ticket-head {
    margin-bottom: 4px;
  }

  .ticket:not(.shape-player) .ticket-grid {
    gap: 1px 2px;
  }

  .ticket:not(.shape-player) .ticket-number {
    height: 14px;
    min-height: 14px;
    aspect-ratio: auto;
    font-size: 0.58rem;
    line-height: 1;
  }

  .shape-player {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}
