:root {
  color-scheme: dark;
  --ink: #0e0a16;
  --panel: rgba(39, 24, 48, 0.82);
  --panel-strong: rgba(23, 16, 33, 0.94);
  --line: rgba(213, 181, 104, 0.24);
  --text: #f5eff6;
  --muted: #b9a9c4;
  --lime: #d9ff63;
  --mint: #70f0c0;
  --coral: #ff6471;
  --gold: var(--lime);
  --lilac: var(--mint);
  --violet: #8b5bd6;
  --lavender: #c5a3df;
  --blush: #e7afc2;
  --bg-start: #171021;
  --bg-mid: #0e0a16;
  --bg-end: #08060e;
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-right: max(18px, env(safe-area-inset-right));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  --safe-left: max(18px, env(safe-area-inset-left));
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #08060e;
}

body {
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--lime) 86%, transparent);
  outline-offset: 4px;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 8%, color-mix(in srgb, var(--mint) 17%, transparent), transparent 31%),
    radial-gradient(circle at 88% 72%, color-mix(in srgb, var(--lime) 8%, transparent), transparent 28%),
    linear-gradient(155deg, var(--bg-start) 0%, var(--bg-mid) 46%, var(--bg-end) 100%);
}

.game-shell::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  content: "";
}

.game-shell::after {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.42);
  content: "";
}

#gameCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.knife-cursor {
  --knife-angle: 0rad;
  --knife-x: -100px;
  --knife-y: -100px;
  position: absolute;
  top: var(--knife-y);
  left: var(--knife-x);
  z-index: 19;
  width: 58px;
  height: 58px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 5px 7px rgba(5, 2, 9, 0.58));
  transform: translate(-57px, -42px) rotate(var(--knife-angle)) scale(0.98);
  transform-origin: 57px 42px;
  transition: opacity 90ms ease, filter 90ms ease;
  will-change: top, left, transform;
}

.knife-cursor.is-visible {
  opacity: 1;
}

.knife-cursor.is-slicing {
  filter:
    drop-shadow(0 4px 6px rgba(5, 2, 9, 0.62))
    drop-shadow(0 0 7px color-mix(in srgb, var(--mint) 58%, transparent));
  transform: translate(-57px, -42px) rotate(var(--knife-angle)) scale(1.08);
}

.knife-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.knife-cursor__blade {
  fill: #e9e5ef;
  stroke: #35283c;
  stroke-width: 2.1;
  stroke-linejoin: round;
}

.knife-cursor__shine {
  fill: rgba(255, 255, 255, 0.88);
}

.knife-cursor__hole {
  fill: #2b1d34;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.2;
}

.knife-cursor__guard {
  fill: var(--lime);
  stroke: #493a2b;
  stroke-width: 1.8;
}

.knife-cursor__handle {
  fill: #49305c;
  stroke: #25182d;
  stroke-width: 2.2;
}

.knife-cursor__grip {
  fill: none;
  stroke: color-mix(in srgb, var(--mint) 56%, #fff);
  stroke-width: 1.8;
  stroke-linecap: round;
}

@media (hover: hover) and (pointer: fine) {
  #gameCanvas {
    cursor: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .knife-cursor {
    display: none;
  }
}

.topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  pointer-events: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--lime) 52%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--lime) 9%, transparent);
  transform: rotate(-5deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  left: 9px;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--lime);
  content: "";
  transform: rotate(-42deg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--lime) 45%, transparent);
}

.brand-mark::before { top: 11px; }
.brand-mark span { top: 17px; }
.brand-mark::after { top: 23px; }

.micro-label,
.brand-title,
.eyebrow,
.hero-copy,
.start-meta p,
.game-tip,
.countdown-number + p,
.result-card p {
  margin: 0;
}

.micro-label {
  color: var(--lime);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.brand-title {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.brand-title span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.top-actions {
  display: flex;
  gap: 9px;
  pointer-events: auto;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8, 21, 30, 0.66);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.17);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--lime) 42%, transparent);
  background: rgba(18, 40, 47, 0.8);
  transform: translateY(-1px);
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button .sound-off,
.icon-button[aria-pressed="false"] .sound-on {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-off {
  display: block;
}

.hud {
  position: absolute;
  top: calc(var(--safe-top) + 64px);
  left: 50%;
  z-index: 10;
  display: grid;
  grid-template-columns: 108px minmax(146px, 190px) 108px;
  gap: 8px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.hud.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.score-block,
.timer-block,
.lives-block {
  min-height: 62px;
  padding: 9px 13px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 17, 25, 0.65);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
  text-align: center;
  backdrop-filter: blur(14px);
}

.hud-label {
  display: block;
  margin-bottom: 1px;
  color: #7e9996;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

#scoreValue,
#timerValue {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

#scoreValue.bump {
  display: inline-block;
  animation: score-bump 180ms ease-out;
}

#scoreValue.compact {
  font-size: 18px;
  letter-spacing: 0;
}

.timer-block {
  min-width: 146px;
}

.timer-track {
  width: 100%;
  height: 3px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.timer-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--lime));
  box-shadow: 0 0 10px color-mix(in srgb, var(--mint) 62%, transparent);
  transform-origin: left;
}

.timer-block.fever {
  border-color: rgba(255, 100, 113, 0.46);
  animation: fever-pulse 850ms ease-in-out infinite alternate;
}

.timer-block.fever #timerValue {
  color: #ff9e91;
}

.lives {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
}

.life {
  color: var(--coral);
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255, 100, 113, 0.55);
  transition: color 200ms ease, opacity 200ms ease, transform 200ms ease;
}

.life:not(.active) {
  color: #304148;
  opacity: 0.62;
  text-shadow: none;
  transform: scale(0.74);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: grid;
  padding: calc(var(--safe-top) + 65px) var(--safe-right) var(--safe-bottom) var(--safe-left);
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(90deg, rgba(3, 11, 17, 0.82), rgba(3, 11, 17, 0.36) 62%, rgba(3, 11, 17, 0.15));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#startScreen {
  justify-items: start;
  padding-left: max(7.5vw, var(--safe-left));
}

.hero-card {
  width: min(540px, 47vw);
  padding: 38px 42px 34px;
  border: 1px solid rgba(220, 255, 240, 0.13);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(8, 24, 32, 0.89), rgba(7, 18, 27, 0.73));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(22px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.eyebrow span {
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

h1 {
  margin: 16px 0 18px;
  font-size: clamp(48px, 5.5vw, 82px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.07em;
}

h1 em {
  color: var(--lime);
  font-style: normal;
  text-shadow: 0 0 34px color-mix(in srgb, var(--lime) 16%, transparent);
}

.hero-copy {
  max-width: 420px;
  color: #a8bbb7;
  font-size: 14px;
  line-height: 1.75;
}

.how-to {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 26px 0 18px;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 65px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.028);
}

.instruction > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.instruction strong {
  font-size: 13px;
  font-weight: 760;
}

.instruction small {
  color: #718985;
  font-size: 10px;
}

.mouse-icon,
.swipe-icon {
  position: relative;
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 34px;
}

.mouse-icon {
  border: 1.5px solid #8fb0aa;
  border-radius: 14px;
}

.mouse-icon::after {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 7px;
  border-radius: 99px;
  background: var(--lime);
  content: "";
  transform: translateX(-50%);
}

.swipe-icon::before {
  position: absolute;
  top: 4px;
  right: 3px;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--lime);
  border-radius: 50%;
  content: "";
  transform: rotate(-36deg);
}

.swipe-icon::after {
  position: absolute;
  top: 1px;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--lime);
  border-right: 2px solid var(--lime);
  content: "";
  transform: rotate(17deg);
}

