/* Shut the Box. Dice artwork lives in the shared assets/css/dice.css */

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

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

.stb-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3.25rem;
  margin: 0;
  padding: 0.2rem 0 0;
  list-style: none;
}

.stb-tile {
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fffdf7;
  color: #1d2433;
  font-family: Georgia, serif;
  font-size: 1.45rem;
  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;
}

.stb-tile.is-selected {
  border-color: #e0b948;
  transform: translateY(-3px);
  box-shadow: 0 6px 0 #b8923a, 0 8px 10px rgba(0, 0, 0, 0.28);
}

.stb-tile.is-shut {
  background: rgba(0, 0, 0, 0.28);
  color: rgba(244, 240, 232, 0.45);
  border-color: transparent;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: default;
  transform: none;
}

.stb-tile:disabled:not(.is-shut) { cursor: default; }

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

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

.stb-dice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 6.6rem;
}

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

.stb-board .die { width: clamp(3.1rem, 14cqw, 4.1rem); }

.die-wrap.is-aside { opacity: 0.38; }

.stb-total {
  min-width: 4.2rem;
  text-align: center;
  color: #f4f0e8;
}

.stb-total small {
  display: block;
  min-height: 1.2em;
  font: 600 0.72rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stb-total b {
  display: block;
  min-height: 1.15em;
  font-family: Georgia, serif;
  font-size: 2.5rem;
  font-weight: normal;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stb-status {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
  min-height: 2.8em;
  text-align: center;
  color: #f4f0e8;
  font-size: 1rem;
  line-height: 1.4;
}

.stb-status span {
  display: block;
  min-height: 1.4em;
}

.stb-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

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

.stb-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);
}

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

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

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

.stb-stat b {
  display: inline-block;
  min-width: 2.4rem;
}

@container (max-width: 33rem) {
  .stb-tiles { min-height: 7.1rem; }
}

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

  .game-page .game-header h1 {
    font-size: 1.35rem;
    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;
  }

  .stb-tile {
    width: clamp(2.75rem, 17cqw, 3.25rem);
    height: clamp(2.75rem, 17cqw, 3.25rem);
    font-size: 1.3rem;
  }

  .stb-board .die { width: clamp(2.8rem, 18cqw, 3.6rem); }
  .stb-dice { min-height: 5.6rem; gap: 0.6rem; }
  .stb-total b { font-size: 2.15rem; }
}
