.starry-page {
  padding-bottom: 4rem;
}

.starry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 1.5rem;
  align-items: end;
  padding: 3.5rem 0 2rem;
}

.starry-hero .page-title {
  font-size: clamp(3rem, 8vw, 6rem);
}

.starry-intro {
  max-width: 38rem;
  margin: 1.2rem 0 0;
  color: var(--tend-muted);
  font-size: 1.15rem;
}

.starry-rule-card,
.starry-panel {
  border: 1px solid rgba(214, 211, 209, 0.9);
  border-radius: var(--tend-radius);
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--tend-shadow);
}

.starry-rule-card {
  padding: 1.35rem;
  background: #29241f;
  color: #fffaf1;
}

.starry-rule-card strong {
  color: #f0bd72;
  font-family: Georgia, serif;
  font-size: 1.3rem;
}

.starry-rule-card p {
  margin: 0.55rem 0 0;
  color: #ded2c3;
  font-size: 0.95rem;
}

.starry-game {
  display: grid;
  gap: 1rem;
}

.starry-panel {
  padding: 1.35rem;
}

.setup-panel,
.scoreboard-panel,
.action-panel,
.dice-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setup-panel h2,
.dice-panel h2 {
  margin: 0.15rem 0 0;
  font-family: Georgia, serif;
  font-size: 1.8rem;
}

.panel-copy {
  margin: 0.35rem 0 0;
  color: var(--tend-muted);
  font-size: 0.92rem;
}

.section-kicker,
.panel-label {
  margin: 0;
  color: var(--tend-accent-strong);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-controls,
.action-buttons,
.number-options {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.setup-controls label {
  color: var(--tend-muted);
  font-size: 0.9rem;
}

.setup-controls select {
  min-width: 5.5rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid var(--tend-line);
  border-radius: 12px;
  background: #fffdf9;
  color: var(--tend-text);
  font: inherit;
  font-weight: 700;
}

.starry-button,
.number-option {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.starry-button {
  padding: 0.72rem 1rem;
  border-radius: 12px;
}

.starry-button:hover:not(:disabled),
.number-option:hover:not(:disabled) {
  transform: translateY(-2px);
}

.starry-button:disabled,
.number-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.starry-button--primary {
  background: var(--tend-accent-strong);
  color: #fffaf1;
}

.starry-button--quiet {
  background: var(--tend-panel);
  color: var(--tend-text);
}

.scoreboard-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(100px, auto));
  gap: 1.25rem;
  background: #f0e7da;
}

.scoreboard-main strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--tend-accent-strong);
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.scoreboard-stat {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 0.35rem;
  align-items: baseline;
}

.scoreboard-stat .panel-label {
  grid-column: 1 / -1;
}

.scoreboard-stat strong {
  font-size: 1.6rem;
}

.dice-count-badge {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #29241f;
  color: #f0bd72;
  font-size: 0.86rem;
  font-weight: 800;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 0.7rem;
  min-height: 8rem;
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(240, 189, 114, 0.18), transparent 26%),
    #29241f;
}

.game-die {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  border: 2px solid #e4d9ca;
  border-radius: 13px;
  background: linear-gradient(145deg, #fffdf8, #ded4c8);
  color: #29241f;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.16);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
  transform: rotate(0deg);
}

.game-die.is-rolling {
  animation: die-roll 0.42s ease-in-out infinite alternate;
}

.game-die.is-hit {
  animation: die-hit 0.32s ease forwards;
}

.game-message {
  min-height: 2.3rem;
  margin-top: 1rem;
  color: var(--tend-muted);
  font-weight: 700;
}

.game-message.is-taunt {
  color: var(--tend-accent-strong);
}

.game-message.is-win {
  color: #26734d;
  font-size: 1.15rem;
}

.number-picker {
  display: grid;
  gap: 0.55rem;
}

.number-option {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: var(--tend-panel);
  color: var(--tend-text);
}

.number-option.is-selected {
  background: var(--tend-accent-strong);
  color: #fffaf1;
  box-shadow: 0 0 0 4px rgba(148, 97, 43, 0.15);
}

@keyframes die-roll {
  from { transform: rotate(-12deg) translateY(-2px); }
  to { transform: rotate(12deg) translateY(2px); }
}

@keyframes die-hit {
  to { opacity: 0; transform: scale(0.2) rotate(22deg); }
}

@media (max-width: 720px) {
  .starry-hero {
    grid-template-columns: 1fr;
    padding-top: 2.4rem;
  }

  .setup-panel,
  .action-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-controls,
  .action-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .setup-controls .starry-button,
  .action-buttons .starry-button {
    flex: 1;
  }

  .scoreboard-panel {
    grid-template-columns: 1fr 1fr;
  }

  .scoreboard-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .starry-panel {
    padding: 1rem;
  }

  .dice-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    padding: 0.7rem;
  }

  .game-die {
    border-radius: 9px;
    font-size: 1.1rem;
  }

  .number-options {
    justify-content: space-between;
  }
}
