:root {
  --bg: #0c0f14;
  --panel: #151a22;
  --muted: #9aa4b2;
  --text: #e7ecf3;
  --accent: #8ef0ff;
  --primary: #7aa2ff;
  --success: #5bd59c;
  --danger: #ff7a7a;
  --yellow: #ffd766;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 50% 20%, #0f1320, #0c0f14 60%);
}

.app { max-width: 1100px; margin: 0 auto; padding: 16px; }
.app__header { display: flex; align-items: center; justify-content: space-between; }
.app__header h1 { font-size: 20px; margin: 0; letter-spacing: 0.5px; }
.app__meta { display: flex; gap: 12px; color: var(--muted); }
.meta__item span { color: var(--text); font-weight: 600; }

.app__main { display: grid; grid-template-columns: 260px 1fr 300px; gap: 16px; margin-top: 16px; }
.board { background: var(--panel); border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.collapsible { display: none; }
.scoring__list { display: grid; gap: 6px; }
.scoring__row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: #0f1420; border: 1px solid #2a3446; border-radius: 8px; padding: 6px 8px; font-size: 12px; color: var(--muted); }
.scoring__row .name { color: var(--text); font-weight: 600; }
.scoring__row .chips, .scoring__row .mult { color: var(--muted); }
.scoring__row--active { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255,215,102,0.25) inset, 0 0 18px rgba(255,215,102,0.25); position: relative; }
.scoring__row--active::after { content: ""; position: absolute; inset: -2px; border-radius: 8px; box-shadow: 0 0 0 0 rgba(255,215,102,0.35); animation: flare 0.7s ease-out infinite; pointer-events: none; }
@keyframes flare {
  0% { box-shadow: 0 0 0 0 rgba(255,215,102,0.35); }
  70% { box-shadow: 0 0 0 6px rgba(255,215,102,0.0); }
  100% { box-shadow: 0 0 0 10px rgba(255,215,102,0.0); }
}
.sidebar { display: grid; gap: 16px; }
.panel { background: var(--panel); border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }

.board__dice { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 12px; }
.die {
  background: #0f1420;
  border: 1px solid #232c3b;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.die:hover { transform: translateY(-2px); }
.die--held { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(122,162,255,0.2) inset; }
.die__value { font-size: 28px; font-weight: 800; }
.die__label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.die:active { transform: translateY(0); }
.btn:active { transform: translateY(1px); }
.btn:hover:not(:disabled) { filter: brightness(1.05); }

/* Rolling animation */
.die--rolling { animation: wobble 600ms ease both; background: #121a2a; }
@keyframes wobble {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(6deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-2px) rotate(-6deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.board__controls { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.board__status { display: flex; gap: 12px; color: var(--muted); }
.hand__summary { margin-top: 8px; color: var(--accent); min-height: 20px; }
.hand__actions { display: flex; gap: 8px; margin-top: 8px; }

.chipsmult { display: grid; gap: 4px; }
.chipsmult div { background: #0f1420; padding: 6px 8px; border-radius: 6px; border: 1px solid #2a3446; }

/* Scoring highlight */
.highlight-yellow { color: var(--yellow); text-shadow: 0 0 10px rgba(255,215,102,0.4); transition: color 220ms ease, text-shadow 220ms ease; }

.btn { background: #222a38; border: 1px solid #2a3446; color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: #2a3a6a; border-color: #33427a; }
.btn--success { background: #214e3e; border-color: #2f6f59; }

/* Neon call-to-action for Next Hand / Next Round */
.btn--neon {
  background: #17ff88;
  color: #0b1b13;
  border-color: #24ff97;
  box-shadow: 0 0 14px rgba(23,255,136,0.6), 0 0 28px rgba(23,255,136,0.25);
  animation: neonPulse 1.2s ease-in-out infinite;
}
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(23,255,136,0.5), 0 0 24px rgba(23,255,136,0.2); filter: brightness(1); }
  50% { box-shadow: 0 0 18px rgba(23,255,136,0.8), 0 0 36px rgba(23,255,136,0.35); filter: brightness(1.05); }
}

.jokers { display: grid; gap: 8px; }
.joker { position: relative; background: #0f1420; border: 1px dashed #2a3446; border-radius: 8px; padding: 8px; font-size: 12px; color: var(--muted); }
.joker__badge { position: absolute; top: -6px; right: -6px; background: #2a3a6a; color: #fff; border: 1px solid #33427a; border-radius: 999px; padding: 2px 6px; font-size: 11px; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }

/* Modal */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; padding: 16px; }
.modal__dialog { background: var(--panel); border: 1px solid #2a3446; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid #2a3446; }
.modal__info { padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px dashed #2a3446; }
.shop__items { display: grid; gap: 8px; padding: 12px; }
.shop__card { background: #0f1420; border: 1px solid #2a3446; border-radius: 8px; padding: 10px; display: flex; align-items: center; justify-content: space-between; }
.shop__card h4 { margin: 0 0 6px 0; font-size: 14px; }
.shop__card p { margin: 0; font-size: 12px; color: var(--muted); }

.win__content { padding: 12px; display: grid; place-items: center; }
.win__img { width: 100%; max-width: 360px; border-radius: 12px; border: 1px solid #2a3446; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

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

