/* Culturoo's editorial typography and character motion. */
:root {
    /* Keep the original Culturoo colour tokens from site.css. */
    --roo-highlight: var(--premium-amber);
    --roo-warm-soft: #f8f3eb;
    --roo-green-soft: #edf2ec;
    --roo-coral: var(--premium-coral);
    --roo-sky-soft: #eef1f1;
    --roo-ink: var(--premium-ink);
    --roo-auth-background: linear-gradient(135deg, var(--premium-green-dark), var(--premium-navy-2));
    --premium-radius: 8px;
    --premium-shadow-soft: 0 4px 16px rgba(26, 20, 13, 0.035);
    --premium-shadow: 0 12px 30px rgba(26, 20, 13, 0.065);
    --roo-heading: var(--font-display);
    --font-weight-bold: 650;
    --sidebar-width: 220px;
}

body { background: var(--premium-canvas); }
h1, h2, h3, h4 { text-wrap: balance; }
:is(.home-dashboard__title, .page-banner__title, .shop-command__title, .leaderboard-hero__title,
    .home-path-panel__title, .home-section-heading h2,
    .premium-game-start__title, .ws-start__title, .tq-start__title, .ws-summary__title,
    .tq-summary__title, .meet-setup-modal__title,
    .games-section-title, .game-card__title, .ranking-panel--games .ranking-card__name,
    .shop-section__title, .shop-card__name, .leaderboard-section-header h2, .lb-podium__name, .practice-game__top h2, .practice-prompt strong,
    .game-page__language-title, .game-page__drawer-title, .premium-game-loading__title) {
    font-family: var(--roo-heading);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.12;
}
:is(a, button, input, select, summary):focus-visible {
    outline: 3px solid var(--premium-green);
    outline-offset: 4px;
}
.roo-eyebrow { display: block; margin-bottom: 10px; color: var(--premium-green); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.13em; line-height: 1.6; }
.roo-wordmark { display: inline-flex; align-items: baseline; color: var(--premium-ink); font-family: var(--font-family); font-size: 2.1rem; font-weight: 750; letter-spacing: -0.065em; line-height: 1; }
.roo-wordmark span { color: var(--premium-green); }
.roo-wordmark b { margin-left: 4px; color: var(--roo-highlight); font-size: 1.25rem; align-self: flex-start; }

/* Shell */
.main-scroll { background: var(--premium-canvas); }
.content-layout { gap: 20px; grid-template-columns: minmax(0, 1fr) 286px; padding-top: 20px; }
.card-panel, .ranking-panel, .ranking-card { border-radius: 14px; }
.card-panel { padding: 16px; }
.card-panel__title { font-family: var(--roo-heading); }

/* The mascot: a quiet idle sway, a greeting hop, and a celebratory pose. */
@keyframes roo-idle { 0%, 100% { transform: rotate(-1.5deg) translateY(0); } 50% { transform: rotate(1.5deg) translateY(-7px); } }
@keyframes roo-hop { 0%, 100% { transform: translateY(0) scale(1); } 18% { transform: translateY(3px) scale(1.04,.96); } 48% { transform: translateY(-20px) rotate(-4deg) scale(.98,1.03); } 74% { transform: translateY(0) scale(1.03,.97); } }

