:root {
  color-scheme: dark;
  --bg-start: #08131f;
  --bg-mid: #0b1c2d;
  --bg-end: #10263a;
  --bg-glow-a: rgba(22, 200, 214, 0.2);
  --bg-glow-b: rgba(255, 191, 105, 0.16);
  --grid-line: rgba(255, 255, 255, 0.03);
  --panel-top: rgba(15, 29, 44, 0.82);
  --panel-bottom: rgba(6, 14, 24, 0.72);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #eef6ff;
  --muted: #9db4c9;
  --accent: #56f3d6;
  --accent-soft: #c1fff3;
  --accent-warm: #ffbf69;
  --accent-warm-soft: #ffd98b;
  --primary-text: #07212c;
  --danger: #ff6b6b;
  --success: #7df5a2;
  --stat-surface: rgba(255, 255, 255, 0.05);
  --badge-bg: rgba(255, 255, 255, 0.06);
  --badge-border: rgba(255, 255, 255, 0.08);
  --badge-text: #d6faff;
  --board-frame-top: rgba(255, 255, 255, 0.04);
  --board-frame-bottom: rgba(255, 255, 255, 0.015);
  --board-frame-surface: rgba(6, 13, 22, 0.72);
  --board-frame-border: rgba(255, 255, 255, 0.08);
  --cell-top: rgba(255, 255, 255, 0.12);
  --cell-bottom: rgba(255, 255, 255, 0.02);
  --cell-surface-a: rgba(18, 41, 63, 0.92);
  --cell-surface-b: rgba(11, 23, 36, 0.96);
  --cell-border: rgba(255, 255, 255, 0.04);
  --cell-revealed-top: rgba(255, 255, 255, 0.2);
  --cell-revealed-bottom: rgba(255, 255, 255, 0.08);
  --cell-revealed-a: rgba(72, 105, 132, 0.92);
  --cell-revealed-b: rgba(38, 58, 77, 0.96);
  --cell-revealed-ring: rgba(131, 214, 255, 0.34);
  --cell-empty-glow: rgba(145, 236, 255, 0.22);
  --flag-text: #042130;
  --flag-a: #ffbf69;
  --flag-b: #ffe5ad;
  --mine-text: #2a0808;
  --mine-a: #ff9079;
  --mine-b: #ff6b6b;
  --ambient-one: rgba(86, 243, 214, 0.18);
  --ambient-two: rgba(255, 191, 105, 0.16);
  --panel-radius: 28px;
  --board-radius: 26px;
  --cell-radius: 16px;
  --button-radius: 18px;
  --display-font: "Space Grotesk", "Segoe UI", sans-serif;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --cell-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

body[data-theme="dune"] {
  --bg-start: #16120e;
  --bg-mid: #2a1d17;
  --bg-end: #46322a;
  --bg-glow-a: rgba(255, 189, 111, 0.2);
  --bg-glow-b: rgba(255, 123, 89, 0.16);
  --panel-top: rgba(42, 28, 23, 0.84);
  --panel-bottom: rgba(18, 11, 8, 0.76);
  --text: #fff4e8;
  --muted: #d3b9a2;
  --accent: #ffc66d;
  --accent-soft: #ffe5b6;
  --accent-warm: #ff9c66;
  --accent-warm-soft: #ffd6a1;
  --primary-text: #31190d;
  --stat-surface: rgba(255, 245, 236, 0.06);
  --badge-bg: rgba(255, 241, 230, 0.08);
  --badge-border: rgba(255, 235, 219, 0.12);
  --badge-text: #ffecd8;
  --board-frame-surface: rgba(22, 13, 10, 0.7);
  --cell-surface-a: rgba(69, 47, 36, 0.94);
  --cell-surface-b: rgba(35, 23, 17, 0.98);
  --cell-revealed-top: rgba(255, 255, 255, 0.18);
  --cell-revealed-bottom: rgba(255, 255, 255, 0.06);
  --cell-revealed-a: rgba(144, 108, 82, 0.9);
  --cell-revealed-b: rgba(90, 62, 45, 0.95);
  --cell-revealed-ring: rgba(255, 215, 143, 0.34);
  --cell-empty-glow: rgba(255, 226, 158, 0.22);
  --flag-text: #3a1909;
  --flag-a: #ffd07f;
  --flag-b: #fff0c5;
  --mine-text: #390e0a;
  --mine-a: #ffb06e;
  --mine-b: #ff7b59;
  --ambient-one: rgba(255, 189, 111, 0.18);
  --ambient-two: rgba(255, 123, 89, 0.14);
  --panel-radius: 32px;
  --board-radius: 30px;
  --cell-radius: 18px;
  --button-radius: 22px;
  --display-font: "Outfit", "Segoe UI", sans-serif;
}

body[data-theme="ember"] {
  --bg-start: #130b12;
  --bg-mid: #24101a;
  --bg-end: #381720;
  --bg-glow-a: rgba(255, 96, 122, 0.18);
  --bg-glow-b: rgba(255, 158, 88, 0.14);
  --panel-top: rgba(37, 14, 24, 0.84);
  --panel-bottom: rgba(17, 8, 14, 0.78);
  --text: #fff1f4;
  --muted: #d6a8b2;
  --accent: #ff7f8d;
  --accent-soft: #ffc1c8;
  --accent-warm: #ffb36a;
  --accent-warm-soft: #ffd7a6;
  --primary-text: #351015;
  --stat-surface: rgba(255, 241, 244, 0.05);
  --badge-bg: rgba(255, 235, 240, 0.08);
  --badge-border: rgba(255, 223, 231, 0.12);
  --badge-text: #ffe5eb;
  --board-frame-surface: rgba(18, 8, 15, 0.72);
  --cell-surface-a: rgba(72, 25, 42, 0.92);
  --cell-surface-b: rgba(29, 12, 20, 0.98);
  --cell-revealed-top: rgba(255, 255, 255, 0.16);
  --cell-revealed-bottom: rgba(255, 255, 255, 0.05);
  --cell-revealed-a: rgba(149, 78, 93, 0.9);
  --cell-revealed-b: rgba(88, 38, 52, 0.95);
  --cell-revealed-ring: rgba(255, 180, 152, 0.32);
  --cell-empty-glow: rgba(255, 191, 122, 0.2);
  --flag-text: #3d150d;
  --flag-a: #ffc06c;
  --flag-b: #ffe5ae;
  --mine-text: #35080f;
  --mine-a: #ff8a72;
  --mine-b: #ff5f74;
  --ambient-one: rgba(255, 96, 122, 0.17);
  --ambient-two: rgba(255, 158, 88, 0.14);
  --panel-radius: 24px;
  --board-radius: 22px;
  --cell-radius: 14px;
  --button-radius: 16px;
}

body[data-theme="aurora"] {
  --bg-start: #07131a;
  --bg-mid: #0b2431;
  --bg-end: #153848;
  --bg-glow-a: rgba(126, 255, 241, 0.2);
  --bg-glow-b: rgba(147, 197, 255, 0.16);
  --panel-top: rgba(11, 33, 46, 0.82);
  --panel-bottom: rgba(5, 18, 27, 0.74);
  --text: #effcff;
  --muted: #a9c9d4;
  --accent: #7afff1;
  --accent-soft: #d3fffb;
  --accent-warm: #93c5ff;
  --accent-warm-soft: #d2e5ff;
  --primary-text: #082337;
  --stat-surface: rgba(239, 252, 255, 0.05);
  --badge-bg: rgba(228, 250, 255, 0.07);
  --badge-border: rgba(218, 247, 255, 0.11);
  --badge-text: #dbfaff;
  --board-frame-surface: rgba(5, 17, 26, 0.72);
  --cell-surface-a: rgba(20, 58, 76, 0.92);
  --cell-surface-b: rgba(8, 26, 37, 0.98);
  --cell-revealed-top: rgba(255, 255, 255, 0.22);
  --cell-revealed-bottom: rgba(255, 255, 255, 0.08);
  --cell-revealed-a: rgba(91, 145, 167, 0.9);
  --cell-revealed-b: rgba(44, 85, 104, 0.96);
  --cell-revealed-ring: rgba(163, 239, 255, 0.34);
  --cell-empty-glow: rgba(170, 244, 255, 0.24);
  --flag-text: #0a2b39;
  --flag-a: #89fff2;
  --flag-b: #d9fffb;
  --mine-text: #132341;
  --mine-a: #9ad7ff;
  --mine-b: #69baff;
  --ambient-one: rgba(126, 255, 241, 0.18);
  --ambient-two: rgba(147, 197, 255, 0.14);
  --panel-radius: 30px;
  --board-radius: 32px;
  --cell-radius: 20px;
  --button-radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  overflow: hidden;
  overflow-x: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, var(--bg-glow-a), transparent 28%),
    radial-gradient(circle at right 15% top 10%, var(--bg-glow-b), transparent 24%),
    linear-gradient(145deg, var(--bg-start), var(--bg-mid) 46%, var(--bg-end));
  color: var(--text);
  font-family: "Outfit", "Segoe UI", sans-serif;
  transition:
    background 260ms ease,
    color 260ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 88%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.68;
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}

