:root {
  --ink: #0b0910;
  --ink-2: #141019;
  --ink-3: #1c1724;
  --gold: #e9c98b;
  --gold-strong: #ffe6b0;
  --gold-dim: rgba(233, 201, 139, 0.28);
  --text: #f4eee6;
  --muted: rgba(244, 238, 230, 0.56);
  --danger: #ff8a7a;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 22px;
  --shadow-board: 0 26px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #07060b;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}

@media (min-width: 560px) {
  body { display: grid; place-items: center; padding: 24px 0; }
  .app {
    min-height: auto;
    height: min(920px, calc(100vh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 34px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
  }
}

.backdrop {
  position: absolute;
  inset: -30px;
  z-index: -3;
  background-image: var(--backdrop);
  background-size: cover;
  background-position: center 18%;
  filter: blur(38px) saturate(0.9) brightness(0.42);
  opacity: 0.55;
  transition: background-image 0.6s ease;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(233, 201, 139, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(11, 9, 16, 0.55) 0%, rgba(11, 9, 16, 0.92) 52%, #0b0910 100%);
}

.glow {
  position: absolute;
  z-index: -1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.32;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

.glow--one { top: -90px; left: -110px; background: #8a5cff; }
.glow--two { bottom: -120px; right: -100px; background: #e9a15c; animation-delay: -8s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(24px, 30px, 0) scale(1.15); }
}

/* ---------- HUD ---------- */

.hud {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 10px;
}

.hud__score { flex: 1; }

.hud__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.hud__score strong {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-strong);
  text-shadow: 0 2px 18px rgba(233, 201, 139, 0.25);
}

.hud__time { text-align: center; }
.hud__time strong {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hud__time em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.hud__time.danger strong { color: var(--danger); animation: pulse 1s ease-in-out infinite; }

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

.hud__actions { display: flex; gap: 6px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; fill: var(--text); }
.icon-btn svg .wave { fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; }
.icon-btn[aria-pressed="false"] svg { opacity: 0.35; }

.goal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 2px 9px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.goal__label { color: var(--gold); }

.goal__track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.goal__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9a7337, var(--gold));
  transition: width 0.3s ease, background 0.3s ease;
}

.goal.done .goal__track i { background: linear-gradient(90deg, #58b98f, #a8f0cd); }

.goal__value {
  font-variant-numeric: tabular-nums;
  color: var(--gold-strong);
  letter-spacing: 0.04em;
}

.timebar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}
.timebar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c79a54, var(--gold-strong));
  transition: width 0.12s linear, background 0.4s ease;
}
.timebar.danger i { background: linear-gradient(90deg, #d9524a, #ff9c8f); }

/* ---------- Board ---------- */

.stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}

.board-shell {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 10px;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(233, 201, 139, 0.2);
  box-shadow: var(--shadow-board);
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: var(--radius);
  border: 1px solid rgba(233, 201, 139, 0.08);
  pointer-events: none;
}

.board {
  display: grid;
  grid-template-columns: repeat(var(--size, 8), minmax(0, 1fr));
  gap: 5px;
  touch-action: none;
  user-select: none;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.tile {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 3px var(--accent, var(--gold-dim)),
    0 3px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  will-change: transform;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.tile::before {
  content: var(--glyph, "");
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, var(--gold));
  color: #141019;
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 44%);
  pointer-events: none;
}

.cell.selected .tile {
  transform: scale(1.08);
  box-shadow:
    inset 0 0 0 3px var(--gold-strong),
    0 0 20px rgba(255, 219, 150, 0.6);
  z-index: 3;
}

.cell.hint .tile { animation: hintPulse 1.15s ease-in-out infinite; }

@keyframes hintPulse {
  0%, 100% { box-shadow: inset 0 0 0 3px var(--accent), 0 3px 8px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: inset 0 0 0 3px var(--gold-strong), 0 0 22px rgba(255, 219, 150, 0.75); }
}

.cell.invalid .tile { animation: shake 0.3s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-2deg); }
  45% { transform: translateX(5px) rotate(2deg); }
  70% { transform: translateX(-3px); }
}

.tile.clearing {
  animation: clearTile 0.22s cubic-bezier(0.4, 0, 0.6, 1) forwards;
  z-index: 4;
}

@keyframes clearTile {
  0% { transform: scale(1); filter: brightness(1); }
  38% { transform: scale(1.18); filter: brightness(1.45); }
  100% { transform: scale(0.15) rotate(10deg); opacity: 0; }
}

.shard {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-size: cover;
  background-position: center 22%;
  pointer-events: none;
  z-index: 6;
  filter: brightness(1.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  animation: shatter 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes shatter {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  55% { opacity: 0.92; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.58); opacity: 0; }
}

.clear-flash {
  position: absolute;
  inset: -12%;
  z-index: 7;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, var(--accent, #ffffff) 34%, transparent 70%);
  mix-blend-mode: screen;
  animation: flashBurst 0.3s ease-out forwards;
}

@keyframes flashBurst {
  from { transform: scale(0.35); opacity: 0.95; }
  to { transform: scale(1.5); opacity: 0; }
}

.tile.drop {
  animation: dropTile 0.28s cubic-bezier(0.2, 0.9, 0.25, 1) both;
  animation-delay: var(--delay, 0ms);
}

@keyframes dropTile {
  from { transform: translateY(-46%) scale(0.94); opacity: 0.2; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.board__combo {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-strong);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.7), 0 0 26px rgba(255, 205, 120, 0.55);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.board__combo.on { animation: comboPop 0.8s cubic-bezier(0.2, 1.2, 0.3, 1) forwards; }

@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  25% { opacity: 1; transform: translate(-50%, -58%) scale(1.12); }
  60% { opacity: 1; transform: translate(-50%, -62%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -92%) scale(0.96); }
}

.board__toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, 8px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(12, 9, 16, 0.86);
  border: 1px solid var(--gold-dim);
  font-size: 12px;
  color: var(--gold-strong);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.board__toast.on { opacity: 1; transform: translate(-50%, 0); }

.float-score {
  position: absolute;
  z-index: 6;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--gold-strong);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 0.9s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(1); }
}

.tip {
  margin: 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(244, 238, 230, 0.42);
}

/* ---------- Layers ---------- */

.layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom));
  background: rgba(9, 7, 13, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  backdrop-filter: blur(20px) saturate(1.1);
  overflow-y: auto;
}

