/* SIXZEE — safari-knights 8-bit dice theme. Loaded last so it wins over the
   shared wallet/shell styles while leaving wallet panels untouched. */

:root {
  --sixzee-ink: #06171f;
  --sixzee-panel: rgba(6, 23, 31, 0.92);
  --sixzee-panel-2: rgba(10, 38, 47, 0.94);
  --sixzee-gold: #f4bb3f;
  --sixzee-gold-dim: #b98528;
  --sixzee-ivory: #f6ead0;
  --sixzee-teal: #5fe0d0;
  --sixzee-danger: #ff6a5e;
  --sixzee-line: rgba(244, 187, 63, 0.35);
}

body {
  background-color: var(--sixzee-ink);
  background-image:
    linear-gradient(180deg, rgba(3, 16, 22, 0.72), rgba(3, 16, 22, 0.94)),
    url('assets/safari-knights-reference.jpg');
  background-size: cover, cover;
  background-position: center, center 35%;
  background-attachment: fixed;
}

#game-container { max-width: 1180px; }

/* app-layout.css still has a cribbage-era two-column game shell. Sixzee uses
   the full width so the dice and paper scorecard are not squeezed into one
   narrow column with an empty second column. */
#game-screen > .pixel-border {
  display: flex;
  flex-direction: column;
}

.pixel-header .logo h1,
.pixel-header .tagline {
  color: var(--sixzee-ivory);
  text-shadow: 0 0 14px rgba(244, 187, 63, 0.45);
}

.pixel-header .logo-icon { filter: drop-shadow(0 0 8px rgba(244, 187, 63, 0.6)); }

.sixzee-board {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.35fr);
  gap: 18px;
  padding: 18px;
  background: var(--sixzee-panel);
  border: 2px solid var(--sixzee-line);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 12px 40px rgba(0, 0, 0, 0.45);
}

.board-info,
.opponents-area { grid-column: 1 / -1; }

.player-score {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sixzee-panel-2);
  border: 1px solid var(--sixzee-line);
  color: var(--sixzee-ivory);
  font-family: 'VT323', monospace;
  font-size: 20px;
}

.player-chip.active {
  border-color: var(--sixzee-gold);
  box-shadow: 0 0 16px rgba(244, 187, 63, 0.35);
}

.player-chip .seat-dot {
  width: 10px;
  height: 10px;
  background: var(--chip-color, var(--sixzee-teal));
  box-shadow: 0 0 8px var(--chip-color, var(--sixzee-teal));
}

.player-chip b { color: var(--sixzee-gold); font-size: 24px; }

.opponent-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 8px 0;
  padding: 8px 12px;
  border: 1px solid var(--sixzee-line);
  background: rgba(4, 18, 25, 0.8);
  color: var(--sixzee-ivory);
  font-family: 'VT323', monospace;
  font-size: 19px;
}

.opponent-card.waiting { opacity: 0.65; }

.dice-stage {
  grid-column: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(13, 47, 55, 0.9), rgba(5, 20, 27, 0.95));
  border: 1px dashed var(--sixzee-line);
}

.dice-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--sixzee-ivory);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1.7;
}

.dice-header .turn-status { color: var(--sixzee-gold); }
.dice-header .rolls-label { color: var(--sixzee-teal); }

.dice-tray {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  min-height: 68px;
}

