@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --paper-base: #dfbe86;
    --paper-light: #e8ca94;
    --paper-dark: #d4ad6c;

    --text: #111111;
    --muted: #342817;
    --soft: #5a4324;
    --accent: #6d4310;

    --soft-panel: rgba(248, 232, 196, 0.50);
    --soft-panel-strong: rgba(248, 232, 196, 0.68);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background-color: var(--paper-base);
    background-image:
        radial-gradient(circle at 12% 14%, rgba(255, 244, 218, 0.10) 0, rgba(255, 244, 218, 0.10) 9%, transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(145, 95, 30, 0.055) 0, rgba(145, 95, 30, 0.055) 8%, transparent 24%),
        radial-gradient(circle at 24% 76%, rgba(132, 92, 34, 0.04) 0, rgba(132, 92, 34, 0.04) 11%, transparent 28%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='180' viewBox='0 0 340 180'%3E%3Cg fill='none'%3E%3Cpath d='M-10 25 C 20 6, 42 48, 78 27 S 138 0, 177 29 S 237 54, 281 24 S 320 2, 350 20' stroke='rgba(122,74,18,0.075)' stroke-width='1.1'/%3E%3Cpath d='M-8 60 C 22 40, 52 84, 94 58 S 154 36, 190 64 S 246 86, 290 56 S 327 40, 352 60' stroke='rgba(255,243,214,0.105)' stroke-width='0.9'/%3E%3Cpath d='M-12 98 C 18 76, 54 121, 88 96 S 149 75, 192 101 S 252 126, 299 95 S 327 73, 352 90' stroke='rgba(122,74,18,0.06)' stroke-width='1.0'/%3E%3Cpath d='M-15 138 C 30 110, 66 157, 105 132 S 167 108, 210 138 S 271 166, 318 131 S 340 111, 358 126' stroke='rgba(255,247,226,0.09)' stroke-width='0.85'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, var(--paper-light) 0%, var(--paper-base) 45%, var(--paper-dark) 100%);
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, no-repeat;
    background-size: auto, auto, auto, 340px 180px, auto;
    background-attachment: fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    width: min(1160px, calc(100% - 30px));
    margin: 0 auto;
    padding: 18px 0 38px;
}

/* TOP BAR */

.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--soft-panel);
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.topbar-title {
    font-weight: 700;
    color: var(--muted);
}

/* ZAJEDNIČKI PAPIR ZA SVE PROZORE */

.home-hero,
.module-shell,
.module-card,
.sentence-stage {
    background-color: var(--paper-base);
    background-image:
        radial-gradient(circle at 18% 16%, rgba(255, 244, 220, 0.085), transparent 28%),
        radial-gradient(circle at 78% 74%, rgba(145, 99, 35, 0.045), transparent 25%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='180' viewBox='0 0 340 180'%3E%3Cg fill='none'%3E%3Cpath d='M-10 25 C 20 6, 42 48, 78 27 S 138 0, 177 29 S 237 54, 281 24 S 320 2, 350 20' stroke='rgba(122,74,18,0.065)' stroke-width='1.05'/%3E%3Cpath d='M-8 60 C 22 40, 52 84, 94 58 S 154 36, 190 64 S 246 86, 290 56 S 327 40, 352 60' stroke='rgba(255,243,214,0.095)' stroke-width='0.85'/%3E%3Cpath d='M-12 98 C 18 76, 54 121, 88 96 S 149 75, 192 101 S 252 126, 299 95 S 327 73, 352 90' stroke='rgba(122,74,18,0.052)' stroke-width='0.95'/%3E%3Cpath d='M-15 138 C 30 110, 66 157, 105 132 S 167 108, 210 138 S 271 166, 318 131 S 340 111, 358 126' stroke='rgba(255,247,226,0.08)' stroke-width='0.8'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, var(--paper-light) 0%, var(--paper-base) 48%, var(--paper-dark) 100%);
    background-repeat: no-repeat, no-repeat, repeat, no-repeat;
    background-size: auto, auto, 340px 180px, auto;
    border: none;
    box-shadow: none;
}

/* HOME */

.home-hero {
    padding: clamp(24px, 5vw, 52px);
    border-radius: 30px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--soft-panel);
    color: var(--text);
    font-weight: 800;
    margin-bottom: 22px;
}

.home-hero h1 {
    margin: 0;
    max-width: 850px;
    font-size: clamp(2.6rem, 8vw, 6.5rem);
    line-height: 0.94;
    letter-spacing: -0.05em;
    color: var(--text);
    font-weight: 800;
}

.home-hero p {
    margin: 22px 0 0;
    max-width: 740px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.28rem);
    line-height: 1.55;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.module-card {
    min-height: 210px;
    position: relative;
    padding: 22px;
    border-radius: 26px;
    color: var(--text);
    transition: filter 120ms ease;
}

.module-card.active:hover {
    filter: brightness(0.985);
}

.module-card.locked {
    opacity: 0.75;
}

