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

:root {
    --bg: #f5f1e8;
    --card: #fffdf8;
    --ink: #263c35;
    --muted: #849087;
    --green: #286753;
    --green-dark: #1f5543;
    --sage: #e3ebdd;
    --line: #e6e4d9;
    --cream: #f0e8d7;
    --gold: #b98632;
    --accent: var(--green);
    --shadow: 0 8px 30px #293e3410
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 14px
}

button {
    font: inherit;
    cursor: pointer;
    color: inherit
}

button:focus-visible {
    outline: 3px solid #b98632;
    outline-offset: 3px
}

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

.hidden {
    display: none !important
}

.topbar {
    height: 83px;
    padding: 0 clamp(20px, 4.5vw, 64px);
    display: flex;
    align-items: center;
    gap: clamp(22px, 4vw, 60px);
    border-bottom: 1px solid var(--line);
    background: #f8f5ed
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: none;
    font: 500 31px Fredoka, sans-serif;
    letter-spacing: -1px;
    padding: 0
}

.mosaic-mark {
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    transform: rotate(-8deg);
    flex: none
}

.mosaic-mark i {
    display: block;
    background: var(--green);
    border-radius: 3px
}

.mosaic-mark i:nth-child(2) {
    opacity: .7
}

.mosaic-mark i:nth-child(3) {
    opacity: .45
}

.mosaic-mark i:nth-child(4) {
    opacity: .85
}

.mosaic-mark.small {
    width: 28px;
    height: 28px
}

.mosaic-mark.large {
    width: 56px;
    height: 56px;
    gap: 5px
}

.nav-tabs {
    height: 100%;
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 42px);
    flex: 1
}

.nav-tab {
    height: 100%;
    position: relative;
    background: none;
    border: 0;
    color: #7b867e;
    font-weight: 700
}

.nav-tab.active {
    color: var(--ink)
}

.nav-tab i {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    display: none
}

.nav-tab.active i {
    display: block
}

.player {
    display: flex;
    align-items: center;
    gap: 18px
}

.streak {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    white-space: nowrap
}

.streak span {
    font-size: 18px
}

.avatar {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    border: 1px solid #d8dfd2;
    background: var(--sage);
    color: var(--green);
    font-size: 18px;
    font-weight: 800
}

.main {
    width: min(1380px, calc(100% - 64px));
    margin: 0 auto;
    padding: 32px 0 44px
}

.level-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px
}

.level-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    background: #e8e6d9;
    color: #6c796f;
    padding: 8px 13px;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 800
}

.level-heading h1,
.page-heading h1 {
    font: 500 36px/1.15 Fredoka, sans-serif;
    letter-spacing: -.5px;
    margin: 9px 0 5px
}

.subheading,
.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 18px
}

.heading-note {
    color: var(--muted);
    font-size: 12px
}

.icon-button {
    height: 43px;
    width: 43px;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 13px;
    font-size: 20px;
    box-shadow: 0 3px 8px #293e3408
}

.workspace {
    display: grid;
    grid-template-columns: 235px minmax(390px, 1fr) 245px;
    gap: 27px;
    align-items: start
}

.dashboard,
.play-column,
.guide-column {
    min-width: 0
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 13px
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow)
}

.score-card {
    padding: 21px 19px;
    display: flex;
    flex-direction: column;
    gap: 20px
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.3px;
    font-weight: 800;
    color: #8b958b
}

.score-block>strong {
    display: block;
    font: 500 43px/1.2 Fredoka, sans-serif;
    margin: 5px 0 6px;
    letter-spacing: -1px
}

.best {
    font-size: 11px;
    color: var(--muted)
}

.best b {
    color: var(--ink)
}

.progress-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px
}

.progress-label strong {
    font-size: 12px
}

.progress-track {
    height: 7px;
    border-radius: 10px;
    background: #e9e8df;
    overflow: hidden;
    margin: 10px 0 7px
}

.progress-track i {
    height: 100%;
    display: block;
    width: 0;
    background: var(--accent);
    border-radius: 10px;
    transition: width .3s
}

.progress-block small {
    font-size: 10px;
    color: var(--muted)
}

.line-progress {
    border-top: 1px solid var(--line);
    padding-top: 17px
}

.bars {
    display: flex;
    gap: 6px;
    margin-top: 11px
}

.bars i {
    height: 5px;
    flex: 1;
    border-radius: 5px;
    background: #e7e7df
}

