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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-btn {
  background: #16213e;
  border: 1px solid #F4A820;
  color: #F4A820;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  white-space: nowrap;
}

.nav-btn:hover {
  background: #F4A820;
  color: #1a1a2e;
  transform: translateY(-2px);
}

.nav-btn:active {
  transform: translateY(1px);
}

/* ── THREE-COLUMN LAYOUT ── */
#game-area {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.sidebar-block {
  background: #16213e;
  border-radius: 10px;
  border: 1px solid #2a2a4a;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* ── LEFT SIDEBAR ── */

/* Utility panel */
#left-top {
  flex: 0 0 auto;
}

#utility-panel {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#utility-panel h1 {
  color: #F4A820;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 2px 2px 0 #8B4513;
  letter-spacing: 1px;
  text-align: center;
  margin: 0;
  padding-bottom: 2px;
}

#game-feed {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 11px;
  color: #aaa;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  border-top: 1px solid #2a2a4a;
  background: #0f0f23;
  width: 100%;
  cursor: default;
  text-align: left;
}

#utility-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

#utility-btns .nav-btn {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 6px 14px;
  text-align: center;
}

/* Player list block */
#left-bottom {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

#left-bottom::-webkit-scrollbar {
  width: 4px;
}

#left-bottom::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

#log-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
}

#log-container::-webkit-scrollbar {
  width: 4px;
}

#log-container::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

#log {
  font-size: 10px;
  color: #aaa;
  line-height: 1.6;
}

/* ── CENTER COLUMN ── */
.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  gap: 6px;
  overflow: hidden;
}

#board-center-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

#board-wrap {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-height: 0;
  flex-shrink: 1;
  z-index: 1;
}



#board-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  border: 3px solid #8B4513;
  transform: translateZ(0);
  will-change: transform;
}

#cells-layer,
#tokens-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.cell-hit {
  position: absolute;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}

.cell-hit:hover {
  background: rgba(255, 215, 0, 0.35);
  outline: 2px solid gold;
}

.cell-hit.highlight {
  background: rgba(255, 215, 0, 0.5);
  outline: 2px solid gold;
}

.cell-flash {
  animation: cellFlash 0.6s ease-in-out 2;
}

@keyframes cellFlash {
  0% { background: rgba(255, 215, 0, 0); outline: none; }
  30% { background: rgba(255, 215, 0, 0.8); outline: 3px solid gold; }
  70% { background: rgba(255, 215, 0, 0.8); outline: 3px solid gold; }
  100% { background: rgba(255, 215, 0, 0); outline: none; }
}

.ptoken {
  position: absolute;
  width: 4.5%;
  height: 4.5%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(12px, 2vw, 22px);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: left 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.2), top 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.2);
  z-index: 20;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.ptoken.bounce {
  animation: tokenBounce 0.2s ease-out;
}

@keyframes tokenBounce {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.ptoken.token-active {
  animation: gentlePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(244, 168, 32, 0.5), 0 0 0 6px rgba(244, 168, 32, 0.2), 0 2px 8px rgba(0, 0, 0, 0.6);
  border: 2px solid #F4A820;
  filter: drop-shadow(0 0 3px rgba(244, 168, 32, 0.5));
  z-index: 25;
}

@keyframes gentlePulse {
  0% { box-shadow: 0 0 0 3px rgba(244, 168, 32, 0.5), 0 0 0 6px rgba(244, 168, 32, 0.2); transform: translate(-50%, -50%) scale(1); }
  50% { box-shadow: 0 0 0 5px rgba(244, 168, 32, 0.7), 0 0 0 10px rgba(244, 168, 32, 0.3); transform: translate(-50%, -50%) scale(1.02); }
  100% { box-shadow: 0 0 0 3px rgba(244, 168, 32, 0.5), 0 0 0 6px rgba(244, 168, 32, 0.2); transform: translate(-50%, -50%) scale(1); }
}
/* ── RIGHT SIDEBAR ── */

#right-top {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#players-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-card {
  background: #0f0f23;
  border-radius: 10px;
  padding: 10px 14px;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.3s;
}

.player-card.active {
  border-color: #F4A820;
  box-shadow: 0 0 12px rgba(244, 168, 32, 0.4);
}

.token-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-name {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
}

.player-score {
  color: #aaa;
  font-size: 12px;
  margin-top: 2px;
}

.player-laps {
  font-size: 11px;
  color: #F4A820;
  margin-top: 2px;
}

.player-stats {
  text-align: right;
  flex-shrink: 0;
}

.player-stats .player-score {
  color: #F4A820;
  font-weight: 700;
  font-size: 15px;
}

.player-stats .player-laps {
  margin-top: 2px;
}

