:root {
  --bg: #090b10;
  --surface: rgba(255, 255, 255, .88);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, .62);
  --text: #172033;
  --muted: #6b7280;
  --line: rgba(23, 32, 51, .12);
  --accent: #ef4444;
  --accent-dark: #991b1b;
  --green: #10b981;
  --green-dark: #047857;
  --brown: #422006;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --radius: 24px;
  --radius-sm: 16px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content-max: 1700px;
  --page-pad: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, .32), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(16, 185, 129, .24), transparent 34rem),
    linear-gradient(135deg, rgba(9, 11, 16, .84), rgba(9, 11, 16, .96)),
    url("img/background-img.png") center/cover fixed no-repeat;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(calc(100% - 28px), var(--content-max));
  margin: 0 auto;
  padding: var(--page-pad) 0;
}

.topbar,
.card,
.site-footer {
  border: 1px solid rgba(255, 255, 255, .34);
  background: linear-gradient(145deg, var(--surface), rgba(255, 255, 255, .76));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 14px 28px rgba(239, 68, 68, .32);
}

.brand strong {
  display: block;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: -.04em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.nav-links a,
.site-footer a {
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 800;
}

.nav-links a:hover,
.site-footer a:hover {
  background: rgba(15, 23, 42, .08);
  color: var(--text);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 900;
}

.pill span {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

select {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 900;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.btn,
.mBtn,
.k,
.player {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn:hover,
.mBtn:hover,
.k:hover,
.player:hover {
  transform: translateY(-1px);
}

.btn {
  border-radius: 999px;
  padding: 11px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 16px 28px rgba(153, 27, 27, .25);
  font-weight: 950;
}

.btn.secondary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.btn.warn {
  background: linear-gradient(135deg, #78350f, #1c1917);
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  box-shadow: none;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(340px, .85fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.card {
  overflow: hidden;
  border-radius: var(--radius);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.head h1 {
  margin: 0;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.head span {
  color: var(--muted);
  font-weight: 900;
}

.players,
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.player {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .68);
  color: var(--text);
  text-align: left;
}

.player.active {
  outline: 4px solid rgba(239, 68, 68, .18);
  border-color: rgba(239, 68, 68, .36);
  background: #fff;
}

.pname,
.pmeta,
.badge,
.status-row,
.turn-head,
.footerActions,
.multis,
.addRow,
.site-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pname {
  min-width: 0;
}

.name {
  overflow: hidden;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pmeta {
  justify-content: flex-end;
}

.score {
  min-width: 76px;
  padding: 9px 11px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 1.1rem;
  font-weight: 950;
  text-align: center;
}

.badge {
  width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(16, 185, 129, .22);
  border-radius: 999px;
  background: rgba(16, 185, 129, .1);
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 950;
}

.badge img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.addRow {
  flex-wrap: wrap;
  padding: 0 14px 14px;
}

.addRow input {
  flex: 1 1 190px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .84);
  color: var(--text);
  font-weight: 850;
}

.status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .64);
}

.status-row,
.turn-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.active-player {
  font-weight: 950;
}

.active-player span {
  color: var(--accent-dark);
}

.turn {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .7);
}

.darts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dart,
.hint,
.mBtn,
.k {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
}

.dart {
  padding: 11px 10px;
  font-weight: 950;
  text-align: center;
}

.hint {
  padding: 11px 12px;
  color: #7f1d1d;
  background: rgba(254, 226, 226, .9);
  font-weight: 850;
}

.hint[hidden] {
  display: none;
}

.multis {
  flex-wrap: wrap;
}

.mBtn {
  flex: 1 1 120px;
  min-height: 44px;
  font-weight: 950;
  color: var(--text);
}

.mBtn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.k {
  min-height: 54px;
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 950;
}

.k.r {
  background: rgba(209, 250, 229, .92);
  color: var(--green-dark);
}

.k.zero {
  background: rgba(254, 243, 199, .92);
  color: #92400e;
}

.footerActions {
  flex-wrap: wrap;
}

.footerActions .btn {
  flex: 1 1 150px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 680px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.site-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  color: var(--muted);
  font-weight: 800;
}

/* Große Bildschirme: mehr Platz nutzen und Spielbereich größer machen */
@media (min-width: 1800px) {
  :root {
    --content-max: 2400px;
    --page-pad: clamp(22px, 1.4vw, 40px);
    --radius: 30px;
    --radius-sm: 20px;
  }

  body {
    font-size: clamp(1rem, .55vw, 1.22rem);
  }

  .shell {
    width: min(calc(100% - clamp(48px, 4vw, 120px)), var(--content-max));
  }

  .topbar {
    gap: clamp(18px, 1.2vw, 32px);
    padding: clamp(18px, 1.1vw, 30px);
  }

  .grid {
    grid-template-columns: minmax(520px, .95fr) minmax(760px, 1.35fr);
    gap: clamp(20px, 1.2vw, 34px);
    margin-top: clamp(20px, 1.2vw, 34px);
  }

  .game-card {
    position: sticky;
    top: var(--page-pad);
  }

  .players {
    max-height: calc(100vh - 280px);
    overflow: auto;
  }

  .brand {
    min-width: 320px;
    gap: clamp(14px, .8vw, 24px);
  }

  .brand-mark {
    width: clamp(54px, 3.2vw, 76px);
    height: clamp(54px, 3.2vw, 76px);
    border-radius: 22px;
    font-size: clamp(1.35rem, 1.25vw, 2rem);
  }

  .brand strong {
    font-size: clamp(1.5rem, 1.15vw, 2.3rem);
  }

  .brand small {
    font-size: clamp(.9rem, .55vw, 1.15rem);
  }

  .controls {
    gap: clamp(12px, .8vw, 22px);
  }

  .head {
    padding: clamp(20px, 1.2vw, 34px) clamp(22px, 1.4vw, 38px);
  }

  .head h1 {
    font-size: clamp(.95rem, .58vw, 1.22rem);
  }

  .players,
  .panel {
    gap: clamp(14px, .9vw, 24px);
    padding: clamp(16px, 1vw, 28px);
  }

  .player {
    gap: clamp(14px, .9vw, 24px);
    padding: clamp(16px, 1vw, 28px);
  }

  .name {
    font-size: clamp(1.05rem, .72vw, 1.55rem);
  }

  .score {
    min-width: clamp(90px, 5vw, 150px);
    padding: clamp(10px, .7vw, 18px) clamp(12px, .9vw, 22px);
    border-radius: 18px;
    font-size: clamp(1.25rem, .95vw, 2.1rem);
  }

  .status,
  .turn {
    gap: clamp(14px, .9vw, 24px);
    padding: clamp(16px, 1vw, 28px);
  }

  .active-player,
  .turn-head,
  .badge,
  .hint,
  .dart {
    font-size: clamp(1rem, .65vw, 1.35rem);
  }

  .badge {
    padding: clamp(8px, .55vw, 14px) clamp(12px, .8vw, 20px);
  }

  .badge img {
    width: clamp(20px, 1vw, 30px);
    height: clamp(20px, 1vw, 30px);
  }

  .darts,
  .keypad {
    gap: clamp(12px, .8vw, 24px);
  }

  .dart {
    padding: clamp(13px, .9vw, 24px) clamp(12px, .8vw, 20px);
    border-radius: 20px;
  }

  .addRow {
    gap: clamp(12px, .8vw, 22px);
    padding: 0 clamp(16px, 1vw, 28px) clamp(16px, 1vw, 28px);
  }

  .btn,
  .mBtn,
  .pill,
  .addRow input,
  select {
    min-height: clamp(48px, 2.4vw, 66px);
    font-size: clamp(1rem, .62vw, 1.28rem);
  }

  .btn,
  .mBtn {
    padding: clamp(12px, .75vw, 20px) clamp(18px, 1vw, 28px);
  }

  .pill {
    padding: clamp(9px, .6vw, 16px) clamp(14px, .9vw, 24px);
  }

  .pill span {
    font-size: clamp(.78rem, .45vw, 1rem);
  }

  input[type="checkbox"] {
    width: clamp(18px, 1vw, 26px);
    height: clamp(18px, 1vw, 26px);
  }

  .k {
    min-height: clamp(70px, 4.7vw, 122px);
    border-radius: clamp(18px, 1vw, 30px);
    font-size: clamp(1.18rem, 1vw, 2.15rem);
  }

  .footerActions {
    gap: clamp(12px, .8vw, 24px);
  }

  .footerActions .btn {
    flex-basis: 220px;
  }

  .site-footer {
    margin-top: clamp(20px, 1.2vw, 34px);
    padding: clamp(16px, 1vw, 26px) clamp(18px, 1.2vw, 32px);
    font-size: clamp(.95rem, .55vw, 1.18rem);
  }

  .toast {
    bottom: clamp(22px, 1.4vw, 40px);
    max-width: min(80vw, 900px);
    padding: clamp(14px, .8vw, 22px) clamp(18px, 1.1vw, 30px);
    font-size: clamp(1rem, .65vw, 1.35rem);
  }
}

/* Extra große Bildschirme / TV / Beamer */
@media (min-width: 2400px) {
  :root {
    --content-max: 2800px;
  }

  .grid {
    grid-template-columns: minmax(620px, .9fr) minmax(920px, 1.4fr);
  }

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

  .players {
    max-height: calc(100vh - 320px);
  }
}

/* Kleine Bildschirme */
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .controls {
    justify-content: flex-start;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, var(--content-max));
    padding: 10px 0;
  }

  .topbar,
  .head,
  .panel,
  .players {
    padding: 12px;
  }

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

  .darts {
    grid-template-columns: 1fr;
  }

  .btn,
  .mBtn,
  .k {
    width: 100%;
  }
}