:root {
    --bg: #1a1a2e;
    --text: #eee;
    --text-muted: #888;
    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --card-bg: #16213e;
    --secondary: #0f3460;
    --secondary-hover: #1a4a7a;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 2rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: block;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.back-link:hover {
    color: var(--accent-hover);
}

h1, h2 {
    color: var(--accent);
}

h1 {
    text-align: center;
}

.story-list {
    display: grid;
    gap: 1.5rem;
}

.story-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid var(--secondary);
}

.story-card h2 {
    margin-top: 0;
}

.story-card a {
    text-decoration: none;
}

.story-card button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

.story-card button:hover {
    background: var(--accent-hover);
}

.story-scene {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.story-scene h2 {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.choice {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--secondary);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.choice:hover {
    transform: translateY(-2px);
    background: var(--secondary-hover);
}

.choice-text {
    font-size: 1.2rem;
    flex: 1;
}

.hint {
    text-align: center;
    color: var(--text-muted);
    margin-top: 2rem;
    font-style: italic;
}

.ending {
    text-align: center;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.ending-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.qr-section p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    order: -1;
}

@media (max-width: 500px) {
    .ending-actions {
        flex-direction: column;
    }
}

.theme-picker {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--secondary);
    margin-bottom: 1rem;
    width: fit-content;
}

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

.theme-picker input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.error {
    background: var(--accent-hover);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

#scanner {
    position: fixed;
    top: 0;
    left: -9999px;
}
