[hidden] { display: none !important; }

.alpha-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #120f0c;
  overflow-x: hidden;
}

.alpha-page > header,
.alpha-page > main,
.alpha-page > footer {
  position: relative;
  z-index: 1;
}

.alpha-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(232, 178, 61, 0.16), transparent 42%),
    radial-gradient(ellipse at 88% 100%, rgba(225, 90, 69, 0.14), transparent 46%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 5px
    );
  background-size: 150% 150%, 160% 160%, auto;
  background-position: 0% 0%, 100% 80%, 0 0;
  animation: alpha-wash 18s ease-in-out infinite alternate;
}

.alpha-field::before,
.alpha-field::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
}

.alpha-field::before {
  width: 42vw;
  height: 42vw;
  left: -8vw;
  top: 8vh;
  background: radial-gradient(circle, rgba(232, 178, 61, 0.22), transparent 68%);
  animation: alpha-glow 26s ease-in-out infinite alternate;
}

.alpha-field::after {
  width: 36vw;
  height: 36vw;
  right: -6vw;
  bottom: -4vh;
  background: radial-gradient(circle, rgba(225, 90, 69, 0.18), transparent 70%);
  animation: alpha-glow 34s ease-in-out infinite alternate-reverse;
}

.alpha-field span {
  position: absolute;
  font-family: var(--shg-font-display);
  font-size: clamp(4.5rem, 14vw, 10rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 230, 214, 0.1);
  user-select: none;
  animation:
    alpha-drift var(--dur, 24s) ease-in-out infinite alternate,
    alpha-fade calc(var(--dur, 24s) * 0.8) ease-in-out infinite alternate;
}

.alpha-field span:nth-child(3n) {
  color: rgba(232, 178, 61, 0.055);
  -webkit-text-stroke: 0;
}

.alpha-field span:nth-child(4n) {
  color: transparent;
  -webkit-text-stroke: 1px rgba(225, 90, 69, 0.16);
}

.alpha-field span:nth-child(1) { left: -2%; top: 6%; --rot: -14deg; --dx: 6vw; --dy: 8vh; --dur: 22s; }
.alpha-field span:nth-child(2) { left: 68%; top: -2%; --rot: 8deg; --dx: -5vw; --dy: 6vh; --dur: 28s; font-size: clamp(6rem, 18vw, 13rem); }
.alpha-field span:nth-child(3) { left: 84%; top: 34%; --rot: 16deg; --dx: -7vw; --dy: -5vh; --dur: 18s; }
.alpha-field span:nth-child(4) { left: 6%; top: 70%; --rot: -8deg; --dx: 5vw; --dy: -7vh; --dur: 26s; }
.alpha-field span:nth-child(5) { left: 58%; top: 76%; --rot: 11deg; --dx: 4vw; --dy: -5vh; --dur: 24s; }
.alpha-field span:nth-child(6) { left: 34%; top: 18%; --rot: -4deg; --dx: 3vw; --dy: 6vh; --dur: 32s; font-size: clamp(8rem, 22vw, 16rem); }
.alpha-field span:nth-child(7) { left: 90%; top: 64%; --rot: 6deg; --dx: -4vw; --dy: 5vh; --dur: 20s; }
.alpha-field span:nth-child(8) { left: 18%; top: 40%; --rot: -18deg; --dx: 7vw; --dy: -4vh; --dur: 30s; }
.alpha-field span:nth-child(9) { left: 46%; top: 86%; --rot: 4deg; --dx: -5vw; --dy: -3vh; --dur: 23s; }
.alpha-field span:nth-child(10) { left: -4%; top: 46%; --rot: 12deg; --dx: 6vw; --dy: 4vh; --dur: 27s; }
.alpha-field span:nth-child(11) { left: 74%; top: 16%; --rot: -10deg; --dx: -3vw; --dy: 7vh; --dur: 19s; }
.alpha-field span:nth-child(12) { left: 12%; top: 18%; --rot: 7deg; --dx: 4vw; --dy: 5vh; --dur: 25s; }