.bars i.filled {
    background: var(--accent)
}

.hint-button {
    width: 100%;
    height: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: white;
    box-shadow: 0 5px 12px #28675322
}

.hint-button>span:first-child {
    font-size: 22px
}

.hint-button b {
    font-size: 13px
}

.hint-count {
    border-radius: 20px;
    background: #ffffff26;
    padding: 3px 8px;
    font-size: 11px
}

.secondary-actions {
    display: flex;
    gap: 9px
}

.secondary-button {
    height: 42px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 700;
    font-size: 12px
}

.saved-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #77877c
}

.save-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6f9b7a;
    flex: none
}

.small-note {
    font-size: 10px;
    color: #9aa198;
    line-height: 1.5;
    margin: 0
}

.board-status {
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 11px;
    padding: 0 3px;
    color: #718077;
    font-size: 11px
}

.board-status>span:first-child {
    display: flex;
    align-items: center;
    gap: 8px
}

.board-status i {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    background: #80a780
}

.timer-label {
    display: flex;
    gap: 6px;
    align-items: center
}

.timer-label b {
    font-weight: 700
}

.game-card {
    position: relative;
    min-height: 570px;
    padding: 24px 26px 20px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 15px;
    overflow: hidden
}

.timer-strip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px
}

.timer-icon {
    height: 39px;
    width: 39px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #e9eee2;
    color: var(--green);
    font-size: 22px
}

.timer-line {
    flex: 1;
    height: 3px;
    background: #e6e7dc;
    border-radius: 4px;
    position: relative
}

.timer-line i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 4px;
    transition: width .2s
}

.timer-line span {
    position: absolute;
    right: -3px;
    top: -12px;
    font-size: 18px;
    color: #b3b8ac
}

.timer-strip>strong {
    font-size: 12px;
    font-variant-numeric: tabular-nums
}

.timer-strip>button {
    border: 0;
    background: none;
    font-size: 20px;
    color: #64766b;
    padding: 4px
}

.expression-label {
    font-size: 9px;
    letter-spacing: 1.6px;
    color: #909b90;
    font-weight: 800;
    margin-top: 5px
}

.expression {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    width: 100%;
    border-radius: 17px;
    background: #f3f0e6;
    font: 500 26px Fredoka, sans-serif;
    padding: 10px
}

.expression .operator {
    font: 800 11px 'DM Sans', sans-serif;
    letter-spacing: 1px;
    color: #89948a;
    background: #e5e7dc;
    padding: 7px 10px;
    border-radius: 7px
}

.venn-wrap {
    position: relative;
    width: min(100%, 390px);
    aspect-ratio: 360/260;
    margin: 0 auto
}

.venn-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible
}

.venn-svg circle {
    stroke-width: 2.2;
    fill-opacity: .47
}

.circle-a {
    fill: #b8d2b0;
    stroke: #7ca27d
}

.circle-b {
    fill: #f0d9a7;
    stroke: #d0b46e
}

.set-label {
    position: absolute;
    top: 9%;
    font: 600 17px Fredoka, sans-serif;
    z-index: 2
}

.label-a {
    left: 28%
}

.label-b {
    right: 28%
}

.venn-region {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 1px solid #ffffffb8;
    border-radius: 11px;
    background: #fffdf0c7;
    color: #445c4b;
    padding: 4px 7px;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 2px 7px #263c3510;
    transition: transform .15s, background .15s, border-color .15s
}

.venn-region:hover {
    transform: scale(1.06);
    background: #fff;
    box-shadow: 0 4px 12px #263c3520
}

.venn-region.chosen {
    border: 2px solid var(--accent);
    background: #dcebd8;
    box-shadow: 0 0 0 3px #28675320
}

.venn-region.hinted {
    border: 2px dashed var(--gold);
    background: #fff0c8;
    animation: pulse 1.2s infinite
}

.venn-region.outside {
    left: 40%;
    bottom: 1%;
    width: 20%;
    height: 16%
}

.venn-region.only-a {
    left: 14%;
    top: 39%;
    width: 22%;
    height: 17%
}

.venn-region.only-b {
    right: 14%;
    top: 39%;
    width: 22%;
    height: 17%
}

.venn-region.overlap {
    left: 40%;
    top: 39%;
    width: 20%;
    height: 17%
}

