/* Tic-Tac-Toe Dice. Shared dice art lives in assets/css/dice.css */

.game-root { min-height: 30rem; }

.ttd-board {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(100%, 42rem);
  margin-inline: auto;
  container-type: inline-size;
}

.ttd-seats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.ttd-seat {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-height: 14.5rem;
  padding: 0.55rem 0.5rem 0.55rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.18);
  color: #f4f0e8;
  box-sizing: border-box;
}

.ttd-seat.is-active {
  border-color: #e0b948;
  background: rgba(0, 0, 0, 0.28);
}

.ttd-who {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.4rem;
}

.ttd-name {
  font: 600 0.72rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5e9e2;
}

.ttd-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.15rem;
}

.ttd-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}

.ttd-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 2.75rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fffdf7;
  color: #1d2433;
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 4.2cqw, 1.35rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 0 #c4baa2, 0 4px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  touch-action: manipulation;
}

.ttd-cell .ttd-num { position: relative; z-index: 1; }

.ttd-cell.is-selected {
  border-color: #e0b948;
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #b8923a, 0 7px 10px rgba(0, 0, 0, 0.28);
}

.ttd-cell.is-selected::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #b8923a;
  border-radius: 6px;
  pointer-events: none;
}

.ttd-cell.is-marked {
  background: rgba(0, 0, 0, 0.32);
  color: rgba(244, 240, 232, 0.55);
  border-color: transparent;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: default;
  transform: none;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.ttd-cell.is-marked .ttd-x {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55em;
  font-weight: 700;
  color: rgba(244, 240, 232, 0.55);
  text-decoration: none;
  pointer-events: none;
}

.ttd-cell.is-win {
  background: #fff4c8;
  color: #1d2433;
  border-color: #1d2433;
  border-style: double;
  border-width: 3px;
  box-shadow: 0 0 0 2px #e0b948;
  text-decoration: none;
  cursor: default;
}

.ttd-cell.is-win .ttd-x {
  color: #1d2433;
  opacity: 0.35;
}

.ttd-cell:disabled:not(.is-marked):not(.is-win) { cursor: default; }

.ttd-cell:focus-visible {
  outline: 3px solid #e0b948;
  outline-offset: 2px;
}

@media (hover: hover) {
  .ttd-cell:not(:disabled):hover { border-color: #e0b948; }
}

.ttd-seat-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  min-height: 1.2em;
  padding: 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(244, 240, 232, 0.78);
  font-variant-numeric: tabular-nums;
}

.ttd-dice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 5.8rem;
  flex-wrap: wrap;
}

.ttd-board .dice-tray {
  width: fit-content;
  margin: 0;
  padding: 0.65rem 0.75rem 0.35rem;
}

.ttd-board .die { width: clamp(2.9rem, 12cqw, 3.9rem); }

.ttd-instruction {
  margin: 0;
  min-height: 1.5em;
  text-align: center;
  color: #fffdf7;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
}

.ttd-target {
  margin: 0;
  min-height: 1.35em;
  text-align: center;
  color: #e0b948;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.ttd-detail {
  margin: 0;
  min-height: 2.6em;
  text-align: center;
  color: #f4f0e8;
  font-size: 0.95rem;
  line-height: 1.35;
}

.ttd-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.55rem;
}

.ttd-actions .btn {
  min-height: 3rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.ttd-actions .btn-primary {
  background: linear-gradient(180deg, #e8c45a, #c9a02e);
  border-color: #9c7a1c;
  color: #2a2208;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

.ttd-actions .btn-primary:disabled {
  background: rgba(255, 255, 255, 0.18);
  border-color: transparent;
  color: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.ttd-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  text-align: center;
  color: #e5e9e2;
  font-size: 0.88rem;
  line-height: 1.35;
}

.ttd-caption span {
  display: block;
  min-height: 1.35em;
}

.ttd-objective {
  color: #fffdf7;
  font-weight: 600;
}

.ttd-example {
  color: rgba(244, 240, 232, 0.82);
  font-size: 0.84rem;
}

@media (prefers-reduced-motion: reduce) {
  .ttd-cell.is-selected { transform: none; }
}

@container (max-width: 34rem) {
  .ttd-seats { gap: 0.5rem; }
  .ttd-cell { min-height: 2.4rem; }
}

@media (max-width: 640px) {
  .game-page .breadcrumb {
    padding-top: 0.45rem;
    font-size: 0.8rem;
  }

  .game-page .game-header h1 {
    font-size: 1.3rem;
    margin: 0.15rem 0 0.2rem;
  }

  .game-page .game-intro { display: none; }

  .game-page .game-root {
    min-height: 0;
    margin: 0.45rem 0 1rem;
    padding: 0.55rem;
  }

  .ttd-seat {
    min-height: 0;
    padding: 0.4rem 0.35rem 0.45rem;
  }

  .ttd-cell { min-height: 2.35rem; font-size: 1.05rem; }
  .ttd-board .die { width: clamp(2.6rem, 16cqw, 3.3rem); }
  .ttd-dice { min-height: 5rem; gap: 0.55rem; }
  .ttd-instruction { font-size: 1.05rem; }
  .ttd-target { font-size: 0.98rem; }
  .ttd-detail { font-size: 0.9rem; min-height: 2.4em; }
  .ttd-actions { gap: 0.4rem; }
  .ttd-actions .btn { min-height: 2.75rem; font-size: 0.98rem; }
}