.ambient-one {
  top: 10%;
  right: -70px;
  width: 220px;
  height: 220px;
  background: var(--ambient-one);
}

.ambient-two {
  bottom: 12%;
  left: -60px;
  width: 260px;
  height: 260px;
  background: var(--ambient-two);
  animation-duration: 15s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1460px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0;
  height: 100vh;
  min-height: 0;
  transition:
    filter 180ms ease,
    transform 180ms ease;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 28px);
  min-height: 0;
}

.sidebar,
.game-panel {
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow: auto;
}

.sidebar-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-hero h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.1rem, 3vw, 3.2rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.sidebar-section {
  min-width: 0;
}

.sidebar-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.menu-card,
.help-card {
  padding: 12px;
  border-radius: calc(var(--panel-radius) - 6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.help-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.help-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.panel {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    border-radius 220ms ease,
    box-shadow 220ms ease;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.eyebrow-link {
  width: fit-content;
  text-decoration: none;
  transition:
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.eyebrow-link:hover {
  color: var(--accent-soft);
  transform: translateY(-1px);
}

.hero-text,
.hint-text,
.status-text,
.help-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.primary-button,
.difficulty-button,
.tool-button,
.theme-button,
.result-restart-button,
.verse-refresh-button,
.quote-modal-button,
.quote-modal-close {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-button {
  padding: 12px 18px;
  border-radius: var(--button-radius);
  color: var(--primary-text);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-warm-soft));
  box-shadow: 0 20px 40px color-mix(in srgb, var(--accent-warm) 28%, transparent);
}

.primary-button:hover,
.difficulty-button:hover,
.tool-button:hover,
.theme-button:hover {
  transform: translateY(-2px);
}

.sidebar .primary-button {
  width: 100%;
}

.sidebar-hero .hero-text {
  font-size: 0.9rem;
  line-height: 1.45;
}

.theme-title {
  margin: 4px 0 0;
  font-family: var(--display-font);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  letter-spacing: -0.04em;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.theme-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: calc(var(--button-radius) + 4px);
  text-align: left;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    var(--stat-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, rgba(255, 255, 255, 0.1));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent),
    0 20px 42px color-mix(in srgb, var(--accent) 12%, transparent);
}

.theme-swatch {
  display: flex;
  gap: 6px;
}

.theme-swatch i {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.theme-label {
  font-family: var(--display-font);
  font-size: 0.88rem;
  font-weight: 700;
}

.theme-note {
  display: none;
}

.theme-button[data-theme="spectrum"] .theme-swatch i:nth-child(1) {
  background: #56f3d6;
}

.theme-button[data-theme="spectrum"] .theme-swatch i:nth-child(2) {
  background: #17c8d6;
}

.theme-button[data-theme="spectrum"] .theme-swatch i:nth-child(3) {
  background: #ffbf69;
}

.theme-button[data-theme="dune"] .theme-swatch i:nth-child(1) {
  background: #ffc66d;
}

.theme-button[data-theme="dune"] .theme-swatch i:nth-child(2) {
  background: #ff9c66;
}

.theme-button[data-theme="dune"] .theme-swatch i:nth-child(3) {
  background: #6b4636;
}

.theme-button[data-theme="ember"] .theme-swatch i:nth-child(1) {
  background: #ff7f8d;
}

.theme-button[data-theme="ember"] .theme-swatch i:nth-child(2) {
  background: #ffb36a;
}

.theme-button[data-theme="ember"] .theme-swatch i:nth-child(3) {
  background: #5d2035;
}

.theme-button[data-theme="aurora"] .theme-swatch i:nth-child(1) {
  background: #7afff1;
}

.theme-button[data-theme="aurora"] .theme-swatch i:nth-child(2) {
  background: #93c5ff;
}

.theme-button[data-theme="aurora"] .theme-swatch i:nth-child(3) {
  background: #244c61;
}

.difficulty-switch,
.tool-switch {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.difficulty-button,
.tool-button {
  flex: 1;
  padding: 13px 14px;
  border-radius: calc(var(--button-radius) - 2px);
  color: var(--text);
  background: var(--stat-surface);
}

.difficulty-button.is-active,
.tool-button.is-active {
  color: var(--primary-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 22%, transparent);
}

.panel-stats .stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.stat-card {
  padding: 12px 14px;
  border-radius: calc(var(--button-radius) + 2px);
  background: var(--stat-surface);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display-font);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  letter-spacing: -0.04em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.hint-text {
  margin-top: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.game-panel {
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
}

.game-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
}

.game-panel-copy {
  min-width: 0;
}

.game-panel-head h2 {
  margin: 8px 0 0;
  font-family: var(--display-font);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  letter-spacing: -0.04em;
}

.result-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(180px, 22vw, 240px);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.result-action.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.result-restart-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--button-radius);
  color: #ecfbff;
  font-weight: 700;
  letter-spacing: 0.04em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-warm) 18%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 40px rgba(0, 0, 0, 0.24);
}

.result-restart-button:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 24px 48px rgba(0, 0, 0, 0.28);
}