.board-instruction {
    font-size: 11px;
    color: #8b968c;
    margin: 0;
    text-align: center
}

.feedback {
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
    color: #78867c;
    min-height: 18px
}

.feedback.success {
    color: var(--green);
    font-weight: 800
}

.feedback.error {
    color: #a36545
}

.hint-detail {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f5ebd2;
    border: 1px solid #e9d9b4;
    color: #806d3b;
    padding: 10px 12px;
    border-radius: 12px;
    width: 100%;
    font-size: 11px;
    line-height: 1.45
}

.hint-detail span {
    flex: 1
}

.hint-detail button {
    border: 0;
    background: none;
    font-size: 18px;
    color: inherit
}

.pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: #f5f1e8dc;
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 20px
}

.pause-card {
    width: min(290px, 100%);
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 22px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 14px 40px #283c3614
}

.pause-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--sage);
    color: var(--green);
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    font-size: 21px
}

.pause-card h2 {
    font: 500 25px Fredoka, sans-serif;
    margin: 0 0 8px
}

.pause-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 18px
}

.primary-button {
    border: 0;
    background: var(--green);
    color: white;
    border-radius: 12px;
    min-height: 43px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800
}

.guide-column {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.guide-card {
    padding: 20px 17px;
    display: flex;
    flex-direction: column;
    gap: 20px
}

.guide-card h2 {
    font: 500 21px Fredoka, sans-serif;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap
}

.guide-symbol {
    color: var(--green);
    font-size: 22px
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 11px
}

.guide-step>span {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--sage);
    color: var(--green);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 900;
    flex: none
}

.guide-step b {
    font-size: 12px
}

.guide-step p {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.55;
    margin: 5px 0 0
}

.reward-card {
    border: 1px solid #e6d9b7;
    background: #f4e9cd;
    border-radius: 21px;
    padding: 17px;
    text-align: left;
    color: var(--ink);
    width: 100%
}

.reward-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #8c753e;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .3px
}

.reward-body {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px
}

.reward-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--card);
    display: grid;
    place-items: center;
    transform: rotate(-5deg);
    flex: none
}

.reward-body>div:nth-child(2) {
    flex: 1;
    min-width: 0
}

.reward-body h3 {
    font: 500 19px Fredoka, sans-serif;
    margin: 0 0 3px;
    white-space: nowrap
}

.reward-body p {
    font-size: 10px;
    color: #8c753e;
    margin: 0;
    line-height: 1.4
}

.daily-card {
    padding: 17px;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.daily-card h3 {
    font: 500 20px Fredoka, sans-serif;
    margin: 0
}

.daily-card p,
.daily-card small {
    font-size: 11px;
    line-height: 1.5;
    color: var(--muted)
}

.daily-card p {
    margin: 0
}

.daily-card .primary-button {
    width: 100%
}

.daily-card small {
    min-height: 15px
}

.footer {
    min-height: 78px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px clamp(20px, 4.5vw, 64px);
    gap: 20px
}

.tagline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px
}

.tagline>span:first-child {
    font-size: 20px;
    color: var(--green)
}

.audio-controls,
.footer-right {
    display: flex;
    align-items: center;
    gap: 14px
}

.audio-controls button,
.footer-right button {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    padding: 4px
}

.audio-controls button.enabled {
    color: var(--ink)
}

.audio-controls button.enabled b {
    color: var(--green)
}

.audio-controls>i {
    height: 16px;
    width: 1px;
    background: var(--line)
}

.footer-right {
    gap: 22px
}

.footer-right button {
    white-space: nowrap
}

.collection-page {
    padding: 12px 0 25px
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px
}

.page-heading h1 {
    font-size: 42px;
    margin: 7px 0
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px
}

.collect-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    display: grid;
    grid-template-columns: 68px 1fr auto;
    gap: 14px;
    align-items: center
}

.swatch {
    height: 66px;
    width: 66px;
    border-radius: 15px;
    background: var(--cream);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 9px;
    position: relative;
    overflow: hidden
}

.swatch i {
    border-radius: 5px
}

.collect-card h2 {
    font: 500 19px Fredoka, sans-serif;
    margin: 0 0 4px
}

.collect-card p {
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 6px
}

.collect-card small {
    font-size: 10px;
    color: #8c753e
}

.collect-card>button {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--green)
}

.collect-card>button.selected {
    background: var(--sage);
    border-color: var(--sage)
}