@keyframes alpha-drift {
  from { transform: translate3d(0, 0, 0) rotate(var(--rot)); }
  to { transform: translate3d(var(--dx), var(--dy), 0) rotate(calc(var(--rot) + 8deg)); }
}

@keyframes alpha-fade {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes alpha-wash {
  from { background-position: 0% 0%, 100% 80%, 0 0; }
  to { background-position: 10% 8%, 78% 100%, 0 16px; }
}

@keyframes alpha-glow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 5vh, 0) scale(1.18); }
}

.alpha-page .shg-game-header {
  display: block;
  padding: 0;
}

.header-bar {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(0.85rem, 3vw, 1.75rem);
}

.alpha-page .shg-game-title {
  text-align: center;
}

.header-tools {
  display: flex;
  justify-content: flex-end;
}

.music-toggle {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--shg-border);
  border-radius: 4px;
  background: var(--shg-surface);
  color: var(--shg-text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.music-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4z'/></svg>") center / contain no-repeat;
}

.music-toggle.is-muted {
  color: var(--shg-text-muted);
}

.music-toggle.is-muted .music-toggle-icon {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm12.5 1.5 1.4-1.4 1.1 1.1-1.4 1.4 1.4 1.4-1.1 1.1-1.4-1.4-1.4 1.4-1.1-1.1 1.4-1.4-1.4-1.4 1.1-1.1 1.4 1.4z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M4 9v6h4l5 5V4L8 9H4zm12.5 1.5 1.4-1.4 1.1 1.1-1.4 1.4 1.4 1.4-1.1 1.1-1.4-1.4-1.4 1.4-1.1-1.1 1.4-1.4-1.4-1.4 1.1-1.1 1.4 1.4z'/></svg>") center / contain no-repeat;
}

.layout {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1.25rem clamp(0.85rem, 3vw, 1.75rem) 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.15rem;
  align-items: start;
  align-content: center;
  flex: 1;
}

.stage,
.board {
  background: var(--shg-surface);
  border: 1px solid var(--shg-border);
  border-radius: 8px;
}

.stage {
  padding: 1rem;
  min-width: 0;
}

.timer-housing {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 0.85rem 1rem 0.75rem;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    #221e1a;
  border: 1px solid #3a332c;
}

.rec {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--shg-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--shg-text-muted);
}

.rec i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #5c534a;
}

.rec.is-on {
  color: #e7c7bf;
}

.rec.is-on i {
  background: #e15a45;
  box-shadow: 0 0 8px #e15a45;
  animation: rec-pulse 1s ease-in-out infinite;
}

.timer-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.timer-readout {
  font-family: var(--shg-font-mono);
  font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 5.6rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: #6d6254;
}

.timer-readout.is-live {
  color: var(--shg-caution);
  text-shadow: 0 0 28px rgba(232, 178, 61, 0.28);
}

.timer-readout.is-good {
  color: #b6e7a8;
}

.timer-readout.is-bad {
  color: #ffb0a4;
}

.timer-unit {
  font-family: var(--shg-font-mono);
  font-size: 1rem;
  color: var(--shg-text-muted);
}

.meter {
  text-align: right;
  min-width: 6.5rem;
  padding-bottom: 0.15rem;
}

.meter-label,
.mode-kicker,
.board-note,
.hint,
.run-note,
.verdict-sub,
.save-note,
.extra-line {
  font-family: var(--shg-font-mono), "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", sans-serif;
  letter-spacing: 0.04em;
}

.meter-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--shg-text-muted);
}

.meter-value {
  font-family: var(--shg-font-mono);
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--shg-text);
  font-variant-numeric: tabular-nums;
}

.meter-value.is-hot {
  color: var(--shg-caution);
}

.meter-value.is-low {
  color: #ffb0a4;
}

.gauge {
  margin-top: 0.4rem;
  height: 0.4rem;
  border-radius: 99px;
  background: #14110e;
  border: 1px solid #3a332c;
  overflow: hidden;
}

.gauge-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #e15a45;
  border-radius: inherit;
}

.gauge-fill.is-mid {
  background: var(--shg-caution);
}

