body {
    margin: 0;
    background: #FCFAF9;
    color: #111827;
    font-family: Inter, Arial, sans-serif;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(252, 250, 249, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(209, 213, 219, 0.65);
}

.header-nav {
    max-width: 1100px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
}

.brand-text {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(90deg, #6A35D7 0%, #3A66E8 50%, #1FB7C6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.language-form {
    margin: 0;
}

.language-select,
.header-action {
    text-decoration: none;

    height: 38px;

    padding: 0 15px;

    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.9);

    background-color: rgba(255, 255, 255, 0.75);

    font-size: 14px;
    font-weight: 700;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.language-select {
    appearance: none;

    padding-right: 36px;
    cursor: pointer;

    background-color: rgba(255, 255, 255, 0.75);

    background-image:
        linear-gradient(45deg, transparent 50%, #6B7280 50%),
        linear-gradient(135deg, #6B7280 50%, transparent 50%);

    background-position:
        calc(100% - 17px) 50%,
        calc(100% - 12px) 50%;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}

.header-action:hover,
.language-select:enabled:hover {
    text-decoration: none;
    background-color: white;
    color: #3A66E8;
    border-color: rgba(58, 102, 232, 0.35);
    box-shadow:
        0 4px 12px rgba(58, 102, 232, 0.12),
        0 0 16px rgba(31, 183, 198, 0.08);
}

.language-select:enabled:hover {
    background-image:
        linear-gradient(45deg, transparent 50%, #3A66E8 50%),
        linear-gradient(135deg, #3A66E8 50%, transparent 50%);
}

.header-action.primary {
    text-decoration: none;
    border: none;
    color: white;
    background: linear-gradient(90deg, #6A35D7 0%, #3A66E8 50%, #1FB7C6 100%);
    box-shadow:
        0 4px 12px rgba(58, 102, 232, 0.22),
        0 0 18px rgba(31, 183, 198, 0.10);
}

.header-action.primary:hover {
    text-decoration: none;
    color: white;
    filter: brightness(1.06);
    box-shadow:
        0 8px 24px rgba(58, 102, 232, 0.32),
        0 0 28px rgba(106, 53, 215, 0.16),
        0 0 28px rgba(31, 183, 198, 0.16);
}

.page-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.dummy-content p {
    margin-bottom: 24px;
}

.site-footer {
    margin-top: 40px;

    border-top: 1px solid rgba(209, 213, 219, 0.65);

    background: #FCFAF9;
}

.footer-content {
    max-width: 1100px;

    margin: 0 auto;
    padding: 24px;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-copyright {
    color: #6B7280;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.footer-links a:hover {
    color: #3A66E8;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-weight: 700;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid rgba(209, 213, 219, 0.9);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.75);

    font-size: 15px;
    font-family: inherit;

    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;

    border-color: rgba(58, 102, 232, 0.5);

    box-shadow:
        0 0 0 3px rgba(58, 102, 232, 0.10);
}

.form-button {
    border: none;

    padding: 12px 22px;

    border-radius: 14px;

    color: white;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    background: linear-gradient(
        90deg,
        #6A35D7 0%,
        #3A66E8 50%,
        #1FB7C6 100%
    );

    box-shadow:
        0 4px 12px rgba(58, 102, 232, 0.22),
        0 0 18px rgba(31, 183, 198, 0.10);

    transition:
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.form-button:hover {
    filter: brightness(1.06);

    box-shadow:
        0 8px 24px rgba(58, 102, 232, 0.32),
        0 0 28px rgba(106, 53, 215, 0.16),
        0 0 28px rgba(31, 183, 198, 0.16);
}

.gradient-text {
    background: linear-gradient(
        90deg,
        #6A35D7 0%,
        #3A66E8 50%,
        #1FB7C6 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    display: inline-block;
}

.success-card {
    max-width: 600px;

    margin: 40px auto;

    padding: 32px;

    text-align: center;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid rgba(209, 213, 219, 0.8);
    border-radius: 18px;

    box-shadow:
        0 6px 18px rgba(58, 102, 232, 0.16),
        0 0 22px rgba(106, 53, 215, 0.08),
        0 0 22px rgba(31, 183, 198, 0.08);
}

.success-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 32px;
    font-weight: bold;

    color: white;

    background: linear-gradient(
        90deg,
        #6A35D7 0%,
        #3A66E8 50%,
        #1FB7C6 100%
    );
}

.success-card p {
    color: #4B5563;
    line-height: 1.6;
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    line-height: 1.7;
}

.story-grid {
    display: grid;

    grid-template-columns: repeat(
        auto-fill,
        minmax(280px, 1fr)
    );

    gap: 24px;

    margin-top: 32px;
}

.story-card {
    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid rgba(209, 213, 219, 0.8);

    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.story-card:hover {
    transform: translateY(-3px);

    border-color: rgba(58, 102, 232, 0.25);

    box-shadow:
        0 8px 24px rgba(58, 102, 232, 0.12),
        0 0 24px rgba(31, 183, 198, 0.08);
}

.story-cover {
    width: 100%;

    aspect-ratio: 3 / 2;

    object-fit: cover;

    display: block;
}

.story-info {
    padding: 18px;
}

.story-info h2 {
    margin: 0 0 8px 0;

    font-size: 20px;
    font-weight: 700;

    color: #111827;
}

.story-age {
    margin: 0;

    font-size: 14px;
    font-weight: 600;

    color: #6B7280;
}

.episode-card {
    max-width: 900px;

    margin: 32px auto;

    overflow: hidden;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid rgba(209, 213, 219, 0.8);

    box-shadow:
        0 6px 18px rgba(58, 102, 232, 0.10),
        0 0 22px rgba(31, 183, 198, 0.06);
}

.episode-image {
    width: 100%;

    display: block;

    aspect-ratio: 3 / 2;

    object-fit: cover;
}

.audio-controls {
    display: flex;
    justify-content: center;
    gap: 16px;

    padding: 24px;
}

.audio-button {
    border: none;

    min-width: 120px;
    height: 42px;

    padding: 0 20px;

    border-radius: 999px;

    cursor: pointer;

    color: white;

    font-size: 14px;
    font-weight: 700;

    background: linear-gradient(
        90deg,
        #6A35D7 0%,
        #3A66E8 50%,
        #1FB7C6 100%
    );

    box-shadow:
        0 4px 12px rgba(58, 102, 232, 0.22),
        0 0 18px rgba(31, 183, 198, 0.10);

    transition:
        box-shadow 0.2s ease,
        filter 0.2s ease,
        transform 0.2s ease;
}

.audio-button:hover {
    filter: brightness(1.06);

    box-shadow:
        0 8px 24px rgba(58, 102, 232, 0.32),
        0 0 28px rgba(106, 53, 215, 0.16),
        0 0 28px rgba(31, 183, 198, 0.16);
}

.audio-button:active {
    transform: translateY(1px);

    box-shadow:
        0 2px 8px rgba(58, 102, 232, 0.18),
        0 0 12px rgba(31, 183, 198, 0.08);
}

.choice-card {
    max-width: 900px;

    margin: 32px auto;

    padding: 28px;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid rgba(209, 213, 219, 0.8);

    box-shadow:
        0 6px 18px rgba(58, 102, 232, 0.10),
        0 0 22px rgba(31, 183, 198, 0.06);

    scroll-margin-bottom: 40px;
}

.choice-list {
    display: flex;
    flex-direction: column;

    gap: 14px;

    margin-top: 20px;
}

.choice-button {
    display: flex;
    align-items: center;

    min-height: 48px;

    padding: 0 18px;

    border-radius: 14px;

    border: 1px solid rgba(209, 213, 219, 0.8);

    background: rgba(255, 255, 255, 0.75);

    color: #374151;

    font-size: 15px;
    font-weight: 600;

    text-decoration: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease;
}

.choice-button:hover {
    color: #3A66E8;

    border-color: rgba(58, 102, 232, 0.35);

    transform: translateY(-1px);

    box-shadow:
        0 4px 12px rgba(58, 102, 232, 0.12),
        0 0 16px rgba(31, 183, 198, 0.08);
}

.hidden {
    display: none;
}

.visible {
    display: block;

    animation: fadeInChoiceCard 0.5s ease;
}

@keyframes fadeInChoiceCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story-detail-hero {
    max-width: 1100px;
    margin: 0 auto;
}

.story-detail-heading {
    margin-bottom: 20px;
}

.story-detail-actions-top {
    margin-bottom: 16px;
}

.story-back-button {
    display: inline-flex;
    color: #374151;
    background: rgba(255, 255, 255, 0.75);
}

.story-back-link:hover {
    color: #3A66E8;
}

.story-detail-heading h1 {
    margin: 0 0 8px;
}

.story-detail-age {
    margin: 0;

    font-size: 17px;
    font-weight: 700;

    color: #4B5563;
}

.story-detail-card {
    display: flex;
    flex-direction: column;

    max-width: 760px;
    margin: 0 auto 32px;
    padding: 24px;

    border-radius: 18px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(209, 213, 219, 0.8);

    box-shadow:
        0 6px 18px rgba(58, 102, 232, 0.10),
        0 0 22px rgba(31, 183, 198, 0.06);
}

.story-detail-cover {
    width: 100%;
    border-radius: 14px;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    margin-bottom: 22px;
}

.story-summary {
    margin: 24px;

    line-height: 1.7;
    color: #374151;
    font-size: 16px;
}

.story-start-panel {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.story-start-button {
    height: 48px;
    padding: 0 32px;
    font-size: 16px;
    font-weight: 700;
}

.story-language-select {
    height: 44px;
    min-width: 160px;
}

@media (max-width: 800px) {
    .story-detail-card {
        padding: 20px;
    }

    .story-start-panel {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .story-start-button,
    .story-language-select {
        width: auto;
        min-height: 44px;
    }
}

/* Mobile improvements */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

img,
video,
audio {
    max-width: 100%;
}

@media (max-width: 700px) {
    .header-nav {
        height: auto;
        min-height: 64px;
        padding: 12px 16px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .header-left,
    .header-right {
        gap: 10px;
    }

    .brand-text {
        font-size: 16px;
    }

    .header-logo {
        width: 34px;
        height: 34px;
    }

    .language-select,
    .header-action {
        height: 40px;
        padding-left: 13px;
        padding-right: 13px;
        font-size: 13px;
    }

    .language-select {
        padding-right: 34px;
    }

    .page-content,
    .legal-content {
        padding: 24px 16px 48px;
    }

    .story-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 24px;
    }

    .story-info {
        padding: 16px;
    }

    .story-info h2 {
        font-size: 19px;
    }

    .episode-card,
    .choice-card,
    .success-card,
    .story-detail-card {
        margin: 24px auto;
        border-radius: 16px;
    }

    .choice-card,
    .success-card,
    .story-detail-card {
        padding: 20px;
    }

    .audio-controls {
        flex-direction: column;
        padding: 20px;
        gap: 12px;
    }

    .audio-button {
        width: 100%;
        min-width: 0;
        height: 48px;
        font-size: 15px;
    }

    .choice-button {
        min-height: 52px;
        padding: 12px 16px;
        line-height: 1.35;
    }

    .story-actions {
        flex-direction: column;
        gap: 12px;
    }

    .story-actions .header-action,
    .story-actions .form-button {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 16px;
        gap: 16px;
    }

    .footer-links {
        gap: 14px 20px;
    }
}

@media (max-width: 420px) {
    .header-nav {
        padding-left: 12px;
        padding-right: 12px;
    }

    .brand-text {
        font-size: 15px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .language-form,
    .language-select,
    .header-action {
        flex: 1;
    }

    .language-select,
    .header-action {
        width: 100%;
    }

    .story-cover,
    .episode-image,
    .story-detail-cover {
        aspect-ratio: 3 / 2;
    }

    .story-detail-card {
        padding: 18px;
    }

    .story-start-panel {
        flex-wrap: wrap;
    }

    .story-start-button,
    .story-language-select {
        flex: 1 1 auto;
        min-width: 140px;
    }
}

.account-card {
    max-width: 500px;

    margin: 32px auto;

    padding: 32px;

    border-radius: 18px;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid rgba(209, 213, 219, 0.8);

    box-shadow:
        0 6px 18px rgba(58, 102, 232, 0.10),
        0 0 22px rgba(31, 183, 198, 0.06);
}

.account-footer {
    margin-top: 24px;

    text-align: center;

    color: #6B7280;
}

.account-footer a {
    color: #3A66E8;
    text-decoration: none;
    font-weight: 600;
}

.error-message {
    margin-bottom: 20px;
    padding: 12px 14px;

    border-radius: 14px;
    border: 1px solid rgba(220, 38, 38, 0.18);

    background: rgba(220, 38, 38, 0.08);
    color: #B91C1C;

    font-size: 14px;
    font-weight: 600;
}

.form-actions {
    display: flex;
    justify-content: center;
}

.account-actions {
    display: flex;
    justify-content: center;
    gap: 16px;

    margin-top: 24px;

    flex-wrap: wrap;
}

.subscribe-card {
    max-width: 520px;
    margin: 40px auto;
    padding: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(209, 213, 219, 0.9);
    text-align: center;
}

.subscribe-card h1 {
    margin-top: 0;
    font-size: 28px;
}

.subscribe-card p {
    color: #4b5563;
    line-height: 1.5;
}

.promo-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.promo-form label {
    font-weight: 700;
    font-size: 14px;
}

.promo-form input {
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    font-size: 14px;
}

.promo-form button {
    height: 42px;
    border-radius: 999px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.subscription-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.subscription-option {
    position: relative;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 1rem;
    background: #fff;
}

.subscription-option-highlighted {
    border-width: 2px;
}

.subscription-badge {
    position: absolute;
    top: -0.75rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #222;
    color: #fff;
    font-size: 0.8rem;
}

.subscription-price {
    margin: 1rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.subscription-price span {
    font-size: 1rem;
    font-weight: 400;
}

.subscription-description {
    min-height: 3rem;
}

.subscription-button {
    width: 100%;
}

.promo-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

@media (max-width: 700px) {
    .subscription-options {
        grid-template-columns: 1fr;
    }
}

.promo-card {
    margin-top: 2rem;
}

.promo-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    list-style: none;
}

.promo-summary::-webkit-details-marker {
    display: none;
}

.promo-summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.promo-card[open] .promo-summary::before {
    transform: rotate(90deg);
}

.promo-content {
    margin-top: 1rem;
}

.subscription-success-card {
    text-align: center;
}

.subscription-success-note {
    opacity: 0.75;
}

.access-card {
    margin-bottom: 2rem;
}

.access-expiry {
    margin-top: 0.75rem;
}

.subscription-actions {
    margin-top: 1.5rem;
}

.manage-subscription-button {
    display: inline-block;

    padding: 0.75rem 1.25rem;

    border: 1px solid #ccc;
    border-radius: 8px;

    text-decoration: none;
    font-weight: 600;

    color: inherit;
    background: #f5f5f5;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.manage-subscription-button:hover {
    background: #ebebeb;
    border-color: #aaa;
}