/* ── 1000 Punten — kaartavond aan de vilttafel ── */

:root {
  --felt: #14503A;
  --felt-deep: #0B3323;
  --felt-line: rgba(255, 255, 255, 0.08);
  --card: #FBF6EB;
  --card-edge: #E8DFC9;
  --ink: #23222A;
  --ink-soft: #6E6A5E;
  --red: #C3272E;
  --gold: #E8B54A;
  --gold-deep: #B4802A;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--felt) 0%, var(--felt-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior-y: none;
}

.screen {
  max-width: 30rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ── Merk / logo ── */

.brand {
  position: relative;
  text-align: center;
  padding: 2.2rem 0 1.6rem;
}

.brand-card {
  position: absolute;
  top: 1.1rem;
  width: 3.4rem;
  height: 4.7rem;
  background: var(--card);
  border-radius: 0.55rem;
  box-shadow: var(--shadow);
  font-size: 2rem;
  line-height: 4.7rem;
  animation: dealt 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.brand-card--left  { left: 6%; transform: rotate(-14deg); color: var(--red); animation-delay: 0.1s; }
.brand-card--right { right: 6%; transform: rotate(12deg); color: var(--ink); animation-delay: 0.25s; }

@keyframes dealt {
  from { opacity: 0; translate: 0 -2.5rem; scale: 0.6; }
  to   { opacity: 1; translate: 0 0; scale: 1; }
}

.brand-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
}

.brand-1000 {
  position: relative;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  font-size: clamp(3.2rem, 15vw, 4.4rem);
  color: var(--red);
  background: var(--card);
  border-radius: 1rem;
  padding: 1.4rem 1.6rem 1.2rem;
  box-shadow: var(--shadow);
  letter-spacing: 0.02em;
  line-height: 1;
}

.pip {
  position: absolute;
  font-family: "Nunito", sans-serif;
  font-size: 1.15rem;
  color: var(--red);
}
.pip-tl { top: 0.45rem; left: 0.65rem; }
.pip-br { bottom: 0.45rem; right: 0.65rem; rotate: 180deg; }

.brand-sub {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.5rem;
}

.brand-tag {
  margin-top: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  font-style: italic;
}

/* ── Panelen & knoppen ── */

.panel {
  background: var(--card);
  border-radius: 1.1rem;
  border-bottom: 4px solid var(--card-edge);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.1rem 1.2rem;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 0.9rem;
}

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--card);
  background: var(--red);
  box-shadow: 0 3px 0 #8C1B21;
  transition: translate 0.1s ease;
}

.btn:active { translate: 0 2px; box-shadow: 0 1px 0 #8C1B21; }

.btn--big { padding: 1.05rem 1rem; font-size: 1.2rem; margin-top: 0.9rem; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--card-edge);
}
.btn--ghost:active { translate: 0 1px; }

.btn--danger { color: var(--red); box-shadow: inset 0 0 0 2px #EFC5C4; }

.btn--light { color: var(--card); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4); }

.btn--resume {
  margin-top: 1.1rem;
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--gold-deep);
}

.btn-suit { display: inline-block; margin-left: 0.2rem; }

.hint { margin-top: 0.7rem; color: var(--red); font-weight: 700; text-align: center; }

/* ── Namen invoeren ── */

.name-list { list-style: none; display: grid; gap: 0.6rem; margin-bottom: 0.8rem; }

.name-row { display: flex; gap: 0.5rem; align-items: center; }

.name-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--card-edge);
  border-radius: 0.7rem;
  background: #fff;
  color: var(--ink);
}

.name-row .remove {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 0.7rem;
  background: #F1EADA;
  color: var(--ink-soft);
  font-size: 1.1rem;
  font-weight: 900;
}

/* ── Spelscherm ── */

.game-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0 1rem;
  color: var(--card);
}

.iconbtn {
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.12);
  color: var(--card);
  font-size: 1.25rem;
}

.game-title {
  flex: 1;
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}