.swipe-icon i {
  position: absolute;
  bottom: 0;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8fb0aa;
  box-shadow: 0 0 9px rgba(143, 176, 170, 0.5);
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: -3px 0 13px;
}

.mode-option {
  display: flex;
  min-height: 51px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  color: #879d99;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.mode-option:hover {
  border-color: color-mix(in srgb, var(--lime) 30%, transparent);
  color: var(--text);
  transform: translateY(-1px);
}

.mode-option:disabled,
.primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.mode-option.selected {
  border-color: color-mix(in srgb, var(--lime) 58%, transparent);
  background: color-mix(in srgb, var(--lime) 10%, transparent);
  color: var(--text);
  box-shadow: inset 0 0 20px color-mix(in srgb, var(--lime) 4%, transparent);
}

.mode-option strong {
  font-size: 12px;
  font-weight: 850;
}

.mode-option.selected strong {
  color: var(--lime);
}

.mode-option small {
  color: #708783;
  font-size: 9px;
  font-weight: 650;
}

.primary-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--lime);
  color: #122014;
  box-shadow: 0 13px 35px color-mix(in srgb, var(--lime) 18%, transparent);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.primary-button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.47) 48%, transparent 68%);
  content: "";
  transform: translateX(-110%);
  transition: transform 430ms ease;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 17px 42px color-mix(in srgb, var(--lime) 25%, transparent);
  transform: translateY(-2px);
}

.primary-button:hover:not(:disabled)::before {
  transform: translateX(110%);
}

.button-arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: rgba(11, 28, 15, 0.12);
  font-size: 19px;
}

.start-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  color: #718985;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.start-meta p {
  display: flex;
  align-items: center;
  gap: 7px;
}

.start-meta strong {
  color: #c7d6d1;
  font-size: 10px;
}

.warning-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 9px var(--coral);
}

#countdownScreen {
  align-content: center;
  background: rgba(3, 12, 18, 0.33);
  text-align: center;
}

.countdown-number {
  color: var(--lime);
  font-size: min(25vw, 180px);
  font-weight: 950;
  line-height: 0.8;
  text-shadow: 0 0 60px color-mix(in srgb, var(--lime) 22%, transparent);
  animation: countdown-pop 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.countdown-number + p {
  margin-top: 24px;
  color: #a9bdb7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.26em;
}

.compact-screen {
  background: rgba(3, 11, 17, 0.72);
  backdrop-filter: blur(10px);
}

.result-card {
  position: relative;
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid rgba(220, 255, 240, 0.14);
  border-radius: 26px;
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.result-card .eyebrow {
  justify-content: center;
}

.result-card h2 {
  margin: 13px 0 24px;
  font-size: 31px;
  letter-spacing: -0.04em;
}

.final-score {
  display: flex;
  min-height: 114px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--lime) 18%, transparent);
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 10%, transparent), color-mix(in srgb, var(--mint) 3.5%, transparent));
}

.final-score span,
.result-grid span {
  color: #7d9591;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.final-score strong {
  margin-top: 4px;
  color: var(--lime);
  font-size: 47px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0.04em;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 9px 0 20px;
}

.result-grid > div {
  display: flex;
  min-height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.023);
}

.result-grid strong {
  margin-top: 3px;
  font-size: 20px;
}

.new-record {
  position: absolute;
  top: -14px;
  left: 50%;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--lime);
  color: #132017;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.17em;
  transform: translateX(-50%) rotate(-2deg);
}

.text-button {
  margin-top: 15px;
  border: 0;
  background: transparent;
  color: #829994;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover { color: var(--text); }

.pause-card p:not(.eyebrow) {
  margin: -12px 0 25px;
  color: #8da39e;
  font-size: 13px;
}

.combo-pill {
  position: absolute;
  top: 34%;
  left: 50%;
  z-index: 11;
  display: flex;
  min-width: 155px;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 10px 12px 10px 16px;
  border: 1px solid color-mix(in srgb, var(--lime) 50%, transparent);
  border-radius: 999px;
  background: rgba(10, 30, 31, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22), 0 0 24px color-mix(in srgb, var(--lime) 8%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px) scale(0.87);
  backdrop-filter: blur(12px);
}

.combo-pill.show {
  animation: combo-pop 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.combo-pill span {
  color: var(--lime);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.combo-pill small {
  padding: 5px 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--lime) 12%, transparent);
  color: color-mix(in srgb, var(--lime) 72%, white);
  font-size: 10px;
  font-weight: 850;
}

.fever-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}

.fever-banner.show {
  animation: fever-banner 1800ms ease both;
}

.fever-banner span {
  color: #ff9c78;
  font-size: clamp(33px, 6vw, 66px);
  font-weight: 950;
  font-style: italic;
  letter-spacing: -0.04em;
  text-shadow: 0 0 34px rgba(255, 99, 94, 0.42);
}

.fever-banner small {
  color: #ffd9b7;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.3em;
}

.game-tip {
  position: absolute;
  bottom: var(--safe-bottom);
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  background: rgba(5, 17, 25, 0.46);
  color: #758c88;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.game-tip span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 7px var(--mint);
}

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

@keyframes score-bump {
  45% { color: var(--lime); transform: scale(1.18); }
}

@keyframes countdown-pop {
  from { opacity: 0; transform: scale(1.45); }
  28% { opacity: 1; }
  to { opacity: 0.78; transform: scale(0.9); }
}

@keyframes combo-pop {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(0.75); }
  18%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -16px) scale(0.95); }
}

@keyframes fever-pulse {
  to { box-shadow: 0 0 26px rgba(255, 100, 113, 0.15); }
}

@keyframes fever-banner {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.85); }
  18%, 68% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -15px) scale(1.04); }
}

@media (min-width: 1200px) {
  .game-shell {
    width: min(1440px, 100%);
    margin: 0 auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }
}