/* Action container */
#right-bottom {
  flex: 0 0 auto;
}

#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  height: 100%;
}

#dice-display {
  width: 60px;
  height: 60px;
  background: linear-gradient(145deg, #f0f0f0, #d4d4d4);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s;
}

.die {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 8px;
}

.dot {
  background: radial-gradient(circle at 40% 40%, #ccc, #999);
  border-radius: 50%;
  width: 100%;
  height: 100%;
  transition: background 0.08s, box-shadow 0.08s, transform 0.1s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dot.lit {
  background: radial-gradient(circle at 35% 35%, #555, #1a1a1a);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4), inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes rollShake {
  0% { transform: rotate(0deg) scale(1); }
  10% { transform: rotate(20deg) scale(1.15); }
  25% { transform: rotate(-15deg) scale(1.2); }
  40% { transform: rotate(12deg) scale(1.25); }
  55% { transform: rotate(-8deg) scale(1.15); }
  70% { transform: rotate(5deg) scale(1.1); }
  85% { transform: rotate(-3deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.rolling {
  animation: rollShake 0.6s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes rollBounce {
  0% { transform: scale(1.3); box-shadow: 0 0 30px rgba(255, 107, 107, 0.5); }
  40% { transform: scale(0.95); }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
}

.bounce {
  animation: rollBounce 0.5s cubic-bezier(0.25, 1.5, 0.5, 1);
}

#roll-btn {
  width: 100%;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 8px;
  border: 1.5px solid #F4A820;
  background: #F4A820;
  color: #1a1a2e;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
  text-align: center;
}

#roll-btn:hover {
  background: #d4920a;
}

#roll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#turn-label {
  color: #F4A820;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

button {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid #F4A820;
  background: #1a1a2e;
  color: #F4A820;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

button:hover {
  background: #F4A820;
  color: #1a1a2e;
}

button:active {
  transform: scale(0.96);
}

/* ── SETUP SCREEN ── */
#setup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #16213e;
  border-radius: 14px;
  padding: 20px;
  width: min(400px, 95vw);
  border: 2px solid #F4A820;
  color: #fff;
  z-index: 100;
}

#setup h2 {
  color: #F4A820;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
}

.setup-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: #ccc;
}

select,
input[type="text"],
.volume-slider {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #0f0f23;
  color: #fff;
  width: 160px;
}

.volume-slider {
  padding: 0;
  height: 20px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  background: transparent;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #F4A820;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  margin-top: -5px;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #F4A820;
  cursor: pointer;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  margin: 0;
}

.volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, #F4A820 0%, #F4A820 var(--value), #444 var(--value), #444 100%);
  height: 6px;
  border-radius: 3px;
  border: none;
}

.volume-slider::-moz-range-track {
  background: #444;
  height: 6px;
  border-radius: 3px;
  border: none;
}

.volume-slider::-moz-range-progress {
  background: #F4A820;
  height: 6px;
  border-radius: 3px;
}

#start-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  font-size: 15px;
  background: #F4A820;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

#start-btn:hover {
  background: #d4920a;
}

/* ── MODAL ── */
#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

#modal.show {
  display: flex;
}

#modal-box {
  background: #16213e;
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 92%;
  text-align: center;
  border: 2px solid #F4A820;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #F4A820;
}

#modal-body {
  font-size: 14px;
  color: #ddd;
  margin-bottom: 20px;
  line-height: 1.6;
}

#quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0 10px;
}

.quiz-opt-btn {
  background: #0f0f23;
  border: 1.5px solid #F4A820;
  border-radius: 30px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: 0.1s;
  color: #fff;
}

.quiz-opt-btn:hover {
  background: #F4A820;
  color: #1a1a2e;
  border-color: #fff;
}

.opt-prefix {
  font-weight: 800;
  font-size: 16px;
  min-width: 32px;
}

#modal-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.answer-img {
  max-width: 200px;
  max-height: 150px;
  margin: 10px auto;
  display: block;
  border-radius: 8px;
  border: 2px solid #F4A820;
}

/* ── LOADING ── */
.loading {
  text-align: center;
  color: #F4A820;
  padding: 20px;
}

/* ── RESULT OVERLAY ── */
.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}

.result-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

#result-box {
  background: #16213e;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  border: 2px solid #F4A820;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 92%;
  max-width: 480px;
}

.result-correct { display: none; }
.result-wrong { display: none; }

.result-emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.result-text {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #F4A820;
}

.result-question {
  font-size: 14px;
  color: #ddd;
  margin-bottom: 20px;
  line-height: 1.6;
}

.result-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0 10px;
}

