aside {
  border-radius: 18px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 7%);
  padding: 18px;
  min-height: 0;
  align-self: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.game-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.sidebar-section {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--glass-line);
}

.sidebar-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.section-title {
  margin-bottom: 10px;
}

.sidebar-section > .info-title:first-child {
  margin-top: 0;
}

.turn-actions .mode-select {
  margin-bottom: 0;
}

.turn-actions__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.turn-actions .mode-select--accent {
  font-weight: 600;
  border-color: oklch(62% 0.12 260);
  background: oklch(32% 0.06 260);
}

.turn-actions .mode-select.is-ready {
  font-weight: 600;
  border-color: oklch(72% 0.14 82);
  background: oklch(32% 0.08 82);
  color: oklch(94% 0.04 82);
  box-shadow: 0 0 14px oklch(72% 0.16 82 / 45%);
  animation: begin-ready-pulse 1.6s ease-in-out infinite;
}

@keyframes begin-ready-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px oklch(72% 0.16 82 / 35%);
  }
  50% {
    box-shadow: 0 0 20px oklch(78% 0.18 82 / 55%);
  }
}

.turn-actions .mode-select--danger {
  border-color: oklch(52% 0.14 25);
  color: oklch(78% 0.1 25);
}

.turn-actions .mode-select--danger:hover {
  border-color: oklch(62% 0.16 25);
  background: oklch(28% 0.06 25);
}

.turn-actions .mode-select.is-pass-choice {
  font-weight: 600;
  border-color: oklch(62% 0.16 25);
  background: oklch(28% 0.07 25);
  color: oklch(90% 0.1 25);
  box-shadow: 0 0 14px oklch(62% 0.18 25 / 45%);
  animation: pass-choice-pulse 1.6s ease-in-out infinite;
}

@keyframes pass-choice-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px oklch(62% 0.18 25 / 35%);
  }
  50% {
    box-shadow: 0 0 20px oklch(68% 0.2 25 / 55%);
  }
}

.game-actions .mode-select {
  margin-bottom: 0;
}

.game-actions #new-game.is-highlighted {
  font-weight: 600;
  border-color: oklch(72% 0.14 82);
  background: oklch(32% 0.08 82);
  color: oklch(94% 0.04 82);
  box-shadow: 0 0 14px oklch(72% 0.16 82 / 45%);
  animation: new-game-highlight-pulse 1.6s ease-in-out infinite;
}

@keyframes new-game-highlight-pulse {
  0%,
  100% {
    box-shadow: 0 0 10px oklch(72% 0.16 82 / 35%);
  }
  50% {
    box-shadow: 0 0 20px oklch(78% 0.18 82 / 55%);
  }
}

.game-actions .mode-select--danger {
  border-color: oklch(50% 0.12 25);
  background: oklch(24% 0.05 25);
  color: oklch(76% 0.1 25);
}

.game-actions .mode-select--danger:hover:not(:disabled) {
  border-color: oklch(60% 0.14 25);
  background: oklch(30% 0.07 25);
  color: oklch(88% 0.08 25);
}

.game-actions .mode-select--danger:disabled {
  opacity: 0.5;
}

.sidebar-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.sidebar-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--tile-hover);
  cursor: pointer;
}

#new-game {
  font-weight: 600;
}

.path-rules-subtitle {
  margin: 14px 0 10px;
  font-size: 12px;
}

.game-status-slot {
  flex-shrink: 0;
  height: 4.5rem;
  margin: 0 0 14px;
}

.game-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 14%);
  text-align: center;
  transition:
    background 0.45s ease,
    box-shadow 0.45s ease,
    color 0.3s ease;
}

/* Win virtue atmosphere — matches end-modal backdrop tones (game-modals.css). */
.game-status[data-win-reason="wisdom"] {
  --win-tone: oklch(62% 0.14 250);
  background:
    radial-gradient(ellipse 130% 110% at 50% 8%, oklch(42% 0.12 250 / 52%), transparent 68%),
    radial-gradient(ellipse 90% 80% at 88% 92%, oklch(28% 0.08 250 / 38%), transparent 55%),
    oklch(14% 0.05 250 / 96%);
  box-shadow:
    inset 0 0 0 1px oklch(62% 0.14 250 / 38%),
    0 0 18px oklch(42% 0.12 250 / 28%);
}

.game-status[data-win-reason="vigor"] {
  --win-tone: oklch(72% 0.18 38);
  background:
    radial-gradient(ellipse 130% 110% at 50% 8%, oklch(48% 0.14 38 / 50%), transparent 68%),
    radial-gradient(ellipse 90% 80% at 12% 92%, oklch(32% 0.1 38 / 36%), transparent 55%),
    oklch(14% 0.04 38 / 96%);
  box-shadow:
    inset 0 0 0 1px oklch(72% 0.18 38 / 40%),
    0 0 18px oklch(48% 0.14 38 / 26%);
}