.gauge-fill.is-full {
  background: #7dcea0;
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
  padding: 1.35rem 0.35rem 0.8rem;
}

.intro-kicker {
  margin: 0;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shg-caution);
}

.intro-title {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--shg-font-display);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 0.92;
  transform-origin: left center;
  will-change: transform;
}

.intro-copy {
  margin: 0;
  max-width: 28rem;
  color: var(--shg-text-muted);
  line-height: 1.45;
}

.intro-begin {
  margin: 1.15rem 0 1rem;
  font-family: var(--shg-font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: intro-pulse 1.8s ease-in-out infinite;
}

.sound-btn {
  border: 1px solid var(--shg-border);
  background: #14110e;
  color: var(--shg-text);
  border-radius: 4px;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
}

.sound-btn[aria-pressed="true"] {
  color: var(--shg-text-muted);
}

.sound-btn:hover {
  border-color: var(--shg-caution);
  color: var(--shg-caution);
}

.intro-layout {
  position: relative;
  margin-top: 0.85rem;
}

.alphabet-menu {
  position: relative;
}

.alphabet-menu-btn {
  font: inherit;
  cursor: pointer;
}

.alphabet-menu-btn::after {
  content: "";
  width: 0.55rem;
  height: 0.38rem;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='black' d='M1 1.2 6 6.8 11 1.2'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='black' d='M1 1.2 6 6.8 11 1.2'/></svg>") center / contain no-repeat;
}

.intro-layout .alphabet-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--shg-text-muted);
  font-family: var(--shg-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-layout .alphabet-menu-btn:hover,
.intro-layout .alphabet-menu-btn:focus-visible,
.intro-layout.is-open .alphabet-menu-btn {
  color: var(--shg-text);
  outline: none;
}

.alphabet-menu-list {
  position: absolute;
  z-index: 8;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 13.5rem;
  margin: 0;
  padding: 0.28rem;
  list-style: none;
  background: #1c1916;
  border: 1px solid #3a332c;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.alphabet-menu-list button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--shg-text);
  font-family: var(--shg-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 0.42rem 0.6rem;
  cursor: pointer;
}

.alphabet-menu-list button:hover,
.alphabet-menu-list button:focus-visible {
  background: #2a2520;
  color: var(--shg-caution);
  outline: none;
}

.alphabet-menu-list button[aria-selected="true"] {
  background: #2a241c;
  color: var(--shg-caution);
}

.layout-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: min(100%, 24rem);
  margin-top: 1.15rem;
}

.board .layout-field {
  width: 100%;
  margin-top: 0.75rem;
}

.layout-field span {
  font-family: var(--shg-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shg-text-muted);
}

.layout-field .alphabet-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #14110e;
  color: var(--shg-text);
  border: 1px solid var(--shg-border);
  border-radius: 4px;
  padding: 0.6rem 0.7rem;
  font-family: var(--shg-font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-align: left;
}

.layout-field .alphabet-menu-btn:hover,
.layout-field .alphabet-menu-btn:focus-visible,
.layout-field.is-open .alphabet-menu-btn {
  border-color: var(--shg-caution);
  outline: none;
}

.layout-field .alphabet-menu-list {
  width: 100%;
}

.board-places {
  margin: 0.45rem 0 0.15rem;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--shg-text-muted);
}

