@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;600;700;800&display=swap');

:root {
  --ink: #111;
  --paper: #f1efe7;
  --acid: #d8ff38;
  --pink: #ff5ba7;
  --blue: #6f8cff;
  --orange: #ff8a38;
  --line: 2px solid var(--ink);
  --radius: 18px;

  /* iPhone / Capacitor safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --topbar-base-height: 78px;
  --topbar-height: calc(var(--topbar-base-height) + var(--safe-top));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(17,17,17,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.055) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  font: 16px/1.45 Inter, system-ui, sans-serif;
}

html,
body {
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: 16px !important;
}

button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: var(--topbar-height);
  padding-top: calc(14px + var(--safe-top));
  padding-right: max(18px, var(--safe-right));
  padding-bottom: 14px;
  padding-left: max(18px, var(--safe-left));
  border-bottom: var(--line);
  background: rgba(241,239,231,.94);
  backdrop-filter: blur(12px);
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: "Archivo Black", Impact, sans-serif;
  line-height: .96;
  letter-spacing: -.035em;
}
h1 { margin: 0; font-size: clamp(24px, 6vw, 40px); }
h2 { font-size: clamp(34px, 10vw, 72px); }
h3 { font-size: 28px; }
.eyebrow {
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

main { width: min(100%, 900px); margin: 0 auto; padding: 24px max(16px, var(--safe-right)) calc(80px + var(--safe-bottom)) max(16px, var(--safe-left)); }
.screen { animation: enter .35s ease both; }
.hidden { display: none !important; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

.hero-card, .panel, .team-card, .winner-card, .selected-venue {
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ink);
  background: #fff;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 340px;
  align-items: end;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--acid);
}
.hero-card h2 { max-width: 650px; margin-bottom: 12px; }
.hero-number {
  position: absolute;
  top: -30px;
  right: -8px;
  font-family: "Archivo Black";
  font-size: 190px;
  line-height: 1;
  opacity: .11;
}

.panel { margin-top: 24px; padding: 22px; border-radius: var(--radius); }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.primary, .secondary, .icon-button, .map-button, .penalty-button {
  border: var(--line);
  color: var(--ink);
  font-weight: 800;
}
.primary, .secondary {
  width: 100%;
  margin-top: 16px;
  min-height: 54px;
  border-radius: 999px;
}
.primary { background: var(--ink); color: #fff; }
.secondary { background: #fff; }
.primary:active, .secondary:active { transform: translate(2px, 2px); }

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pink);
  font-size: 23px;
}

.section-heading { padding: 36px 4px 12px; }
.team-grid { display: grid; gap: 18px; }
.team-card { padding: 24px; border-radius: var(--radius); }
.team-card:first-child { background: var(--acid); }
.team-card:last-child { background: var(--pink); }
.team-card ul { padding: 0; margin: 14px 0 0; list-style: none; font-size: 22px; font-weight: 700; }

.tabs {
  position: sticky;
  z-index: 900;
  top: var(--topbar-height);
  display: grid;
  grid-template-columns: repeat(3,1fr);
  margin: -24px -16px 18px;
  border-bottom: var(--line);
  background: var(--paper);
}
.tab {
  padding: 16px 8px;
  border: 0;
  border-right: var(--line);
  background: transparent;
  font-weight: 800;
}
.tab:last-child { border-right: 0; }
.tab.active { background: var(--acid); }

#map {
  height: 390px;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}

.selected-venue {
  margin: 18px 0 22px;
  padding: 18px;
  border-radius: 14px;
  background: var(--acid);
}
.selected-venue h3 { margin-bottom: 7px; font-size: 24px; }
.selected-venue p { margin-bottom: 12px; }
.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.route-list { display: grid; gap: 12px; }
.route-stop {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: var(--line);
  border-radius: 14px;
  background: #fff;
  transition: .18s ease;
  cursor: pointer;
}
.route-stop:hover { transform: translateY(-2px); }
.route-stop.active {
  background: var(--acid);
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-2px,-2px);
}
.stop-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: var(--line);
  border-radius: 50%;
  background: var(--acid);
  font-family: "Archivo Black";
}
.route-stop.active .stop-number { background: #fff; }
.route-stop p { margin: 3px 0 0; font-size: 13px; color: #555; }
.pub-meta { text-align: right; font-size: 12px; font-weight: 800; }

.score-summary {
  position: sticky;
  z-index: 20;
  top: calc(var(--topbar-height) + 54px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
  padding: 8px 0;
  background: var(--paper);
}
.score-summary > div {
  padding: 14px;
  border: var(--line);
  border-radius: 14px;
  background: #fff;
}
.score-summary strong { display: block; font-size: 24px; }

.venue-score-group {
  margin: 26px 0 34px;
}
.venue-score-heading {
  padding: 18px;
  border: var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ink);
  color: #fff;
}
.venue-score-heading h2 { margin: 0 0 6px; font-size: clamp(27px,7vw,48px); }
.venue-score-heading p { margin: 0; }

.hole-card {
  padding: 18px;
  border: var(--line);
  border-top: 0;
  background: #fff;
}
.hole-card:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 5px 5px 0 var(--ink);
}
.hole-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #bbb;
}
.hole-head h3 { margin: 0; font-size: 22px; }
.hazard {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.challenge { margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--paper); }

.player-score-row {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}
.player-score-row input { min-height: 42px; text-align: center; }

.quick-penalties {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.penalty-button {
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--orange);
  font-size: 11px;
}
.penalty-button:active { transform: translate(1px,1px); }

.rules ol { padding-left: 22px; }
.rules li { margin-bottom: 13px; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule-card { padding: 16px; border: var(--line); background: var(--acid); }
.rule-card:nth-child(even) { background: var(--pink); }

.winner-card {
  margin-top: 50px;
  padding: 30px 22px;
  border-radius: var(--radius);
  text-align: center;
  background: var(--acid);
}
.trophy { font-size: 90px; }
.winner-card h2 { margin-bottom: 12px; }
.final-board { margin-top: 26px; display: grid; gap: 10px; }
.final-row {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  border: var(--line);
  background: #fff;
  text-align: left;
}
.loser-card {
  margin-top: 14px;
  padding: 14px;
  border: var(--line);
  background: var(--pink);
}

footer {
  padding: 24px 24px calc(24px + var(--safe-bottom));
  border-top: var(--line);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

@media (max-width: 600px) {
  .input-grid, .rule-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 420px; }
  #map { height: 330px; }
  :root { --topbar-base-height: 73px; }
  .route-stop { grid-template-columns: 44px 1fr; }
  .route-stop .pub-meta { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; }
}


.connection-status {
  position: sticky;
  z-index: 980;
  top: var(--topbar-height);
  padding: 9px max(16px, var(--safe-right)) 9px max(16px, var(--safe-left));
  border-bottom: var(--line);
  background: var(--orange);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.offline-map-message {
  display: grid;
  height: 100%;
  padding: 28px;
  place-content: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.offline-map-message strong {
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 25px;
}

.offline-map-message span {
  max-width: 330px;
}

.loser-card {
  display: grid;
  gap: 5px;
}

.loser-card .loser-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
}

.loser-card strong {
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(34px, 10vw, 64px);
  line-height: .95;
}

/* ===== V4 setup & game additions ===== */
.muted { color: #666; }
.setup-panel { overflow: hidden; }
.setup-title-row { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.setup-title-row h3 { margin-bottom:0; }
.player-count-control { display:grid; grid-template-columns:44px 48px 44px; align-items:center; border:var(--line); border-radius:999px; overflow:hidden; background:#fff; }
.player-count-control button { height:44px; border:0; background:var(--acid); font-size:22px; font-weight:800; }
.player-count-control strong { text-align:center; font-size:20px; }
.compact-button { width:auto; padding:0 22px; }
.choice-grid { display:grid; gap:12px; }
.choice-grid.two { grid-template-columns:1fr 1fr; }
.choice-card { position:relative; display:block; cursor:pointer; }
.choice-card input { position:absolute; opacity:0; pointer-events:none; }
.choice-card span { display:grid; gap:4px; min-height:110px; padding:18px; border:var(--line); border-radius:14px; background:#fff; transition:.15s ease; }
.choice-card strong { font-family:"Archivo Black", Impact, sans-serif; font-size:24px; }
.choice-card small { color:#666; text-transform:none; }
.choice-card input:checked + span { background:var(--acid); box-shadow:4px 4px 0 var(--ink); transform:translate(-2px,-2px); }
.choice-card.extreme-choice input:checked + span { background:var(--pink); }
.mode-explanation { margin-top:14px; padding:14px; border:1px solid #aaa; border-radius:12px; background:var(--paper); }
.text-button { padding:8px 0; border:0; background:transparent; text-decoration:underline; font-weight:800; }
.venue-choices { display:grid; gap:10px; margin-top:14px; }
.venue-choice { display:grid; grid-template-columns:24px 48px 1fr; align-items:center; gap:10px; padding:12px; border:var(--line); border-radius:14px; background:#fff; text-transform:none; cursor:pointer; }
.venue-choice input { width:20px; min-height:20px; accent-color:#111; }
.venue-choice-number { display:grid; width:42px; height:42px; place-items:center; border:var(--line); border-radius:50%; background:var(--acid); font-family:"Archivo Black"; }
.venue-choice strong, .venue-choice small { display:block; }
.venue-choice small { margin-top:2px; color:#666; }
.course-preview { margin:16px 0 0; padding:14px; border-radius:12px; background:var(--ink); color:#fff; }
.big-start { margin-top:26px; min-height:64px; font-size:18px; }
.game-meta-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 8px; font-size:12px; }
#gameModeBadge { padding:7px 10px; border:var(--line); border-radius:999px; background:var(--pink); font-weight:800; }
.progress-track { height:8px; margin-bottom:18px; border:1px solid var(--ink); background:#fff; overflow:hidden; }
.progress-track span { display:block; width:0; height:100%; background:var(--acid); transition:width .25s ease; }
.hole-team-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.team-hole-panel { padding:14px; border:var(--line); border-radius:14px; background:var(--paper); }
.team-hole-panel.team-0 { box-shadow:inset 6px 0 0 var(--acid); }
.team-hole-panel.team-1 { box-shadow:inset 6px 0 0 var(--pink); }
.team-hole-title { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:12px; }
.sip-target { padding:5px 8px; border:1px solid var(--ink); border-radius:999px; background:#fff; font-size:11px; font-weight:800; white-space:nowrap; }
.sip-target.doubled { background:var(--orange); }
.drinker-select-label { display:grid; gap:5px; text-transform:uppercase; font-size:10px; }
.drinker-select { width:100%; min-height:42px; padding:8px; border:var(--line); border-radius:9px; background:#fff; font:inherit; }
.team-hole-banner { margin-bottom:10px; padding:10px; border:var(--line); background:var(--pink); font-size:11px; font-weight:800; }
.is-team-hole { background:linear-gradient(135deg,#fff 0 80%,rgba(255,91,167,.25)); }
.extreme-hazard { background:var(--pink); }
.powerup-strip { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:center; margin:14px 0; padding:14px; border:var(--line); border-radius:12px; background:var(--blue); color:#fff; }
.powerup-strip > div:first-child { display:grid; grid-template-columns:auto 1fr; column-gap:10px; }
.powerup-strip > div:first-child > span { grid-row:1/3; font-size:28px; }
.powerup-strip small { display:block; }
.powerup-actions { display:flex; flex-wrap:wrap; gap:7px; }
.powerup-button { padding:9px 11px; border:var(--line); border-radius:999px; background:#fff; font-weight:800; }
.powerup-button:disabled { opacity:.55; }
.modal-backdrop { position:fixed; z-index:3000; inset:0; display:grid; place-items:center; padding:calc(20px + var(--safe-top)) max(20px, var(--safe-right)) calc(20px + var(--safe-bottom)) max(20px, var(--safe-left)); background:rgba(17,17,17,.78); }
.powerup-modal { position:relative; width:min(100%,540px); padding:24px; border:var(--line); border-radius:22px; box-shadow:8px 8px 0 #000; background:var(--acid); }
.powerup-modal h2 { margin-bottom:20px; }
.modal-close { position:absolute; top:12px; right:12px; width:40px; height:40px; border:var(--line); border-radius:50%; background:#fff; font-size:24px; }
.powerup-question { font-family:"Archivo Black", Impact, sans-serif; font-size:24px; line-height:1.05; }
.answer-grid { display:grid; gap:10px; }
.answer-button { min-height:52px; padding:12px 14px; border:var(--line); border-radius:12px; background:#fff; text-align:left; font-weight:800; }
.powerup-result { text-align:center; }
.powerup-result > span { display:block; font-size:70px; }
.powerup-result h3 { font-size:34px; }
.powerup-result.success { padding-top:10px; }
.powerup-result.fail { padding-top:10px; }
.individual-board { display:grid; gap:7px; margin-top:24px; text-align:left; }
.individual-row { display:flex; justify-content:space-between; padding:10px 12px; border:1px solid var(--ink); background:#fff; }
.loser-card p { margin:8px 0 0; }

@media (max-width: 650px) {
  .choice-grid.two, .hole-team-grid { grid-template-columns:1fr; }
  .powerup-strip { grid-template-columns:1fr; }
  .setup-title-row { align-items:flex-start; }
  .player-count-control { flex:0 0 auto; }
}


.setup-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.choice-card { display:flex; gap:10px; align-items:center; padding:14px; border:var(--line); border-radius:14px; background:#fff; text-transform:none; cursor:pointer; }
.choice-card input { width:20px; min-height:20px; accent-color:#111; }
.choice-card strong, .choice-card small { display:block; }
.mode-explanation, .course-preview { margin-top:14px; padding:14px; border:var(--line); border-radius:12px; background:var(--acid); }
.mini-button { min-height:38px; padding:0 12px; border:var(--line); border-radius:999px; background:#fff; font-weight:800; }
.venue-manager-list { display:grid; gap:8px; margin:18px 0; }
.venue-manager-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px; border:var(--line); border-radius:12px; background:#fff; }
.venue-manager-row strong, .venue-manager-row small { display:block; }
.venue-manager-row small { color:#666; margin-top:2px; }
.venue-manager-actions { display:flex; gap:6px; }
.mini-button.danger, .danger-text { background:var(--pink); }
.venue-form { padding-top:18px; border-top:var(--line); }
.editor-buttons { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.danger-zone { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:20px; padding-top:18px; border-top:var(--line); }
.empty-state { padding:18px; border:2px dashed var(--ink); border-radius:12px; text-align:center; }
.switcheroo-banner { background:var(--pink) !important; }
.game-status { margin-bottom:10px; }
.game-status > div:first-child { display:flex; justify-content:space-between; gap:10px; margin-bottom:8px; }
.modal-backdrop { position:fixed; z-index:3000; inset:0; display:grid; place-items:center; padding:calc(18px + var(--safe-top)) max(18px, var(--safe-right)) calc(18px + var(--safe-bottom)) max(18px, var(--safe-left)); background:rgba(0,0,0,.72); }
.modal-close { position:absolute; right:12px; top:10px; width:38px; height:38px; border:var(--line); border-radius:50%; background:#fff; font-size:24px; }
.answer-grid { display:grid; gap:9px; margin-top:16px; }
.answer-button { min-height:48px; padding:10px; border:var(--line); border-radius:12px; background:#fff; font-weight:800; }
@media(max-width:600px) {
  .choice-grid, .danger-zone, .editor-buttons { grid-template-columns:1fr; }
  .setup-row { align-items:center; }
  .venue-manager-row { align-items:flex-start; flex-direction:column; }
}


.manual-result-grid { grid-template-columns: 1fr 1fr; }
.manual-correct { background: var(--acid); }
.manual-wrong { background: var(--pink); }
@media (max-width: 600px) {
  .manual-result-grid { grid-template-columns: 1fr; }
}


/* ===== v7 iPhone / Dynamic Island polish ===== */
html, body {
  min-height: 100%;
  background-color: var(--paper);
}

body {
  padding: 0;
}

.topbar {
  /* Background intentionally extends behind the status bar / Dynamic Island.
     Only interactive content is pushed into the safe area. */
  box-sizing: border-box;
}

.icon-button {
  flex: 0 0 44px;
}

@supports (padding: env(safe-area-inset-top)) {
  .topbar {
    padding-top: calc(14px + var(--safe-top));
  }
}


/* v9 — iPhone polish */

button,
input,
select,
textarea {
  font-size: 16px;
}

@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}


.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.rule-card {
  padding: 16px;
  border: var(--line);
  background: var(--acid);
}

.rule-card:nth-child(even) {
  background: var(--pink);
}

@media (max-width: 600px) {
  .rule-grid {
    grid-template-columns: 1fr;
  }
}


/* Prevent iOS from applying its default blue link color */
a,
a:link,
a:visited,
a:hover,
a:active {
  color: inherit !important;
  -webkit-text-fill-color: currentColor;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}



/* ===== Final iOS interactive colour fixes ===== */

/* Light / coloured buttons use dark text */
button,
input[type="button"],
input[type="submit"] {
  color: var(--ink);
  -webkit-text-fill-color: currentColor;
}

/* Dark primary buttons use light text */
button.primary,
.primary {
  color: var(--paper) !important;
  -webkit-text-fill-color: var(--paper) !important;
}

/* Tab and utility buttons stay dark */
.tabs button,
.tab,
.tab.active,
.mini-button,
.penalty-button,
.powerup-button,
.answer-button,
.icon-button,
.text-button {
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
}


/* ===== v10: dynamic teams, shared powerups, splash-ready polish ===== */

.setup-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0 20px;
}

.counter-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.counter-block > span {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
}

.editable-team-card {
  background: var(--team-color) !important;
}

.team-name-label {
  text-transform: none;
  font-size: 11px;
}

.team-name-input {
  margin-top: 4px;
  background: rgba(255,255,255,.88);
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 20px !important;
}

.team-card[data-team] ul {
  margin-top: 16px;
}

.score-summary {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.team-summary-card {
  padding: 14px;
  border: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 6px 0 0 var(--team-color);
}

.team-summary-card strong {
  display: block;
  font-size: 24px;
}

.hole-team-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.team-hole-panel {
  box-shadow: inset 6px 0 0 var(--team-color);
}

.shared-powerup {
  background: var(--blue);
}

.score-bonus {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-size: 10px;
}

@media (max-width: 600px) {
  .setup-counters {
    grid-template-columns: 1fr;
  }

  .hole-team-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== V11 game library / custom game builder ===== */
.game-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

.game-choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  min-height: 180px;
  padding: 22px;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
  text-align: left;
}

.default-game-card { background: var(--acid); }
.custom-game-card { background: var(--pink); }

.game-choice-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(25px, 5vw, 38px);
  line-height: 1;
}

.game-choice-card small {
  display: block;
  font-size: 14px;
  line-height: 1.4;
}

.game-choice-icon { font-size: 34px; }

.saved-games-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.saved-game-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.saved-game-card h3 {
  margin: 0;
  font-size: 23px;
}

.saved-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-hole-editor {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.custom-hole-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  padding: 14px;
  border: var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.custom-hole-number {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: var(--line);
  border-radius: 50%;
  background: var(--acid);
  font-family: "Archivo Black", Impact, sans-serif;
}

.custom-hole-fields {
  display: grid;
  gap: 12px;
}

.custom-hole-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
}

textarea {
  width: 100%;
  padding: 11px 12px;
  border: var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

@media (max-width: 650px) {
  .game-choice-grid { grid-template-columns: 1fr; }
  .game-choice-card { min-height: 150px; }
  .custom-hole-row { grid-template-columns: 1fr; }
  .custom-hole-meta { grid-template-columns: 90px 1fr; }
}


/* ===== V11.1 language + custom power-ups ===== */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
}

.language-button,
.language-choice span {
  min-width: 42px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.language-button.active {
  background: var(--acid);
}

.editor-language-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.editor-language-row > span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.language-choice {
  display: block;
  gap: 0;
  cursor: pointer;
}

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

.language-choice input:checked + span {
  display: block;
  background: var(--acid);
}

.switch-control {
  display: inline-block;
  flex: 0 0 auto;
  cursor: pointer;
}

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

.switch-control span {
  position: relative;
  display: block;
  width: 58px;
  height: 34px;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
}

.switch-control span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: transform .18s ease;
}

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

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

.simple-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  text-transform: none;
  cursor: pointer;
}

.simple-check input {
  width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  accent-color: #111;
}

.custom-powerup-editor {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #aaa;
}

.powerup-reward-options {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
}
