/* Story presentation stays entirely inside CYOA. No Batcave theme dependencies. */
:root { --accent-rgb: 255,126,95; --strong-rgb: 255,209,102; --cyan-rgb: 77,228,247; --scene-bg: #10152a; }
[data-story="gta-iii"], [data-story-palette="gta-iii"] { --accent:#c7cbd0; --accent-strong:#f1d68a; --strong-rgb:241,214,138; --accent-cyan:#91b8c9; --accent-rgb:199,203,208; --cyan-rgb:145,184,201; --scene-bg:#10181d; }
[data-story="gta-iv"], [data-story-palette="gta-iv"] { --accent:#d6b58f; --accent-strong:#eed5aa; --strong-rgb:238,213,170; --accent-cyan:#9bacb4; --accent-rgb:214,181,143; --cyan-rgb:155,172,180; --scene-bg:#181a1e; }
[data-story="gta-san-andreas"], [data-story-palette="gta-san-andreas"] { --accent:#b0cc8c; --accent-strong:#f3d597; --strong-rgb:243,213,151; --accent-cyan:#85cec1; --accent-rgb:176,204,140; --cyan-rgb:133,206,193; --scene-bg:#18201c; }
[data-story="gta-v"], [data-story-palette="gta-v"] { --accent:#88d9bb; --accent-strong:#f2dc92; --strong-rgb:242,220,146; --accent-cyan:#7fcfe6; --accent-rgb:136,217,187; --cyan-rgb:127,207,230; --scene-bg:#101f25; }
[data-story="red-dead-redemption-2"], [data-story-palette="red-dead-redemption-2"] { --accent:#e6ac83; --accent-strong:#f5d5a2; --strong-rgb:245,213,162; --accent-cyan:#bfc6a1; --accent-rgb:230,172,131; --cyan-rgb:191,198,161; --scene-bg:#211b19; }
[data-story="monsters-inc"], [data-story-palette="monsters-inc"] { --accent:#8eddd8; --accent-strong:#edc1fb; --strong-rgb:237,193,251; --accent-cyan:#acdcb3; --accent-rgb:142,221,216; --cyan-rgb:172,220,179; --scene-bg:#13232b; }
body { background:var(--scene-bg); }
body[data-story]:not([data-story="library"]):not([data-story="vice-city"])::before {
  background:radial-gradient(ellipse at 10% 0%,rgba(var(--accent-rgb),.13),transparent 60%),radial-gradient(ellipse at 100% 60%,rgba(var(--cyan-rgb),.09),transparent 55%),var(--scene-bg);
}
body[data-story="red-dead-redemption-2"] .scene-title,
body[data-story="red-dead-redemption-2"] .ending-title { font-family:Georgia,serif; }
body[data-story="monsters-inc"] .story-hero,
body[data-story="monsters-inc"] .scene-text { border-radius:24px; }
#app-shell { background:linear-gradient(170deg,rgba(12,14,27,.9),rgba(17,20,35,.82)); min-height:calc(100svh - 32px); }
.story-hero { background:linear-gradient(130deg,rgba(var(--accent-rgb),.14),rgba(var(--cyan-rgb),.06) 65%,transparent); }
.story-card { border-left:3px solid var(--accent); }
.story-card h2 { margin:0 0 12px; font-size:1.45rem; font-family:var(--font-heading); color:var(--accent-strong); }
.story-card-actions { flex-wrap:wrap; }
.story-card-actions > button { min-height:44px; }
.library-note { color:var(--muted); line-height:1.6; max-width:62ch; }
.story-button { background:linear-gradient(135deg,rgba(var(--accent-rgb),.25),rgba(var(--cyan-rgb),.10)); border-color:rgba(var(--accent-rgb),.5); }
.primary-button { box-shadow:0 8px 24px rgba(var(--accent-rgb),.16); }
.scene-title { text-shadow:none; }
#story-screen .scene-title,
#story-screen .scene-text,
#story-screen .choice-list,
#story-screen .end-state,
#story-intro-screen .summary-card { max-width:42rem; width:100%; margin-inline:auto; text-align:left; }
#story-screen .scene-title { margin-top:32px; margin-bottom:18px; }
#story-screen .scene-text { line-height:1.8; font-size:clamp(1.15rem,1.4vw,1.3rem); padding:clamp(18px,3vw,28px); }
.scene-text p:last-child { margin-bottom:0; }
.story-status { max-width:900px; margin-inline:auto; border-color:rgba(var(--cyan-rgb),.22); }
.story-status-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.choice-button { background:linear-gradient(120deg,rgba(var(--accent-rgb),.12),rgba(var(--cyan-rgb),.06) 65%,rgba(255,255,255,.02)); }
.choice-button:hover { box-shadow:0 8px 24px rgba(var(--accent-rgb),.14); }
.choice-button.is-locked { opacity:.78; }
.choice-button.is-locked:hover { transform:none; box-shadow:none; }
.ending-panel { border-color:rgba(var(--accent-rgb),.42); background:linear-gradient(180deg,rgba(var(--accent-rgb),.12),rgba(17,15,28,.94)); }
.ending-panel p { max-width:65ch; margin-inline:auto; line-height:1.75; }
.ending-discovery.is-new { animation:ending-glow 650ms ease both; border-color:rgba(var(--accent-rgb),.5); box-shadow:0 0 18px rgba(var(--accent-rgb),.18); }
@keyframes ending-glow { from { opacity:.2; transform:translateY(5px); } to { opacity:1; transform:none; } }
.load-notice { padding:18px; border:1px solid var(--border); border-radius:12px; color:var(--muted); line-height:1.65; }
.load-notice button { margin:8px; }
.cyoa-footer { flex-direction:column; gap:12px; padding-bottom:max(22px,env(safe-area-inset-bottom)); }
#save-status { margin:0; font-size:.95rem; color:var(--muted); text-align:center; max-width:65ch; }
#save-status.is-warning { color:var(--accent-strong); }
.skip-link { position:fixed; left:16px; top:12px; z-index:10; opacity:0; pointer-events:none; transform:translateY(-150%); padding:12px 20px; background:#fff; color:#14121b; border-radius:8px; }
.skip-link:focus { opacity:1; pointer-events:auto; transform:none; }
.music-button { min-width:44px; min-height:44px; }
.volume-controls input { min-height:44px; }
.archive-list { display:grid; gap:12px; max-width:760px; margin-inline:auto; }
.archive-list button { text-align:left; }
.archive-list span { display:block; margin-top:6px; color:var(--muted); font-weight:400; }
.achievement-summary { margin-top:24px; }
.achievement-list { list-style:none; padding:0; display:grid; gap:8px; }
.achievement-list li { padding:9px 12px; border:1px solid var(--border); border-radius:8px; color:var(--muted); }
.achievement-list .is-unlocked { color:var(--accent-strong); border-color:rgba(var(--accent-rgb),.4); }
.achievement-list span { display:block; color:var(--muted); font-size:.8rem; }
button:disabled { cursor:not-allowed; }
.screen h1:focus, .scene-title:focus, .ending-title:focus { outline:none; }
.screen h1:focus-visible, .scene-title:focus-visible, .ending-title:focus-visible { outline:2px solid var(--accent); outline-offset:8px; }
@media(min-width:921px) {
  .story-card h2 { grid-column:1; grid-row:1; }
  .story-card-actions { grid-column:2; grid-row:1 / span 4; max-width:300px; justify-content:flex-end; }
  .story-card .story-button { width:auto; min-width:100px; }
}
@media(max-width:640px) {
  #app-shell { min-height:calc(100svh - 16px); }
  .music-player { grid-template-columns:auto auto; gap:6px; }
  .music-transport { grid-column:1; grid-row:2; }
  .volume-controls { grid-column:2; grid-row:2; }
  .volume-controls input { width:68px; }
  .music-player .music-button { width:44px; min-height:44px; }
  #home-button { width:100%; }
  .story-card-actions { gap:8px; }
  .story-card-actions > button { flex:1 1 auto; }
  .story-status-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 10px; }
  .scene-title { font-size:1.8rem; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(max-width:380px) { .volume-controls input { width:48px; } }
@media(prefers-reduced-transparency:reduce) { #app-shell { backdrop-filter:none; background:#121622; } }
@media(forced-colors:active) { .story-card,.choice-button,.story-button,.primary-button { border:1px solid ButtonText; } }

.music-play-pause:hover,.music-play-pause:focus-visible { background:linear-gradient(135deg,var(--accent),var(--accent-strong)); filter:brightness(1.08); }