.layer--start {
  background:
    radial-gradient(80% 40% at 50% 0%, rgba(233, 201, 139, 0.13), transparent 70%),
    rgba(9, 7, 13, 0.62);
}

.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.brand__eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
}

.brand__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(40px, 13vw, 54px);
  line-height: 1.05;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff3d8 8%, #e9c98b 48%, #b98f4e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(233, 201, 139, 0.25));
}

.brand__title span {
  display: block;
  margin-top: 6px;
  font-size: 0.52em;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(244, 238, 230, 0.86);
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.brand__sub {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lineup-wrap { width: 100%; }

.lineup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.start__record {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(244, 238, 230, 0.4);
}

.text-btn {
  padding: 2px 0;
  border: 0;
  background: none;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.08em;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.text-btn:active { border-bottom-color: var(--gold-dim); }

.lineup {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.lineup__item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  background-size: cover;
  background-position: center 22%;
  box-shadow:
    inset 0 0 0 3px var(--accent, rgba(233, 201, 139, 0.55)),
    0 6px 16px rgba(0, 0, 0, 0.45);
  animation: lineupIn 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both;
  animation-delay: calc(var(--i) * 55ms);
}

.lineup__item::before {
  content: var(--glyph, "");
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, var(--gold));
  color: #141019;
  font-size: 7px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

@keyframes lineupIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* ---------- Buttons ---------- */

.btn {
  width: 100%;
  height: 54px;
  border-radius: 999px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.975); }

.btn--primary {
  color: #2a1d08;
  background: linear-gradient(135deg, #ffeecb 0%, #e9c98b 45%, #cfa863 100%);
  box-shadow: 0 12px 30px rgba(233, 201, 139, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.rules {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 11.5px;
  line-height: 1.9;
  color: rgba(244, 238, 230, 0.5);
}
.rules b {
  display: inline-block;
  margin-right: 8px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.login-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(244, 238, 230, 0.45);
  cursor: pointer;
}
.login-hint svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.login-hint__avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.login-hint.is-user {
  color: var(--gold-strong);
  border-color: var(--gold-dim);
}

.login-hint span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet__card .btn + .btn { margin-top: 10px; }

.link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ---------- 排行榜 ---------- */

.rank {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  max-height: 82vh;
  padding: 6px 4px 0;
}

.rank__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rank__head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.16em;
  background: linear-gradient(180deg, #fff3d8, #c79a54);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rank__close { width: 32px; height: 32px; font-size: 13px; color: var(--muted); }

.rank__sub {
  margin: 6px 0 14px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.rank__list {
  flex: 1;
  min-height: 80px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rank__item {
  display: grid;
  grid-template-columns: 26px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rank__no {
  font-family: var(--font-serif);
  font-size: 15px;
  text-align: center;
  color: rgba(244, 238, 230, 0.45);
  font-variant-numeric: tabular-nums;
}

.rank__item:nth-child(1) .rank__no { color: #ffe6b0; font-size: 19px; }
.rank__item:nth-child(2) .rank__no { color: #d9d5cf; font-size: 17px; }
.rank__item:nth-child(3) .rank__no { color: #d5a06a; font-size: 17px; }

.rank__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-size: cover;
  background-position: center 20%;
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(233, 201, 139, 0.25);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--gold);
}

.rank__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.rank__level {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.rank__score {
  font-family: var(--font-serif);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  color: var(--gold-strong);
}

.rank__state {
  margin: 0;
  padding: 28px 0 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- Result ---------- */

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 330px;
  text-align: center;
}

.result__eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
}

.result__score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: -6px;
}
.result__score strong {
  font-family: var(--font-serif);
  font-size: clamp(64px, 20vw, 84px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff5de, #e9c98b 60%, #b3863f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result__score span { font-size: 13px; color: var(--muted); letter-spacing: 0.2em; }

.result__best { margin: 0; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.result__best b { color: var(--gold-strong); font-weight: 600; }

.result__gap { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.result__gap b { color: var(--gold-strong); font-weight: 600; }

.new-record {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(233, 201, 139, 0.16);
  border: 1px solid var(--gold-dim);
  font-size: 10px;
  color: var(--gold-strong);
  letter-spacing: 0.1em;
}

.result__stats {
  display: flex;
  width: 100%;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.result__stats div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.result__stats b { font-family: var(--font-serif); font-size: 24px; color: var(--text); }
.result__stats span { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); }

.result .btn { margin-top: 2px; }

/* ---------- Pause ---------- */

.pause-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}
.pause-card__title {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 0.18em;
  color: var(--gold-strong);
}

/* ---------- Sheet ---------- */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: rgba(5, 4, 8, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sheet__card {
  width: 100%;
  max-width: 400px;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #1b1622, #131019);
  border: 1px solid rgba(233, 201, 139, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: sheetIn 0.28s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.sheet__card h2 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.08em;
  color: var(--gold-strong);
}
.sheet__card p {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 350px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .hud__score strong { font-size: 30px; }
  .board { gap: 4px; }
  .cell { border-radius: 9px; }
  .brand__title { font-size: 38px; }
  .lineup { gap: 6px; }
  .rules { font-size: 11px; }
  .btn { height: 50px; }
  .login-hint span { max-width: 150px; }
}

@media (max-height: 640px) {
  .start { gap: 14px; }
  .brand__sub { margin-top: 8px; }
  .rules { line-height: 1.6; }
  .board-shell { max-width: min(100%, calc(100vh - 170px)); }
  .board-shell { max-width: min(100%, calc(100dvh - 170px)); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app { max-width: 720px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .hud { padding-bottom: 6px; }
  .goal { margin-bottom: 6px; }
  .stage { gap: 6px; }
  .board-shell { max-width: min(100%, calc(100vh - 120px)); }
  .board-shell { max-width: min(100%, calc(100dvh - 120px)); }
  .tip { display: none; }
  .tile::before { display: none; }
  .layer--start { padding: 6px 18px; }
  .start { gap: 8px; max-width: 520px; }
  .brand__title { font-size: 30px; }
  .brand__sub { margin-top: 6px; }
  .rules { display: none; }
  .start__record { margin-top: 6px; }
  .btn { height: 50px; }
}

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