@media (max-width: 760px) {
  :root {
    --safe-top: max(12px, env(safe-area-inset-top));
    --safe-right: max(12px, env(safe-area-inset-right));
    --safe-bottom: max(12px, env(safe-area-inset-bottom));
    --safe-left: max(12px, env(safe-area-inset-left));
  }

  .brand-lockup { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; transform: scale(0.9) rotate(-5deg); }
  .brand-title { font-size: 13px; }
  .brand-title span { display: none; }
  .micro-label { font-size: 7px; }
  .top-actions { gap: 6px; }
  .icon-button { width: 38px; height: 38px; border-radius: 12px; }

  .hud {
    top: calc(var(--safe-top) + 52px);
    grid-template-columns: 82px minmax(104px, 1fr) 82px;
    gap: 5px;
    width: calc(100% - 24px);
  }

  .score-block,
  .timer-block,
  .lives-block {
    min-height: 55px;
    padding: 8px 6px;
    border-radius: 13px;
  }

  .timer-block { min-width: 0; }
  #scoreValue, #timerValue { font-size: 21px; }
  .lives { gap: 6px; margin-top: 6px; }
  .life { font-size: 14px; }

  #startScreen {
    align-items: end;
    justify-items: stretch;
    padding: calc(var(--safe-top) + 58px) var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: linear-gradient(180deg, rgba(3, 11, 17, 0.08), rgba(3, 11, 17, 0.54) 44%, rgba(3, 11, 17, 0.95));
  }

  .hero-card {
    width: 100%;
    padding: 24px 22px 20px;
    border-radius: 24px;
  }

  h1 { margin: 11px 0 12px; font-size: clamp(43px, 13.5vw, 65px); }
  .hero-copy { font-size: 12px; line-height: 1.6; }
  .how-to { margin: 18px 0 13px; }
  .instruction { min-height: 56px; padding: 9px 10px; }
  .instruction strong { font-size: 11px; }
  .instruction small { font-size: 9px; }
  .mouse-icon, .swipe-icon { transform: scale(0.82); }
  .mode-selector { gap: 7px; margin-bottom: 11px; }
  .mode-option { min-height: 47px; padding: 7px 11px; }
  .primary-button { min-height: 54px; }
  .start-meta { margin-top: 13px; }
  .game-tip { display: none; }
  .result-card { padding: 30px 22px 24px; }
  .combo-pill { top: 30%; }
}

@media (max-width: 380px), (max-height: 650px) {
  .hero-card { padding-top: 18px; }
  h1 { font-size: 40px; }
  .hero-copy { display: none; }
  .how-to { margin-top: 14px; }
  .mode-option { min-height: 42px; }
  .result-card h2 { margin-bottom: 16px; }
  .final-score { min-height: 92px; }
  .result-grid > div { min-height: 58px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --safe-top: max(8px, env(safe-area-inset-top));
    --safe-right: max(10px, env(safe-area-inset-right));
    --safe-bottom: max(8px, env(safe-area-inset-bottom));
    --safe-left: max(10px, env(safe-area-inset-left));
  }

  .brand-mark { width: 32px; height: 32px; transform: scale(0.82) rotate(-5deg); }
  .brand-lockup { gap: 5px; }
  .brand-title { font-size: 12px; }
  .micro-label { font-size: 7px; }
  .top-actions { gap: 5px; }
  .icon-button { width: 36px; height: 36px; border-radius: 11px; }

  .hud {
    top: var(--safe-top);
    grid-template-columns: 86px 132px 86px;
    gap: 5px;
  }

  .score-block,
  .timer-block,
  .lives-block {
    min-height: 50px;
    padding: 6px 8px;
    border-radius: 12px;
  }

  #scoreValue,
  #timerValue { font-size: 19px; }
  .lives { margin-top: 4px; }

  #startScreen {
    align-items: center;
    justify-items: start;
    padding: 48px var(--safe-right) var(--safe-bottom) max(7vw, var(--safe-left));
  }

  .hero-card {
    width: min(610px, 68vw);
    padding: 15px 20px 13px;
    border-radius: 20px;
  }

  h1 {
    margin: 7px 0 9px;
    font-size: 36px;
    line-height: 0.92;
  }

  .hero-copy { display: none; }
  .how-to { gap: 7px; margin: 10px 0 9px; }
  .instruction { min-height: 43px; padding: 6px 10px; }
  .instruction strong { font-size: 11px; }
  .mouse-icon, .swipe-icon { transform: scale(0.72); }
  .mode-selector { gap: 6px; margin: -2px 0 7px; }
  .mode-option { min-height: 38px; padding: 5px 10px; border-radius: 11px; }
  .mode-option small { display: none; }
  .primary-button { min-height: 45px; border-radius: 13px; }
  .button-arrow { width: 31px; height: 31px; }
  .start-meta { margin-top: 7px; }
  .game-tip { display: none; }

  .result-card {
    width: min(610px, 72vw);
    padding: 18px 22px 14px;
  }

  .result-card h2 { margin: 7px 0 10px; font-size: 24px; }
  .final-score { min-height: 64px; }
  .final-score strong { font-size: 32px; }
  .result-grid { margin: 7px 0 10px; }
  .result-grid > div { min-height: 48px; }
  .result-grid strong { font-size: 17px; }
  .text-button { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Moonlit atelier presentation layer. The game pieces stay untouched; this
   section only changes the frame, hierarchy, and interaction chrome. */

button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 88%, white);
  outline-offset: 4px;
}

.game-shell {
  background:
    radial-gradient(circle at 76% 13%, color-mix(in srgb, var(--lilac) 17%, transparent), transparent 27%),
    radial-gradient(circle at 15% 92%, color-mix(in srgb, var(--violet) 15%, transparent), transparent 33%),
    linear-gradient(155deg, var(--bg-start) 0%, var(--bg-mid) 52%, var(--bg-end) 100%);
}

.game-shell::before {
  z-index: 2;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 31px, color-mix(in srgb, var(--lavender) 9%, transparent) 32px 33px, transparent 34px 64px),
    repeating-linear-gradient(-45deg, transparent 0 31px, color-mix(in srgb, var(--lavender) 7%, transparent) 32px 33px, transparent 34px 64px),
    radial-gradient(circle at 2% 50%, color-mix(in srgb, var(--violet) 11%, transparent), transparent 28%),
    radial-gradient(circle at 98% 42%, color-mix(in srgb, var(--gold) 7%, transparent), transparent 26%);
  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;
  content: "";
  mask-image: linear-gradient(90deg, black 0%, transparent 23%, transparent 77%, black 100%);
  opacity: 0.5;
  pointer-events: none;
}

.game-shell::after {
  border: 1px solid color-mix(in srgb, var(--gold) 10%, transparent);
  box-shadow:
    inset 0 0 110px rgba(6, 3, 11, 0.66),
    inset 0 0 0 5px rgba(197, 163, 223, 0.014);
}

.brand-lockup {
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-left: 1px solid color-mix(in srgb, var(--gold) 52%, transparent);
  background: linear-gradient(90deg, rgba(23, 16, 33, 0.56), transparent);
  text-shadow: 0 1px 8px rgba(4, 2, 8, 0.78);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  border-radius: 14px 5px 14px 5px;
  background:
    radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--lavender) 21%, transparent), transparent 32%),
    linear-gradient(145deg, rgba(62, 39, 80, 0.92), rgba(23, 16, 33, 0.94));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--lavender) 8%, transparent),
    0 0 22px color-mix(in srgb, var(--violet) 12%, transparent);
  transform: rotate(-3deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  background: var(--gold);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 32%, transparent);
}