.die {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  max-width: 52px;
  justify-self: center;
  border: 3px solid var(--sixzee-ivory);
  border-radius: 8px;
  background: linear-gradient(145deg, #fffdf4, #d9c9a4);
  box-shadow: 0 4px 0 #8a7448, 0 0 18px rgba(244, 187, 63, 0.18);
  cursor: pointer;
  padding: 8%;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.die:hover { transform: translateY(-3px); }

.die.held {
  border-color: var(--sixzee-gold);
  box-shadow: 0 4px 0 var(--sixzee-gold-dim), 0 0 22px rgba(244, 187, 63, 0.6);
  transform: translateY(-5px);
}

.die.locked { cursor: default; opacity: 0.72; }
.die.locked:hover { transform: none; }

.die-face {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
}

.pip {
  align-self: center;
  justify-self: center;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: var(--sixzee-ink);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.25);
}

.die.held .pip { background: #7a3f18; }

.dice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.dice-hint {
  color: rgba(246, 234, 208, 0.75);
  font-family: 'VT323', monospace;
  font-size: 17px;
}

.scorecard-wrap {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Paper scorecard, like the real Yahtzee pad, dropped onto the safari board. */
.scorecard {
  background: linear-gradient(180deg, #f8edd6 0%, #e9d6ae 100%);
  border: 3px solid #b98528;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 6px 0 #6d4f1c;
  padding: 10px 12px 12px;
  color: #10262f;
}

.scorecard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 2px dashed rgba(122, 63, 24, 0.6);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.scorecard-head h3 {
  margin: 0;
  color: #7a3f18;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}

.scorecard-head > span {
  color: #7a3f18;
  font-family: 'VT323', monospace;
  font-size: 14px;
}

.joker-badge {
  background: #7a3f18;
  border: 1px solid #f4bb3f;
  color: #f4bb3f;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 4px 6px;
  animation: joker-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes joker-pulse {
  from { box-shadow: 0 0 0 rgba(244, 187, 63, 0); }
  to { box-shadow: 0 0 12px rgba(244, 187, 63, 0.65); }
}

.score-cell {
  display: grid;
  grid-template-columns: 22px 1fr 44px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  margin: 2px 0;
  padding: 3px 6px;
  border: 1px solid rgba(122, 63, 24, 0.4);
  border-bottom: 1px dotted rgba(122, 63, 24, 0.6);
  background: rgba(255, 255, 255, 0.38);
  color: #10262f;
  font-family: 'VT323', monospace;
  font-size: 19px;
  text-align: left;
  cursor: pointer;
}

.score-cell:hover:not(:disabled),
.score-cell.preview:not(:disabled) {
  border-color: #0a7d6f;
  background: rgba(95, 224, 208, 0.22);
}

.score-cell:disabled { cursor: default; }
.score-cell.filled { background: rgba(122, 63, 24, 0.08); }
.score-cell.filled .cat-name { text-decoration: line-through; opacity: 0.62; }
.score-cell.zero .score-value { color: #b23b2e; }
.score-cell.jackpot { border-color: #b98528; background: rgba(244, 187, 63, 0.16); }

.cat-icon { font-size: 16px; text-align: center; }
.cat-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.cat-name { font-weight: 700; }
.cat-copy small { color: #7a3f18; font-size: 13px; }

.score-value {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 28px;
  border: 2px solid #7a3f18;
  background: #fffaf0;
  color: #7a3f18;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
}

.score-cell.filled .score-value { background: #d9c49a; }
.score-cell .preview-value { color: #0a7d6f; }

.score-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 6px 2px;
  color: #7a3f18;
  font-family: 'VT323', monospace;
  font-size: 17px;
}

.score-summary b { font-family: 'Press Start 2P', monospace; font-size: 11px; }
.score-summary.summary-line { border-top: 2px solid rgba(122, 63, 24, 0.55); margin-top: 5px; }
.score-summary.summary-hit b { color: #0a7d6f; }

/* The chunky 6 is the real progress meter: 13 blocks, one per category. */
.six-glyph {
  --six-size: 9px;
  --six-gap: 3px;
  display: inline-grid;
  grid-template-columns: repeat(3, var(--six-size));
  grid-template-rows: repeat(6, var(--six-size));
  gap: var(--six-gap);
  flex: none;
}

.six-glyph.compact { --six-size: 4px; --six-gap: 1px; }
.six-row { display: contents; }

.six-cell {
  width: var(--six-size);
  height: var(--six-size);
  border: 1px solid rgba(244, 187, 63, 0.28);
  background: rgba(244, 187, 63, 0.1);
  box-shadow: inset 0 0 0 1px rgba(3, 16, 22, 0.5);
}

.six-cell.gap { border-color: transparent; background: transparent; box-shadow: none; }

.six-cell.lit {
  border-color: #ffe8a3;
  background: var(--sixzee-gold);
  box-shadow: 0 0 8px rgba(244, 187, 63, 0.75), inset 0 0 0 1px rgba(122, 63, 24, 0.4);
}

.six-glyph.compact .six-cell {
  border-color: rgba(246, 234, 208, 0.22);
  background: rgba(246, 234, 208, 0.1);
  box-shadow: none;
}

.six-glyph.compact .six-cell.lit {
  border-color: var(--chip-color, var(--sixzee-gold));
  background: var(--chip-color, var(--sixzee-gold));
  box-shadow: 0 0 5px var(--chip-color, var(--sixzee-gold));
}

.chip-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.chip-name { white-space: nowrap; }
.chip-bonus { font-size: 12px; }

.score-totals { display: block; }

.sixzee-progress-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border: 2px solid var(--sixzee-gold-dim);
  background:
    radial-gradient(circle at 12% 30%, rgba(244, 187, 63, 0.14), transparent 42%),
    linear-gradient(120deg, rgba(10, 38, 47, 0.96), rgba(3, 16, 22, 0.96));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.55), 0 6px 0 rgba(109, 79, 28, 0.6);
  overflow: hidden;
}

.sixzee-progress-card::after {
  content: 'SIXZEE';
  position: absolute;
  right: 10px;
  top: -10px;
  color: rgba(244, 187, 63, 0.06);
  font-family: 'Press Start 2P', monospace;
  font-size: 46px;
  pointer-events: none;
}

.progress-six {
  --six-size: 10px;
  --six-gap: 3px;
  display: grid;
  place-items: center;
  padding: 9px;
  border: 1px solid var(--sixzee-line);
  background: rgba(3, 16, 22, 0.72);
}

.progress-main { min-width: 0; }

.progress-kicker {
  color: var(--sixzee-teal);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
}

.progress-title { display: flex; align-items: baseline; gap: 5px; margin: 5px 0 7px; }
.progress-title strong { color: var(--sixzee-gold); font-family: 'Press Start 2P', monospace; font-size: 28px; }
.progress-title span { color: rgba(246, 234, 208, 0.65); font-family: 'VT323', monospace; font-size: 20px; }
.progress-title em {
  margin-left: auto;
  color: var(--sixzee-ivory);
  font-family: 'VT323', monospace;
  font-size: 15px;
  font-style: normal;
}

.bonus-meter {
  height: 8px;
  border: 1px solid var(--sixzee-gold-dim);
  background: rgba(3, 16, 22, 0.85);
}

.bonus-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sixzee-teal), var(--sixzee-gold));
  box-shadow: 0 0 10px rgba(95, 224, 208, 0.45);
  transition: width 220ms ease;
}

.bonus-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  color: rgba(246, 234, 208, 0.8);
  font-family: 'VT323', monospace;
  font-size: 14px;
}

.bonus-caption b { color: var(--sixzee-gold); }
.bonus-caption small { color: var(--sixzee-teal); }

.progress-score {
  position: relative;
  z-index: 1;
  padding-left: 16px;
  border-left: 1px dashed var(--sixzee-gold-dim);
  text-align: right;
}

.progress-score > span {
  color: rgba(246, 234, 208, 0.7);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
}

.progress-score b {
  display: block;
  color: var(--sixzee-gold);
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  margin: 6px 0 3px;
}

.progress-score small { color: rgba(246, 234, 208, 0.72); font-family: 'VT323', monospace; font-size: 13px; }

.chip-bonus {
  padding: 1px 5px;
  border: 1px solid var(--sixzee-gold);
  color: var(--sixzee-gold);
  font-size: 14px;
}

.mode-cards .mode-card { width: 172px; }

.phase-indicator {
  margin: 14px 18px 0;
}

.phase-label { color: var(--sixzee-gold); }

.game-log { margin: 12px 18px 18px; }

.seat-portrait {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sixzee-gold);
}

.seat-empty {
  display: inline-grid;
  place-items: center;
  color: var(--sixzee-gold);
  border-style: dashed;
}

@media (max-width: 860px) {
  .sixzee-board { grid-template-columns: 1fr; }
  .dice-stage, .scorecard-wrap, .board-info, .opponents-area { grid-column: 1; }
  .dice-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .die { max-width: 76px; }
  .dice-header { font-size: 8px; }
  .sixzee-progress-card { grid-template-columns: auto 1fr; gap: 12px; }
  .progress-score {
    grid-column: 1 / -1;
    padding: 8px 0 0;
    border-left: 0;
    border-top: 1px dashed var(--sixzee-gold-dim);
    text-align: left;
  }
  .progress-score b { display: inline-block; margin: 0 10px; }
  .progress-title em { margin-left: 0; }
}
