:root {
  --bg: #0b1020;
  --bg-2: #11182d;
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.15);
  --text: #ecf2ff;
  --muted: #aab5d1;
  --gold: #f8d66d;
  --beer: #ffbf3f;
  --red: #ff5c75;
  --black: #10131d;
  --green: #4ddb9f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 191, 63, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(93, 115, 255, 0.18), transparent 25%),
    linear-gradient(180deg, #131b33 0%, var(--bg) 55%, #070b15 100%);
  overflow-x: hidden;
}

.bubbles::before,
.bubbles::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.13) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255,191,63,.14) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(255,255,255,.08) 0 4px, transparent 5px);
  background-size: 180px 180px, 240px 240px, 320px 320px;
  animation: floatBubbles 26s linear infinite;
}
.bubbles::after { animation-duration: 36s; opacity: .7; }

@keyframes floatBubbles {
  from { transform: translateY(20px); }
  to { transform: translateY(-120px); }
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.topbar, .layout { width: min(1200px, calc(100% - 24px)); margin: 18px auto; }
.topbar {
  padding: 20px;
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
}
.topbar h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.3rem); }
.subtitle { margin: 10px 0 0; color: var(--muted); }
.status-group { display: flex; gap: 12px; flex-wrap: wrap; justify-content: end; }
.status-pill {
  min-width: 140px; padding: 12px 14px; border-radius: 18px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
}
.status-pill span { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.status-pill strong { font-size: 1rem; }
.card-status-pill {
  min-width: 110px;
  display: grid;
  justify-items: center;
}
.status-card-slot {
  min-height: 104px;
  display: grid;
  place-items: center;
}
.status-card-slot .card {
  width: 64px;
  height: 92px;
}
.status-card-slot .card .symbol { font-size: 1.65rem; }
.status-card-slot .card .corner { font-size: .7rem; }
.status-card-slot .placeholder {
  font-size: .82rem;
  color: var(--muted);
}

.layout { display: grid; gap: 18px; }
.panel { border-radius: 24px; padding: 18px; }
.hero-panel { display: grid; gap: 16px; }
.hero-copy h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.hero-copy p { color: var(--muted); margin: 10px 0 0; }
.controls, .utility-row { display: flex; flex-wrap: wrap; gap: 12px; }
button {
  appearance: none; border: 0; cursor: pointer; color: white;
  font: inherit; font-weight: 800; letter-spacing: .01em;
  padding: 14px 16px; border-radius: 16px;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}
button:hover { transform: translateY(-2px); filter: brightness(1.06); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button.primary { background: linear-gradient(135deg, #5d73ff, #8f68ff); }
button.secondary { background: linear-gradient(135deg, #ffbf3f, #ff8d3b); color: #231500; }
button.danger { background: linear-gradient(135deg, #ff5c75, #ff7b50); }
button.ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }

.board-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.full-span { grid-column: 1 / -1; }
.panel-title-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px;
}
.panel-title-row h3 { margin: 0; }
.tiny-tag {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 8px 12px;
  font-size: .8rem; color: var(--muted);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
}

.card-row { display: flex; flex-wrap: wrap; gap: 14px; min-height: 170px; }
.deck-zone {
  display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; min-height: 170px;
}
.deck-stack, .draw-slot {
  position: relative; height: 160px; border-radius: 18px;
}
.deck-stack::before, .deck-stack::after {
  content: ""; position: absolute; inset: 0; border-radius: 18px; background: linear-gradient(145deg, #2f3a79, #1b2245);
  border: 1px solid rgba(255,255,255,.15);
}
.deck-stack::before { transform: rotate(-5deg) translate(8px, -4px); }
.deck-stack::after { transform: rotate(4deg) translate(-6px, 4px); }
.draw-slot {
  border: 1px dashed rgba(255,255,255,.18); background: rgba(255,255,255,.04);
  display: grid; place-items: center; color: var(--muted); overflow: visible;
}
.draw-slot::before { content: "Laatste getrokken kaart"; font-weight: 700; }

.card {
  width: 110px; height: 160px; perspective: 1200px; flex: 0 0 auto;
}
.card-inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: flipReveal .65s ease;
}
.card-face {
  position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden;
  box-shadow: 0 14px 24px rgba(0,0,0,.28); overflow: hidden;
}
.card-front {
  background: linear-gradient(180deg, #fff, #edf0f6);
  color: #111; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(17,17,17,.08);
}
.card-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.02)),
    url('../assets/card-back.svg') center/cover no-repeat,
    linear-gradient(135deg, #27336f, #151a34);
  border: 1px solid rgba(255,255,255,.15);
}
.card .corner {
  position: absolute; left: 12px; display: grid; gap: 2px; font-weight: 800; text-align: center;
}
.card .corner.bottom { left: auto; right: 12px; bottom: 10px; transform: rotate(180deg); }
.card .corner.top { top: 10px; }
.card .symbol { font-size: 3rem; }
.card.red .card-front { color: #c61c3f; }
.card.black .card-front { color: #10131d; }
.card.face-down .card-inner { animation: none; }
.card.face-down .card-front { display: none; }
.card.face-down .card-back { transform: rotateY(0deg); }
.card.revealed .card-inner { animation: flipReveal .65s ease; }
.card.match-card {
  filter: drop-shadow(0 0 16px rgba(77,219,159,.32));
}
@keyframes flipReveal { from { transform: rotateY(180deg) translateY(6px); opacity: 0; } to { transform: rotateY(0deg) translateY(0); opacity: 1; } }

.pyramid-board {
  display: grid; gap: 14px; justify-items: center;
}
.pyramid-row {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.pyramid-card-wrap { display: grid; gap: 8px; justify-items: center; max-width: 146px; }
.pyramid-card-wrap button {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.pyramid-card-wrap button:hover { filter: none; }
.pyramid-card-wrap.locked { opacity: .55; }
.pyramid-award {
  font-size: .78rem; color: var(--muted); text-align: center; min-height: 18px;
}
.pyramid-hit {
  min-height: 42px;
  text-align: center;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.3;
}
.pyramid-hit strong { color: var(--green); }
.pyramid-hit .loser { color: #ff9aaa; }

.bus-track {
  display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 12px;
}
.bus-step {
  border-radius: 18px; padding: 14px; min-height: 96px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
}
.bus-step.active { border-color: rgba(255,191,63,.8); box-shadow: 0 0 0 2px rgba(255,191,63,.25) inset; }
.bus-step.done { border-color: rgba(77,219,159,.75); }
.bus-step h4 { margin: 0 0 8px; font-size: .92rem; }
.bus-step p { margin: 0; color: var(--muted); font-size: .82rem; }

.log-panel { padding-bottom: 8px; }
.log { display: grid; gap: 10px; max-height: 320px; overflow: auto; padding-right: 6px; }
.log-entry {
  border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
}
.log-entry strong { color: var(--gold); }
.log-entry .bad { color: #ff92a2; }
.log-entry .good { color: #9ff0c7; }

.beer-burst {
  position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; pointer-events: none;
}
.beer-chip {
  padding: 10px 14px; border-radius: 999px; background: linear-gradient(135deg, #ffcc5a, #ff923b);
  color: #231500; font-weight: 900; box-shadow: 0 10px 24px rgba(0,0,0,.22); animation: popOut 1.5s ease forwards;
}
@keyframes popOut {
  0% { transform: translateY(10px) scale(.9); opacity: 0; }
  20% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-12px) scale(.98); opacity: 0; }
}

.player-setup { display: grid; gap: 14px; }
.player-form, .player-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.player-form input {
  flex: 1 1 220px;
  min-width: 0;
  appearance: none;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}
.player-form input::placeholder { color: var(--muted); }
.players-list {
  display: flex; flex-wrap: wrap; gap: 10px;
  min-height: 48px;
}
.player-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.player-pill.active {
  border-color: rgba(255, 191, 63, .45);
  box-shadow: 0 0 0 1px rgba(255, 191, 63, .25) inset;
}
.player-pill .role-tag {
  font-size: .72rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,191,63,.16);
  color: var(--gold);
}
.player-pill button {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: .82rem;
}
.empty-players { color: var(--muted); font-size: .92rem; }

.player-hand {
  width: 100%;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.player-hand.active {
  border-color: rgba(255,191,63,.45);
  box-shadow: 0 0 0 1px rgba(255,191,63,.22) inset;
}
.player-hand.bus-victim { border-color: rgba(255,92,117,.45); }
.player-hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
}
.mini-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 40px;
}
.mini-card-row .card {
  width: 78px;
  height: 112px;
}
.mini-card-row .card .symbol { font-size: 2rem; }
.player-hand .card.laid-card {
  opacity: .54;
  transform: translateY(4px);
}
.player-hand .card.laid-card::after {
  content: "gelegd";
  position: absolute;
  inset: auto 8px 8px;
  text-align: center;
  font-size: .65rem;
  font-weight: 800;
  color: var(--green);
  background: rgba(10, 20, 16, .75);
  border-radius: 999px;
  padding: 4px 6px;
}

@media (max-width: 900px) {
  .board-grid { grid-template-columns: 1fr; }
  .deck-zone { grid-template-columns: 1fr; }
  .bus-track { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .topbar { flex-direction: column; align-items: stretch; }
  .status-group { justify-content: stretch; }
}

@media (max-width: 600px) {
  .topbar, .layout { width: min(100% - 16px, 1200px); }
  .panel { padding: 16px; border-radius: 20px; }
  .card { width: 88px; height: 128px; }
  .card .symbol { font-size: 2.25rem; }
  .status-card-slot .card { width: 56px; height: 80px; }
}