.result-restart-button:active {
  transform: translateY(0) scale(0.99);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
}

.status-text {
  margin-top: 10px;
  font-size: 0.95rem;
}

.board-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 18px;
  margin-top: 14px;
}

.board-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--board-radius);
  background:
    linear-gradient(180deg, var(--board-frame-top), var(--board-frame-bottom)),
    var(--board-frame-surface);
  border: 1px solid var(--board-frame-border);
  overflow: auto;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    border-radius 220ms ease,
    box-shadow 220ms ease;
}

.verse-panel {
  width: min(430px, 36vw);
  min-width: 340px;
  min-height: 0;
  display: flex;
}

.verse-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  flex: 1;
  gap: 18px;
  min-height: 100%;
  padding: 18px;
  border-radius: calc(var(--board-radius) + 8px);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015) 34%, rgba(255, 255, 255, 0.03) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-top) 92%, #0a1220), color-mix(in srgb, var(--panel-bottom) 96%, #060914));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.verse-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  opacity: 0.76;
  pointer-events: none;
}

.verse-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: calc(var(--board-radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.verse-card-orbit,
.verse-card-grain {
  position: absolute;
  pointer-events: none;
}

.verse-card-orbit {
  top: -84px;
  right: -56px;
  width: 204px;
  height: 204px;
  border-radius: 999px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent-warm) 54%, white) 0 9%, transparent 10%),
    radial-gradient(circle, color-mix(in srgb, var(--accent-warm) 20%, transparent) 0 34%, transparent 56%),
    radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent) 0 48%, transparent 72%);
  filter: blur(4px);
  opacity: 0.96;
}