.module-no {
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.module-card h2 {
    margin: 0;
    font-size: 1.32rem;
    letter-spacing: -0.02em;
    color: var(--text);
    font-weight: 800;
}

.module-card p {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.module-card span {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 20px;
    color: var(--accent);
    font-weight: 800;
}

/* MODULE 1 */

.module-shell {
    min-height: calc(100vh - 96px);
    padding: clamp(16px, 3vw, 26px);
    border-radius: 30px;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 16px;
}

.compact-module-head {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 auto !important;
}

.compact-lesson-select {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border-radius: 13px !important;
    text-align: center !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    font-family: "Open Sans", sans-serif !important;
    color: var(--text) !important;
    background: var(--soft-panel) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.compact-counter {
    width: 94px !important;
    min-width: 94px !important;
    height: 40px !important;
    border-radius: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--soft-panel) !important;
    color: var(--accent) !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
}

.hidden-info,
.hidden-speaker,
.speaker {
    display: none !important;
}

.sentence-stage {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 410px;
    padding: clamp(20px, 5vw, 48px) 16px;
    border-radius: 28px;
}

.sentence-text {
    max-width: 980px;
    color: #111111;
    font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(2.35rem, 6.6vw, 5.8rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 800;
    text-wrap: balance;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    min-height: 84px;
}

.control-btn {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    border: none;
    background: var(--soft-panel);
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    font-family: "Open Sans", sans-serif;
    font-weight: 800;
    box-shadow: none;
    transition: filter 120ms ease;
}

.control-btn.primary {
    width: 82px;
    height: 82px;
    background: var(--soft-panel-strong);
    color: #111111;
}

.control-btn:hover,
.control-btn.primary:hover {
    filter: brightness(0.98);
}

.status {
    min-height: 24px;
    text-align: center;
    color: var(--muted);
    font-weight: 650;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sentence-stage {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 18px, 1160px);
        padding-top: 10px;
    }

    .topbar {
        min-height: 52px;
        font-size: 0.92rem;
    }

    .brand-link {
        min-height: 36px;
        padding: 0 12px;
    }

    .home-hero,
    .module-shell,
    .module-card,
    .sentence-stage {
        border-radius: 22px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 185px;
    }

    .sentence-stage {
        min-height: 390px;
        padding: 24px 14px;
    }

    .sentence-text {
        font-size: clamp(2.05rem, 10.4vw, 4.4rem);
        line-height: 1.1;
    }

    .compact-lesson-select {
        width: 72px !important;
        min-width: 72px !important;
        max-width: 72px !important;
        height: 38px !important;
        min-height: 38px !important;
        font-size: 0.92rem !important;
    }

    .compact-counter {
        width: 82px !important;
        min-width: 82px !important;
        height: 38px !important;
        font-size: 0.92rem !important;
    }

    .control-btn {
        width: 66px;
        height: 66px;
    }

    .control-btn.primary {
        width: 76px;
        height: 76px;
    }
}

/* === NO VISIBLE WINDOWS — ONLY BACKGROUND, TEXT AND BUTTONS === */

.home-hero,
.module-shell,
.module-card,
.sentence-stage,
.select-card,
.listen-card,
.lesson-meta,
.card,
.hero {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.module-shell {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.sentence-stage {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.home-hero {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.module-card {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.module-card.active:hover {
    filter: none !important;
}

.compact-lesson-select,
.compact-counter,
.brand-link {
    background: rgba(248, 232, 196, 0.42) !important;
    border: none !important;
    box-shadow: none !important;
}

.control-btn {
    background: rgba(248, 232, 196, 0.46) !important;
    border: none !important;
    box-shadow: none !important;
}

.control-btn.primary {
    background: rgba(248, 232, 196, 0.68) !important;
    border: none !important;
    box-shadow: none !important;
}

.sentence-text {
    color: #111111 !important;
    text-shadow: none !important;
}

.status {
    color: #342817 !important;
}


/* === TOPBAR LESSON/SENTENCE CONTROLS === */

.module-topbar-clean {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    min-height: 56px !important;
    padding: 0 !important;
}

.module-topbar-clean .brand-link {
    justify-self: start !important;
}

.topbar-lesson-controls {
    justify-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.topbar-spacer {
    justify-self: end !important;
    width: 1px !important;
    height: 1px !important;
}

.topbar-title {
    display: none !important;
}

.module-shell {
    min-height: calc(100vh - 80px) !important;
}

.compact-module-head {
    display: none !important;
}

.compact-lesson-select {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 8px !important;
    border-radius: 13px !important;
    text-align: center !important;
    text-align-last: center !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
}

.compact-counter {
    width: 88px !important;
    min-width: 88px !important;
    height: 38px !important;
    border-radius: 13px !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
}

@media (max-width: 640px) {
    .module-topbar-clean {
        grid-template-columns: auto 1fr !important;
        gap: 10px !important;
    }

    .topbar-lesson-controls {
        justify-self: end !important;
        gap: 8px !important;
    }

    .topbar-spacer {
        display: none !important;
    }

    .compact-lesson-select {
        width: 66px !important;
        min-width: 66px !important;
        max-width: 66px !important;
        height: 36px !important;
        min-height: 36px !important;
        font-size: 0.9rem !important;
    }

    .compact-counter {
        width: 76px !important;
        min-width: 76px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }
}

/* === MOVE L/S CONTROLS TO RIGHT === */

.module-topbar-clean {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 56px !important;
    padding: 0 !important;
}

.module-topbar-clean .brand-link {
    flex: 0 0 auto !important;
}

.topbar-lesson-controls {
    margin-left: auto !important;
    justify-self: end !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
}

.topbar-spacer {
    display: none !important;
}

.compact-lesson-select {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
}

.compact-counter {
    width: 88px !important;
    min-width: 88px !important;
}

@media (max-width: 640px) {
    .module-topbar-clean {
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }

    .topbar-lesson-controls {
        margin-left: auto !important;
        gap: 8px !important;
    }

    .compact-lesson-select {
        width: 66px !important;
        min-width: 66px !important;
        max-width: 66px !important;
    }

    .compact-counter {
        width: 76px !important;
        min-width: 76px !important;
    }
}

/* === HIDE EMPTY STATUS LINE === */
.status:empty {
    display: none !important;
}
