/* Kurve & Köpfchen overhaul: one responsive, brand-faithful visual system.
   URLs, IDs, labels, and game behavior remain in the existing markup and scripts. */
:root {
  --kk-ink: #101d16;
  --kk-ink-soft: #314139;
  --kk-paper: #f4f0e6;
  --kk-surface: #fffdf8;
  --kk-field: #e7ece5;
  --kk-line: rgba(16, 29, 22, .18);
  --kk-lime: #c9ff35;
  --kk-orange: #ff5b24;
  --kk-good: #1f7a43;
  --kk-bad: #b3261e;
  --kk-radius: 12px;
  --kk-radius-large: 18px;
  --paper: var(--kk-paper);
  --paper-2: var(--kk-field);
  --surface: var(--kk-surface);
  --ink: var(--kk-ink);
  --ink-2: var(--kk-ink-soft);
  --line: var(--kk-line);
  --lime: var(--kk-lime);
  --orange: var(--kk-orange);
  --r: var(--kk-radius);
  --radius: var(--kk-radius-large);
}

html { background: var(--kk-paper); }
body, body.tr-body {
  min-height: 100dvh;
  background: var(--kk-paper);
  color: var(--kk-ink);
  font-family: "DM Sans", system-ui, sans-serif;
}
body::before { display: none; }
button, input, select { font-family: inherit; }
:focus-visible {
  outline: 3px solid var(--kk-ink) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--kk-lime) 68%, transparent) !important;
}