.game-status[data-win-reason="presence"] {
  --win-tone: oklch(72% 0.028 260);
  background:
    radial-gradient(ellipse 125% 105% at 50% 10%, oklch(38% 0.03 260 / 48%), transparent 68%),
    radial-gradient(ellipse 85% 75% at 75% 88%, oklch(24% 0.02 260 / 34%), transparent 55%),
    oklch(13% 0.02 260 / 96%);
  box-shadow:
    inset 0 0 0 1px oklch(72% 0.028 260 / 32%),
    0 0 16px oklch(30% 0.02 260 / 22%);
}

.game-status[data-win-reason="courage"] {
  --win-tone: oklch(76% 0.13 82);
  background:
    radial-gradient(ellipse 130% 110% at 50% 8%, oklch(50% 0.12 82 / 48%), transparent 68%),
    radial-gradient(ellipse 90% 80% at 18% 90%, oklch(34% 0.09 82 / 34%), transparent 55%),
    oklch(14% 0.04 82 / 96%);
  box-shadow:
    inset 0 0 0 1px oklch(76% 0.13 82 / 38%),
    0 0 18px oklch(50% 0.12 82 / 24%);
}

.game-status[data-win-reason="prosperity"] {
  --win-tone: oklch(78% 0.14 145);
  background:
    radial-gradient(ellipse 130% 110% at 50% 8%, oklch(46% 0.12 145 / 50%), transparent 68%),
    radial-gradient(ellipse 90% 80% at 82% 90%, oklch(30% 0.08 145 / 36%), transparent 55%),
    oklch(14% 0.04 145 / 96%);
  box-shadow:
    inset 0 0 0 1px oklch(78% 0.14 145 / 38%),
    0 0 18px oklch(46% 0.12 145 / 26%);
}

.game-status[data-win-reason] .game-status__primary {
  color: var(--win-tone);
}

.game-status[data-win-reason] .game-status__meta {
  color: color-mix(in oklch, var(--win-tone) 70%, var(--muted));
}

.game-status__primary {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text);
}

.game-status__meta {
  min-height: 1.2em;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted);
}

.revival-panel__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.revival-panel__hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.revival-panel__pick {
  margin-bottom: 0;
}

.scoreboard-lotus-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.scoreboard-players {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scoreboard-player {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px oklch(100% 0 0 / 12%);
}

.scoreboard-player--active {
  box-shadow: inset 0 0 0 2px oklch(78% 0.14 82 / 80%);
}

.scoreboard-player__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.scoreboard-player__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.scoreboard-player__total {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.scoreboard-breakdown {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
}

.scoreboard-breakdown dt {
  margin: 0;
  color: var(--muted);
}

.scoreboard-breakdown dd {
  margin: 0;
  text-align: right;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.info-title {
  display: block;
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.how-to-play {
  margin: 0 0 16px;
}

.hover-tile .hovered-title {
  margin-top: 0;
}

.hover-tile .key--debug,
.hover-tile .value--debug {
  display: none;
}

.hover-tile.is-debug-mode .key--debug,
.hover-tile.is-debug-mode .value--debug {
  display: block;
}

.sidebar-tools {
  margin-bottom: 0;
}

.sidebar-tools .sidebar-option {
  margin-bottom: 0;
}

.mode-select {
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 12px;
  border: 1px solid oklch(100% 0 0 / 12%);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
}

.mode-select:focus {
  border-color: var(--tile-hover);
}

.path-controls {
  align-items: center;
  margin-bottom: 6px;
}

.compact-input {
  margin-bottom: 0;
  padding: 8px 10px;
}

.arrow-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.arrow-actions .mode-select {
  margin-bottom: 0;
}

.arrow-actions .mode-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.info-value {
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 800;
}

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px 12px;
  font-size: 13px;
}

.key {
  color: var(--muted);
}

.value {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar-collapsible {
  margin-bottom: 10px;
}

.sidebar-collapsible__summary {
  cursor: pointer;
  list-style: none;
  margin: 0 0 0;
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  user-select: none;
}

.sidebar-collapsible__summary::-webkit-details-marker {
  display: none;
}

.sidebar-collapsible__summary::marker {
  content: "";
}

.sidebar-collapsible__summary::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-0.05em, -0.15em);
  vertical-align: middle;
  opacity: 0.65;
}

.sidebar-collapsible[open] .sidebar-collapsible__summary::after {
  transform: rotate(-135deg) translate(-0.1em, 0.05em);
}

.sidebar-collapsible__body {
  padding-top: 4px;
}

.sidebar-collapsible__body .mode-select:last-child {
  margin-bottom: 0;
}

.debug-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-line);
}

.debug-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}

.debug-panel pre {
  margin: 10px 0 0;
  padding: 10px;
  max-height: 200px;
  overflow: auto;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.sidebar-footer {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--glass-line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  aside {
    order: -1;
    max-height: min(42vh, 360px);
  }
}
