:root {
    --background: #07111f;
    --card-background: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --header-height: 72px;
    --navigation-height: 84px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overscroll-behavior-y: contain;
}

body {
    background:
        radial-gradient(circle at top left, #1d4ed8 0%, transparent 35%),
        radial-gradient(circle at bottom right, #dc2626 0%, transparent 30%),
        var(--background);

    color: var(--text-primary);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    min-height: 100vh;
    overflow: hidden;
}

button {
    font: inherit;
}

.top-bar {
    align-items: center;
    backdrop-filter: blur(14px);
    background: rgba(7, 17, 31, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    height: var(--header-height);
    justify-content: space-between;
    left: 0;
    padding: 0 20px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 20;
}

.brand {
    align-items: center;
    display: flex;
    gap: 10px;
}

.brand div {
    display: flex;
    flex-direction: column;
}

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

.brand small {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
}

.logo-flag {
    font-size: 28px;
}

.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 12px;
}

.sections-button {
    background: transparent;
    border: 0;
    color: #fcd34d;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    margin-right: 10px;
}

[hidden] {
    display: none !important;
}

.section-chooser {
    align-items: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: calc(var(--header-height) + 44px) 20px 44px;
}

.chooser-heading {
    margin-bottom: 34px;
    max-width: 620px;
    text-align: center;
}

.eyebrow {
    color: #fcd34d;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.chooser-heading h1 {
    font-size: clamp(36px, 8vw, 58px);
    line-height: 1.05;
    margin: 12px 0 14px;
}

.chooser-heading p {
    color: var(--text-secondary);
    font-size: 17px;
}

.section-grid {
    display: grid;
    gap: 16px;
    max-width: 820px;
    width: 100%;
}

.section-option {
    align-items: center;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    color: var(--text-primary);
    cursor: pointer;
    display: grid;
    gap: 18px;
    grid-template-columns: 64px 1fr auto 24px;
    padding: 22px;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.section-option:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(245, 158, 11, 0.6);
    transform: translateY(-3px);
}

.section-icon {
    align-items: center;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 18px;
    color: #fcd34d;
    display: flex;
    font-size: 21px;
    font-weight: 900;
    height: 64px;
    justify-content: center;
}

.section-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-copy strong { font-size: 19px; }
.section-copy small, .section-count { color: var(--text-secondary); }
.section-count { font-size: 13px; white-space: nowrap; }
.section-arrow { color: #fcd34d; font-size: 24px; }

.cards-container {
    height: 100vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.cards-container::-webkit-scrollbar {
    display: none;
}

.phrase-card {
    align-items: center;
    display: flex;
    height: 100vh;
    justify-content: center;
    padding:
        calc(var(--header-height) + 18px)
        18px
        calc(var(--navigation-height) + 18px);

    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.card-content {
    align-items: center;
    backdrop-filter: blur(18px);
    background: var(--card-background);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
    min-height: 520px;
    overflow: hidden;
    padding: 45px 28px;
    position: relative;
    text-align: center;
    width: 100%;
}

.card-number {
    color: var(--text-secondary);
    font-size: 13px;
    left: 24px;
    position: absolute;
    top: 22px;
}

.category-badge {
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 999px;
    color: #fcd34d;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 30px;
    padding: 8px 14px;
}

.language-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.dutch-phrase {
    font-size: clamp(32px, 8vw, 54px);
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 24px;
    overflow-wrap: anywhere;
}

.audio-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.audio-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.audio-button:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.audio-button:active {
    transform: scale(0.96);
}

.audio-button:disabled {
    cursor: default;
    opacity: 0.65;
}

.audio-button.slow {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.35);
}

.translation-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(12px);
    transition:
        max-height 0.35s ease,
        opacity 0.35s ease,
        transform 0.35s ease;

    width: 100%;
}

.phrase-card.translation-visible .translation-wrapper {
    max-height: 220px;
    opacity: 1;
    transform: translateY(0);
}

.divider {
    background: rgba(255, 255, 255, 0.15);
    height: 1px;
    margin: 8px auto 24px;
    width: 70%;
}

.romanian-phrase {
    color: #f8fafc;
    font-size: clamp(24px, 6vw, 34px);
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.reveal-button {
    background: var(--accent);
    border: 0;
    border-radius: 16px;
    color: #111827;
    cursor: pointer;
    font-weight: 800;
    margin-top: 25px;
    min-height: 52px;
    padding: 14px 22px;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.reveal-button:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.reveal-button:active {
    transform: scale(0.97);
}

.difficulty {
    bottom: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    position: absolute;
}

.swipe-hint {
    animation: bounce 1.8s infinite;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 20px;
}

.bottom-navigation {
    align-items: center;
    background: rgba(7, 17, 31, 0.88);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    bottom: 0;
    display: flex;
    gap: 12px;
    height: var(--navigation-height);
    justify-content: center;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    right: 0;
    z-index: 20;
}

.navigation-button {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    min-height: 48px;
    padding: 12px 20px;
    width: min(180px, 45%);
}

.navigation-button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #111827;
}

.navigation-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.loading-screen,
.error-screen {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100vh;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.loader {
    animation: spin 0.8s linear infinite;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent);
    height: 50px;
    width: 50px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

@media (max-width: 600px) {
    .top-bar {
        padding: 0 14px;
    }

    .brand small {
        display: none;
    }

    .phrase-card {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card-content {
        border-radius: 24px;
        min-height: 500px;
        padding: 40px 20px;
    }

    .audio-button {
        font-size: 14px;
        padding: 11px 16px;
    }

    .navigation-button {
        padding: 10px 12px;
    }

    .section-chooser { padding-left: 14px; padding-right: 14px; }
    .section-option { gap: 13px; grid-template-columns: 54px 1fr 20px; padding: 17px; }
    .section-icon { border-radius: 15px; height: 54px; }
    .section-count { display: none; }
    .sections-button { font-size: 0; margin-right: 4px; }
    .sections-button::before { content: "Secțiuni"; font-size: 12px; }
}

@media (max-height: 700px) {
    .card-content {
        min-height: 430px;
        padding-bottom: 35px;
        padding-top: 35px;
    }

    .category-badge {
        margin-bottom: 18px;
    }

    .dutch-phrase {
        font-size: clamp(28px, 7vw, 44px);
        margin-bottom: 16px;
    }

    .swipe-hint {
        display: none;
    }
}