.micro-label {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.25em;
}

.brand-title {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.brand-title span {
  color: color-mix(in srgb, var(--lavender) 74%, var(--muted));
}

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-color: color-mix(in srgb, var(--gold) 25%, transparent);
  border-radius: 12px 5px 12px 5px;
  background: linear-gradient(150deg, rgba(47, 30, 59, 0.82), rgba(16, 11, 25, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(197, 163, 223, 0.035),
    0 10px 26px rgba(5, 3, 9, 0.25);
  color: color-mix(in srgb, var(--lavender) 84%, white);
}

.icon-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--gold) 62%, transparent);
  background: linear-gradient(150deg, rgba(67, 42, 82, 0.94), rgba(25, 16, 36, 0.94));
  color: color-mix(in srgb, var(--gold) 84%, white);
}

.hud {
  gap: 7px;
  filter: drop-shadow(0 14px 24px rgba(5, 3, 9, 0.28));
}

.score-block,
.timer-block,
.lives-block {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--gold) 21%, transparent);
  border-radius: 11px 4px 11px 4px;
  background:
    linear-gradient(180deg, rgba(49, 31, 60, 0.86), rgba(20, 14, 30, 0.82)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(197, 163, 223, 0.018) 13px 14px);
  box-shadow:
    inset 0 1px rgba(245, 239, 246, 0.045),
    inset 0 -1px color-mix(in srgb, var(--violet) 8%, transparent),
    0 12px 34px rgba(4, 2, 8, 0.22);
}

.score-block::before,
.timer-block::before,
.lives-block::before {
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 72%, transparent), transparent);
  content: "";
}

.hud-label {
  color: color-mix(in srgb, var(--lavender) 72%, var(--muted));
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.24em;
}

#scoreValue,
#timerValue {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  text-shadow: 0 0 18px color-mix(in srgb, var(--lavender) 12%, transparent);
}

.timer-track {
  height: 2px;
  background: rgba(197, 163, 223, 0.11);
}

.timer-track span {
  background: linear-gradient(90deg, var(--lilac), var(--gold));
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 44%, transparent);
}

.life {
  color: var(--blush);
  text-shadow: 0 0 12px color-mix(in srgb, var(--blush) 48%, transparent);
}

.life:not(.active) {
  color: #574a61;
}

.screen {
  background:
    linear-gradient(90deg, rgba(10, 6, 16, 0.9), rgba(17, 10, 27, 0.48) 58%, rgba(20, 12, 30, 0.22)),
    repeating-linear-gradient(135deg, transparent 0 39px, rgba(197, 163, 223, 0.018) 40px 41px, transparent 42px 80px);
}

#startScreen {
  isolation: isolate;
  background:
    radial-gradient(circle at 79% 18%, color-mix(in srgb, var(--lavender) 13%, transparent), transparent 25%),
    linear-gradient(90deg, rgba(8, 5, 13, 0.94), rgba(20, 12, 30, 0.53) 58%, rgba(25, 15, 36, 0.22));
}

#startScreen::before {
  position: absolute;
  top: 10%;
  right: 4.5%;
  z-index: 0;
  width: min(38vw, 500px);
  height: 72%;
  border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  border-radius: 48% 48% 12px 12px / 28% 28% 8px 8px;
  background:
    radial-gradient(circle at 50% 17%, color-mix(in srgb, var(--lavender) 13%, transparent), transparent 29%),
    repeating-linear-gradient(45deg, transparent 0 31px, color-mix(in srgb, var(--lavender) 7%, transparent) 32px 33px, transparent 34px 64px),
    repeating-linear-gradient(-45deg, transparent 0 31px, color-mix(in srgb, var(--gold) 4%, transparent) 32px 33px, transparent 34px 64px);
  box-shadow:
    inset 0 0 0 8px rgba(197, 163, 223, 0.018),
    inset 0 0 58px rgba(139, 91, 214, 0.08),
    0 0 48px rgba(10, 5, 18, 0.28);
  content: "";
  opacity: 0.66;
  pointer-events: none;
}

#startScreen::after {
  position: absolute;
  right: -4%;
  bottom: 8%;
  z-index: 0;
  width: 58%;
  height: 22%;
  border-top: 1px solid color-mix(in srgb, var(--gold) 12%, transparent);
  border-radius: 50% 0 0;
  background: radial-gradient(ellipse at 58% 0%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 68%);
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

#startScreen > * {
  position: relative;
  z-index: 1;
}

.hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--gold) 27%, transparent);
  border-radius: 20px 7px 20px 7px;
  background:
    linear-gradient(145deg, rgba(44, 27, 54, 0.92), rgba(18, 12, 27, 0.88)),
    repeating-linear-gradient(45deg, transparent 0 17px, rgba(197, 163, 223, 0.025) 18px 19px);
  box-shadow:
    0 32px 90px rgba(4, 2, 8, 0.43),
    inset 0 1px rgba(245, 239, 246, 0.06),
    inset 0 0 0 5px rgba(213, 181, 104, 0.018);
}

.hero-card::before {
  position: absolute;
  top: 0;
  left: 28px;
  z-index: 0;
  width: 112px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 18%, transparent);
  content: "";
}

.hero-card::after {
  position: absolute;
  right: -40px;
  bottom: -46px;
  z-index: 0;
  width: 190px;
  height: 190px;
  background:
    repeating-linear-gradient(45deg, transparent 0 20px, color-mix(in srgb, var(--lavender) 6%, transparent) 21px 22px, transparent 23px 42px),
    repeating-linear-gradient(-45deg, transparent 0 20px, color-mix(in srgb, var(--lavender) 5%, transparent) 21px 22px, transparent 23px 42px);
  content: "";
  opacity: 0.62;
  pointer-events: none;
  transform: rotate(7deg);
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: color-mix(in srgb, var(--gold) 82%, white);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.24em;
}

.eyebrow span {
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 30%, transparent);
}

h1,
.result-card h2,
.countdown-number {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.055em;
  text-shadow: 0 5px 28px rgba(5, 2, 10, 0.5);
}