.result-opt-static {
  background: #0f0f23;
  border: 1.5px solid #F4A820;
  border-radius: 30px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.result-opt-static.correct {
  background: #2ecc71;
  border-color: #27ae60;
  animation: blink-green 1s infinite;
}

.result-opt-static.wrong {
  background: #e74c3c;
  border-color: #c0392b;
}

@keyframes blink-green {
  50% { opacity: 0.5; }
}

.result-points {
  font-size: 13px;
  margin-top: 10px;
  color: #F4A820;
}

.result-countdown {
  font-size: 11px;
  color: #888;
  margin-top: 14px;
}

/* ── SPLASH SCREEN ── */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.8s ease-out;
}

#splash-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(244,168,32,0.5);
  animation: splashPulse 1.5s ease-in-out infinite;
}

@keyframes splashPulse {
  0% { transform: scale(0.98); opacity: 0.9; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(0.98); opacity: 0.9; }
}

.splash-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ── SETTINGS PANEL ── */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.settings-panel.show {
  opacity: 1;
  visibility: visible;
}

.settings-content {
  background: #16213e;
  border-radius: 14px;
  border: 2px solid #F4A820;
  width: min(400px, 95vw);
  max-width: 100%;
  box-shadow: 0 8px 32px rgba(244, 168, 32, 0.3);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #F4A820;
}

.settings-header h3 {
  color: #F4A820;
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.settings-close {
  background: transparent;
  border: none;
  color: #F4A820;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.settings-close:hover {
  transform: scale(1.2);
}

.settings-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-row.toggle-row {
  flex-direction: row;
  gap: 10px;
}

.settings-row.toggle-row .nav-btn {
  flex: 1;
  margin: 0;
}

.settings-row label {
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
}

/* ── WINNER OVERLAY ── */
.winner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(6px);
}

.winner-overlay.show {
  opacity: 1;
  visibility: visible;
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.winner-box {
  position: relative;
  background: #16213e;
  border: 2px solid #F4A820;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: min(460px, 94vw);
  text-align: center;
  box-shadow: 0 0 60px rgba(244, 168, 32, 0.35), 0 16px 48px rgba(0,0,0,0.7);
  animation: winnerPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
}

@keyframes winnerPop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.winner-crown {
  font-size: 52px;
  animation: crownBounce 1s ease-in-out infinite alternate;
  display: block;
  margin-bottom: 4px;
}

@keyframes crownBounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.winner-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #F4A820;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.85;
}

.winner-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(244, 168, 32, 0.6);
}

.winner-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #F4A820, transparent);
  margin: 16px 0;
}

.winner-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.winner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f0f23;
  border-radius: 10px;
  padding: 9px 14px;
  border: 1.5px solid #333;
  transition: border-color 0.2s;
}

.winner-row.rank-1 {
  border-color: #F4A820;
  background: rgba(244, 168, 32, 0.08);
}

.winner-row.rank-2 {
  border-color: #aaa;
  background: rgba(200, 200, 200, 0.05);
}

.winner-row.rank-3 {
  border-color: #cd7f32;
  background: rgba(205, 127, 50, 0.05);
}

.winner-medal {
  font-size: 20px;
  min-width: 28px;
}

.winner-token {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.winner-player-info {
  flex: 1;
  text-align: left;
}

.winner-player-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.winner-player-sub {
  font-size: 11px;
  color: #888;
  margin-top: 1px;
}

.winner-player-score {
  font-size: 15px;
  font-weight: 800;
  color: #F4A820;
  text-align: right;
}

.winner-play-again {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  background: #F4A820;
  color: #1a1a2e;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.winner-play-again:hover {
  background: #d4920a;
  transform: translateY(-2px);
}

.winner-play-again:active {
  transform: scale(0.97);
}

/* ── RESPONSIVE: narrow screens ── */
@media (max-width: 900px) {
  #game-area {
    grid-template-columns: 1fr 2fr 1fr;
    gap: 6px;
    padding: 6px;
  }

  #top-bar-left h1 {
    font-size: 14px;
  }

  .nav-btn {
    font-size: 10px;
    padding: 4px 8px;
  }

  #dice-display {
    width: 48px;
    height: 48px;
  }

  #roll-btn {
    font-size: 11px;
    padding: 6px 0;
  }
}

@media (max-width: 700px) {
  #game-area {
    grid-template-columns: 140px 1fr 140px;
    gap: 4px;
    padding: 4px;
  }

  #center-canvas {
    height: 28px;
  }

  #event-feed {
    height: 32px;
  }

  .player-card {
    padding: 4px 8px;
    gap: 6px;
  }

  .token-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .player-name {
    font-size: 10px;
  }
}

@media (max-width: 500px) {
  #game-area {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 4px;
    padding: 4px;
  }

  #log-container {
    max-height: 64px;
  }
}