.game-goal {
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* ── Tussenstand: de racebaan ── */

.standings { list-style: none; display: grid; gap: 0.7rem; }

.player-card {
  position: relative;
  background: var(--card);
  border-radius: 0.9rem;
  border-bottom: 4px solid var(--card-edge);
  box-shadow: var(--shadow);
  padding: 0.75rem 0.9rem 0.9rem;
  transition: order 0.3s;
}

.player-card.leader { border-bottom-color: var(--gold); }

.player-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.player-rank {
  font-family: "Abril Fatface", serif;
  font-size: 1.1rem;
  color: var(--ink-soft);
  min-width: 1.3rem;
}

.player-card.leader .player-rank { color: var(--gold-deep); }

.player-name {
  flex: 1;
  font-weight: 900;
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-total {
  font-family: "Abril Fatface", serif;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}

.player-total.negative { color: var(--red); }

.player-last {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink-soft);
  min-width: 3.2rem;
  text-align: right;
}
.player-last.plus { color: #2E7D4F; }
.player-last.min { color: var(--red); }

.track {
  position: relative;
  margin-top: 0.55rem;
  height: 0.85rem;
  border-radius: 999px;
  background: #EDE5D2;
  overflow: hidden;
}

.track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2E7D4F, #4CAF74);
  transition: width 0.6s cubic-bezier(0.3, 1, 0.4, 1);
}

.player-card.leader .track-fill { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }

.track-finish {
  position: absolute;
  right: 0.15rem;
  top: 50%;
  translate: 0 -50%;
  font-size: 0.6rem;
  line-height: 1;
  opacity: 0.7;
}

.game-actions { margin-top: 1.1rem; }

/* ── Historie ── */

.history {
  margin-top: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  color: var(--card);
}

.history summary {
  padding: 0.8rem 1rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.history summary::-webkit-details-marker { display: none; }
.history summary::before { content: "▸ "; }
.history[open] summary::before { content: "▾ "; }

.history-scroll { overflow-x: auto; padding: 0 0.6rem 0.8rem; }

.history table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.history th, .history td {
  padding: 0.35rem 0.55rem;
  text-align: right;
  white-space: nowrap;
}

.history th:first-child, .history td:first-child { text-align: left; }

.history thead th {
  font-weight: 900;
  color: var(--gold);
  border-bottom: 1px solid var(--felt-line);
}

.history tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.05); }

.history td.min { color: #FF9B9B; }

.history tfoot td {
  border-top: 1px solid var(--felt-line);
  font-weight: 900;
}

/* ── Sheets (ronde-invoer & menu) ── */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 26, 18, 0.65);
  backdrop-filter: blur(3px);
}

.sheet-card {
  width: 100%;
  max-width: 30rem;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 1.2rem 1.2rem 0 0;
  padding: 1.2rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
  animation: sheet-up 0.28s cubic-bezier(0.2, 1, 0.4, 1) both;
}

@keyframes sheet-up {
  from { translate: 0 100%; }
  to   { translate: 0 0; }
}

.sheet-title { font-size: 1.3rem; font-weight: 900; }
.sheet-sub { color: var(--ink-soft); font-weight: 600; margin-top: 0.2rem; }

.round-inputs { list-style: none; display: grid; gap: 0.65rem; margin-top: 1rem; }

.round-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.round-row .rr-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-sign {
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.9rem;
  border: 0;
  border-radius: 0.7rem;
  font-size: 1.3rem;
  font-weight: 900;
  background: #E3F0E7;
  color: #2E7D4F;
}
.rr-sign.min { background: #F8E3E2; color: var(--red); }

.rr-points {
  flex: 0 0 6rem;
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  text-align: right;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--card-edge);
  border-radius: 0.7rem;
  background: #fff;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sheet-btns {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.sheet-btns .btn { margin-top: 0; }

.menu-list { display: grid; gap: 0.6rem; margin-top: 1rem; }
.menu-list .btn { text-align: left; }

/* ── Winnaar ── */

.winner {
  position: fixed;
  inset: 0;
  z-index: 30;
  background:
    radial-gradient(110% 80% at 50% 10%, #1A6647 0%, var(--felt-deep) 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--card);
}

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; }

.winner-inner { position: relative; padding: 1rem 1.5rem; max-width: 30rem; width: 100%; }

.winner-crown {
  font-size: 3.6rem;
  animation: crown-drop 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) both 0.2s;
}

@keyframes crown-drop {
  from { opacity: 0; translate: 0 -3rem; }
  to   { opacity: 1; translate: 0 0; }
}

.winner-pre {
  font-weight: 800;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 0.4rem;
}

.winner-name {
  font-family: "Abril Fatface", serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 13vw, 4rem);
  margin-top: 0.3rem;
  overflow-wrap: anywhere;
}

.winner-score {
  font-size: 1.3rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.4rem;
}

.winner-btns { margin-top: 2rem; display: grid; gap: 0.7rem; }

/* ── Toegankelijkheid / motion ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