h1 em {
  color: color-mix(in srgb, var(--gold) 84%, #fff2ca);
  text-shadow: 0 0 34px color-mix(in srgb, var(--gold) 16%, transparent);
}

.hero-copy {
  color: color-mix(in srgb, var(--lavender) 62%, #9f96aa);
}

.instruction {
  border-color: rgba(197, 163, 223, 0.14);
  border-radius: 10px 3px 10px 3px;
  background: linear-gradient(145deg, rgba(197, 163, 223, 0.055), rgba(9, 6, 14, 0.05));
  box-shadow: inset 0 1px rgba(245, 239, 246, 0.025);
}

.instruction strong {
  color: var(--text);
}

.instruction small {
  color: color-mix(in srgb, var(--lavender) 55%, #766d7f);
}

.mouse-icon {
  border-color: color-mix(in srgb, var(--lavender) 72%, transparent);
}

.mouse-icon::after,
.swipe-icon i {
  background: var(--gold);
  box-shadow: 0 0 9px color-mix(in srgb, var(--gold) 40%, transparent);
}

.swipe-icon::before,
.swipe-icon::after {
  border-color: var(--gold);
}

.mode-option {
  min-height: 52px;
  border-color: rgba(197, 163, 223, 0.14);
  border-radius: 9px 3px 9px 3px;
  background: rgba(197, 163, 223, 0.028);
  color: color-mix(in srgb, var(--lavender) 62%, #82768c);
}

.mode-option:hover {
  border-color: color-mix(in srgb, var(--gold) 42%, transparent);
  background: color-mix(in srgb, var(--violet) 8%, transparent);
}

.mode-option.selected {
  border-color: color-mix(in srgb, var(--gold) 62%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, transparent), color-mix(in srgb, var(--violet) 8%, transparent));
  box-shadow:
    inset 3px 0 color-mix(in srgb, var(--gold) 75%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--violet) 5%, transparent);
}

.mode-option.selected strong {
  color: color-mix(in srgb, var(--gold) 84%, white);
}

.mode-option small {
  color: color-mix(in srgb, var(--lavender) 50%, #6f6578);
}

.primary-button {
  min-height: 58px;
  border: 1px solid color-mix(in srgb, var(--gold) 76%, #fff3c9);
  border-radius: 11px 4px 11px 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 74%, #fff2c4), var(--gold));
  color: #211427;
  box-shadow:
    0 14px 34px color-mix(in srgb, var(--gold) 14%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.43),
    inset 0 -1px rgba(50, 30, 22, 0.18);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-weight: 800;
}

.primary-button:hover:not(:disabled) {
  box-shadow:
    0 18px 42px color-mix(in srgb, var(--gold) 21%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.55),
    inset 0 -1px rgba(50, 30, 22, 0.18);
}

.button-arrow {
  border: 1px solid rgba(45, 24, 48, 0.16);
  border-radius: 9px 3px 9px 3px;
  background: rgba(31, 17, 37, 0.13);
}

.start-meta {
  color: color-mix(in srgb, var(--lavender) 48%, #756b7d);
}

.start-meta strong {
  color: color-mix(in srgb, var(--lavender) 75%, white);
}

.warning-dot {
  background: var(--blush);
  box-shadow: 0 0 9px color-mix(in srgb, var(--blush) 72%, transparent);
}

#countdownScreen {
  background: radial-gradient(circle, rgba(65, 39, 81, 0.38), rgba(8, 5, 13, 0.68));
}

.countdown-number {
  color: color-mix(in srgb, var(--gold) 82%, white);
  font-weight: 700;
  text-shadow:
    0 0 42px color-mix(in srgb, var(--gold) 23%, transparent),
    0 10px 52px rgba(6, 3, 10, 0.52);
}

.countdown-number + p {
  color: color-mix(in srgb, var(--lavender) 73%, white);
}

.compact-screen {
  background:
    radial-gradient(circle at 50% 42%, rgba(65, 39, 81, 0.34), transparent 46%),
    rgba(8, 5, 13, 0.82);
}

.result-card {
  isolation: isolate;
  overflow: visible;
  border-color: color-mix(in srgb, var(--gold) 28%, transparent);
  border-radius: 18px 6px 18px 6px;
  background:
    linear-gradient(145deg, rgba(45, 28, 56, 0.97), rgba(18, 12, 27, 0.97)),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(197, 163, 223, 0.02) 17px 18px);
  box-shadow:
    0 32px 90px rgba(4, 2, 8, 0.52),
    inset 0 0 0 5px rgba(213, 181, 104, 0.018);
}

.result-card h2 {
  font-weight: 760;
}

.final-score {
  border-color: color-mix(in srgb, var(--gold) 28%, transparent);
  border-radius: 12px 4px 12px 4px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 9%, transparent), color-mix(in srgb, var(--violet) 8%, transparent));
  box-shadow: inset 0 0 28px rgba(197, 163, 223, 0.025);
}

.final-score span,
.result-grid span {
  color: color-mix(in srgb, var(--lavender) 62%, #817689);
}

.final-score strong {
  color: color-mix(in srgb, var(--gold) 86%, white);
  font-family: Georgia, "Times New Roman", serif;
}

.result-grid > div {
  border-color: rgba(197, 163, 223, 0.12);
  border-radius: 9px 3px 9px 3px;
  background: rgba(197, 163, 223, 0.025);
}

.new-record {
  border: 1px solid color-mix(in srgb, var(--gold) 76%, #fff0bd);
  background: var(--gold);
  color: #211427;
  box-shadow: 0 9px 24px color-mix(in srgb, var(--gold) 18%, transparent);
}

.text-button {
  min-width: 96px;
  min-height: 44px;
  padding: 8px 14px;
  color: color-mix(in srgb, var(--lavender) 58%, #807588);
}

.text-button:hover {
  color: color-mix(in srgb, var(--gold) 84%, white);
}

.pause-card p:not(.eyebrow) {
  color: color-mix(in srgb, var(--lavender) 58%, #8c8194);
}

.combo-pill {
  border-color: color-mix(in srgb, var(--gold) 54%, transparent);
  border-radius: 12px 4px 12px 4px;
  background: linear-gradient(135deg, rgba(52, 32, 63, 0.91), rgba(18, 12, 27, 0.9));
  box-shadow:
    0 12px 34px rgba(4, 2, 8, 0.31),
    0 0 24px color-mix(in srgb, var(--gold) 8%, transparent);
}

.combo-pill span {
  color: color-mix(in srgb, var(--gold) 86%, white);
  font-family: Georgia, "Times New Roman", serif;
}

.combo-pill small {
  border-radius: 7px 2px 7px 2px;
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  color: color-mix(in srgb, var(--lavender) 78%, white);
}

.fever-banner span {
  color: color-mix(in srgb, var(--blush) 86%, #ffd9dc);
  font-family: Georgia, "Times New Roman", serif;
  text-shadow: 0 0 34px color-mix(in srgb, var(--blush) 38%, transparent);
}

.fever-banner small {
  color: color-mix(in srgb, var(--gold) 72%, white);
}

.game-tip {
  border-color: color-mix(in srgb, var(--gold) 13%, transparent);
  border-radius: 9px 3px 9px 3px;
  background: rgba(20, 13, 29, 0.64);
  color: color-mix(in srgb, var(--lavender) 52%, #726879);
}

.game-tip span {
  border-radius: 1px;
  background: var(--lilac);
  box-shadow: 0 0 7px color-mix(in srgb, var(--lilac) 70%, transparent);
  transform: rotate(45deg);
}

@media (min-width: 1200px) {
  .game-shell {
    border-right-color: color-mix(in srgb, var(--gold) 10%, transparent);
    border-left-color: color-mix(in srgb, var(--gold) 10%, transparent);
  }
}

@media (max-width: 760px) {
  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .hud {
    top: calc(var(--safe-top) + 56px);
  }

  #startScreen {
    background:
      linear-gradient(180deg, rgba(13, 8, 20, 0.16), rgba(19, 12, 29, 0.64) 42%, rgba(8, 5, 13, 0.97)),
      repeating-linear-gradient(135deg, transparent 0 31px, rgba(197, 163, 223, 0.018) 32px 33px);
  }

  #startScreen::before {
    top: 7%;
    right: 4%;
    width: 60vw;
    height: 48%;
    opacity: 0.38;
  }

  #startScreen::after {
    bottom: 40%;
    width: 78%;
  }

  .hero-card {
    border-radius: 17px 5px 17px 5px;
  }

  .mode-option {
    min-height: 48px;
  }
}

@media (max-width: 380px), (max-height: 650px) {
  .mode-option {
    min-height: 44px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .mode-option {
    min-height: 44px;
  }

  .primary-button {
    min-height: 45px;
  }

  #startScreen::before {
    top: 5%;
    width: 38vw;
    height: 80%;
    opacity: 0.42;
  }
}

/* Start-screen information architecture ----------------------------------- */

.play-guide,
.mode-block,
.control-option,
.play-warning,
.start-section-heading h2 {
  margin: 0;
}

.play-guide {
  margin-top: 18px;
}

.mode-block {
  margin-top: 13px;
}

.start-section-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.start-section-heading::after {
  min-width: 18px;
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 34%, transparent), transparent);
  content: "";
}

.start-section-heading > span {
  color: color-mix(in srgb, var(--gold) 76%, white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1;
  white-space: nowrap;
}

.start-section-heading h2 {
  color: color-mix(in srgb, var(--lavender) 80%, white);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.control-guide {
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(197, 163, 223, 0.11);
  border-radius: 10px 3px 10px 3px;
  background:
    linear-gradient(145deg, rgba(197, 163, 223, 0.038), rgba(9, 6, 14, 0.025)),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(197, 163, 223, 0.014) 17px 18px);
  box-shadow: inset 0 1px rgba(245, 239, 246, 0.018);
}

.control-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.control-option > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.control-option small {
  overflow: hidden;
  color: color-mix(in srgb, var(--lavender) 50%, #756b7d);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-option strong {
  color: color-mix(in srgb, var(--text) 91%, var(--lavender));
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  white-space: nowrap;
}

.control-or {
  position: relative;
  display: grid;
  align-self: center;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(197, 163, 223, 0.12);
  border-radius: 50%;
  background: rgba(20, 13, 29, 0.72);
  color: color-mix(in srgb, var(--lavender) 49%, #6e6476);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.control-or::before,
.control-or::after {
  position: absolute;
  left: 50%;
  z-index: -1;
  width: 1px;
  height: 18px;
  background: rgba(197, 163, 223, 0.08);
  content: "";
  transform: translateX(-50%);
}

.control-or::before { bottom: 100%; }
.control-or::after { top: 100%; }

.play-warning {
  display: flex;
  min-height: 18px;
  align-items: center;
  gap: 7px;
  padding: 6px 2px 0;
  color: color-mix(in srgb, var(--blush) 48%, #817483);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.05em;
  line-height: 1.25;
}

.play-warning .warning-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
}

.mode-block .mode-selector {
  gap: 8px;
  margin: 0 0 12px;
}

.mode-block .single-mode-summary {
  display: block;
}

.single-mode-card {
  width: 100%;
  cursor: default;
}

.single-mode-card .mode-choice-indicator {
  width: 34px;
  height: 24px;
  flex-basis: 34px;
  border-radius: 8px 3px 8px 3px;
}

.single-mode-card.mode-option.selected .mode-choice-indicator::before {
  content: "90";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 800;
}

.mode-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 58px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-color: rgba(197, 163, 223, 0.19);
  background: linear-gradient(145deg, rgba(197, 163, 223, 0.042), rgba(17, 10, 26, 0.08));
  box-shadow: inset 0 1px rgba(245, 239, 246, 0.025);
}

.mode-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--gold) 50%, transparent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 7%, transparent), color-mix(in srgb, var(--violet) 8%, transparent));
  transform: translateY(-1px);
}

.mode-option:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.mode-option.selected,
.mode-option[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--gold) 78%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 13%, transparent), color-mix(in srgb, var(--violet) 9%, transparent));
  color: var(--text);
  box-shadow:
    inset 3px 0 color-mix(in srgb, var(--gold) 88%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--gold) 4%, transparent),
    0 0 18px color-mix(in srgb, var(--gold) 5%, transparent);
}