/* Shared controls use one radius, a real hit area, and an actual press response. */
.btn, .mode-action, .seg, .mode-btn, .field, .tr-input, .blitz-option, .schaetz-step,
.home-entry, .launch-mode, .solo-header a, .topbar-back {
  border-radius: var(--kk-radius) !important;
}
.btn, .mode-action, .seg, .mode-btn, .blitz-option, .schaetz-step {
  min-height: 48px;
  transition: transform 150ms ease, background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn-primary, .mode-action:not(.mode-action--secondary), .home-entry--daily .home-entry-action,
.launch-action, .home-primary-mode .home-bots-card {
  background: var(--kk-lime) !important;
  color: var(--kk-ink) !important;
  border-color: var(--kk-ink) !important;
  box-shadow: 0 3px 0 var(--kk-ink) !important;
}
.btn-primary:active:not(:disabled), .mode-action:active, .seg:active:not(:disabled),
.mode-btn:active, .blitz-option:active, .schaetz-step:active { transform: translateY(2px); }
.btn:disabled, .mode-action:disabled { opacity: .46; box-shadow: none !important; }

/* The opening screen keeps its wordmark and player illustration, but reads as one clear starting point. */
#start.view.is-active {
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--kk-paper);
}
#start .launch-shell { max-width: 1120px; }
#start .launch-cover {
  min-height: 360px;
  border-radius: var(--kk-radius-large);
  background: var(--kk-field);
}
#start .launch-intro { padding: 34px 0 30px 32px; }
#start .launch-description h1, #start .launch-mode h2 {
  color: var(--kk-ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
}
#start .launch-description p, #start .launch-detail { color: var(--kk-ink-soft); }
#start .launch-mode {
  min-height: 196px;
  border-color: var(--kk-line);
  background: var(--kk-surface);
  box-shadow: none;
}
#start .launch-mode--daily { background: var(--kk-field); }
#start .launch-mode:active { transform: translateY(2px); }
@media (hover: hover) { #start .launch-mode:hover { transform: translateY(-2px); } }

/* Entry pages are deliberate lists, not a partly empty card collection. */
.solo-header {
  width: min(100%, 760px);
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  border-bottom: 1px solid var(--kk-line);
}
.solo-main { max-width: 760px; padding: 36px 20px 48px; }
.solo-main h1, .solo-main .mode-form h2 {
  color: var(--kk-ink);
  font:800 clamp(30px, 8vw, 42px)/1 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -.035em;
}
.mode-list { margin: 4px 0 0; }
.mode-row {
  grid-template-columns: 40px minmax(0, 1fr) 22px;
  gap: 14px;
  min-height: 82px;
  padding: 16px 0;
  border-bottom: 1px solid var(--kk-line);
}
.mode-row::after { display: none; }
.mode-row .mode-icon {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--kk-paper-2, #E4EAF4); color: var(--kk-dark, #1B2944);
}
.mode-row .mode-copy strong { font-size: clamp(21px, 5vw, 26px); }
.mode-row .mode-copy > span { color: var(--kk-ink-soft); font-size: 15px; }
.mode-row--quiet { margin-top: 0; border-top: 0; }
.mode-row--quiet .mode-copy strong { font-size: clamp(21px, 5vw, 26px); }
.mode-form { gap: 14px; max-width: 520px; }
.mode-form label, .tr-label { color: var(--kk-ink); font-size: 15px; }
.mode-form input, .field, .tr-input {
  min-height: 54px;
  border: 1px solid var(--kk-line) !important;
  border-radius: var(--kk-radius) !important;
  background: var(--kk-surface) !important;
  color: var(--kk-ink) !important;
}
.mode-form input::placeholder, .field::placeholder, .tr-input::placeholder { color: #5c6862; opacity: 1; }
.form-divider { background: var(--kk-line); }
.mode-action--secondary { background: transparent; color: var(--kk-ink); border-color: var(--kk-line); }

/* Shared game shell: full width on phones, contained and calm above them. */
.topbar, body:not(.in-match) .topbar {
  height: 60px;
  padding-inline: max(16px, calc((100vw - 960px) / 2));
  border-bottom: 1px solid var(--kk-line);
  background: var(--kk-paper);
}
.topbar .brand { font: 700 15px/1 "DM Sans", system-ui, sans-serif; }
.topbar .brand-ball { background: var(--kk-lime); }
.play-view { min-height: 100dvh; padding: 0; background: var(--kk-paper); }
#game-stage { max-width: 960px; }
.panel, .panel.darts, .panel.guess, .panel.question, .panel.review, .panel.result, .panel.lobby {
  max-width: 860px;
  padding: 22px clamp(16px, 4vw, 32px) calc(32px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.match-top {
  min-height: 44px;
  margin: 0 0 18px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--kk-line);
}
.match-top .round-tag, .kicker, .career-kicker, .darts-score-label, .tr-head .kicker {
  color: var(--kk-ink-soft);
  font: 700 12px/1.2 "DM Sans", system-ui, sans-serif;
  letter-spacing: .06em;
}
.match-top .icon-btn { min-height: 40px; width: 40px; border: 0; background: transparent; box-shadow: none; }
.sec { margin: 30px 0 14px; font:800 23px/1 "Barlow Condensed", Impact, sans-serif; letter-spacing: -.025em; text-transform: none; }
.sec small { color: var(--kk-ink-soft); font-family: "DM Sans", system-ui, sans-serif; font-size: 14px; }

/* Lobby: the mode grid remains completely visible and the start action follows the content. */
.code-card {
  border: 0;
  border-radius: var(--kk-radius-large);
  background: var(--kk-ink);
  box-shadow: none;
}
.code-card > span, .code-card strong { color: var(--kk-surface); }
.code-card > span { color: var(--kk-lime); font-size: 13px; }
.code-actions .btn { min-height: 46px; border-color: rgba(255,255,255,.6); background: transparent; color: var(--kk-surface); box-shadow: none; }
.lobby-list { gap: 0; }
.lobby-row { min-height: 58px; padding: 10px 0; border-bottom: 1px solid var(--kk-line); }
.lobby-row.is-empty { border: 1px dashed var(--kk-line); border-radius: var(--kk-radius); padding: 10px; }
.mode-btns { gap: 10px; }
.mode-btn { min-height: 106px; border: 1px solid var(--kk-line); border-radius: var(--kk-radius); box-shadow: none; background: var(--kk-surface); }
.mode-btn.is-on { border-color: var(--kk-ink); background: var(--kk-lime); box-shadow: inset 0 -3px 0 var(--kk-ink); }
.mode-btn .mode-icon { display: none; }
.mode-btn .mode-label { font-size: 16px; }
.mode-btn .mode-desc { color: var(--kk-ink-soft); font-size: 13px; }
.rules { padding: 0; border: 0; background: transparent; }
.rules > div { margin-top: 18px; }
.rules > div > b { font-size: 16px; }
.rules > div > span { color: var(--kk-ink-soft); font-size: 14px; }
.segs { gap: 8px; }
.seg { min-height: 48px; border: 1px solid var(--kk-ink); background: var(--kk-surface); box-shadow: none; }
.seg.is-on { background: var(--kk-ink); color: var(--kk-lime); }
.lobby .sticky-cta {
  position: static;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.lobby .sticky-cta .btn { min-height: 54px; }

/* Gameplay surfaces privilege the task and reserve the bottom edge for the next move. */
.status, .guess-turn-state, .career-turn-state {
  min-height: 56px;
  border: 0;
  border-radius: var(--kk-radius);
  background: var(--kk-field);
  box-shadow: none;
}
.status.is-mine, .guess-turn-state.is-mine, .career-turn-state.is-mine { background: var(--kk-ink); color: var(--kk-surface); }
.question-line, .lastmove { border-radius: var(--kk-radius); }
.tcard, .gc-row, .darts-pod, .blitz-option, .tr-card {
  border-color: var(--kk-line) !important;
  box-shadow: none !important;
}
.tcard, .tr-card { min-height: 56px; border-radius: var(--kk-radius); background: var(--kk-surface); }
.edge, .tr-head .edge { color: var(--kk-ink-soft); font-size: 13px; letter-spacing: .04em; }
.rail, .tr-rail, .sticky-cta, .schaetz-controls-sticky, .schaetz-footer {
  background: var(--kk-ink);
  color: var(--kk-surface);
  border: 0;
  box-shadow: none;
}
.rail, .tr-rail { border-radius: var(--kk-radius-large) var(--kk-radius-large) 0 0; }
.rail .dcard, .tr-current { border-radius: var(--kk-radius); }
.rail .dcard, .tr-current { background: var(--kk-surface); color: var(--kk-ink); }
.gc-row { border-radius: var(--kk-radius); }
.gc-chip { min-height: 54px; border-radius: 8px; }
.gc-chip .gc-lab, .gc-chip small, .gc-row-who, .career-guess-meta { font-size: 12px; }
.gmh-name, .pchip-name, .darts-name { font-size: 13px !important; }
.gmh-player-state, .gmh-era, .gmh-tips, .gc-chip-lbl, .gc-row-who,
.darts-pod-total, .darts-pod-picks-label { font-size: 11px !important; }
.gc-chip-lbl { letter-spacing: .02em; }
.guess-input, .darts-input { z-index: 20; }
.guess-input-row, .darts-input-row { gap: 10px; }
.guess-input .btn, .darts-input .btn { min-width: 108px; }
.guess-suggestions, .darts-suggestions { border: 1px solid var(--kk-line); border-radius: var(--kk-radius); box-shadow: 0 12px 28px rgba(16,29,22,.14); }

/* Darts has a compact, legible score board rather than competing tiles. */
.darts-cat-header { padding: 4px 0 16px; border-bottom: 1px solid var(--kk-line); }
.darts-board { gap: 10px; }
.darts-pod { min-height: 142px; border: 0 !important; border-radius: var(--kk-radius); background: var(--kk-field); }
.darts-pod.is-active { background: var(--kk-ink); color: var(--kk-surface); }
.darts-pod.is-active .darts-score-num { color: var(--kk-lime); }
.darts-score-num { font-size: clamp(38px, 10vw, 54px); }
.darts-pod-total, .darts-pod-last { font-size: 13px; }
.darts-action { position: static; margin: 28px 0 0; padding: 0; border: 0; background: transparent; }
.darts-input { padding: 0; }
.darts-log-drawer { border: 1px solid var(--kk-line); border-radius: var(--kk-radius); }

/* Daily, Blitz, estimation, and league screens share the same reading scale. */
.tr-q, .blitz-question, .schaetz-frage-gross {
  max-width: 19ch;
  color: var(--kk-ink);
  font-size: clamp(28px, 8vw, 48px);
  line-height: 1.02;
}
.tr-dots li.is-now, .tr-dots li.is-good { background: var(--kk-orange); }
.tr-current { min-height: 58px; }
.blitz-intro, .schaetz-question, .tr-result { border-color: var(--kk-line); }
.blitz-option { min-height: 64px; border-radius: var(--kk-radius); background: var(--kk-surface); }
.blitz-option--chosen { background: var(--kk-lime); }
.tr-preview { background: var(--kk-field); border: 0; border-radius: var(--kk-radius); }

/* Desktop gets more composition. Phones stay a single-column, thumb-friendly interface. */
@media (min-width: 700px) {
  #start.view.is-active { padding-inline: 32px; }
  #start .launch-cover { min-height: 410px; }
  .solo-main { padding-top: 52px; }
  .mode-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .mode-row { min-height: 112px; }
  .panel, .panel.darts, .panel.guess, .panel.question, .panel.review, .panel.result, .panel.lobby { padding-top: 34px; }
  .lobby .sticky-cta { max-width: 460px; }
  .darts-board[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  #start .launch-cover { min-height: 260px; }
  #start .launch-mode { min-height: 178px; }
  #start .launch-mode--daily { min-height: 132px; }
  .mode-btn { min-height: 98px; padding: 12px 8px; }
  .mode-btn .mode-label { font-size: 14px; }
  .mode-btn .mode-desc { font-size: 12px; }
  .darts-board[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .darts-pod { min-height: 138px; }
  .guess-input-row, .darts-input-row { grid-template-columns: minmax(0, 1fr) auto; }
  .guess-input .btn, .darts-input .btn { min-width: 96px; padding-inline: 10px; }
  .gmh-name, .pchip-name, .darts-name { font-size: 12px !important; }
  .gmh-player-state, .gmh-era, .gmh-tips, .gc-chip-lbl, .gc-row-who,
  .darts-pod-total, .darts-pod-picks-label { font-size: 10px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