.verse-card-grain {
  inset: auto 24px 20px auto;
  width: 132px;
  height: 132px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 44%);
  opacity: 0.3;
  transform: rotate(14deg);
}

.verse-side-rail,
.verse-main,
.verse-head,
.verse-stage,
.verse-refresh-button {
  position: relative;
  z-index: 1;
}

.verse-side-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 0;
  padding: 18px 8px 16px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-warm) 16%, transparent), rgba(0, 0, 0, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 34px rgba(0, 0, 0, 0.18);
}

.verse-side-rail::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.verse-side-label {
  writing-mode: vertical-rl;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--accent-warm-soft) 76%, white);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.verse-side-line {
  flex: 1;
  width: 1px;
  min-height: 86px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.38), transparent);
}

.verse-side-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #4b190f;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 1.36rem;
  line-height: 1;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.44), transparent 56%),
    linear-gradient(135deg, #ffd38a, #ffb46d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 16px 28px rgba(255, 179, 96, 0.24);
}

.verse-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.verse-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.verse-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verse-badge,
.verse-mood {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.verse-badge {
  color: var(--accent-soft);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.verse-mood {
  color: var(--muted);
  font-size: 0.78rem;
}

.verse-summary {
  margin: 0;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: #f7fbff;
  font-family: var(--display-font);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.14);
}

.verse-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 26px 24px 24px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 223, 156, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    linear-gradient(180deg, rgba(4, 10, 18, 0.22), rgba(5, 11, 20, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 40px rgba(0, 0, 0, 0.14);
}

.verse-lead,
.verse-meta,
.verse-library,
.quote-modal-hint,
.quote-modal-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.verse-lead {
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 86%, white);
}

.verse-text,
.quote-modal-quote {
  margin: 0;
  letter-spacing: -0.04em;
  line-height: 1.45;
  quotes: none;
}

.verse-text {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(212px, 30vh, 292px);
  padding: 18px 18px 18px 46px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  font-size: clamp(2rem, 2.8vw, 3.15rem);
  font-weight: 600;
  line-height: 1.84;
  letter-spacing: 0.02em;
  color: #f7fbff;
  text-wrap: balance;
  border-radius: 24px;
  background:
    linear-gradient(90deg, rgba(255, 214, 143, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  text-shadow:
    0 10px 30px rgba(0, 0, 0, 0.18),
    0 0 16px rgba(255, 255, 255, 0.05);
}

.verse-text::after {
  content: "";
  position: absolute;
  inset: 18% 16px 18% 18px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255, 213, 132, 0.08), transparent 58%);
  filter: blur(18px);
  z-index: -1;
}

.verse-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.verse-meta,
.verse-library {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.verse-meta {
  font-size: 0.88rem;
  color: #eff8ff;
}

.verse-library {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.verse-refresh-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 16px 18px;
  border-radius: calc(var(--button-radius) + 4px);
  color: #0d2330;
  font-weight: 700;
  letter-spacing: 0.03em;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.32), transparent 54%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent-warm) 88%, white), color-mix(in srgb, var(--accent) 30%, white));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 26px 44px rgba(0, 0, 0, 0.22);
}

