.story-card {
    --story-accent: #f3cd78;
    position: absolute; inset: 0; z-index: 150; pointer-events: auto;
    display: grid; place-items: center; overflow: auto; overscroll-behavior: contain;
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    background: linear-gradient(180deg, #091b2bbf, #071b2cf5); color: #f9f3df;
    font: 16px/1.8 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
}
.story-card-content { width: min(100%, 660px); margin: auto; text-align: center; animation: story-arrive .6s ease-out both; }
.story-card-eyebrow { color: var(--story-accent); letter-spacing: .24em; margin: 0 0 18px; font-weight: 700; }
.story-card h1 { font-size: clamp(28px, 5vw, 48px); line-height: 1.5; margin: 0; text-wrap: balance; }
.story-card h1::after { content: ''; display: block; width: 72px; height: 3px; background: var(--story-accent); margin: 24px auto; }
.story-card-text { margin: 0 0 28px; font-size:calc(18px * var(--ui-scale, 1)); }
.story-card button { min-height: 48px; padding: 10px 28px; font: inherit; font-weight: 700; border: 2px solid var(--story-accent); background: #153d4e; color: #fff7df; cursor: pointer; border-radius: 5px; touch-action: manipulation; }
.story-card button:hover { background: #245667; }
.story-card :is(button,a):focus-visible { outline: 3px solid #fff4b1; outline-offset: 4px; }
.story-card-details:empty { display: none; }
.story-card-details { text-align: left; margin-bottom: 28px; }
.story-card-details h2 { font-size:calc(18px * var(--ui-scale, 1)); color: var(--story-accent); margin-top: 28px; }
.story-card-details p { margin: 8px 0; }
.story-card.ending .story-card-details p { white-space: pre-line; margin: 0 0 20px; line-height: 1.85; }
.story-card.ending .story-card-text:empty { display: none; }
.ending-choices { display: grid; gap: 12px; margin-top: 24px; }
.story-card-details ul { padding-left: 22px; }
.story-card-details li { margin: 12px 0; }
.story-card a { color: #9bdfeb; text-decoration: underline; text-underline-offset: 3px; }
.story-card.credits .story-card-content { max-width: 640px; }
@keyframes story-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reduced-motion .story-card-content { animation: none; }
@media (prefers-reduced-motion: reduce) { .story-card-content { animation: none; } }
@media (max-height: 480px) { .story-card { padding-top: 18px; padding-bottom: 18px; } .story-card-eyebrow { margin-bottom: 8px; } .story-card h1::after { margin: 12px auto; } .story-card-text { margin-bottom: 16px; } }