.mode-choice-indicator {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border: 1px solid rgba(197, 163, 223, 0.32);
  border-radius: 50%;
  background: rgba(14, 9, 21, 0.46);
  color: #211427;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mode-option.selected .mode-choice-indicator,
.mode-option[aria-pressed="true"] .mode-choice-indicator {
  border-color: color-mix(in srgb, var(--gold) 86%, white);
  background: color-mix(in srgb, var(--gold) 82%, #fff1be);
  box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 24%, transparent);
  transform: scale(1.04);
}

.mode-option.selected .mode-choice-indicator::before,
.mode-option[aria-pressed="true"] .mode-choice-indicator::before {
  content: "✓";
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.mode-choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.mode-choice-copy strong {
  overflow: hidden;
  color: color-mix(in srgb, var(--lavender) 70%, white);
  font-size: 13px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-option.selected .mode-choice-copy strong,
.mode-option[aria-pressed="true"] .mode-choice-copy strong {
  color: color-mix(in srgb, var(--gold) 84%, white);
}

.mode-choice-copy small {
  overflow: hidden;
  max-width: 100%;
  color: color-mix(in srgb, var(--lavender) 50%, #6f6578);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-mode-card:hover,
.single-mode-card:active {
  border-color: color-mix(in srgb, var(--gold) 78%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 13%, transparent), color-mix(in srgb, var(--violet) 9%, transparent));
  cursor: default;
  transform: none;
}

.start-meta {
  justify-content: flex-end;
  margin-top: 11px;
}

@media (max-width: 760px) {
  .play-guide {
    margin-top: 14px;
  }

  .mode-block {
    margin-top: 11px;
  }

  .start-section-heading {
    margin-bottom: 6px;
  }

  .control-guide {
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  }

  .control-option {
    gap: 7px;
    padding: 7px 9px;
  }

  .control-option strong {
    font-size: 12px;
  }

  .control-option small {
    font-size: 8px;
  }

  .control-or {
    width: 21px;
    height: 21px;
    font-size: 8px;
  }

  .mouse-icon,
  .swipe-icon {
    flex-basis: 25px;
    transform: scale(0.76);
  }

  .play-warning {
    padding-top: 5px;
  }

  .mode-block .mode-selector {
    gap: 7px;
    margin-bottom: 10px;
  }

  .mode-option {
    min-height: 54px;
    gap: 8px;
    padding: 8px 9px;
  }

  .mode-choice-indicator {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .mode-choice-copy strong {
    font-size: 12px;
  }

  .mode-choice-copy small {
    font-size: 8px;
  }
}

@media (max-width: 380px) {
  .hero-card > .eyebrow {
    display: none;
  }

  .play-guide {
    margin-top: 12px;
  }

  .start-section-heading {
    gap: 6px;
    margin-bottom: 5px;
  }

  .start-section-heading > span {
    display: none;
  }

  .start-section-heading h2 {
    font-size: 12px;
  }

  .control-guide {
    min-height: 52px;
  }

  .control-option {
    gap: 5px;
    padding: 6px 7px;
  }

  .control-option strong {
    font-size: 11px;
  }

  .mouse-icon,
  .swipe-icon {
    margin-inline: -2px;
    transform: scale(0.68);
  }

  .play-warning {
    min-height: 16px;
    padding-top: 4px;
    font-size: 8px;
  }

  .mode-block {
    margin-top: 9px;
  }

  .mode-option {
    min-height: 52px;
    gap: 6px;
    padding: 7px;
  }

  .mode-choice-indicator {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .mode-choice-copy strong {
    font-size: 11px;
  }

  .mode-choice-copy small {
    font-size: 8px;
  }

  .start-meta {
    margin-top: 8px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hero-card > .eyebrow {
    display: none;
  }

  .play-guide {
    margin-top: 6px;
  }

  .mode-block {
    margin-top: 6px;
  }

  .start-section-heading {
    gap: 6px;
    margin-bottom: 3px;
  }

  .start-section-heading > span {
    font-size: 7px;
  }

  .start-section-heading h2 {
    font-size: 10px;
  }

  .control-guide {
    min-height: 42px;
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  }

  .control-option {
    gap: 6px;
    padding: 4px 8px;
  }

  .control-option strong {
    font-size: 11px;
  }

  .control-option small {
    font-size: 7px;
  }

  .control-or {
    width: 19px;
    height: 19px;
    font-size: 7px;
  }

  .mouse-icon,
  .swipe-icon {
    margin-inline: -2px;
    transform: scale(0.64);
  }

  .play-warning {
    min-height: 12px;
    padding-top: 2px;
    font-size: 8px;
  }

  .mode-block .mode-selector {
    gap: 6px;
    margin-bottom: 6px;
  }

  .mode-option {
    min-height: 44px;
    gap: 7px;
    padding: 5px 9px;
  }

  .mode-choice-indicator {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .mode-choice-copy strong {
    font-size: 11px;
  }

  .mode-choice-copy small {
    display: block;
    font-size: 7px;
  }

  .start-meta {
    margin-top: 4px;
  }
}

/* Sacabambaspis hot-pot season ------------------------------------------- */

:root {
  --broth: #b55239;
  --heat: #ff9a55;
  --steam: #fff0c7;
}

.game-shell {
  background:
    radial-gradient(ellipse at 52% 108%, color-mix(in srgb, var(--heat) 21%, transparent), transparent 38%),
    radial-gradient(circle at 76% 13%, color-mix(in srgb, var(--lilac) 15%, transparent), transparent 27%),
    radial-gradient(circle at 15% 92%, color-mix(in srgb, var(--violet) 13%, transparent), transparent 33%),
    linear-gradient(155deg, var(--bg-start) 0%, var(--bg-mid) 52%, var(--bg-end) 100%);
}

.game-shell::before {
  background-image:
    radial-gradient(circle at 18% 92%, color-mix(in srgb, var(--heat) 11%, transparent) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 86%, color-mix(in srgb, var(--steam) 8%, transparent) 0 2px, transparent 3px),
    repeating-linear-gradient(45deg, transparent 0 31px, color-mix(in srgb, var(--lavender) 8%, transparent) 32px 33px, transparent 34px 64px),
    repeating-linear-gradient(-45deg, transparent 0 31px, color-mix(in srgb, var(--lavender) 6%, transparent) 32px 33px, transparent 34px 64px);
  background-size: 170px 140px, 130px 110px, 46px 46px, 46px 46px;
}

.hero-card,
.result-card {
  border-top-color: color-mix(in srgb, var(--heat) 42%, var(--gold));
  box-shadow:
    0 26px 74px rgba(4, 2, 9, 0.56),
    0 0 34px color-mix(in srgb, var(--heat) 7%, transparent),
    inset 0 1px rgba(255, 246, 224, 0.08);
}

.hero-card .eyebrow,
.result-card .eyebrow,
.start-section-heading > span {
  color: color-mix(in srgb, var(--gold) 78%, var(--heat));
}

.hero-card h1 em {
  color: color-mix(in srgb, var(--gold) 78%, var(--steam));
  text-shadow: 0 10px 32px color-mix(in srgb, var(--heat) 16%, transparent);
}

.control-guide {
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--heat) 7%, transparent), transparent 60%),
    linear-gradient(145deg, rgba(197, 163, 223, 0.038), rgba(9, 6, 14, 0.025));
}

.mode-option.selected,
.mode-option[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--gold) 72%, var(--heat));
  background:
    radial-gradient(circle at 8% 100%, color-mix(in srgb, var(--heat) 12%, transparent), transparent 46%),
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 13%, transparent), color-mix(in srgb, var(--lilac) 5%, transparent));
}

.primary-button {
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--heat) 14%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.24);
}