@keyframes intro-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.kicker {
  margin: 1.15rem 0 0.9rem;
  font-family: var(--shg-font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mode-btn {
  text-align: left;
  cursor: pointer;
  color: var(--shg-text);
  background: #241f1b;
  border: 1px solid var(--shg-border);
  border-bottom-width: 4px;
  border-radius: 6px;
  padding: 0.95rem 1rem 0.85rem;
  font: inherit;
}

.mode-btn:hover,
.mode-btn:focus-visible {
  border-color: var(--shg-caution);
}

.mode-kicker {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--shg-caution);
  margin-bottom: 0.3rem;
}

.mode-name {
  display: block;
  font-family: var(--shg-font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.mode-copy {
  display: block;
  margin-top: 0.45rem;
  color: var(--shg-text-muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.hint,
.run-note,
.board-note,
.save-note,
.extra-line,
.verdict-sub {
  color: var(--shg-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.hint {
  margin: 0.95rem 0 0.25rem;
}

.play-surface {
  min-height: 0;
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
}

.prompt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem;
  background: #14110e;
  border: 1px solid #3a332c;
  border-radius: 6px;
}

.prompt-mark {
  font-family: var(--shg-font-mono);
  color: var(--shg-caution);
  font-size: 1.35rem;
}

.prompt-line {
  min-height: 1.5rem;
  min-width: 0;
  flex: 1;
  font-family: var(--shg-font-mono), "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  letter-spacing: 0.08em;
  line-height: 1.4;
  word-break: break-all;
}

.prompt-line .tok-ok,
.prompt-line .tok-order {
  unicode-bidi: isolate;
}

.prompt-line .tok-ok {
  color: #c8f0bc;
}

.prompt-line .tok-order {
  color: #ffd0c8;
  background: #3a1c17;
  border-radius: 2px;
  box-shadow: inset 0 -2px 0 #e15a45;
}

.prompt-placeholder {
  color: #5c534a;
  letter-spacing: 0.02em;
  text-transform: none;
}

.result-prompt {
  margin-bottom: 0.75rem;
}

.keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  max-width: 100%;
}

.key {
  width: clamp(1.2rem, 6vw, 2.65rem);
  height: clamp(2.35rem, 7.4vw, 3.45rem);
  padding: 0.15rem 0 0.2rem;
  border-radius: 5px;
  border: 1px solid #5a5146;
  border-bottom-width: 4px;
  background: #3a342c;
  color: var(--shg-text);
  font-family: var(--shg-font-mono);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
}

.key-letter {
  font-family: var(--shg-font-mono), "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", sans-serif;
  font-size: clamp(0.68rem, 2vw, 0.98rem);
  line-height: 1;
}

.key .want {
  min-height: 0.55rem;
  font-size: 0.48rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  line-height: 1;
  color: transparent;
}

.key:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.key.is-extra {
  color: #6d6254;
  background: #2a2622;
  border-color: #3a332c;
  cursor: default;
}

.key.is-extra:active {
  transform: none;
  border-bottom-width: 4px;
}

.key.is-next {
  border-color: var(--shg-caution);
  color: var(--shg-caution);
}

.key.is-done {
  background: #1d3a24;
  border-color: #3d7a45;
  color: #c8f0bc;
}

.key.is-order,
.key.is-missed {
  color: #ffd0c8;
  border-color: #e15a45;
  background: #3a1c17;
}

.key.is-order .want,
.key.is-missed .want {
  color: #f3d7a1;
}

.key.is-missed {
  border-style: dashed;
}

.rail {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 0.28rem;
}

.chip {
  min-height: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #1a1613;
  border: 1px solid #3a332c;
  font-family: var(--shg-font-mono);
  font-size: clamp(0.68rem, 2vw, 0.92rem);
  text-transform: uppercase;
  color: #6d6254;
  line-height: 1;
}

.chip .want {
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: #8d7f6c;
}

.chip.is-done,
.chip.is-ok {
  color: #c8f0bc;
  border-color: #2f6a3a;
  background: #17301d;
}

.chip.is-next {
  color: var(--shg-caution);
  border-color: var(--shg-caution);
}

.chip.is-bad {
  color: #ffd0c8;
  border-color: #e15a45;
  background: #3a1c17;
}

.chip.is-bad .want,
.chip.is-missing .want,
.chip.is-order .want,
.chip.is-missed .want {
  color: #f3d7a1;
}

.chip.is-order,
.chip.is-missed {
  color: #ffd0c8;
  border-color: #e15a45;
  background: #3a1c17;
}

.chip.is-missed {
  border-style: dashed;
}

.chip.is-missing {
  color: #6d6254;
  border-style: dashed;
}

.run-bar,
.again,
.name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.run-bar {
  margin-top: 0.35rem;
}

.run-note {
  margin: 0;
}

.verdict {
  margin: 1rem 0 0.2rem;
  font-family: var(--shg-font-display);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
}

.verdict.is-praise {
  color: #d7ffe8;
}

.verdict.is-putdown {
  color: #ffd0c8;
}

.verdict-sub {
  margin: 0 0 0.85rem;
}

.extra-line {
  margin: 0.55rem 0 0;
}

.name-form {
  margin-top: 0.9rem;
}

.name-label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--shg-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--shg-text-muted);
}

.name-row {
  justify-content: flex-start;
}

.name-form input {
  flex: 1;
  min-width: 0;
  max-width: 16rem;
  background: #14110e;
  color: var(--shg-text);
  border: 1px solid var(--shg-border);
  border-radius: 4px;
  padding: 0.7rem 0.75rem;
  font-family: var(--shg-font-mono);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.solid-btn,
.text-btn {
  font-family: var(--shg-font-mono);
  cursor: pointer;
}

.solid-btn {
  border: 0;
  border-radius: 4px;
  background: var(--shg-caution);
  color: #1a1714;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.72rem 0.9rem;
}

.solid-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--shg-text-muted);
  padding: 0.4rem 0;
  letter-spacing: 0.04em;
}

.text-btn:hover {
  color: var(--shg-caution);
}

.again {
  justify-content: flex-start;
  margin-top: 1rem;
}

.save-note {
  margin: 0.45rem 0 0;
  color: #ffb0a4;
}

.score-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(12, 10, 8, 0.72);
}

.score-box {
  width: min(26rem, 100%);
  padding: 1.5rem 1.35rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%),
    var(--shg-surface);
  border: 1px solid var(--shg-border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.score-kicker {
  margin: 0;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--shg-caution);
}

.score-title {
  margin: 0.3rem 0 0.45rem;
  font-family: var(--shg-font-display);
  font-size: clamp(2.1rem, 5vw, 2.8rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 0.95;
}

.score-time {
  margin: 0 0 1.15rem;
  font-family: var(--shg-font-mono);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  color: var(--shg-text);
}

.score-box .name-form {
  margin-top: 0;
}

.score-box .name-form input {
  max-width: none;
}

.board {
  padding: 1rem 0.9rem 0.85rem;
  position: sticky;
  top: 0.75rem;
}

.board-title {
  margin: 0;
  font-family: var(--shg-font-display);
  font-size: 1.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.board-best {
  margin: 0.35rem 0 0.7rem;
  font-family: var(--shg-font-mono);
  font-size: 0.72rem;
  color: var(--shg-text-muted);
  line-height: 1.45;
}

.board-head,
.board-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.45rem;
  align-items: baseline;
  font-family: var(--shg-font-mono);
  font-size: 0.78rem;
}

.board-head {
  color: var(--shg-text-muted);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--shg-border);
}

.board-row {
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(70, 61, 53, 0.65);
  color: var(--shg-text);
}

.board-row.is-you {
  color: var(--shg-caution);
}

.board-row .time {
  font-variant-numeric: tabular-nums;
}

.board-note {
  margin: 0.7rem 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.alpha-page .shg-footer {
  margin-top: auto;
}

@keyframes rec-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-height: 760px) {
  .layout {
    align-content: start;
  }
}

@media (max-width: 640px) {
  .header-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .alpha-page .shg-back-link {
    white-space: nowrap;
    font-size: 0.68rem;
    padding: 0.35rem 0.45rem;
  }

  .alpha-page .shg-game-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .board {
    position: static;
  }

  .mode-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .name-row,
  .again {
    flex-wrap: wrap;
  }

  .name-form input {
    max-width: none;
    flex-basis: 100%;
  }
}

@media (hover: hover) and (pointer: fine) {
  .music-toggle:hover {
    border-color: var(--shg-caution);
    color: var(--shg-caution);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rec.is-on i,
  .alpha-field,
  .alpha-field::before,
  .alpha-field::after,
  .alpha-field span,
  .intro-begin {
    animation: none;
  }
}
