/* BL theme: original couple artwork + native controls. See docs/design.md. */
:root { color-scheme: light; --page:#f8f5fb; --ink:#493851; --muted:#85768c; --accent:#926aa5; --board:#cfc2d8; --empty:#e7dfec; --gap:10px; --padding:16px; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; color:var(--ink); background:var(--page); font-synthesis:none; -webkit-font-smoothing:antialiased; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; min-width:280px; color:var(--ink); background:radial-gradient(ellipse at 15% 25%,#eee6fa66,transparent 55%),var(--page); }
a { color:inherit; text-decoration:none; }
button { font:inherit; border:0; cursor:pointer; -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,.board:focus-visible { outline:3px solid #8c64a3; outline-offset:4px; }
.site-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:6px 48px; border-bottom:1px solid #c6adcf; }
.brand { display:flex; align-items:center; gap:12px; font-size:22px; font-weight:750; }
.brand-hearts { font-family:Arial,sans-serif; position:relative; width:46px; color:#aa7db4; font-size:33px; line-height:.9; letter-spacing:-8px; }
.brand-hearts i { font-style:normal; color:#db909c; }
.site-header p { margin:0; font-size:17px; letter-spacing:.5px; }
.game { max-width:1168px; width:calc(100% - 48px); margin:8px auto 20px; }
.heading-row { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:0 26px 12px; }
h1 { display:flex; align-items:center; gap:8px; white-space:nowrap; margin:0; font-size:56px; line-height:1.16; font-weight:800; letter-spacing:-2px; }
h1 .title-symbol { color:#dba2b1; font-family:Arial,sans-serif; font-size:49px; font-weight:400; transform:rotate(-16deg); }
.subtitle { margin:4px 0 0; font-size:20px; line-height:1.5; letter-spacing:1px; }
.game-actions { display:flex; gap:18px; align-items:center; }
.score-box { position:relative; flex-shrink:0; width:178px; min-height:76px; border:1px solid #c5afcf; border-radius:14px; background:#eee5f361; padding:7px 10px 6px; text-align:center; font-variant-numeric:tabular-nums; }
.score-box > span:first-child { display:block; font-size:17px; font-weight:650; }
.score-box strong { display:block; font-size:36px; font-weight:750; line-height:1.15; }
.score-box strong.compact { font-size:24px; line-height:1.72; }
#score-gain { position:absolute; right:8px; top:24px; font-size:24px; color:#a25589; font-weight:750; opacity:0; pointer-events:none; }
#score-gain.animate { animation:score-rise 750ms ease-out both; }
.primary-button,.secondary-button { min-height:48px; padding:11px 24px; border-radius:12px; font-size:19px; font-weight:700; white-space:nowrap; transition:background 150ms,transform 150ms; }
.primary-button { color:#fffafa; background:linear-gradient(#a47caf,#805892); box-shadow:0 3px 0 #77518a25,inset 0 1px 0 #ffffff40; }
.primary-button:hover { background:linear-gradient(#9568a3,#745081); }
.primary-button:active,.secondary-button:active { transform:translateY(1px); }
.secondary-button { color:#785187; background:#eee2f2; }
.secondary-button:hover { background:#e4d3eb; }
.game-actions .primary-button { min-width:170px; }
.gameplay { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:22px; align-items:stretch; }
.board-column { min-width:0; }
.board { position:relative; width:100%; aspect-ratio:1; border-radius:18px; background:var(--board); box-shadow:0 5px 16px #74627b13; touch-action:none; user-select:none; -webkit-user-select:none; }
.grid-background,.tile-layer { position:absolute; inset:var(--padding); }
.grid-background { display:grid; grid-template-columns:repeat(4,1fr); grid-template-rows:repeat(4,1fr); gap:var(--gap); }
.grid-background > div { background:var(--empty); border-radius:12px; }
.tile { position:absolute; width:calc((100% - 3 * var(--gap)) / 4); height:calc((100% - 3 * var(--gap)) / 4); left:calc(var(--col) * (100% + var(--gap)) / 4); top:calc(var(--row) * (100% + var(--gap)) / 4); border-radius:12px; --label-height:25px; background:var(--tile-color,#c1d9ff); border:2px solid var(--tile-accent,#537dbb); overflow:hidden; box-shadow:0 2px 0 #ffffff83; }
.sprite { position:absolute; display:block; width:100%; aspect-ratio:1; top:0; left:0; background-image:var(--atlas-image,url("../assets/bl-couple-atlas-v2.7c8286588e3b.webp")); background-size:400% 300%; background-position:var(--sx,0%) var(--sy,0%); background-repeat:no-repeat; }
.tile .sprite,.evolution-chain .sprite { width:calc(100% - var(--label-height,24px)); left:50%; transform:translateX(-50%); }
.tile-title { position:absolute; bottom:0; inset-inline:0; height:var(--label-height); display:flex; align-items:center; justify-content:center; padding:0; border-top:1px solid var(--tile-accent,#537dbb); background:var(--tile-color,#c1d9ff); color:#352a43; font-size:17px; font-weight:750; line-height:1.2; letter-spacing:0; white-space:nowrap; }
.tile.long-title .tile-title { font-size:13px; }
.tile[data-value="2048"] { box-shadow:0 0 0 2px #cf93b1,0 0 18px #efc6dd; }
.tile.slide { animation:tile-slide 140ms ease-out both; }
.tile.merged { animation:tile-slide 140ms ease-out both,tile-merge 180ms 140ms ease-out; z-index:2; }
.tile.spawn { animation:tile-spawn 190ms ease-out both; }
.tile.ghost { z-index:3; animation:tile-slide 140ms ease-out both,ghost-hide 1ms 140ms forwards; }
.controls-hint { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:12px; font-size:15px; color:#6b5875; white-space:nowrap; }
.direction-keys { display:flex; gap:10px; }
.direction-keys button { width:42px; height:42px; color:#765086; background:#f4edf8; border:1px solid #ab86be; border-radius:10px; box-shadow:0 2px 0 #c9b0d5; font-size:25px; line-height:1; }
.direction-keys button:hover { background:#e8dbee; }
.direction-keys button:active { box-shadow:none; transform:translateY(2px); }
.controls-hint > span { padding-left:18px; border-left:1px solid #cfb9db; }
.story-panel { min-width:0; display:flex; flex-direction:column; border:1px solid #d6c5e2; border-radius:18px; background:#fffaff80; box-shadow:0 5px 15px #836e9210; overflow:hidden; }
.hero-art { position:relative; aspect-ratio:1.95; flex:1 1 auto; min-height:0; overflow:hidden; background:linear-gradient(#fbf8fd,#f9eff6); }
.hero-art img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:center 32%; }
.hero-art .sprite { display:none; background-image:var(--hero-atlas-image,url("../assets/bl-couple-atlas.331277b6451d.webp")); }
.story-content { padding:14px 20px 14px; }
.stage-summary { text-align:center; }
.stage-eyebrow { display:inline-block; border-radius:20px; background:#e1cfea; padding:4px 17px; line-height:1.3; font-size:15px; font-weight:650; }
#current-stage { margin:5px 0 8px; font-size:54px; line-height:1.2; letter-spacing:-1px; font-weight:800; }
.progress-caption { display:flex; justify-content:flex-start; gap:7px; font-size:17px; font-weight:600; }
progress { display:block; width:100%; height:12px; margin:7px 0 0; border:0; border-radius:20px; overflow:hidden; background:#e7deee; accent-color:#a080b1; }
progress::-webkit-progress-bar { background:#e7deee; border-radius:20px; }
progress::-webkit-progress-value { background:#a080b1; border-radius:20px; transition:width 180ms; }
progress::-moz-progress-bar { background:#a080b1; border-radius:20px; }
.quote-box { margin-top:18px; position:relative; border:1px solid #f0c7cf; border-radius:16px; background:#fde8e8; padding:35px 18px 22px; text-align:center; }
.observer-label { position:absolute; top:6px; left:18px; background:#a77bb1; color:white; border-radius:20px; padding:3px 13px; font-size:13px; font-weight:600; line-height:1.2; }
.quote-box > p { margin:0; font-size:24px; line-height:1.4; font-weight:700; }
.quote-box > p::before { content:"“"; color:#cc8e9b; margin-right:5px; }
.quote-box > p::after { content:"”"; color:#cc8e9b; margin-left:5px; }
.quote-box #extra-quotes { font-size:13px; margin-top:9px; font-weight:450; color:#896278; }
.quote-box #extra-quotes::before,.quote-box #extra-quotes::after { content:""; }
.quote-box.lemon { background:#fff5cf; border-color:#ecd689; }
.quote-box.pop { animation:quote-pop 350ms ease-out; }
.story-help { margin:12px 0 0; text-align:center; font-size:16px; letter-spacing:.5px; }
.merge-toast { position:absolute; z-index:4; bottom:16px; left:50%; width:max-content; max-width:calc(100% - 24px); padding:10px 16px; border:1px solid #c8a7d7; border-radius:13px; background:#fffafbf2; box-shadow:0 5px 18px #5b3e6a24; text-align:center; pointer-events:none; opacity:0; visibility:hidden; }
.merge-toast strong,.merge-toast span { display:block; }
.merge-toast strong { font-size:16px; margin-bottom:3px; color:#8a5b9b; }
.merge-toast span { font-size:14px; line-height:1.5; }
.merge-toast.show { animation:toast-in-out 2500ms ease both; }
.merge-toast.lemon { border-color:#dac15e; background:#fff9ddf5; }
.evolution { margin-top:26px; width:calc(100vw - 64px); max-width:1480px; position:relative; left:50%; transform:translateX(-50%); }
.evolution h2 { display:flex; align-items:center; justify-content:center; gap:12px; margin:0 0 18px; font-size:25px; letter-spacing:1px; }
.evolution h2::before,.evolution h2::after { content:""; height:1px; background:#cdb4d6; flex:1; }
.evolution h2 .chain-symbol { color:#d88d9e; font-family:Arial,sans-serif; font-size:28px; font-weight:400; }
.evolution-chain { display:grid; grid-template-columns:repeat(11,minmax(0,1fr)); gap:8px; padding:0 0 3px; margin:0; list-style:none; }
.evolution-chain li { position:relative; aspect-ratio:1; min-width:0; overflow:hidden; border-radius:12px; --label-height:26px; background:var(--tile-color); border:2px solid var(--tile-accent); box-shadow:0 2px 2px #5339660b; }
.evolution-chain .stage-name { position:absolute; bottom:0; left:0; right:0; height:var(--label-height); display:flex; align-items:center; justify-content:center; border-top:1px solid var(--tile-accent); padding:0; text-align:center; color:#352a43; background:var(--tile-color); font-size:16px; font-weight:700; white-space:nowrap; }
.evolution-chain li[aria-current="step"] { box-shadow:0 0 0 3px #83678f44; }
footer { display:flex; align-items:center; gap:22px; text-align:center; font-size:16px; margin:25px 0 0; }
footer::before,footer::after { content:""; flex:1; height:1px; background:#cfb8db; }
.game-message { position:absolute; z-index:6; inset:0; padding:20px; display:flex; align-items:center; justify-content:center; flex-direction:column; background:#fcf6fbea; backdrop-filter:blur(6px); border-radius:inherit; text-align:center; }
.ending-art .sprite { width:155px; left:50%; transform:translateX(-50%); }
.ending-art { position:relative; width:175px; height:155px; overflow:hidden; flex-shrink:0; margin-bottom:2px; }
.game-message h2 { margin:0 0 8px; font-size:39px; line-height:1.2; }
.game-message p { font-size:17px; line-height:1.6; margin:0 0 8px; }
.game-message #ending-line { max-width:300px; font-size:15px; color:#977088; margin-bottom:18px; }
.message-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; }
.message-actions button { min-height:42px; font-size:16px; padding:10px 22px; }
.text-button { margin-top:12px; background:transparent; color:#8f5e9e; font-size:14px; padding:6px 12px; text-decoration:underline; text-underline-offset:4px; }
.celebration { position:fixed; inset:0; z-index:20; pointer-events:none; overflow:hidden; }
.celebration canvas { width:100%; height:100%; display:block; }
.static-flowers { display:none; position:absolute; left:0; right:0; top:15%; color:#cb84a5; font-size:clamp(24px,5vw,64px); text-align:center; word-spacing:15px; }
.celebration.reduced .static-flowers { display:block; }
.celebration.reduced canvas { display:none; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@keyframes tile-slide { from { transform:translate(calc((var(--from-col) - var(--col)) * (100% + var(--gap))),calc((var(--from-row) - var(--row)) * (100% + var(--gap)))); } to { transform:translate(0,0); } }
@keyframes tile-merge { 50% { scale:1.09; } }
@keyframes tile-spawn { from { opacity:0; scale:.7; } to { opacity:1; scale:1; } }
@keyframes ghost-hide { to { opacity:0; visibility:hidden; } }
@keyframes score-rise { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-45px); } }
@keyframes quote-pop { 40% { transform:scale(1.025); } }
@keyframes toast-in-out { 0% { opacity:0; visibility:visible; transform:translate(-50%,8px); } 10%,82% { opacity:1; visibility:visible; transform:translate(-50%,0); } 100% { opacity:0; visibility:hidden; transform:translate(-50%,-6px); } }
@media (min-width:821px) and (max-height:850px) {
  :root { --padding:12px; --gap:9px; }
  .game { max-width:980px; margin-top:12px; }
  .heading-row { padding:0 12px 14px; gap:16px; }
  h1 { font-size:40px; }
  h1 .title-symbol { font-size:36px; }
  .subtitle { font-size:16px; letter-spacing:0; }
  .game-actions { gap:12px; }
  .score-box { width:105px; min-height:60px; padding:6px; border-radius:11px; }
  .score-box > span:first-child { font-size:13px; }
  .score-box strong { font-size:29px; }
  .game-actions .primary-button { min-width:126px; min-height:43px; font-size:17px; padding:10px 20px; }
  .tile { --label-height:22px; }
  .tile-title { font-size:15px; }
  .story-content { padding:8px 18px 12px; }
  .hero-art { aspect-ratio:2.1; }
  .stage-eyebrow { font-size:13px; padding:3px 14px; }
  #current-stage { font-size:33px; margin:4px 0 7px; }
  .progress-caption { font-size:13px; }
  progress { height:9px; margin-top:5px; }
  .quote-box { margin-top:13px; padding:31px 13px 11px; }
  .quote-box > p { font-size:18px; }
  .observer-label { font-size:12px; }
  .story-help { font-size:14px; margin-top:10px; }
  .controls-hint { font-size:13px; gap:12px; margin-top:11px; }
  .direction-keys { gap:8px; }
  .direction-keys button { width:36px; height:36px; font-size:23px; border-radius:8px; }
  .controls-hint > span { padding-left:12px; }
  .evolution { margin-top:22px; }
  .evolution h2 { font-size:22px; margin-bottom:14px; }
  .evolution-chain .stage-name { font-size:14px; }
}
@media (min-width:821px) and (max-width:1100px) { .heading-row { padding-inline:4px; } h1 { font-size:39px; } .subtitle { font-size:16px; } .game-actions { gap:10px; } .score-box { width:112px; } .game-actions .primary-button { min-width:126px; } }
@media (max-width:820px) {
  :root { --padding:11px; --gap:9px; }
  .site-header { padding:12px 18px; }
  .brand { font-size:17px; gap:8px; }
  .brand-hearts { width:33px; font-size:27px; }
  .site-header p { font-size:12px; letter-spacing:0; }
  .game { max-width:540px; width:calc(100% - 28px); margin:20px auto; }
  .heading-row { display:block; padding:0 0 16px; }
  h1 { font-size:36px; letter-spacing:-1px; gap:6px; }
  h1 .title-symbol { font-size:33px; }
  .subtitle { margin-top:5px; font-size:15px; letter-spacing:.4px; }
  .game-actions { gap:10px; margin-top:16px; }
  .score-box { width:auto; flex:1; min-height:57px; padding:5px 6px; border-radius:11px; }
  .score-box > span:first-child { font-size:12px; }
  .score-box strong { font-size:25px; }
  .score-box strong.compact { font-size:20px; line-height:1.45; }
  .game-actions .primary-button { min-width:120px; min-height:43px; font-size:16px; padding:10px 18px; }
  .gameplay { grid-template-columns:minmax(0,1fr); gap:18px; }
  .board { border-radius:14px; }
  .grid-background > div,.tile { border-radius:8px; }
  .tile { --label-height:21px; }
  .tile-title { font-size:clamp(11px,3.4vw,17px); }
  .tile.long-title .tile-title { font-size:10px; }
  .controls-hint { margin-top:14px; font-size:12px; gap:10px; white-space:normal; }
  .direction-keys { gap:6px; }
  .direction-keys button { width:34px; height:34px; font-size:23px; border-radius:8px; }
  .controls-hint > span { padding-left:10px; }
  .story-panel { display:grid; grid-template-columns:88px minmax(0,1fr); gap:12px; padding:14px; border-radius:14px; }
  .hero-art { grid-column:1; grid-row:1; width:88px; height:88px; aspect-ratio:1; border-radius:10px; }
  .hero-art img { display:none; }
  .hero-art .sprite { display:block; top:0; }
  .story-content { display:contents; }
  .stage-summary { grid-column:2; grid-row:1; min-width:0; text-align:left; }
  .stage-eyebrow { font-size:11px; padding:2px 9px; }
  #current-stage { font-size:24px; margin:3px 0 5px; letter-spacing:0; }
  .progress-caption { font-size:11px; }
  progress { height:6px; margin-top:5px; }
  .quote-box { grid-column:1/-1; margin:0; padding:30px 12px 12px; border-radius:12px; }
  .quote-box > p { font-size:17px; }
  .observer-label { font-size:11px; left:12px; }
  .story-help { grid-column:1/-1; font-size:12px; margin:0; }
  .evolution { margin-top:23px; width:100%; max-width:none; left:0; transform:none; }
  .evolution h2 { font-size:21px; margin-bottom:14px; gap:7px; }
  .evolution-chain { grid-template-columns:repeat(11,83px); gap:8px; overflow-x:auto; padding:3px 2px 8px; scroll-snap-type:x proximity; }
  .evolution-chain li { scroll-snap-align:start; border-radius:9px; --label-height:22px; }
  .evolution-chain .stage-name { font-size:12px; }
  footer { margin-top:17px; font-size:12px; gap:8px; }
  .merge-toast { bottom:9px; padding:8px 10px; border-radius:10px; }
  .merge-toast strong { font-size:13px; }
  .merge-toast span { font-size:12px; }
  .game-message { padding:13px; }
  .ending-art { width:122px; height:104px; }
  .ending-art .sprite { width:104px; }
  .game-message h2 { font-size:28px; }
  .game-message p { font-size:13px; margin-bottom:6px; }
  .game-message #ending-line { font-size:12px; margin-bottom:11px; }
  .message-actions { gap:8px; }
  .message-actions button { font-size:14px; padding:9px 16px; min-height:38px; }
  .text-button { font-size:12px; margin-top:6px; }
}
@media (max-width:440px) { .site-header p { font-size:10px; max-width:118px; text-align:right; line-height:1.5; } }
@media (max-width:350px) { :root { --padding:8px; --gap:7px; } .brand { font-size:15px; } .site-header { padding-inline:14px; } .site-header p { max-width:83px; } h1 { font-size:31px; } .subtitle { font-size:13px; } .game-actions { gap:7px; } .game-actions .primary-button { min-width:106px; font-size:14px; padding-inline:13px; } .tile { --label-height:19px; } .tile-title { font-size:11px; } .game-message h2 { font-size:24px; } .ending-art { width:90px; height:76px; } .ending-art .sprite { width:76px; } .game-message #ending-line { margin-bottom:8px; } .message-actions button { padding:8px 11px; font-size:12px; } .text-button { padding:4px; } .direction-keys button { width:31px; height:32px; } .controls-hint { gap:8px; font-size:11px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-delay:0ms !important; transition-duration:.01ms !important; } }

/* Theme choices share the board and retain separate saves. */
.theme-switcher { display:flex; align-items:center; flex-shrink:0; min-width:566px; border:1px solid #ac8abb; border-radius:24px; overflow:hidden; padding:1px; gap:2px; background:#ffffff55; }
.theme-switcher button { flex:1; padding:4px 19px; border-radius:21px; color:var(--ink); font-size:20px; line-height:1.1; font-weight:600; white-space:nowrap; background:transparent; }
.theme-switcher button span { font-size:24px; vertical-align:-1px; margin-right:5px; }
.theme-switcher button[aria-pressed="true"] { background:#845e97; color:white; }
.theme-switcher button:hover { box-shadow:inset 0 0 0 1px #ac8abb99; }
.theme-switcher button:focus-visible { outline-offset:-3px; }
body[data-theme="showbiz"] { --page:#f2f7fd; --ink:#26364e; --muted:#647891; --accent:#b9842e; --board:#b5c8de; --empty:#d4e2ef; background:radial-gradient(ellipse at 18% 25%,#e3effc99,transparent 60%),var(--page); }
body[data-theme="showbiz"] .site-header { border-color:#aac0d8; }
body[data-theme="showbiz"] .brand-hearts { color:#c0933e; letter-spacing:0; width:30px; }
body[data-theme="showbiz"] h1 .title-symbol,body[data-theme="showbiz"] .evolution h2 .chain-symbol { color:#c0933e; }
body[data-theme="showbiz"] .theme-switcher { border-color:#b78a3e; }
body[data-theme="showbiz"] .theme-switcher button[aria-pressed="true"] { background:#d7ad60; color:#26364e; }
body[data-theme="showbiz"] .score-box { background:#e8f0fa80; border-color:#91abc9; }
body[data-theme="showbiz"] .primary-button { background:linear-gradient(#bb8a37,#a56f23); color:white; box-shadow:0 3px 0 #a6783020,inset 0 1px 0 #ffffff40; }
body[data-theme="showbiz"] .primary-button:hover { background:linear-gradient(#a77a30,#8f5e1a); }
body[data-theme="showbiz"] .secondary-button { color:#3c587c; background:#e2eaf6; }
body[data-theme="showbiz"] .story-panel { border-color:#adc0d7; background:#fbfdffb3; }
body[data-theme="showbiz"] .hero-art { background:#e9f0f7; }
body[data-theme="showbiz"] .stage-eyebrow { color:#654d2e; background:#f1d6a4; }
body[data-theme="showbiz"] progress { background:#e2d9cb; accent-color:#c18b32; }
body[data-theme="showbiz"] progress::-webkit-progress-bar { background:#e2d9cb; }
body[data-theme="showbiz"] progress::-webkit-progress-value { background:#c18b32; }
body[data-theme="showbiz"] progress::-moz-progress-bar { background:#c18b32; }
body[data-theme="showbiz"] .quote-box { background:#fff3e2; border-color:#dabc8e; }
body[data-theme="showbiz"] .observer-label { background:#9e6b22; }
body[data-theme="showbiz"] .quote-box > p::before,body[data-theme="showbiz"] .quote-box > p::after { color:#b3863f; }
body[data-theme="showbiz"] .quote-box.spotlight { background:#fff1ba; border-color:#c9a346; }
body[data-theme="showbiz"] .merge-toast { border-color:#d0ab6c; background:#fffaf0f5; }
body[data-theme="showbiz"] .merge-toast strong { color:#93671e; }
body[data-theme="showbiz"] .merge-toast.spotlight { background:#fff4c8f5; border-color:#c99b39; }
body[data-theme="showbiz"] .direction-keys button { color:#48688f; border-color:#8daac9; background:#edf4fc; box-shadow:0 2px 0 #b8cce1; }
body[data-theme="showbiz"] .direction-keys button:hover { background:#dce9f7; }
body[data-theme="showbiz"] .controls-hint { color:#506781; }
body[data-theme="showbiz"] .controls-hint > span { border-color:#c5d3e3; }
body[data-theme="showbiz"] .evolution h2::before,body[data-theme="showbiz"] .evolution h2::after,body[data-theme="showbiz"] footer::before,body[data-theme="showbiz"] footer::after { background:#d2b887; }
body[data-theme="showbiz"] .evolution-chain li[aria-current="step"] { box-shadow:0 0 0 3px #c4a15855; }
body[data-theme="showbiz"] .tile[data-value="2048"] { box-shadow:0 0 0 2px #d2ad57,0 0 18px #eacb8244; }
body[data-theme="showbiz"] .game-message { background:#f7fbffed; }
body[data-theme="showbiz"] .text-button,body[data-theme="showbiz"] #score-gain { color:#93671e; }
body[data-theme="showbiz"] .static-flowers { color:#ca9a3e; }
@media (max-width:1100px) and (min-width:821px) { .theme-switcher { min-width:260px; } .theme-switcher button { font-size:14px; padding-inline:12px; } }
@media (max-width:820px) { .site-header { flex-wrap:wrap; column-gap:12px; row-gap:9px; } .theme-switcher { order:3; flex-basis:100%; min-width:0; padding:2px; } .theme-switcher button { padding:5px 12px; font-size:14px; } .theme-switcher button span { font-size:19px; } }

@media (min-width:821px) and (min-height:851px) { body[data-theme="showbiz"] .score-box { width:122px; min-height:70px; } body[data-theme="showbiz"] .score-box strong { font-size:34px; } body[data-theme="showbiz"] .game-actions .primary-button { min-width:148px; min-height:50px; } }

/* Keep the final atlas cell clear of the neighboring hero cell. */
body[data-theme="showbiz"] .ending-art .sprite, body[data-theme="showbiz"] .tile[data-value="2048"] .sprite, body[data-theme="showbiz"] .tile.long-title .sprite, body[data-theme="showbiz"] .evolution-chain li:last-child .sprite { clip-path:inset(0 5% 0 0); }

/* 政瞳：太阳橘与小枕头，公开名场面图鉴。 */
body[data-theme="zhengtong"] { --page:#fff7ed; --ink:#513626; --muted:#896b54; --accent:#ff7a00; --board:#e6c49e; --empty:#f4e1c8; background:radial-gradient(ellipse at 18% 25%,#ffedda77,transparent 60%),var(--page); }
body[data-theme="zhengtong"] .site-header { border-color:#e7b989; }
body[data-theme="zhengtong"] .brand-hearts { color:#ff7a00; letter-spacing:0; width:30px; }
body[data-theme="zhengtong"] h1 .title-symbol,body[data-theme="zhengtong"] .evolution h2 .chain-symbol { color:#ff7a00; }
body[data-theme="zhengtong"] .theme-switcher { border-color:#e59b51; }
body[data-theme="zhengtong"] .theme-switcher button[aria-pressed="true"] { background:#ff7a00; color:#402514; }
body[data-theme="zhengtong"] .theme-switcher button:hover { box-shadow:inset 0 0 0 1px #e59b5188; }
body[data-theme="zhengtong"] .score-box { background:#fff0df80; border-color:#dfa66e; }
body[data-theme="zhengtong"] .primary-button { background:linear-gradient(#ff850c,#e96800); color:#fff; box-shadow:0 3px 0 #a45c2220,inset 0 1px 0 #ffffff40; }
body[data-theme="zhengtong"] .primary-button:hover { background:linear-gradient(#eb7300,#cd5800); }
body[data-theme="zhengtong"] .secondary-button { color:#75441d; background:#ffe2bf; }
body[data-theme="zhengtong"] .story-panel { border-color:#deb991; background:#fffaf3b3; }
body[data-theme="zhengtong"] .hero-art { background:#fff0dc; }
body[data-theme="zhengtong"] .stage-eyebrow { color:#75441d; background:#f8d3a8; }
body[data-theme="zhengtong"] progress { background:#efd8be; accent-color:#ff7a00; }
body[data-theme="zhengtong"] progress::-webkit-progress-bar { background:#efd8be; }
body[data-theme="zhengtong"] progress::-webkit-progress-value { background:#ff7a00; }
body[data-theme="zhengtong"] progress::-moz-progress-bar { background:#ff7a00; }
body[data-theme="zhengtong"] .quote-box { background:#fff1df; border-color:#e8b482; }
body[data-theme="zhengtong"] .observer-label { background:#a54b00; }
body[data-theme="zhengtong"] .quote-box > p::before,body[data-theme="zhengtong"] .quote-box > p::after { color:#c86517; }
body[data-theme="zhengtong"] .quote-box.spotlight { background:#eef8df; border-color:#8daf66; }
body[data-theme="zhengtong"] .merge-toast { border-color:#dbab78; background:#fff8ebf5; }
body[data-theme="zhengtong"] .merge-toast strong { color:#a54b00; }
body[data-theme="zhengtong"] .merge-toast.spotlight { background:#eff9e6f5; border-color:#85aa68; }
body[data-theme="zhengtong"] .direction-keys button { color:#8d572f; border-color:#d0a478; background:#fff4e8; box-shadow:0 2px 0 #e0bd98; }
body[data-theme="zhengtong"] .direction-keys button:hover { background:#ffe7cb; }
body[data-theme="zhengtong"] .controls-hint { color:#8a6344; }
body[data-theme="zhengtong"] .controls-hint > span { border-color:#e2c4a5; }
body[data-theme="zhengtong"] .evolution h2::before,body[data-theme="zhengtong"] .evolution h2::after,body[data-theme="zhengtong"] footer::before,body[data-theme="zhengtong"] footer::after { background:#e9b27d; }
body[data-theme="zhengtong"] .evolution-chain li[aria-current="step"] { box-shadow:0 0 0 3px #e78a3455; }
body[data-theme="zhengtong"] .tile[data-value="2048"] { box-shadow:0 0 0 2px #ff9b31,0 0 18px #f7bf6444; }
body[data-theme="zhengtong"] .game-message { background:#fff8eeed; }
body[data-theme="zhengtong"] .text-button,body[data-theme="zhengtong"] #score-gain,body[data-theme="zhengtong"] #ending-line { color:#a35317; }
body[data-theme="zhengtong"] .static-flowers { color:#ee7a0c; }
body[data-theme="zhengtong"] button:focus-visible,body[data-theme="zhengtong"] a:focus-visible,body[data-theme="zhengtong"] .board:focus-visible,body[data-theme="zhengtong"] summary:focus-visible { outline-color:#b15300; }
.theme-sources { color:var(--ink); font-size:15px; line-height:1.65; margin:12px auto 0; max-width:1040px; }
.theme-sources summary { cursor:pointer; width:fit-content; margin:auto; color:#9d4e12; text-decoration:underline; text-underline-offset:4px; font-weight:650; padding:4px 10px; }
.theme-sources > p { color:#806348; margin:12px 0; }
.theme-sources ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:40px; row-gap:12px; padding-left:25px; }
.theme-sources li { padding-left:3px; }
.theme-sources a { color:#93430a; text-decoration:underline; text-underline-offset:3px; font-weight:650; }
.theme-sources li span { display:block; color:#806348; }
@media (min-width:821px) and (min-height:851px) { body[data-theme="zhengtong"] .score-box { width:122px; min-height:70px; } body[data-theme="zhengtong"] .score-box strong { font-size:34px; } body[data-theme="zhengtong"] .game-actions .primary-button { min-width:148px; min-height:50px; } }
@media (max-width:1100px) and (min-width:821px) { .site-header { padding-inline:24px; } .site-header p { max-width:155px; font-size:13px; } }
@media (max-width:820px) { .theme-switcher button { min-height:44px; } .theme-sources ol { grid-template-columns:minmax(0,1fr); } }
@media (max-width:440px) { .theme-switcher button { font-size:12px; padding:6px 5px; } .theme-switcher button span { font-size:16px; margin-right:3px; } }

/* 后会友期：鼠尾草绿的职业群像旅行图鉴。 */
body[data-theme="youqi"] { --page:#f4f8ef; --ink:#28483b; --muted:#6c8373; --accent:#4f806a; --board:#b8cbbb; --empty:#e1ead9; background:radial-gradient(ellipse at 18% 25%,#e2eddc77,transparent 60%),var(--page); }
body[data-theme="youqi"] .site-header { border-color:#a4bda8; }
body[data-theme="youqi"] .brand-hearts { color:#4f806a; letter-spacing:0; width:30px; }
body[data-theme="youqi"] h1 .title-symbol,body[data-theme="youqi"] .evolution h2 .chain-symbol { color:#4f806a; }
body[data-theme="youqi"] .theme-switcher { border-color:#7ba88b; }
body[data-theme="youqi"] .theme-switcher button[aria-pressed="true"] { background:#4f806a; color:#ffffff; }
body[data-theme="youqi"] .theme-switcher button:hover { box-shadow:inset 0 0 0 1px #7ba88b88; }
body[data-theme="youqi"] .score-box { background:#eef4e880; border-color:#9ab69d; }
body[data-theme="youqi"] .primary-button { background:linear-gradient(#568a70,#3c6c55); color:#fff; box-shadow:0 3px 0 #a45c2220,inset 0 1px 0 #ffffff40; }
body[data-theme="youqi"] .primary-button:hover { background:linear-gradient(#47765d,#315d48); }
body[data-theme="youqi"] .secondary-button { color:#31553f; background:#dbe9d4; }
body[data-theme="youqi"] .story-panel { border-color:#a7bda5; background:#f9fcf5b3; }
body[data-theme="youqi"] .hero-art { background:#e4eee0; }
body[data-theme="youqi"] .stage-eyebrow { color:#31553f; background:#c2d7bd; }
body[data-theme="youqi"] progress { background:#c8d9c3; accent-color:#4f806a; }
body[data-theme="youqi"] progress::-webkit-progress-bar { background:#c8d9c3; }
body[data-theme="youqi"] progress::-webkit-progress-value { background:#4f806a; }
body[data-theme="youqi"] progress::-moz-progress-bar { background:#4f806a; }
body[data-theme="youqi"] .quote-box { background:#e9f2e3; border-color:#9cb99a; }
body[data-theme="youqi"] .observer-label { background:#315e45; }
body[data-theme="youqi"] .quote-box > p::before,body[data-theme="youqi"] .quote-box > p::after { color:#789667; }
body[data-theme="youqi"] .quote-box.spotlight { background:#fff2d5; border-color:#d6a16c; }
body[data-theme="youqi"] .merge-toast { border-color:#a3ba99; background:#f9fff3f5; }
body[data-theme="youqi"] .merge-toast strong { color:#315e45; }
body[data-theme="youqi"] .merge-toast.spotlight { background:#fff5def5; border-color:#d6a16c; }
body[data-theme="youqi"] .direction-keys button { color:#44684e; border-color:#95b08f; background:#f1f7eb; box-shadow:0 2px 0 #b9ceb0; }
body[data-theme="youqi"] .direction-keys button:hover { background:#e1edd8; }
body[data-theme="youqi"] .controls-hint { color:#5c7b60; }
body[data-theme="youqi"] .controls-hint > span { border-color:#b0c8a5; }
body[data-theme="youqi"] .evolution h2::before,body[data-theme="youqi"] .evolution h2::after,body[data-theme="youqi"] footer::before,body[data-theme="youqi"] footer::after { background:#89a78c; }
body[data-theme="youqi"] .evolution-chain li[aria-current="step"] { box-shadow:0 0 0 3px #679b7855; }
body[data-theme="youqi"] .tile[data-value="2048"] { box-shadow:0 0 0 2px #d8af57,0 0 18px #e5c88044; }
body[data-theme="youqi"] .game-message { background:#f6fbf0ed; }
body[data-theme="youqi"] .text-button,body[data-theme="youqi"] #score-gain,body[data-theme="youqi"] #ending-line { color:#456c4e; }
body[data-theme="youqi"] .static-flowers { color:#e49179; }
body[data-theme="youqi"] button:focus-visible,body[data-theme="youqi"] a:focus-visible,body[data-theme="youqi"] .board:focus-visible,body[data-theme="youqi"] summary:focus-visible { outline-color:#3c7353; }

/* Four choices retain their individual game sessions. */
.theme-switcher { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); min-width:640px; }
.theme-switcher button { font-size:18px; padding-inline:12px; }
.theme-switcher button span { font-size:22px; }
.stage-cast { margin:3px 0 8px; color:var(--muted); font-size:14px; line-height:1.45; font-weight:500; }
body[data-theme="youqi"] h1 .title-symbol,body[data-theme="youqi"] .evolution h2 .chain-symbol { color:#e49179; }
body[data-theme="youqi"] #current-stage { margin-bottom:4px; }
body[data-theme="youqi"] .theme-sources summary,body[data-theme="youqi"] .theme-sources a { color:#35644a; }
body[data-theme="youqi"] .theme-sources > p,body[data-theme="youqi"] .theme-sources li span { color:#627b63; }
@media (min-width:821px) and (min-height:851px) { body[data-theme="youqi"] .score-box { width:122px; min-height:70px; } body[data-theme="youqi"] .score-box strong { font-size:34px; } body[data-theme="youqi"] .game-actions .primary-button { min-width:148px; min-height:50px; } }
@media (max-width:1200px) and (min-width:821px) { .site-header { padding-inline:24px; } .theme-switcher { min-width:440px; } .theme-switcher button { font-size:14px; padding-inline:8px; } .theme-switcher button span { font-size:18px; margin-right:3px; } .site-header p { max-width:100px; font-size:12px; } }
@media (max-width:820px) { .theme-switcher { min-width:0; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); border-radius:18px; } .theme-switcher button { min-height:44px; font-size:14px; border-radius:14px; padding:6px 10px; } .theme-switcher button span { font-size:18px; } .stage-cast { font-size:11px; margin:3px 0 5px; } }

/* Clear neighboring atlas outlines at the two final cells' right edge. */
body[data-theme="youqi"] .tile[data-value="1024"] .sprite,body[data-theme="youqi"] .tile[data-value="2048"] .sprite,body[data-theme="youqi"] .tile.long-title .sprite,body[data-theme="youqi"] .evolution-chain li:nth-child(10) .sprite,body[data-theme="youqi"] .evolution-chain li:last-child .sprite,body[data-theme="youqi"] .ending-art .sprite { clip-path:inset(0 4% 0 0); }
