:root {
  --game-yellow: #f0c674;
  --game-orange: #de935f;
  --game-red: #a40000;
}

.game-masthead .top-note {
  visibility: visible;
  color: var(--red);
}

.game-shell {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.game-label {
  margin: 0 0 6px;
  color: #555;
  font: 700 10px/1.2 "Courier New", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px inset #fff;
  background: #fff;
}

.community-strip div {
  padding: 12px 10px;
  text-align: center;
}

.community-strip div + div { border-left: 1px dotted #777; }
.community-strip strong { display: block; font: 700 clamp(24px, 5vw, 38px)/1 "Courier New", monospace; }
.community-strip span { color: #555; font: 700 10px/1.2 "Courier New", monospace; text-transform: uppercase; }

.flash,
.game-card,
.game-console,
.leaderboard-card,
.rules-card {
  border: 2px groove #fff;
  background: #ddd;
}

.flash {
  padding: 9px;
  font: 700 12px Arial, sans-serif;
}

.flash-success { color: var(--green); }
.flash-error { color: var(--red); }

.game-signin {
  max-width: 690px;
  margin: 8px auto 0;
  padding: 16px;
  text-align: center;
}

.game-signin h2,
.rules-card h2,
.leaderboard-card h2,
.player-heading h2 { margin: 0; }

.game-signin p { font-size: 17px; }

.game-console { overflow: hidden; }

.player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  color: #fff;
  background: #000080;
}

.player-heading .game-label { color: #c7d7ff; }
.player-heading h2 { overflow-wrap: anywhere; font-size: clamp(22px, 4vw, 34px); }
.player-heading .button { flex: 0 0 auto; }

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
  border-bottom: 2px groove #fff;
  background: #c0c0c0;
}

.scoreboard div {
  padding: 10px;
  border: 2px inset #fff;
  background: #fff;
}

.scoreboard span {
  display: block;
  color: #555;
  font: 700 10px/1.2 "Courier New", monospace;
  text-transform: uppercase;
}

.scoreboard strong {
  display: block;
  margin-top: 4px;
  font: 700 clamp(24px, 5vw, 40px)/1 "Courier New", monospace;
}

.scoreboard strong span {
  display: inline;
  color: inherit;
  font: inherit;
  text-transform: none;
}

.button-stage {
  display: grid;
  min-height: 340px;
  place-items: center;
  padding: 34px;
  border-bottom: 2px groove #fff;
  background:
    repeating-radial-gradient(circle at center, transparent 0 27px, rgba(0, 0, 0, 0.08) 28px 29px),
    #efefef;
}

.point-button {
  display: grid;
  width: min(250px, 68vw);
  aspect-ratio: 1;
  place-content: center;
  border: 12px outset #ffb273;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffd09c, var(--game-orange) 42%, var(--game-red) 76%);
  box-shadow: 0 14px 0 #5c2114, 0 22px 0 rgba(0, 0, 0, 0.18);
  color: #fff8e8;
  cursor: pointer;
  font-family: Arial, sans-serif;
  text-shadow: 2px 2px 0 #5c2114;
  touch-action: manipulation;
  user-select: none;
}

.point-button span { font-size: clamp(64px, 15vw, 112px); font-weight: 900; line-height: 0.85; }
.point-button small { margin-top: 12px; font-size: 16px; font-weight: 900; letter-spacing: 0.24em; }
.point-button:hover { transform: translateY(2px); box-shadow: 0 12px 0 #5c2114, 0 18px 0 rgba(0, 0, 0, 0.18); }
.point-button:active,
.point-button.point-earned { border-style: inset; transform: translateY(10px); box-shadow: 0 4px 0 #5c2114, 0 8px 0 rgba(0, 0, 0, 0.16); }
.point-button:disabled { cursor: wait; filter: grayscale(0.65); opacity: 0.65; }

.energy-panel {
  padding: 12px;
  background: #ddd;
}

.energy-heading {
  display: flex;
  justify-content: space-between;
  font: 700 12px/1.2 "Courier New", monospace;
  text-transform: uppercase;
}

.energy-meter {
  display: block;
  width: 100%;
  height: 18px;
  margin-top: 8px;
  border: 2px inset #fff;
  border-radius: 0;
  background: #fff;
}

.energy-meter::-webkit-progress-bar { background: #fff; }
.energy-meter::-webkit-progress-value { background: linear-gradient(90deg, var(--game-orange), var(--game-yellow)); transition: width 160ms ease; }
.energy-meter::-moz-progress-bar { background: linear-gradient(90deg, var(--game-orange), var(--game-yellow)); transition: width 160ms ease; }
.game-status { min-height: 1.4em; margin: 9px 0 0; font: 12px/1.4 Arial, sans-serif; }

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.leaderboard-card h2,
.rules-card h2 {
  margin: 0;
  padding: 5px 7px;
  color: #fff;
  font: 700 12px Arial, sans-serif;
  text-transform: uppercase;
  background: #000080;
}

.leaderboard-card > div,
.rules-card p { padding: 12px; }
.leaderboard-card ol { margin: 0; padding-left: 24px; }
.leaderboard-card li { padding: 8px 4px; border-bottom: 1px dotted #777; }
.leaderboard-card li:last-child { border-bottom: 0; }
.leaderboard-card li::marker { color: #555; font: 700 12px "Courier New", monospace; }
.leaderboard-card li span { overflow-wrap: anywhere; }
.leaderboard-card li strong { float: right; margin-left: 16px; font-family: "Courier New", monospace; }
.empty-leaderboard { margin: 0; color: #555; }
.rules-card p { margin: 0; line-height: 1.45; }

.game-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 8px;
  border-top: 2px groove #fff;
  padding-top: 12px;
  font: 12px Arial, sans-serif;
}

.dark-mode .community-strip,
.dark-mode .scoreboard div,
.dark-mode .button-stage,
.dark-mode .energy-meter,
.dark-mode .energy-meter::-webkit-progress-bar {
  color: #c5c8c6;
  border-color: #111;
  background: #1d1f21;
}

.dark-mode .flash,
.dark-mode .game-card,
.dark-mode .game-console,
.dark-mode .leaderboard-card,
.dark-mode .rules-card,
.dark-mode .scoreboard,
.dark-mode .energy-panel {
  color: #c5c8c6;
  border-color: #111;
  background: #282a2e;
}

.dark-mode .player-heading,
.dark-mode .leaderboard-card h2,
.dark-mode .rules-card h2 { background: #111; }
.dark-mode .game-label,
.dark-mode .community-strip span,
.dark-mode .scoreboard span,
.dark-mode .leaderboard-card li::marker,
.dark-mode .empty-leaderboard { color: #969896; }
.dark-mode .player-heading .game-label { color: #b5bd68; }
.dark-mode .button-stage { background: repeating-radial-gradient(circle at center, transparent 0 27px, rgba(255, 255, 255, 0.08) 28px 29px), #1d1f21; }
.dark-mode .flash-error { color: #cc6666; }
.dark-mode .flash-success { color: #b5bd68; }

@media (max-width: 680px) {
  .community-strip,
  .scoreboard,
  .leaderboard-grid { grid-template-columns: 1fr; }
  .community-strip div + div { border-top: 1px dotted #777; border-left: 0; }
  .button-stage { min-height: 300px; padding: 28px 18px 38px; }
  .player-heading { align-items: flex-start; flex-direction: column; }
  .game-footer { align-items: center; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .energy-meter::-webkit-progress-value,
  .energy-meter::-moz-progress-bar { transition: none; }
}