.timer-block.fever {
  border-color: color-mix(in srgb, var(--heat) 68%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--heat) 18%, transparent);
}

.timer-block.fever #timerValue,
.fever-banner span {
  color: var(--steam);
  text-shadow: 0 0 18px color-mix(in srgb, var(--heat) 58%, transparent);
}

.fever-banner {
  border-color: color-mix(in srgb, var(--heat) 54%, transparent);
  background: linear-gradient(135deg, rgba(92, 37, 46, 0.94), rgba(47, 28, 57, 0.94));
}

.game-tip span,
.warning-dot {
  background: var(--heat);
  box-shadow: 0 0 9px color-mix(in srgb, var(--heat) 72%, transparent);
}

.combo-pill {
  border-color: color-mix(in srgb, var(--heat) 48%, var(--gold));
  background: linear-gradient(135deg, rgba(82, 42, 57, 0.92), rgba(37, 24, 49, 0.94));
}

.combo-pill small,
.final-score strong {
  color: color-mix(in srgb, var(--gold) 76%, var(--steam));
}

.game-tip {
  bottom: calc(var(--safe-bottom) + clamp(54px, 8vh, 72px));
}

.eyebrow b,
.game-tip b {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.game-tip[hidden] {
  display: none;
}

/* Portrait phones hide the longer home intro, so keep the new timing rule
   visible just above the pot while the round is running. */
@media (max-width: 760px) and (orientation: portrait) and (min-height: 651px) {
  .game-tip {
    bottom: calc(var(--safe-bottom) + clamp(94px, 15vh, 126px));
    display: flex;
    width: max-content;
    max-width: calc(100% - 40px);
    justify-content: center;
    padding: 7px 10px;
    font-size: 8px;
    letter-spacing: 0.035em;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timer-block.fever {
    box-shadow: none;
  }
}

/* Compact gameplay HUD: keep the throwing and slicing lane unobstructed. */
.hud {
  top: calc(var(--safe-top) + 54px);
  grid-template-columns: 76px 112px 76px;
  gap: 4px;
}

.score-block,
.timer-block,
.lives-block {
  min-height: 44px;
  padding: 6px 8px 7px;
  border-radius: 9px 3px 9px 3px;
}

.timer-block {
  min-width: 0;
}

.hud-label {
  margin-bottom: 0;
  font-size: 6px;
  line-height: 1.1;
  letter-spacing: 0.16em;
}

#scoreValue,
#timerValue {
  font-size: 18px;
}

#scoreValue.compact {
  font-size: 15px;
}