.verse-refresh-button span {
  font-size: 1rem;
}

.verse-refresh-button small {
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(13, 35, 48, 0.72);
  opacity: 0.95;
}

.verse-refresh-button:hover:not(:disabled),
.quote-modal-button:hover,
.quote-modal-close:hover {
  transform: translateY(-2px);
}

.verse-refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.verse-panel.is-idle .verse-card {
  opacity: 0.92;
}

.verse-panel[data-variant="win"] .verse-card {
  box-shadow:
    inset 0 0 0 1px rgba(125, 245, 162, 0.16),
    0 38px 72px rgba(125, 245, 162, 0.12);
}

.verse-panel[data-variant="win"] .verse-side-rail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(125, 245, 162, 0.14), rgba(0, 0, 0, 0.02));
}

.verse-panel[data-variant="win"] .verse-badge {
  color: #dffff0;
  background: rgba(125, 245, 162, 0.12);
  border-color: rgba(125, 245, 162, 0.22);
}

.verse-panel[data-variant="win"] .verse-summary {
  border-color: rgba(125, 245, 162, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(125, 245, 162, 0.14);
}

.verse-panel[data-variant="lose"] .verse-card {
  box-shadow:
    inset 0 0 0 1px rgba(255, 191, 105, 0.16),
    0 38px 72px rgba(255, 143, 123, 0.12);
}

.verse-panel[data-variant="lose"] .verse-side-rail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, rgba(255, 191, 105, 0.14), rgba(0, 0, 0, 0.02));
}