.collect-card.locked {
    opacity: .75
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #283c3666;
    backdrop-filter: blur(3px);
    display: grid;
    place-items: center;
    padding: 20px
}

.modal {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 29px;
    width: min(470px, 100%);
    box-shadow: 0 18px 60px #283c3625
}

.modal h2 {
    font: 500 29px Fredoka, sans-serif;
    margin: 8px 0 10px
}

.modal p,
.modal li {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    border: 0;
    background: var(--cream);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 22px
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 22px
}

.modal-actions>* {
    min-width: 110px
}

.how-list {
    padding-left: 20px
}

.how-list li {
    padding-left: 4px;
    margin: 13px 0
}

.how-list b {
    font-size: 13px;
    color: var(--ink)
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line)
}

.setting-row b {
    font-size: 13px
}

.setting-row p {
    font-size: 11px;
    margin: 4px 0 0
}

.toggle {
    border: 1px solid var(--line);
    background: white;
    border-radius: 20px;
    padding: 7px 13px;
    min-width: 55px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800
}

.toggle.on {
    background: var(--sage);
    color: var(--green);
    border-color: var(--sage)
}

.range-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    font-size: 12px;
    color: var(--muted)
}

.range-row input {
    width: 48%;
    accent-color: var(--green)
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    background: #263c35;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 12px;
    box-shadow: var(--shadow);
    transition: all .25s;
    z-index: 50
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0)
}

@keyframes pulse {
    50% {
        filter: brightness(1.12)
    }
}

@media(max-width:1120px) {
    .workspace {
        grid-template-columns: 215px minmax(330px, 1fr);
        gap: 22px
    }

    .guide-column {
        grid-column: 1/-1;
        display: grid;
        grid-template-columns: 1fr 1fr
    }

    .guide-card {
        grid-row: span 2
    }

    .main {
        width: min(900px, calc(100% - 40px))
    }

    .game-card {
        min-height: 600px
    }

    .nav-tabs {
        gap: 22px
    }
}

@media(max-width:700px) {
    .topbar {
        height: auto;
        min-height: 76px;
        flex-wrap: wrap;
        padding: 14px 18px;
        gap: 12px
    }

    .brand {
        font-size: 27px;
        gap: 9px
    }

    .brand .mosaic-mark {
        width: 29px;
        height: 29px
    }

    .player {
        margin-left: auto;
        gap: 10px
    }

    .streak b {
        font-size: 11px
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        height: 34px;
        justify-content: center;
        gap: clamp(20px, 7vw, 38px)
    }

    .nav-tab {
        font-size: 12px
    }

    .main {
        width: calc(100% - 26px);
        padding: 23px 0 28px
    }

    .level-heading {
        margin-bottom: 18px;
        align-items: flex-start;
        gap: 10px
    }

    .level-heading h1 {
        font-size: 30px
    }

    .heading-note {
        font-size: 10px;
        text-align: right;
        max-width: 115px;
        padding-top: 8px
    }

    .heading-actions {
        gap: 9px
    }

    .icon-button {
        width: 38px;
        height: 38px;
        flex: none
    }

    .workspace {
        display: flex;
        flex-direction: column;
        gap: 16px
    }

    .play-column {
        width: 100%;
        order: 0
    }

    .board-status {
        margin-bottom: 9px
    }

    .game-card {
        width: 100%;
        min-height: 535px;
        padding: 19px 15px 17px;
        border-radius: 20px;
        gap: 13px
    }

    .timer-strip {
        gap: 8px
    }

    .timer-icon {
        width: 35px;
        height: 35px
    }

    .expression {
        min-height: 65px;
        font-size: 24px;
        gap: 9px
    }

    .expression .operator {
        font-size: 9px;
        padding: 6px 8px
    }

    .venn-wrap {
        max-width: 355px;
        width: 100%;
        margin-top: 5px
    }

    .venn-region {
        font-size: 9px;
        padding: 3px 4px
    }

    .dashboard {
        order: 1;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }

    .score-card {
        grid-column: 1/-1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 17px;
        border-radius: 20px
    }

    .score-block>strong {
        font-size: 39px
    }

    .line-progress {
        grid-column: 1/-1;
        padding-top: 14px
    }

    .hint-button {
        height: 45px;
        gap: 7px;
        padding: 0 7px
    }

    .hint-button b {
        font-size: 11px
    }

    .secondary-actions {
        gap: 7px
    }

    .secondary-button {
        padding: 0 7px;
        font-size: 11px;
        gap: 5px;
        min-width: 0
    }

    .saved-note,
    .small-note {
        grid-column: 1/-1
    }

    .guide-column {
        order: 2;
        width: 100%;
        display: flex;
        gap: 12px
    }

    .guide-card {
        padding: 19px;
        border-radius: 20px;
        gap: 17px
    }

    .guide-card h2 {
        font-size: 21px
    }

    .guide-step p {
        font-size: 12px
    }

    .reward-card {
        width: 100%;
        border-radius: 20px
    }

    .footer {
        padding: 16px 18px;
        flex-wrap: wrap;
        gap: 14px
    }

    .tagline {
        font-size: 11px
    }

    .audio-controls {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 10px;
        border-top: 1px solid var(--line)
    }

    .footer-right {
        gap: 12px
    }

    .collection-page {
        padding-top: 8px
    }

    .page-heading h1 {
        font-size: 36px
    }

    .collection-grid {
        grid-template-columns: 1fr
    }

    .collect-card {
        grid-template-columns: 56px 1fr auto;
        padding: 12px;
        gap: 10px
    }

    .swatch {
        width: 54px;
        height: 54px;
        padding: 7px
    }

    .collect-card h2 {
        font-size: 17px
    }

    .collect-card>button {
        padding: 7px
    }

    .modal {
        padding: 25px 20px
    }

    .modal-actions {
        flex-wrap: wrap
    }

    .modal-actions>* {
        flex: 1
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important
    }
}