.timer-track {
  margin-top: 4px;
}

.lives {
  gap: 4px;
  margin-top: 4px;
}

.life {
  font-size: 10px;
}

@media (max-width: 760px) {
  .hud {
    top: calc(var(--safe-top) + 48px);
    grid-template-columns: 68px 94px 68px;
    gap: 4px;
    width: max-content;
  }

  .score-block,
  .timer-block,
  .lives-block {
    min-height: 40px;
    padding: 5px 6px 6px;
  }

  #scoreValue,
  #timerValue {
    font-size: 16px;
  }

  .lives {
    gap: 3px;
    margin-top: 3px;
  }

  .life {
    font-size: 9px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hud {
    top: var(--safe-top);
  }
}

/* ==========================================================================
   線上功能：登入身分、排行榜、背景音樂
   --------------------------------------------------------------------------
   這一段的元素在伺服器沒回應時全部維持 [hidden]，所以整段的預設狀態就是
   「不存在」——不必為離線另外寫一套樣式。
   ========================================================================== */

/* ---- 右上角的使用者 ---- */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(8, 21, 30, 0.66);
  backdrop-filter: blur(14px);
}

.user-chip__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--violet) 55%, transparent);
  background-size: cover;
  background-position: center;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.user-chip__avatar.has-image { color: transparent; }

.user-chip__name {
  max-width: 12ch;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__logout {
  color: #829994;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.user-chip__logout:hover { color: var(--text); }

/* 背景音樂鍵沿用音效鍵的開關語彙（aria-pressed 決定畫哪一顆圖示） */
.icon-button .music-off,
.icon-button[aria-pressed="false"] .music-on { display: none; }
.icon-button[aria-pressed="false"] .music-off { display: block; }
.icon-button.is-muted { color: var(--muted); }

/* ---- 首頁底部那一條 ---- */
.online-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ghost-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 21, 30, 0.5);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.ghost-button:hover {
  border-color: color-mix(in srgb, var(--lime) 48%, transparent);
  background: rgba(8, 21, 30, 0.78);
}

.ghost-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ghost-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- 對話框 ---- */
.sheet {
  width: min(460px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 26px 26px 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow-y: auto;
}

.sheet::backdrop {
  background: rgba(6, 4, 12, 0.72);
  backdrop-filter: blur(4px);
}

.sheet h2 {
  margin: 6px 0 4px;
  font-size: 25px;
  letter-spacing: -0.01em;
}

.sheet h3 { margin: 0; font-size: 17px; }
.sheet h4 { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }

.sheet__close-form {
  float: right;
  margin: -8px -8px 0 0;
}

.sheet__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.sheet__close:hover { color: var(--text); }

.sheet__lede {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.sheet__empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---- 排行榜 ---- */
.board-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.board-row {
  display: grid;
  grid-template-columns: 30px 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
}

.board-row + .board-row { margin-top: 2px; }

.board-row.is-you {
  background: color-mix(in srgb, var(--lime) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 34%, transparent);
}

.board-row__rank {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.board-row:nth-child(1) .board-row__rank,
.board-row:nth-child(2) .board-row__rank,
.board-row:nth-child(3) .board-row__rank { color: var(--lime); }

.board-row__avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--violet) 55%, transparent);
  background-size: cover;
  background-position: center;
  font-size: 11px;
  font-weight: 900;
}

.board-row__avatar.has-image { color: transparent; }

.board-row__name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-row__score {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* 結算頁那一行上傳回音 */
.board-result {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.board-result.is-good { color: var(--lime); }
.board-result.is-warn { color: var(--blush); }

/* ---- 音樂署名 ---- */
.credit-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 21, 30, 0.5);
}

.credit-card__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 900;
}

.credit-card__by {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.credit-card__by strong { color: var(--lime); }

.credit-card__note {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--lime) 40%, transparent);
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.credit-card__meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* ---- 上傳表單 ---- */
.upload-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.field {
  display: block;
  margin: 0 0 14px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.field > span b { color: var(--coral); }

.field input[type="text"],
.field textarea,
.field input[type="file"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 21, 30, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.field textarea { resize: vertical; line-height: 1.7; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--lime) 70%, transparent);
  outline-offset: 1px;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.upload-status {
  margin: 12px 0 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}

.upload-status.is-good { color: var(--lime); }
.upload-status.is-error { color: var(--coral); }

.history-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list .text-button {
  margin-top: 0;
  padding: 6px 0;
  text-align: left;
}

@media (max-width: 720px) {
  .user-chip__name { display: none; }
  .online-strip { grid-template-columns: 1fr; }
}

/* 未登入時取代 BEST 那行的說明。開始鍵這時是「用 Discord 登入」，
   一顆孤立的登入鍵不會告訴人登入換得到什麼，這行負責講。 */
.login-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

/* ==========================================================================
   甲魚特權：紅字的邀請按鈕，以及第一次登入的告知視窗
   ========================================================================== */

/* 「甲魚特權可以新增背景音樂」。這顆按鈕在有特權且尚無配樂時才變成這個樣子——
   它是邀請，不是狀態列，所以要比旁邊的排行榜鍵搶眼一階。 */
.ghost-button.is-privilege {
  border-color: color-mix(in srgb, var(--coral) 55%, transparent);
  background: color-mix(in srgb, var(--coral) 12%, rgba(8, 21, 30, 0.5));
  color: var(--coral);
  font-weight: 900;
}

.ghost-button.is-privilege:hover {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 20%, rgba(8, 21, 30, 0.7));
}

.ghost-button.is-privilege svg { stroke: var(--coral); }

/* 輕微的呼吸感，讓它在首頁上抓得到眼睛。系統偏好減少動態時停掉——
   遊戲其他地方也遵守同一條規則。 */
@media (prefers-reduced-motion: no-preference) {
  .ghost-button.is-privilege {
    animation: privilege-pulse 2.6s ease-in-out infinite;
  }
}

@keyframes privilege-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--coral) 32%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--coral) 0%, transparent); }
}

.privilege-sheet {
  width: min(420px, calc(100vw - 32px));
  border-color: color-mix(in srgb, var(--coral) 40%, transparent);
  text-align: center;
}

.privilege-eyebrow b { color: var(--coral); }
.privilege-eyebrow span { background: var(--coral); }

.privilege-copy {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.85;
}

.privilege-copy strong { color: var(--coral); }

.privilege-copy--muted {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
}

.privilege-sheet .text-button { display: block; width: 100%; }