.verse-panel[data-variant="lose"] .verse-badge {
  color: #fff0d3;
  background: rgba(255, 191, 105, 0.12);
  border-color: rgba(255, 191, 105, 0.22);
}

.verse-panel[data-variant="lose"] .verse-summary {
  border-color: rgba(255, 191, 105, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(255, 191, 105, 0.12);
}

body.modal-open .app-shell {
  filter: blur(4px) saturate(0.92);
  transform: scale(0.992);
}

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.quote-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.quote-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 214, 143, 0.08), transparent 22%),
    rgba(4, 7, 13, 0.72);
  backdrop-filter: blur(20px);
}

.quote-modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  width: min(860px, calc(100vw - 28px));
  padding: 18px;
  border-radius: 40px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 34%, rgba(255, 255, 255, 0.03)),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-top) 92%, #0a1220), color-mix(in srgb, var(--panel-bottom) 96%, #060914));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 42px 120px rgba(0, 0, 0, 0.38);
  transform: translateY(18px) scale(0.96);
  transition: transform 220ms ease;
  overflow: hidden;
}

.quote-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 18%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
  opacity: 0.76;
  pointer-events: none;
}

.quote-modal-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.quote-modal.is-open .quote-modal-card {
  transform: translateY(0) scale(1);
}

.quote-modal-orbit,
.quote-modal-paper,
.quote-modal-side-rail,
.quote-modal-main {
  position: relative;
  z-index: 1;
}

.quote-modal-orbit {
  position: absolute;
  top: -98px;
  right: -48px;
  width: 238px;
  height: 238px;
  border-radius: 999px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent-warm) 54%, white) 0 8%, transparent 9%),
    radial-gradient(circle, color-mix(in srgb, var(--accent-warm) 18%, transparent) 0 32%, transparent 54%),
    radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent) 0 48%, transparent 72%);
  filter: blur(5px);
  opacity: 0.95;
  pointer-events: none;
}

.quote-modal-paper {
  position: absolute;
  right: 42px;
  bottom: 34px;
  width: 162px;
  height: 162px;
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%);
  transform: rotate(14deg);
  opacity: 0.26;
  pointer-events: none;
}

.quote-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--text);
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.14);
}

.quote-modal-side-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px 8px 16px;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-warm) 18%, transparent), rgba(0, 0, 0, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 38px rgba(0, 0, 0, 0.18);
}

.quote-modal-side-rail::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.quote-modal-side-label {
  writing-mode: vertical-rl;
  letter-spacing: 0.24em;
  font-size: 0.84rem;
  color: color-mix(in srgb, var(--accent-warm-soft) 76%, white);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.quote-modal-side-line {
  flex: 1;
  width: 1px;
  min-height: 126px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.42), transparent);
}

.quote-modal-side-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #511b10;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 1.44rem;
  line-height: 1;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.46), transparent 56%),
    linear-gradient(135deg, #ffd38a, #ffb46d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 18px 28px rgba(255, 179, 96, 0.24);
}

.quote-modal-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.quote-modal-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-modal-kicker {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.quote-modal-summary {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: #f7fbff;
  font-family: var(--display-font);
  font-size: 0.94rem;
  letter-spacing: 0.02em;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.14);
}

.quote-modal-title {
  margin: 2px 46px 0 0;
  font-family: "ZCOOL XiaoWei", var(--display-font), sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  letter-spacing: -0.05em;
  line-height: 1.08;
}