/* =========================
   MOSAIC INTRO LOADER
========================= */


#mosaic-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f1e8;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#mosaic-loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#mosaic-loader .loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

#mosaic-loader .loader-mark {
  display: grid;
  grid-template-columns: repeat(2, 22px);
  gap: 5px;
  margin-bottom: 22px;
  animation: mosaic-pulse 1.2s ease-in-out infinite alternate;
}

#mosaic-loader .loader-mark i {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #286753;
}

#mosaic-loader .loader-mark i:nth-child(2) {
  opacity: 0.7;
}

#mosaic-loader .loader-mark i:nth-child(3) {
  opacity: 0.5;
}

#mosaic-loader .loader-mark i:nth-child(4) {
  opacity: 0.85;
}

#mosaic-loader h1 {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  color: #263b32;
}

#mosaic-loader h1 span {
  color: #286753;
}

#mosaic-loader .loader-caption {
  margin: 10px 0 26px;
  color: #77766f;
  font-size: 14px;
}

#mosaic-loader .loader-progress {
  width: 180px;
  height: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: #dedbd1;
}

#mosaic-loader .loader-progress-fill {
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: #286753;
  animation: mosaic-loading 1.4s ease-in-out infinite;
}

#mosaic-loader .loader-status {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 2px;
  color: #77766f;
}

@keyframes mosaic-loading {
  from { transform: translateX(-110%); }
  to { transform: translateX(350%); }
}

@keyframes mosaic-pulse {
  from { transform: scale(0.92); }
  to { transform: scale(1.05); }
}

/* Bilingual support */
.language-switch {
  border: 1px solid var(--line, #d8ded5);
  background: var(--card, #fffdf8);
  color: var(--ink, #263c35);
  border-radius: 999px;
  padding: .5rem .85rem;
  font: inherit;
  font-size: .80rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
html[dir="rtl"] body { text-align: start; }
html[dir="rtl"] .topbar,
html[dir="rtl"] .player,
html[dir="rtl"] .nav-tabs,
html[dir="rtl"] .footer,
html[dir="rtl"] .audio-controls,
html[dir="rtl"] .footer-right { direction: rtl; }
html[dir="rtl"] .venn-wrap,
html[dir="rtl"] .venn-svg,
html[dir="rtl"] .expression,
html[dir="rtl"] .timer-line,
html[dir="rtl"] .bars { direction: ltr; }
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] p,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .feedback,
html[dir="rtl"] .modal { font-family: Tahoma, "Segoe UI", sans-serif; }
html[dir="rtl"] p,
html[dir="rtl"] .feedback,
html[dir="rtl"] .modal { line-height: 1.8; }
@media (max-width: 640px) {
  .language-switch { padding: .40rem .6rem; font-size: .78rem; }
}