/* Home */
.home-dashboard { position: relative; grid-template-columns: minmax(0, 1fr) 160px; align-items: center; min-height: 210px; border: 1px solid var(--premium-line); border-radius: 14px; background: var(--premium-paper); box-shadow: none; }
.home-dashboard__copy { padding: 20px 24px; position: relative; z-index: 2; }
.home-dashboard__title { margin: 0; font-size: clamp(1.9rem, 2.5vw, 2.5rem); line-height: 1.06; letter-spacing: -.05em; }
.home-dashboard__title > span { color: var(--premium-green-dark); }
.home-dashboard__desc { color: var(--color-text-muted); max-width: 390px; font-size: .85rem; line-height: 1.55; margin: 12px 0 0; }
.home-dashboard__actions { gap: 10px; margin-top: 18px; }
.home-dashboard__primary, .auth-submit, .premium-game-start__btn { background: linear-gradient(180deg, #119171, var(--premium-green)); border: 1.5px solid var(--premium-green); color: var(--premium-paper); border-radius: 14px; box-shadow: 0 4px 0 rgba(8,120,95,.2); }
.home-dashboard__primary:hover, .auth-submit:hover, .premium-game-start__btn:hover { background: var(--premium-green-dark); color: var(--premium-paper); transform: translateY(-2px); }
.home-dashboard__primary, .home-dashboard__secondary { width: auto; padding: 0 14px; min-height: 42px; border-radius: 10px; box-shadow: none; font-size: .78rem; }
.home-dashboard__secondary { background: transparent; border: 1px solid var(--premium-line-strong); color: var(--roo-ink); }
.home-dashboard__secondary:hover { background: rgba(255,255,255,.6); color: var(--roo-ink); border-color: var(--roo-ink); }
.home-metrics { gap: 12px; margin: 22px 0 26px; }
.home-metric { border-radius: 14px; padding: 12px; box-shadow: 0 1px 0 rgba(24,43,50,.035); }
.home-metric .home-metric__icon { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--roo-warm-soft); color: var(--premium-amber); font-size: 1rem; transform: rotate(-5deg); }
.home-metric:nth-child(2) .home-metric__icon { background: var(--roo-green-soft); color: var(--premium-green); transform: rotate(5deg); }
.home-metric:nth-child(3) .home-metric__icon { background: var(--roo-sky-soft); color: var(--premium-sky); }
.home-metric strong { font-size: 1.35rem; font-weight: 900; }
.home-metric span { font-size: .72rem; }
.home-workbench { gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.home-path-panel { border: 1.5px solid var(--premium-line); border-radius: 16px; background: var(--roo-green-soft); padding: 18px; min-height: 245px; }
.home-path-panel__title { font-size: 1.5rem; margin-top: 16px; }
.home-path-panel__desc { font-size: .82rem; color: var(--color-text-muted); }
.home-path-panel__icon { background: var(--premium-paper); border: 0; border-radius: 12px; }
.home-path-panel__status { background: rgba(255,255,255,.6); border-radius: 999px; font-size: .57rem; letter-spacing: .02em; }
.home-path-panel__progress { height: 9px; border-radius: 99px; background: rgba(20,107,83,.14); }
.home-path-panel__progress span { background: var(--premium-green); }
.home-path-panel__cta { font-size: .77rem; }
.home-practice-panel { padding: 6px 0 0; border: 0; background: transparent; box-shadow: none; }
.home-section-heading h2 { font-size: 1.2rem; }
.home-section-heading p { font-size: .77rem; }
.home-practice-row { padding: 10px 12px; border: 1px solid var(--premium-line); border-radius: 11px; margin-top: 7px; background: var(--premium-paper); }
.home-practice-row:hover { transform: translateX(3px); background: var(--premium-paper); border-color: var(--premium-green); }
.home-practice-row__icon { width: 34px; height: 34px; border: 0; background: var(--roo-sky-soft); color: var(--premium-sky); border-radius: 9px; }
.home-practice-row:nth-child(2) .home-practice-row__icon { background: var(--roo-warm-soft); color: var(--premium-amber); }
.home-practice-row:nth-child(3) .home-practice-row__icon { background: #f5e5de; color: var(--premium-coral); }
.home-practice-row strong { font-size: .85rem; }
.home-practice-row span:not(.home-practice-row__icon, .fas) { font-size: .68rem; }

/* Character-led banners and game cards */
.page-banner { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; min-height: 220px; border: 1.5px solid var(--premium-line); border-radius: 25px; padding: 28px; background: var(--roo-green-soft); }
.page-banner__text { max-width: 68%; }
.page-banner__title { font-size: clamp(2rem, 3vw, 3.2rem); }
.page-banner__desc { margin-bottom: 0; font-size: .88rem; max-width: 430px; }
.page-banner--games { background: var(--roo-sky-soft); border-color: var(--premium-line); }
.page-banner--games .roo-eyebrow { color: var(--premium-sky); }
.page-banner--meet { background: #f7eee7; border-color: #e1d3c5; }
.game-card { position: relative; border-radius: 22px; background: var(--premium-paper); box-shadow: var(--premium-shadow-soft); }
.game-card--featured { min-height: 270px; padding: 24px; background: var(--roo-warm-soft); border: 1.5px solid var(--premium-line); }
.game-card--featured:nth-child(2) { background: var(--roo-green-soft); border-color: var(--premium-line); }
.game-card--featured .game-card__title, .game-card--featured .game-card__desc { max-width: 65%; position: relative; z-index: 1; }
.game-card--featured .game-card__title { font-family: var(--roo-heading); font-size: 1.7rem; line-height: 1.05; letter-spacing: -.04em; }
.game-card--featured .game-card__desc { font-size: .78rem; min-height: 65px; }
.game-card__character { position: absolute; right: -3px; bottom: 14px; width: 39%; height: 175px; object-fit: contain; transform: rotate(5deg); transition: transform .25s; }
.game-card--featured:hover .game-card__character { transform: translateY(-8px) rotate(-3deg); }
.game-card__badge { border-radius: 999px; }
.game-card__icon { background: var(--roo-sky-soft); color: var(--premium-sky); border: 0; border-radius: 13px; transform: rotate(-5deg); }
.game-card__action { font-weight: 900; }
.game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.game-card--locked { border-style: dashed; border-radius: 22px; }
.games-signal-strip { border-radius: 18px; background: var(--premium-paper); }
.learn-lang-card { border-radius: 20px; background: var(--premium-paper); border: 1.5px solid var(--premium-line); box-shadow: 0 4px 0 #e5ded2; }
.learn-lang-card:hover { background: var(--roo-green-soft); border-color: var(--premium-green); transform: translateY(-4px) rotate(-1deg); }
.learn-lang-card__name { font-weight: 800; }
.meet-start-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px; margin-top: 22px; border-radius: 24px; border: 1.5px solid var(--premium-line); background: var(--premium-paper); }
.meet-start-card__welcome h2 { font-family: var(--roo-heading); font-size: 2rem; font-weight: 900; letter-spacing: -.04em; }
.meet-start-card__welcome p { color: var(--color-text-muted); font-size: .9rem; }
.meet-start-btn { border-radius: 15px; }
.shop-command, .leaderboard-hero { border-radius: 25px; background: var(--roo-warm-soft); }
.shop-command__title, .leaderboard-hero__title { font-size: clamp(2.3rem, 3.7vw, 4rem); }
.shop-wallet, .shop-section, .leaderboard-table-shell, .leaderboard-podium-shell, .shop-card, .lb-podium__card { border-radius: 20px; }
.shop-command__link, .leaderboard-tab { border-radius: 13px; }

/* Sign in and registration */
.auth-body { overflow-y: auto; background: var(--premium-canvas); background-image: radial-gradient(var(--premium-line) 1px, transparent 1px); background-size: 22px 22px; }
.auth-label { color: var(--roo-ink); font-size: .75rem; letter-spacing: 0; text-transform: none; font-weight: 800; margin-bottom: 8px; }
.auth-input { min-height: 50px; border: 1.5px solid var(--premium-line); border-radius: 13px; background: var(--roo-warm-soft); font-size: .9rem; }
.auth-input:focus { border-color: var(--premium-green); background: var(--premium-paper); box-shadow: 0 0 0 3px #dcece3; }
.auth-submit { min-height: 50px; margin-top: 7px; font-size: .9rem; }
.auth-check { font-size: .8rem; }

/* Game rooms */
.game-page { background: var(--premium-canvas); }
.game-page__header { border-bottom: 1px solid var(--premium-line); background: var(--premium-paper); }
.game-page__title { font-family: var(--font-display); font-weight: 400; }
.game-page__actions { gap: 12px; }
.game-page__drawer:not(.game-page__drawer--open), .game-page__language-drawer:not(.game-page__language-drawer--open) { box-shadow: none; visibility: hidden; }
.premium-game-start { border-radius: 28px; border: 1.5px solid var(--premium-line); min-height: 510px; }
.premium-game-start__media { position: relative; min-height: 450px; background: var(--roo-warm-soft); }
.premium-game-start__media::before { content: ""; position: absolute; width: 82%; aspect-ratio: 1; left: 9%; top: 14%; border-radius: 50%; background: #dcece3; }
.premium-game-start__media::after { content: ""; position: absolute; inset: 30px; background: url('/images/characters/roo-ink-wave.png') center / contain no-repeat; animation: roo-idle 5s ease-in-out infinite; }
.premium-game-shell--quiz .premium-game-start__media { background: var(--roo-sky-soft); }
.premium-game-shell--quiz .premium-game-start__media::before { background: #d6e3e7; }
.premium-game-start__content, .ws-start__card.premium-game-start__content, .tq-start__card.premium-game-start__content { background: var(--premium-paper); }
.premium-game-start__title { font-size: clamp(2.5rem, 4vw, 4.25rem); }
.premium-game-start__btn { border-radius: 14px; }
.premium-game-round, .premium-game-summary, .tq-choice, .ws-round__input, .ws-round__letter { border-radius: 18px; }
.roo-game-reaction { position: fixed; right: 24px; bottom: 24px; z-index: 950; display: flex; align-items: center; gap: 12px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 22px 12px 12px; border: 1.5px solid var(--premium-line); border-radius: 20px; background: var(--roo-green-soft); box-shadow: 0 5px 0 #182b3214; color: var(--roo-ink); font-weight: 800; font-size: .85rem; pointer-events: none; }
.roo-game-reaction[hidden] { display: none; }
.roo-game-reaction img { height: 90px; width: 70px; object-fit: contain; animation: roo-hop .8s ease-in-out 2; }
.roo-game-reaction[data-mood="encourage"] { background: var(--roo-green-soft); border-color: var(--premium-line); }

@media (min-width: 769px) and (max-width: 1280px) {
    .content-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
    .premium-game-start { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 768px) {
    :root { --mobile-nav-icon-active: var(--premium-green); }
    .content-layout { padding: 16px; gap: 18px; grid-template-columns: minmax(0, 1fr); }
    .home-dashboard { grid-template-columns: minmax(0, 1fr) 140px; min-height: 200px; border-radius: 16px; }
    .home-dashboard__copy { padding: 20px; }
    .home-dashboard__copy { order: 0; }
    .home-dashboard__title { font-size: clamp(2rem, 5vw, 2.5rem); }
    .home-dashboard__desc { font-size: .83rem; }
    .home-dashboard__actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
    .home-dashboard__primary, .home-dashboard__secondary { font-size: .73rem; min-height: 42px; padding: 0 12px; }
    .home-metric { padding: 12px; gap: 10px; }
    .home-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-metric .home-metric__icon { height: 34px; width: 34px; font-size: .9rem; }
    .home-metric strong { font-size: 1.1rem; }
    .home-metric span { font-size: .64rem; }
    .home-workbench { grid-template-columns: 1fr; }
    .home-practice-panel { padding-top: 12px; }
    .home-practice-row { padding: 10px 12px; }
    .page-banner { min-height: 215px; padding: 24px; border-radius: 23px; }
    .page-banner__title { font-size: 2.35rem; }
    .page-banner__text { max-width: 69%; }
    .page-banner__text { margin: 0; }
    .page-banner__desc { font-size: .8rem; }
    .page-banner .roo-eyebrow { font-size: .52rem; }
    .learn-lang-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .learn-lang-card { min-height: 105px; padding: 16px 10px; }
    .game-card--featured { padding: 20px; }
    .game-card--featured .game-card__title { font-size: 1.45rem; }
    .game-card__character { height: 145px; }
    .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .meet-start-card { padding: 25px; }
    .shell-page--meet .meet-start-card { order: 2; }
    .meet-start-card__welcome h2 { font-size: 1.8rem; }
    .game-page__actions { gap: 7px; }
    .game-page__title { font-size: 1.05rem; }
    .game-page__lang-label { display: none; }
    .premium-game-start { grid-template-columns: 1fr; }
    .premium-game-start__media { min-height: 255px; }
    .premium-game-start__media::before { width: 210px; height: 210px; left: calc(50% - 105px); top: 22px; }
    .premium-game-start__media::after { inset: 15px; }
    body.game-culture-shell .game-page[data-game-state="start"] .premium-game-start { grid-template-rows: minmax(110px, .85fr) minmax(0, 1.4fr); }
    body.game-culture-shell .game-page[data-game-state="start"] .premium-game-start__media { display: block; min-height: 0; }
    body.game-culture-shell .game-page[data-game-state="start"] .premium-game-start__media::before { width: auto; height: 80%; top: 10%; left: 50%; transform: translateX(-50%); }
    body.game-culture-shell .game-page[data-game-state="start"] .premium-game-start__content,
    body.game-culture-shell .game-page[data-game-state="start"] .ws-start__card.premium-game-start__content,
    body.game-culture-shell .game-page[data-game-state="start"] .tq-start__card.premium-game-start__content { justify-content: center; padding: 24px; overflow-y: auto; }
    .roo-game-reaction { bottom: 20px; right: 16px; }
    .app-layout ~ .roo-game-reaction { bottom: 112px; }
    .auth-body { height: auto; min-height: 100dvh; overflow-y: auto; }
}
@media (max-width: 480px) {
    .home-dashboard { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .home-dashboard__copy { padding: 18px; }
    .home-dashboard__title { padding-right: 44px; font-size: clamp(1.7rem, 7vw, 2.1rem); }
    .home-dashboard__desc { font-size: .81rem; max-width: 280px; }
    .home-metrics { gap: 7px; }
    .home-metric { flex-direction: column; align-items: flex-start; padding: 12px; }
    .home-metric strong { margin-top: 4px; }
    .page-banner { padding: 23px 18px; min-height: 225px; }
    .page-banner__title { font-size: 2rem; }
    .page-banner__text { max-width: 70%; }
    .page-banner__desc { font-size: .75rem; }
    .learn-lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .games-featured-grid { grid-template-columns: 1fr; }
    .game-card--featured { min-height: 240px; }
    .game-card--featured .game-card__title { font-size: 1.8rem; }
    .game-card__character { height: 170px; width: 35%; }
    .game-grid { gap: 10px; }
    .game-grid .game-card { padding: 18px 14px; }
    .game-grid .game-card__title { font-size: 1rem; }
    .game-grid .game-card__desc { font-size: .74rem; }
    .game-grid .game-card__badge { font-size: .5rem; }
}

/* The system preference always wins. The explicit control also persists across pages. */
html[data-roo-motion="paused"] :is( .roo-game-reaction img, .premium-game-start__media::after) { animation: none !important; transition: none !important; }
html[data-roo-motion="paused"] :is(.game-card__character) { transition: none; transform: none; }
@media (prefers-reduced-motion: reduce) {
     .roo-game-reaction img, .premium-game-start__media::after { animation: none !important; transition: none !important; }
    .game-card__character { transition: none; transform: none !important; }
    .home-dashboard__primary:hover, .auth-submit:hover, .premium-game-start__btn:hover,
    .home-practice-row:hover, .learn-lang-card:hover { transform: none; }
}