.quote-modal-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 24px 24px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(255, 223, 156, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    linear-gradient(180deg, rgba(4, 10, 18, 0.22), rgba(5, 11, 20, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 44px rgba(0, 0, 0, 0.14);
}

.quote-modal-quote {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(240px, 34vh, 330px);
  padding: 18px 18px 18px 50px;
  border-radius: 26px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", serif;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.86;
  letter-spacing: 0.02em;
  color: #f8fcff;
  text-wrap: balance;
  background:
    linear-gradient(90deg, rgba(255, 214, 143, 0.09), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  text-shadow:
    0 12px 30px rgba(0, 0, 0, 0.18),
    0 0 16px rgba(255, 255, 255, 0.05);
}

.quote-modal-quote::after {
  content: "";
  position: absolute;
  inset: 18% 18px 18% 18px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(255, 213, 132, 0.08), transparent 58%);
  filter: blur(18px);
  z-index: -1;
}

.quote-modal-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quote-modal-meta,
.quote-modal-hint {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.6;
}

.quote-modal-meta {
  font-size: 0.9rem;
  color: #eef8ff;
}

.quote-modal-hint {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.quote-modal-actions {
  display: flex;
  gap: 12px;
}

.quote-modal-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  padding: 16px 18px;
  border-radius: calc(var(--button-radius) + 4px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.quote-modal-button span {
  font-size: 1rem;
}

.quote-modal-button small {
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quote-modal-button.is-secondary {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)),
    var(--stat-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-modal-button.is-secondary small {
  color: var(--accent-soft);
  opacity: 0.92;
}

.quote-modal-button.is-primary {
  color: #0d2330;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.32), transparent 54%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent-warm) 88%, white), color-mix(in srgb, var(--accent) 30%, white));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 24px 42px rgba(0, 0, 0, 0.22);
}

.quote-modal-button.is-primary small {
  color: rgba(13, 35, 48, 0.74);
}

.board {
  --cell-size: 46px;
  --cell-gap: 6px;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell-size));
  grid-template-rows: repeat(var(--rows), var(--cell-size));
  gap: var(--cell-gap);
  min-width: max-content;
  margin: 0;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--cell-radius);
  padding: 0;
  color: var(--text);
  font-family: var(--display-font);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  background:
    linear-gradient(180deg, var(--cell-top), var(--cell-bottom)),
    linear-gradient(135deg, var(--cell-surface-a), var(--cell-surface-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    var(--cell-shadow);
  cursor: pointer;
  user-select: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.cell::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid var(--cell-border);
  pointer-events: none;
}

.cell:hover {
  transform: translateY(-1px) scale(1.01);
}

.cell.is-revealed {
  color: #f7fbff;
  background:
    linear-gradient(180deg, var(--cell-revealed-top), var(--cell-revealed-bottom)),
    linear-gradient(135deg, var(--cell-revealed-a), var(--cell-revealed-b));
  box-shadow:
    inset 0 0 0 1px var(--cell-revealed-ring),
    inset 0 10px 20px rgba(255, 255, 255, 0.04);
  cursor: default;
}

.cell.is-revealed::after {
  border-color: color-mix(in srgb, var(--cell-revealed-ring) 78%, rgba(255, 255, 255, 0.12));
}

.cell.is-revealed:not(.is-empty):not(.is-mine) {
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.16),
    0 1px 0 rgba(7, 16, 24, 0.32);
}

.cell.is-empty {
  color: transparent;
  background:
    radial-gradient(circle at center, var(--cell-empty-glow) 0 18%, transparent 19%),
    linear-gradient(180deg, var(--cell-revealed-top), var(--cell-revealed-bottom)),
    linear-gradient(135deg, var(--cell-revealed-a), var(--cell-revealed-b));
  box-shadow:
    inset 0 0 0 1px var(--cell-revealed-ring),
    inset 0 0 22px rgba(255, 255, 255, 0.05);
}

.cell.is-flagged {
  color: var(--flag-text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.4), transparent 52%),
    linear-gradient(135deg, var(--flag-a), var(--flag-b));
}

.cell.is-mine {
  color: var(--mine-text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.42), transparent 48%),
    linear-gradient(135deg, var(--mine-a), var(--mine-b));
}

.cell.is-exploded {
  animation: pulseDanger 700ms ease;
}

.cell.is-hint-1 {
  color: #88efff;
}

.cell.is-hint-2 {
  color: #7df5a2;
}

.cell.is-hint-3 {
  color: #ffd66f;
}

.cell.is-hint-4 {
  color: #ff9f7a;
}

.cell.is-hint-5,
.cell.is-hint-6,
.cell.is-hint-7,
.cell.is-hint-8 {
  color: #ffd6ee;
}

.game-won .board-frame {
  box-shadow: inset 0 0 0 1px rgba(125, 245, 162, 0.22), 0 0 60px rgba(125, 245, 162, 0.1);
}

.game-won .result-restart-button {
  color: #08271d;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.38), transparent 58%),
    linear-gradient(135deg, #7df5a2, #d8ffd4);
  box-shadow: 0 20px 42px rgba(125, 245, 162, 0.18);
}

.game-lost .board-frame {
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.22), 0 0 60px rgba(255, 107, 107, 0.1);
}

.game-lost .result-restart-button {
  color: #301010;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.36), transparent 56%),
    linear-gradient(135deg, #ffbf69, #ff8f7b);
  box-shadow: 0 20px 42px rgba(255, 143, 123, 0.18);
}

@media (max-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: minmax(300px, 332px) minmax(0, 1fr);
  }

  .panel-stats .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-shell {
    flex-direction: column;
  }

  .verse-panel {
    width: 100%;
    min-width: 0;
  }

  .verse-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .verse-side-rail {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
  }

  .verse-side-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.18em;
  }

  .verse-side-line {
    width: auto;
    min-height: 0;
    height: 1px;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -18px, 0);
  }
}

@keyframes pulseDanger {
  0% {
    transform: scale(0.96);
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 960px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    width: min(100% - 20px, 1460px);
    height: auto;
    min-height: auto;
    padding: 12px 0 20px;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .sidebar,
  .game-panel {
    overflow: visible;
  }

  .game-panel-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .quote-modal-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 28px;
  }

  .quote-modal-side-rail {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
  }

  .quote-modal-side-label {
    writing-mode: horizontal-tb;
    letter-spacing: 0.18em;
  }

  .quote-modal-side-line {
    width: auto;
    min-height: 0;
    height: 1px;
  }

  .quote-modal-stage {
    padding: 22px 18px 18px;
  }

  .quote-modal-quote {
    min-height: 196px;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    line-height: 1.76;
  }

  .sidebar-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-action,
  .badge-row {
    min-width: 0;
    justify-content: flex-start;
  }

  .primary-button {
    width: 100%;
  }

  .verse-text {
    min-height: 184px;
    font-size: clamp(1.8rem, 5vw, 2.45rem);
    line-height: 1.72;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 1120px);
    padding-bottom: 24px;
  }

  .sidebar,
  .game-panel,
  .menu-card,
  .help-card {
    padding: 18px;
    border-radius: 24px;
  }

  .panel-stats .stats-row,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .theme-note {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.3;
  }

  .difficulty-switch,
  .tool-switch {
    flex-direction: column;
  }

  .verse-card {
    padding: 14px;
    border-radius: 26px;
  }

  .verse-stage {
    padding: 20px 16px 18px;
    border-radius: 24px;
  }

  .verse-summary,
  .verse-meta,
  .verse-library {
    width: 100%;
  }

  .verse-refresh-button {
    min-height: 56px;
    padding: 14px 16px;
  }

  .quote-modal {
    padding: 14px;
  }

  .quote-modal-title {
    margin-right: 36px;
  }

  .quote-modal-quote {
    min-height: 0;
    padding: 14px 10px 14px 36px;
    font-size: clamp(1.5rem, 8vw, 2.2rem);
    line-height: 1.66;
  }

  .quote-modal-summary,
  .quote-modal-meta,
  .quote-modal-hint {
    width: 100%;
  }

  .quote-modal-actions {
    flex-direction: column;
  }

  .quote-modal-button {
    min-height: 56px;
    padding: 14px 16px;
  }

  .verse-text {
    min-height: 0;
    padding: 14px 10px 14px 36px;
    font-size: clamp(1.54rem, 7vw, 2rem);
    line-height: 1.66;
  }

  .board {
    --cell-gap: 6px;
  }
}
