@import url('./open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

:root {
    --btn-width: 220px;
    --btn-height: 70px;
    --btn-shadow: 0 8px 22px rgba(0,0,0,0.18);
    --btn-focus: 3px solid rgba(226,158,82,0.28);
    --wood-top: #efb36a;
    --wood-bottom: #d6833e;
    --wood-border: #8a4d26;
    --wood-text: #4b1c0d;
}

/* =========================================
   Global & Typography
   ========================================= */
html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Fredoka', 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
    direction: rtl;
    text-align: right;
    background: #eaf6ff;
    color: #244761;
}

*, *::before, *::after {
    box-sizing: border-box;
}

a, .btn-link {
    color: inherit;
}

button {
    font: inherit;
}

#app {
    min-height: 100dvh;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   Shared Buttons & Inputs
   ========================================= */
.village-action-button,
.auth-main-button,
.play-entry-button,
.character-next-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    border: 2px solid var(--wood-border);
    color: var(--wood-text);
    background: linear-gradient(180deg, var(--wood-top) 0%, var(--wood-bottom) 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.36), inset 0 -3px 0 rgba(91, 45, 20, 0.18), 0 5px 0 rgba(96, 55, 27, 0.34), 0 10px 20px rgba(46, 72, 94, 0.18);
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease;
    overflow: hidden;
    min-height: unset;
}

.village-action-button:hover,
.auth-main-button:hover,
.play-entry-button:hover,
.character-next-button:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.36), inset 0 -3px 0 rgba(91, 45, 20, 0.18), 0 8px 0 rgba(96, 55, 27, 0.34), 0 14px 24px rgba(46, 72, 94, 0.22);
}

.village-action-button:active,
.auth-main-button:active,
.play-entry-button:active,
.character-next-button:active {
    transform: translateY(-1px) scale(.997);
}

.village-action-button:focus,
.auth-main-button:focus,
.play-entry-button:focus,
.character-next-button:focus {
    outline: none;
    box-shadow: var(--btn-shadow), var(--btn-focus);
}

.auth-main-button:disabled,
.character-next-button:disabled {
    opacity: 0.72;
    cursor: default;
    transform: none;
}

.auth-input,
.parent-pin-input,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
    min-height: 56px;
    border: 2px solid #c7a87c;
    border-radius: 16px;
    background-color: #fff;
    background-image: none;
    box-shadow: inset 0 2px 5px rgba(119, 85, 44, 0.08);
    padding: 0 18px 4px 18px;
    color: #5b2a0d;
    font-weight: 800;
    font-family: 'Fredoka', sans-serif;
    font-size: 18px;
    text-align: right;
    width: 100%;
    box-sizing: border-box;
}

textarea {
    min-height: 110px;
    padding-block: 24px;
    resize: vertical;
}

.auth-input:focus,
.parent-pin-input:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus {
    outline: none;
}

/* Parent/Wood Theme Overrides for shared items */
.parent-link-button,
.parent-wood-button,
.parent-wood-select select,
.parent-login-submit,
.top-nav-btn,
.auth-guest-button {
    border: 2px solid var(--wood-border);
    color: var(--wood-text);
    background: linear-gradient(180deg, var(--wood-top) 0%, var(--wood-bottom) 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.36), inset 0 -3px 0 rgba(91, 45, 20, 0.18), 0 5px 0 rgba(96, 55, 27, 0.34), 0 10px 20px rgba(46, 72, 94, 0.18);
    font-weight: 800;
    min-height: unset;
}

.parent-link-button {
    min-width: 172px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 0 20px;
    text-decoration: none;
    cursor: pointer;
}

/* =========================================
   Opening Screen
   ========================================= */
.opening-screen-wrapper {
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opening-screen,
.opening-scene,
.opening-screen-wrapper {
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    max-width: 100%;
}

.opening-scene {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    background: #bfe7ff;
    aspect-ratio: auto;
}

.opening-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opening-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: clamp(4px, 2.4dvh, 24px);
    gap: clamp(6px, 1.5dvh, 14px);
}

.opening-logo {
    width: clamp(280px, 42vw, 540px);
    max-width: min(70vw, 540px);
    max-height: 36dvh;
    object-fit: contain;
    height: auto !important;
    animation: logoFadeIn 1s ease-out 1.8s both;
}

@keyframes logoFadeIn {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.opening-overlay .play-entry-button {
    width: clamp(210px, 28vw, 370px);
    aspect-ratio: 836 / 299;
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent url('../images/opening-play-button.png') center / contain no-repeat;
    box-shadow: none;
    overflow: visible;
    animation: buttonPushUp 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2.2s both;
}

@keyframes buttonPushUp {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.play-entry-button__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    pointer-events: none;
}

.opening-overlay .play-entry-button::before,
.opening-overlay .play-entry-button__text,
.opening-overlay .play-entry-button__icon,
.opening-mascot {
    display: none;
}

.opening-overlay .play-entry-button:hover {
    transform: scale(1.03) translateY(-2px);
    box-shadow: none;
}

/* =========================================
   Pin Explanation Box
   ========================================= */

.pin-explanation-box {
    display: flex;
    align-items: center;
    background-color: #FDF1DD;
    border: 1px solid #F3CBA2;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    direction: rtl;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.pin-icon-circle {
    background-color: #F8D3A5;
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5B2A0D;
    font-size: 20px;
}

.pin-icon-circle .oi {
    position: relative;
    top: -2px; /* Lift the icon to center it visually */
}

.pin-explanation-text {
    text-align: right;
    color: #5B2A0D;
}

.pin-explanation-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 800;
}

.pin-explanation-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    font-family: 'Fredoka', sans-serif;
}

/* =========================================
   Intro Clouds Animation ("קריעת ים סוף")
   ========================================= */
.intro-clouds-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    animation: fadeOutContainer 0.8s ease-in-out 3s forwards;
}

@keyframes fadeOutContainer {
    to { opacity: 0; visibility: hidden; }
}

.intro-cloud {
    position: absolute;
    object-fit: contain;
    opacity: 1;
}

.cloud-left { animation: driftLeft 3.5s ease-in-out forwards; }
.cloud-right { animation: driftRight 3.5s ease-in-out forwards; }

@keyframes driftLeft {
    0% { transform: translateX(0) scale(1.1); opacity: 1; }
    80% { opacity: 0.9; }
    100% { transform: translateX(-120vw) scale(1.3); opacity: 0; }
}

@keyframes driftRight {
    0% { transform: translateX(0) scale(1.1); opacity: 1; }
    80% { opacity: 0.9; }
    100% { transform: translateX(120vw) scale(1.3); opacity: 0; }
}

/* Scatter the clouds */
.cluster-1 { top: -5%; left: -10%; width: 65%; animation-duration: 3.2s; }
.single-1 { top: 15%; right: -5%; width: 45%; animation-duration: 3.8s; }
.cluster-2 { top: 40%; right: -15%; width: 75%; animation-duration: 3.5s; }
.single-2 { top: 55%; left: 5%; width: 40%; animation-duration: 3.1s; }
.cluster-3 { bottom: -5%; left: -10%; width: 70%; animation-duration: 3.6s; }
.single-3 { bottom: 15%; right: 10%; width: 50%; animation-duration: 2.9s; }
.single-4 { top: 35%; left: 20%; width: 30%; animation-duration: 3.3s; }
.cluster-4 { bottom: -10%; right: -10%; width: 65%; animation-duration: 3.7s; }

.opening-volume-note {
    position: static;
    margin: 0;
    color: #000 !important;
    font-size: 20px !important;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: none !important;
    text-align: center;
    z-index: 3;
}

/* =========================================
   Login Cards Screen
   ========================================= */
.login-cards-screen {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 76px;
    padding-bottom: 24px;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.login-cards-shell {
    margin: auto;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 3vw, 40px);
    max-width: 1200px;
    z-index: 10;
}

.login-action-card {
    min-width: 0;
    min-height: clamp(260px, 32vw, 340px);
    border: 4px solid #c78435;
    border-radius: 18px;
    padding: clamp(18px, 2.2vw, 28px) clamp(16px, 2vw, 24px) clamp(16px, 2vw, 22px);
    display: grid;
    grid-template-rows: auto minmax(140px, 1fr) auto;
    justify-items: center;
    align-items: center;
    background: rgba(255, 250, 239, 0.97);
    box-shadow: 0 14px 28px rgba(40, 78, 106, 0.2);
    color: #582706;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.login-action-card:hover,
.login-action-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 18px 34px rgba(40, 78, 106, 0.3);
}

.login-action-card:active {
    transform: translateY(-2px) scale(0.995);
}

.login-action-card:focus-visible {
    outline: 3px solid rgba(255, 202, 88, 0.95);
    outline-offset: 4px;
}

.login-action-title {
    font-size: clamp(34px, 4.2vw, 58px);
    font-weight: 900;
    line-height: 1;
    color: #5b2a0d;
    text-shadow: 0 2px 0 #f5d49b, 0 4px 6px rgba(91, 42, 13, 0.22);
}

.login-action-figure {
    display: block;
    width: auto;
    max-width: 88%;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 7px rgba(120, 71, 17, 0.16));
    pointer-events: none;
}

.login-action-figure--door {
    max-height: clamp(110px, 14vw, 170px);
}

.login-action-figure--signup,
.login-action-figure--guest {
    max-height: clamp(150px, 19vw, 226px);
    max-width: 94%;
}



.login-action-button {
    width: min(100%, 268px);
    min-height: clamp(50px, 5vw, 60px);
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 2px solid var(--wood-border);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--wood-top) 0%, var(--wood-bottom) 100%);
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.36), inset 0 -3px 0 rgba(91, 45, 20, 0.18), 0 5px 0 rgba(96, 55, 27, 0.34), 0 10px 20px rgba(46, 72, 94, 0.18);
    color: var(--wood-text);
    font-size: clamp(18px, 2.2vw, 25px);
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    padding: 0 20px;
}

.login-action-arrow {
    font-size: 1.35em;
    line-height: 0.85;
    transform: translateY(-1px);
}

.login-guest-figure {
    position: relative;
    display: grid;
    place-items: center;
}

.login-guest-figure img {
    width: auto;
    height: clamp(138px, 18vw, 206px);
    object-fit: contain;
}

.login-card-divider,
.login-guest-badge {
    display: none;
}

@media (min-width: 1024px) {
    .login-cards-shell {
        width: min(96vw, 1100px);
        gap: 32px;
        margin: auto;
    }
    
    .login-action-card {
        min-height: 480px;
        max-height: 600px;
        padding: 36px 28px;
        border-width: 4px;
        border-radius: 22px;
        grid-template-rows: auto 1fr auto;
    }
    
    .login-action-title {
        font-size: 28px;
    }
    
    .login-action-figure {
        margin: auto;
        display: block;
    }
    
    .login-action-figure--door {
        max-height: 100px;
    }
    
    .login-action-figure--signup,
    .login-action-figure--guest {
        max-height: 86px;
    }
    
    .login-action-button {
        width: 100%;
        min-height: 50px;
        border-radius: 16px;
        font-size: 18px;
        padding-inline: 16px;
    }
}

/* =========================================
   Auth & Forms Screen
   ========================================= */
.auth-choice-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 84px 24px 24px;
    box-sizing: border-box;
    background-image: url('../images/auth-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.auth-choice-panel,
.auth-form-panel {
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-title {
    font-size: 32px;
    font-weight: 900;
    text-align: center;
    color: #5b2a0d;
    text-shadow: 0 2px 0 #f5d49b, 0 4px 6px rgba(91, 42, 13, 0.22);
    margin-top: 10px;
    margin-bottom: 0;
    white-space: nowrap;
}

.auth-subtitle {
    font-size: 16px;
    text-align: center;
    color: #666;
}

.auth-bottom-link {
    color: #6a3018;
    font-weight: 700;
    text-align: center;
    font-size: 20px;
}

.auth-google-button {
    width: 200px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    white-space: nowrap;
    cursor: pointer;
    margin-top: 5px;
    margin-bottom: 5px;
}

.auth-form-panel form,
.auth-form-panel .auth-box {
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 24px 40px;
    background: rgba(255, 250, 239, 0.97);
    border: 4px solid #c78435;
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(40, 78, 106, 0.2);
}

.auth-main-button {
    width: min(100%, 360px);
    font-size: clamp(18px, 2vw, 22px);
    border-radius: 18px;
    font-weight: 700;
    height: 50px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #666;
    width: 100%;
    margin: 10px 0;
    font-weight: 700;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #bbb;
}
.auth-divider:not(:empty)::before {
    margin-left: 15px;
}
.auth-divider:not(:empty)::after {
    margin-right: 15px;
}

.auth-guest-button {
    border: none;
    background: transparent;
    color: #6a3018;
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    font-size: 20px;
    cursor: pointer;
}

.auth-field-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.auth-input.has-icon-right {
    padding-right: 48px;
}

.auth-input.has-icon-left {
    padding-left: 48px;
}

.auth-icon-right {
    position: absolute;
    right: 18px;
    top: 28px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5b2a0d;
    pointer-events: none;
    opacity: 0.7;
}

.auth-icon-left {
    position: absolute;
    left: 8px;
    top: 28px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5b2a0d;
    cursor: pointer;
    opacity: 0.7;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.icon-crossed::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 2px;
    background-color: currentColor;
    transform: translateY(-50%) rotate(-45deg);
    border-radius: 2px;
    box-shadow: 0 0 0 2px #fff;
}

.auth-google-link,
.auth-bottom-link,
.auth-bottom-link a {
    color: #6a3018;
    font-weight: 700;
    text-align: center !important;
    align-self: center !important;
    text-decoration: underline !important;
}

.auth-message {
    min-height: 24px;
    color: #93361D;
    font-weight: 700;
    font-size: 17px;
    text-align: center;
    margin: -10px 0;
}

.auth-validation {
    min-height: 24px;
    color: #93361D;
    font-weight: 700;
    font-size: 17px;
    text-align: center;
    margin: 0;
}

.auth-message-large {
    font-size: 22px;
}
.valid.modified:not([type=checkbox]) {
    border-color: #006B3C !important;
    outline: none !important;
}

.invalid,
.invalid.modified,
.valid.invalid.modified:not([type=checkbox]) {
    border-color: #93361D !important;
    outline: none !important;
}

.validation-message {
    min-height: 24px;
    color: #93361D;
    font-weight: 700;
    font-size: 17px;
    text-align: center;
    margin-top: 5px;
}

/* =========================================
   Character Stage Selection
   ========================================= */
.character-screen {
    position: relative;
    min-height: 100dvh;
    display: block;
    overflow: hidden;
    padding: 0;
    background: #cfefff;
}

.character-stage {
    position: relative;
    width: min(100%, 980px);
    aspect-ratio: 2.17 / 1;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(64, 115, 150, 0.18);
    background: #dfeef8;
}

.character-stage-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.character-stage-overlay {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    justify-items: center;
    padding: clamp(14px, 3vw, 30px);
}

.character-title {
    margin: 0;
    margin-top: 80px;
    color: #000000;
    font-size: clamp(22px, 4vw, 36px);
    text-align: center;
    align-self: start;
    justify-self: center;
    font-weight: 900;
}

/* =========================================
   Responsive Toggles
   ========================================= */
@media (orientation: landscape) {
    .portrait-only { display: none !important; }
}
@media (orientation: portrait) {
    .landscape-only { display: none !important; }
}

.character-options {
    direction: ltr;
    width: min(88vw, 780px);
    align-self: center;
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    justify-items: center;
    gap: clamp(28px, 7vw, 86px);
    padding: 0;
    margin-top: 90px;
}

.character-option {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter .2s ease;
    transform-origin: bottom center;
}

.landscape-only .character-option:hover {
    transform: scale(1.06) translateY(-8px);
}

.landscape-only .character-option.selected {
    transform: scale(1.1) translateY(-14px);
    filter: drop-shadow(0 12px 18px rgba(0,0,0,0.18));
}

.landscape-only .character-option:active {
    transform: scale(1.04) translateY(-4px);
}

.landscape-only .character-option img {
    display: block;
    height: clamp(300px, 54vw, 620px);
    max-height: 46dvh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.landscape-only .character-option--bear img {
    height: clamp(308px, 40vw, 464px);
    max-height: none;
}

.landscape-only .character-option--rabbit img {
    height: clamp(364px, 46vw, 548px);
    max-height: none;
}

.landscape-only .character-option--duck img {
    height: clamp(308px, 40vw, 464px);
    max-height: none;
}

.character-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.character-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    width: 100%;
    gap: 15px;
    padding: 30px 0;
    scroll-behavior: smooth;
    --card-w: 65%;
}

.character-carousel::before,
.character-carousel::after {
    content: '';
    flex: 0 0 calc(17.5% - 15px);
}

@media (min-width: 768px) {
    .character-carousel {
        --card-w: clamp(240px, 30vw, 320px);
        padding-bottom: 0px;
    }
    .character-carousel::before,
    .character-carousel::after {
        flex: 0 0 calc(50% - (var(--card-w) / 2) - 7.5px);
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .character-carousel {
        --card-w: clamp(100px, 30dvh, 180px);
        padding: 10px 0 0 0;
    }
    .character-carousel::before,
    .character-carousel::after {
        flex: 0 0 calc(50% - (var(--card-w) / 2) - 7.5px);
    }
}

.character-carousel::-webkit-scrollbar {
    display: none;
}

.character-card-wrap {
    flex: 0 0 var(--card-w);
    scroll-snap-align: center;
    display: flex;
    justify-content: center;
}

.character-option.character-card {
    width: 100%;
    aspect-ratio: 0.82;
    border-radius: 30px;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
    transform: scale(0.9);
    border: none;
    cursor: pointer;
}

.character-option.character-card.selected {
    transform: scale(1.05);
    background: #FFCC96;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* Remove old gradients */

.character-option.character-card img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(91, 42, 13, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.carousel-arrow.prev { right: 0px; }
.carousel-arrow.next { left: 0px; }

.character-name-display {
    font-size: clamp(32px, 8vw, 32px);
    font-weight: 900;
    color: #5b2a0d;
    margin-top: 5px;
    letter-spacing: 1px;
}

.carousel-dots {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 20px;
}

.carousel-dots .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(91, 42, 13, 0.3);
    cursor: pointer;
    transition: 0.3s;
}

.carousel-dots .dot.active {
    background: #5b2a0d;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.character-select-btn {
    width: 150px;
    min-width: 150px;
    height: 56px;
    font-size: 22px;
    margin-top: 5px;
}

.character-next-button {
    align-self: flex-end;
    min-width: 168px;
    height: 70px;
    border-radius: 18px;
    padding: 0 24px;
    font-size: 28px;
    font-weight: 700;
}

.character-next-button--arrow {
    align-self: center;
    justify-self: center;
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    height: 56px;
    padding: 0 24px;
    
    color: var(--wood-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    
    background: linear-gradient(180deg, var(--wood-top) 0%, var(--wood-bottom) 100%);
    border: 2px solid var(--wood-border);
    border-radius: 16px;
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.36), 
        inset 0 -3px 0 rgba(91, 45, 20, 0.18), 
        0 5px 0 rgba(96, 55, 27, 0.34), 
        0 10px 20px rgba(46, 72, 94, 0.18);
        
    cursor: pointer;
    z-index: 10;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.character-next-button--arrow::before,
.character-next-button--arrow::after {
    display: none !important;
}

.character-next-button--arrow:hover {
    transform: translateY(-2px);
    box-shadow: 
        inset 0 2px 0 rgba(255,255,255,0.36), 
        inset 0 -3px 0 rgba(91, 45, 20, 0.18), 
        0 7px 0 rgba(96, 55, 27, 0.34), 
        0 14px 24px rgba(46, 72, 94, 0.22);
}

.character-next-button--arrow:active {
    transform: translateY(1px) scale(0.98);
}

.character-next-button--arrow:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.character-next-button--arrow span {
    display: block;
    transform: none;
}

/* =========================================
   Parent Auth & Dashboard
   ========================================= */
.parent-auth-page,
.parent-dashboard-page {
    min-height: 100dvh;
    background-color: #70b8f2;
    background-image: url('../images/parent-sky-bg.png');
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
}

.parent-dashboard-page {
    padding: clamp(70px, 10dvh, 90px) clamp(12px, 5vw, 70px) 14px;
    overflow-x: hidden;
    overflow-y: auto;
}

.parent-auth-page {
    display: flex;
    flex-direction: column;
    padding: clamp(54px, 10dvh, 92px) 18px 24px;
}

#app > .parent-auth-page {
    min-height: 100dvh !important;
    padding: 0 !important;
}

.parent-auth-stage {
    width: min(100%, 980px);
    margin: auto;
    min-height: min(560px, calc(100dvh - 120px));
    display: flex;
    align-items: center;
    justify-content: center;
}

.parent-auth-card {
    position: relative;
    width: min(92vw, 390px);
    padding: 46px 38px 30px;
    border: 4px solid #c78435;
    border-radius: 18px;
    background: rgba(255, 250, 239, 0.96);
    box-shadow: 0 16px 30px rgba(58, 83, 105, 0.24);
    text-align: center;
}

.parent-auth-card--message {
    font-size: 22px;
    font-weight: 800;
}

.parent-auth-card h1 {
    margin: 0 0 22px;
    color: #4e260f;
    font-weight: 800;
    font-size: clamp(30px, 4.2vw, 46px);
    line-height: 1;
}

.parent-auth-card form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes mascot-float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-6px);
    }
}

.parent-login-mascot {
    position: absolute;
    top: clamp(-112px, -13vw, -92px);
    left: 50%;
    width: clamp(118px, 17vw, 166px);
    height: auto;
    transform: translateX(-50%);
    filter: drop-shadow(0 8px 12px rgba(211, 151, 41, 0.28));
    animation: mascot-float 3s ease-in-out infinite;
}

.parent-login-links {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-top: 14px;
}

.parent-login-links button {
    border: 0;
    padding: 0;
    color: #355568;
    background: transparent;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.parent-login-links .parent-link-button {
    border: 2px solid var(--wood-border);
    padding: 0 20px;
    color: var(--wood-text);
    background: linear-gradient(180deg, var(--wood-top) 0%, var(--wood-bottom) 100%);
    text-decoration: none;
}

.parent-login-submit {
    width: 100%;
    height: 58px;
    border-radius: 18px;
    font-size: 28px;
}

.parent-message-container {
    min-height: 42px;
    width: 100%;
}

.parent-auth-message {
    min-height: 24px;
    color: #93361D;
    font-weight: 700;
    font-size: 17px;
    text-align: center;
    margin-top: 5px;
}

.parent-dashboard-actions {
    width: min(100%, 980px);
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
    position: relative;
    z-index: 1;
}

.parent-wood-button,
.parent-wood-select select {
    height: 38px;
    border-radius: 14px;
    font-size: 15px;
}

.parent-wood-button {
    padding: 0 20px;
    cursor: pointer;
}

.parent-wood-select select {
    min-width: 120px;
    padding: 0 12px 0 26px;
    text-align: center;
    cursor: pointer;
}

.parent-dashboard-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 980px);
    height: min(80dvh, 720px);
    min-height: 360px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(235, 247, 255, 0.86);
    box-shadow: 0 16px 34px rgba(52, 107, 150, 0.18);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
}

.parent-dashboard-shell--message {
    display: flex;
    align-items: center;
    justify-content: center;
    height: min(64dvh, 440px);
    font-size: 22px;
    font-weight: 700;
}

.parent-dashboard-header {
    height: 42px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px;
    direction: rtl;
    position: relative;
    z-index: 30;
}

.parent-dashboard-header h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(18px, 2.1vw, 24px);
    font-weight: 800;
    text-align: right;
}

.parent-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: clamp(14px, 1.7vw, 17px);
    font-weight: 700;
    direction: rtl;
}

.parent-soft-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 136px;
    height: 34px;
    border: 2px solid #9d5c2f;
    border-radius: 14px;
    background: rgba(255, 239, 206, 0.94);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 3px 0 rgba(96, 55, 27, 0.24);
}

.parent-soft-select--lesson {
    min-width: 178px;
}

.parent-soft-select--sort {
    min-width: 128px;
}

.parent-soft-select::after {
    content: "âŒ„";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-55%);
    color: #5b2b15;
    font-size: 17px;
    font-weight: 900;
    pointer-events: none;
}

.parent-wood-select {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1.5px solid #b77943;
    border-radius: 10px;
    padding: 0 14px 0 28px;
    color: #000;
    background: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.parent-wood-select::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #000;
    border-radius: 2px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.parent-wood-select.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-container {
    position: relative;
    display: inline-block;
    min-width: 120px;
    height: 38px;
}


/* Base layout (Vertical) */
.auth-layout-columns {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.auth-section-google, 
.auth-section-manual {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.auth-google-title,
.auth-google-firefly {
    display: none;
}



.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: max-content;
    background: #fff;
    border: 1.5px solid #b77943;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 100;
    overflow: hidden;
}

.custom-dropdown-menu li {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    text-align: right;
    border-bottom: 1px solid #e2cfbd;
    transition: background 0.15s ease;
}

.custom-dropdown-menu li:last-child {
    border-bottom: none;
}

.custom-dropdown-menu li:hover {
    background: #fdf5ea;
}

.parent-dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    direction: rtl;
    flex-shrink: 0;
}

.parent-dashboard-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #000;
}

.parent-practice-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 20px 20px;
    scrollbar-color: #697075 rgba(255,255,255,0.58);
    scrollbar-width: thin;
    position: relative;
    z-index: 1;
    direction: ltr; /* Forces scrollbar to the right */
}

.parent-practice-scroll > * {
    direction: rtl; /* Revert content back to right-to-left */
}

.parent-practice-scroll::-webkit-scrollbar {
    width: 8px;
}
.parent-practice-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.parent-practice-scroll::-webkit-scrollbar-thumb {
    background: #cba885;
    border-radius: 4px;
}
.parent-practice-scroll::-webkit-scrollbar-button {
    display: none;
}

.parent-practice-scroll.empty-scroll {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.parent-practice-scroll.empty-scroll .parent-empty-state {
    flex: 1;
    margin-top: 0;
    min-height: max-content;
}

.parent-empty-state {
    min-height: 226px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    overflow: visible;
}

.parent-empty-state h2 {
    margin: 0;
    color: #0b0f15;
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    text-align: center;
}

.parent-empty-state img {
    width: clamp(108px, 16vw, 176px);
    max-width: 38%;
    max-height: 42%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.parent-loading-state {
    width: min(92vw, 520px);
    margin: auto;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-5dvh);
}

.parent-loading-state img {
    width: clamp(140px, 20vw, 220px);
    max-width: 60%;
    max-height: 60%;
    height: auto;
    object-fit: contain;
    display: block;
    animation: parent-float 2.4s ease-in-out infinite;
    filter: drop-shadow(0 10px 14px rgba(188, 134, 28, 0.28));
}

@keyframes parent-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.practice-set-card {
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
}

.practice-set-card + .practice-set-card {
    margin-top: 8px;
}

.practice-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    color: #000;
    background: #86c2f4;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    direction: rtl;
}

.practice-header-round {
    font-size: 16px;
    font-weight: 800;
}

.practice-header-score {
    text-align: center;
}

.practice-header-type {
    text-align: left;
}



.practice-mistake-row,
.practice-success-row {
    padding: 10px 24px 14px;
    text-align: center;
    border-bottom: 2px solid #c7c7c7;
}

.practice-set-card > :last-child {
    border-bottom: 0;
}

.practice-success-row {
    color: #24582f;
    font-size: 20px;
    font-weight: 800;
}

.practice-mistake-label {
    margin: 0 0 4px;
    font-size: 18px;
}

.practice-mistake-row strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.practice-answer-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.practice-answer {
    min-width: 98px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #161616;
    background: #d8d8d8;
    font-size: 17px;
    line-height: 1;
}

.practice-answer--correct {
    background: #82df98;
}

.practice-answer--wrong {
    background: #ff5a5d;
}

.practice-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 0;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    direction: rtl;
    border: none;
    border-top: none;
}

.practice-table th {
    background-color: #f0f4fb;
    color: #4a2b16;
    font-weight: bold;
    padding: 12px;
    text-align: center;
    padding: 12px 8px;
    font-weight: 800;
    color: #000;
    text-align: center;
    border-bottom: 2px solid #e0c8b0;
    width: 33.33%;
}

.practice-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 18px;
    font-weight: 600;
    width: 33.33%;
}

.practice-table td.word-col {
    color: #333;
    font-weight: normal;
}

.practice-table td.child-choice-correct {
    background-color: #f2f9f4;
    color: #1a7a37;
}

.practice-table td.child-choice-wrong {
    background-color: #fcebeb;
    color: #c62828;
}

.practice-table td.correct-col {
    color: #1a7a37;
}

.parent-dashboard-message {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 4px;
    margin: 0;
    color: #6a3018;
    font-weight: 800;
    text-align: center;
}

.parent-page {
    padding: 24px 16px 32px;
    display: flex;
    justify-content: center;
}

.parent-card {
    width: min(100%, 880px);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 40px rgba(74, 120, 156, 0.12);
}

.parent-card--pin {
    text-align: center;
}

.parent-card h1 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3vw, 34px);
}

.parent-card p {
    margin: 0;
    line-height: 1.7;
    font-size: 18px;
}

.parent-info-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.parent-info-box {
    background: #f4fbff;
    border: 1px solid #d8ebf7;
    border-radius: 18px;
    padding: 16px;
}

.parent-info-title {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: #6b8aa1;
}

/* =========================================
   About Page
   ========================================= */
.about-page {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(40px, 8dvh, 80px) 20px 20px;
    background-color: #70b8f2;
    background-image: url('../images/character-bg.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.about-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: clamp(280px, 50vw, 420px);
    margin: auto;
}

.about-panel {
    position: relative;
    width: 100%;
    border: 4px solid #c78435;
    border-radius: 24px;
    background: #f7e6cc;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    padding: clamp(20px, 4dvh, 40px) 10px 10px;
    z-index: 1;
}

.about-logos-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 4vw, 30px);
    margin-top: 2px;
}

.about-ui-logo {
    width: clamp(120px, 30vw, 160px);
    object-fit: contain;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.5dvh, 12px);
    color: #4a2c1a;
}

.about-content h2 {
    font-size: clamp(24px, 6vw, 30px);
    font-weight: 600;
    margin: 0;
    color: #3b1f0e;
    text-align: center;
}

.about-content h3 {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 500;
    margin: clamp(4px, 1dvh, 8px) auto 0;
    color: #3b1f0e;
    padding-bottom: 2px;
    border-bottom: 2.5px solid #c9a06c;
    width: auto;
    max-width: 95%;
    text-align: center;
}

.about-credits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
        "developed instructed"
        "design design";
    row-gap: 24px;
    column-gap: clamp(10px, 4vw, 40px);
    width: 100%;
    margin-top: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.credit-developed { grid-area: developed; }
.credit-instructed { grid-area: instructed; }
.credit-design { grid-area: design; }

.about-credits-row {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 5vw, 40px);
    width: 100%;
    text-align: center;
}

.credit-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 8px;
    text-align: center;
}

.credit-title {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    margin: 0;
    color: #4a2c1a;
    border-bottom: 2.5px solid #d4b48a;
    padding-bottom: 2px;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
}

.credit-value {
    font-size: clamp(17px, 4.5vw, 21px);
    font-weight: 500;
    margin: 0;
    color: #4a2c1a;
    text-align: center;
    white-space: nowrap;
}

.about-year {
    font-size: 20px;
    margin: 12px 0 0 0;
    padding: 0;
    line-height: 1;
    color: #553521;
    font-weight: 500;
}

.about-hit-logo {
    width: clamp(120px, 30vw, 160px);
    object-fit: contain;
}

.about-faculty-link-text {
    font-size: clamp(16px, 3.5vw, 18px);
    color: #000;
    text-decoration: underline;
    margin-top: 0;
    font-weight: 500;
    transition: color 0.2s;
}

.about-girl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 85%;
    max-width: 40vw;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
}

.about-girl--top {
    display: none;
}

.about-girl-left {
    left: 0;
    transform: translateX(calc(-75% + 10px)) translateY(-50%);
}

.about-girl-right {
    right: 0;
    transform: translateX(calc(75% + 5px)) translateY(-50%);
}

@media (max-width: 950px) and (orientation: landscape) and (max-height: 600px) {
    .parent-auth-stage {
        margin-top: 50px;
    }
    .about-page {
        padding-top: 10px;
    }
    .about-wrapper {
        width: clamp(340px, 75vw, 550px);
        margin-top: 50px;
    }
    .about-panel {
        padding: 10px 15px 5px 15px !important;
    }
    .about-girl {
        height: 50%;
    }
    .about-logos-row {
        gap: 10px;
    }
    .about-content { gap: 4px; }
    .about-content h2 { font-size: 18px; white-space: nowrap; }
    .about-content h3 { font-size: 16px; white-space: nowrap; }
    .about-faculty-link-text { font-size: 16px; margin: 0; }
    .about-hit-logo { width: 80px; margin-top: 5px; }
    .about-ui-logo { width: 80px; margin-top: 5px; }
    .about-year { margin-top: 8px; white-space: nowrap; }

    .about-credits-grid {
        grid-template-columns: 1fr 1fr 1fr;
        width: max-content;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        grid-template-areas: "developed instructed design";
        gap: 20px;
        margin-top: 5px;
        margin-bottom: 5px;
    }
    .credit-block {
        padding-bottom: 0;
    }
    .credit-title, .credit-value, .about-year {
        font-size: 16px;
    }
    .about-content h3 {
        border-bottom: 2.5px solid #c9a06c;
        padding-bottom: clamp(6px, 1.2dvh, 10px);
        width: auto;
    }
    
    .about-girl {
        height: 60%;
        top: 50%;
    }

    /* Removed reduce padding on landscape mobile as it is now 80px globally */
}

@supports (-webkit-touch-callout: none) {
    .auth-choice-screen { 
        padding-top: 76px; 
        background-attachment: scroll;
    }
    .login-cards-screen { padding-top: 64px; }
    .login-cards-shell { gap: 15px; }
}

@media (max-height: 600px) {
    .unity-frame-shell {
        transform: translateY(-2px);
    }
    
    @supports not (-webkit-touch-callout: none) {
        .auth-choice-screen { padding-top: 64px !important; }
        .login-cards-screen { padding-top: 56px !important; }
        .auth-title { font-size: 28px !important; margin-bottom: 0 !important; }
        .login-action-title { font-size: 24px !important; }
        .login-action-figure--signup,
        .login-action-figure--guest { max-height: 120px !important; }
        .login-action-figure--door { max-height: 90px !important; }
        .login-action-card { min-height: 200px !important; padding: 10px !important; }
        .login-cards-shell { gap: 10px !important; }
    }
}

/* Auth forms split layout for landscape mobile */
@media (max-height: 600px) and (orientation: landscape) and (min-width: 500px), (max-width: 1023px) and (orientation: landscape) and (min-width: 500px) {
    .auth-form-panel form {
        max-width: 700px !important;
        width: 95vw !important;
        padding: 20px !important;
        transform: translateY(-10px);
    }
    .auth-title {
        font-size: 26px !important;
        margin-bottom: 12px !important;
    }
    .auth-layout-columns {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 20px;
    }
    .auth-section-google {
        flex: 1;
        justify-content: flex-start;
        border-left: 1px solid #d1bfae; /* Custom divider line */
        padding-left: 20px;
        padding-top: 5px;
    }
    .auth-section-manual {
        flex: 1;
        justify-content: center;
        padding-right: 20px;
    }
    .auth-divider {
        display: none; /* Hide default divider in row mode, using border-left instead */
    }
    .auth-google-title {
        display: block;
        font-family: 'Fredoka', sans-serif;
        font-size: 20px;
        color: #5b2a0d;
        margin-bottom: 14px;
        font-weight: 800;
        text-align: center;
    }
    .auth-google-firefly {
        display: block;
        max-height: 110px;
        object-fit: contain;
        margin-top: 14px;
        transform: scale(1.1);
    }
    .auth-field-wrap {
        margin-bottom: 8px !important;
    }
    .auth-bottom-link {
        margin-top: 15px !important;
    }
    body.is-android .auth-form-panel {
        top: 5px !important;
    }
}

@media (min-width: 768px) and (min-height: 601px) {
    .about-wrapper {
        width: clamp(280px, 60vw, 800px);
    }

    
    .about-girl {
        height: 55%;
        top: 50%;
    }
    
    .about-girl-left {
        transform: translateX(calc(-75% + 11px)) translateY(-50%);
    }
    
    .about-credits-grid {
        grid-template-columns: 1fr 1fr 1fr;
        width: max-content;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
        grid-template-areas: "developed instructed design";
        gap: 20px;
        margin-top: 15px;
        margin-bottom: 10px;
    }
    .credit-block {
        padding-bottom: 0;
    }
    .about-content h3 {
        border-bottom: 2.5px solid #c9a06c;
        padding-bottom: clamp(6px, 1.2dvh, 10px);
        width: auto;
    }

    .login-cards-shell {
        width: min(100%, 950px);
        margin-left: auto;
        margin-right: auto;
        min-height: auto;
    }
    .login-action-card {
        min-height: clamp(240px, 28vw, 340px);
        padding: clamp(16px, 2vw, 24px) clamp(12px, 1.5vw, 18px);
        border-width: 3px;
        border-radius: clamp(16px, 2vw, 24px);
    }
    .login-action-figure {
        transform: scale(1.6);
        margin: 20px auto;
    }
}

/* =========================================
   Course & Unity Integration
   ========================================= */
.course-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.course-card {
    width: min(100%, 880px);
    background: rgba(255,255,255,0.9);
    border-radius: 26px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(74, 120, 156, 0.12);
    text-align: center;
}

.course-card h1 {
    margin: 0 0 10px;
    color: #6a3018;
}

.unity-frame-wrapper {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(8px, 2vw, 18px);
    box-sizing: border-box;
    margin-top: clamp(60px, 8dvh, 80px);
}

.unity-frame-shell {
    position: relative;
    width: min(100%, 1280px, calc((100dvh - 90px) * 21 / 9));
    max-width: 1280px;
    aspect-ratio: 21 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(33, 65, 90, 0.18);
}

.unity-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

/* =========================================
   Pre-game Splash Overlay
   ========================================= */
.pregame-splash-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: #70b8f2;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pregameFadeOut 0.8s ease-in-out 4s forwards;
    pointer-events: none; /* Let clicks pass through after fade out */
}

@keyframes pregameFadeOut {
    to { opacity: 0; visibility: hidden; }
}

.pregame-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.pregame-icons-row {
    display: flex;
    gap: 40px;
    align-items: center;
}

.pregame-icon-volume {
    color: #111;
    animation: pulseVolume 1s infinite alternate;
}

@keyframes pulseVolume {
    from { transform: scale(0.9); opacity: 0.8; }
    to { transform: scale(1.1); opacity: 1; }
}

.pregame-icon-phone {
    color: #111;
    transform-origin: center;
    animation: rotatePhone 2.5s ease-in-out infinite;
}

@keyframes rotatePhone {
    0%, 15% { transform: rotate(0deg); }
    40%, 65% { transform: rotate(-90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.pregame-splash-text {
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(18px, 4vw, 28px);
    color: #111;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: none; /* Removed white shadow for cleaner black text */
    margin: 0;
}

.unity-fullscreen-button {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(89, 45, 18, 0.86);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(239, 179, 106, 0.96), rgba(214, 131, 62, 0.96));
    color: #4b1c0d;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.38), 0 4px 0 rgba(96, 55, 27, 0.34), 0 8px 18px rgba(0,0,0,0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    line-height: 1;
    font-weight: 900;
}

.unity-fullscreen-button:hover {
    transform: translateY(-2px);
}

.unity-fullscreen-button:active {
    transform: translateY(0);
}

.unity-fullscreen-icon--exit {
    display: none;
}

.unity-frame-wrapper:fullscreen,
.unity-frame-wrapper:-webkit-full-screen,
.unity-frame-wrapper.unity-fallback-fullscreen {
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    margin-top: 0 !important;
}

.unity-frame-wrapper.unity-fallback-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.unity-frame-wrapper:fullscreen .unity-frame-shell,
.unity-frame-wrapper:-webkit-full-screen .unity-frame-shell,
.unity-frame-wrapper.unity-fallback-fullscreen .unity-frame-shell {
    width: min(calc(100vw - 20px), calc((100dvh - 20px) * 21 / 9));
    max-width: none;
    height: min(calc(100dvh - 20px), calc((100vw - 20px) * 9 / 21));
    border-radius: 0;
    box-shadow: none;
    flex: 0 0 auto;
}

.unity-frame-wrapper:fullscreen .unity-fullscreen-button,
.unity-frame-wrapper:-webkit-full-screen .unity-fullscreen-button,
.unity-frame-wrapper.unity-fallback-fullscreen .unity-fullscreen-button {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
}

.unity-frame-wrapper:fullscreen .unity-fullscreen-icon--enter,
.unity-frame-wrapper:-webkit-full-screen .unity-fullscreen-icon--enter,
.unity-frame-wrapper.unity-fallback-fullscreen .unity-fullscreen-icon--enter {
    display: none;
}

.unity-frame-wrapper:fullscreen .unity-fullscreen-icon--exit,
.unity-frame-wrapper:-webkit-full-screen .unity-fullscreen-icon--exit,
.unity-frame-wrapper.unity-fallback-fullscreen .unity-fullscreen-icon--exit {
    display: inline-flex;
}

html.unity-course-fullscreen,
body.unity-course-fullscreen {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* iPhone / iOS only */
@supports (-webkit-touch-callout: none) {
    .unity-frame-wrapper {
        position: relative;
    }
}

/* =========================================
   Blazor Error UI
   ========================================= */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyIDI2Ny44NzkgNjkuMzE3OSAyNjcuODc5IDY3LjExODIgMjY2LjQ0OCA2Ni4wMTgzIDI2My41ODYgNjYuMDE4M1pNMjYzLjU3NiA4Ni4wNTQ3QzI2MS4wNDkgODYuMDU0NyAyNTkuNzg2IDg3LjMwMDUgMjU5Ljc4NiA4OS43OTIxIDI1OS43ODYgOTIuMjgzNyAyNjEuMDQ5IDkzLjUyOTUgMjYzLjU3NiA5My41Mjk1IDI2Ni4xMTYgOTMuNTI5NSAyNjcuMzg3IDkyLjI4MzcgMjY3LjM4NyA4OS43OTIxIDI2Ny4zODcgODcuMzAwNSAyNjYuMTE2IDg2LjA1NDcgMjYzLjU3NiA4Ni4wNTQ3WiIgZmlsbD0iI0ZGRTUwMCIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9nPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}


/* =========================================
   MEDIA QUERIES (Unified)
   ========================================= */

@media (max-width: 980px) and (orientation: landscape) and (min-width: 500px) {
    .login-cards-screen {
        min-height: 100dvh;
        padding: 8px 16px;
    }
    .login-cards-shell {
        width: min(96vw, 900px);
        gap: 14px;
    }
    .login-action-card {
        min-height: calc(100dvh - 72px);
        max-height: calc(100dvh - 64px);
        padding: 12px 14px 16px;
        border-width: 4px;
        border-radius: 22px;
        grid-template-rows: auto minmax(104px, 1fr) auto auto;
    }
    .login-action-title {
        font-size: clamp(26px, 5vw, 38px);
    }
    .login-action-figure--door {
        max-height: 30dvh;
    }
    .login-action-figure--signup,
    .login-action-figure--guest {
        max-height: 22dvh;
    }
    .login-action-button {
        width: 100%;
        min-height: clamp(45px, 4.5vw, 55px);
        border-radius: 16px;
        font-size: clamp(15px, 2.3vw, 18px);
        padding-inline: 12px;
    }
    .opening-logo {
        width: 800px;
        max-width: 80vw;
        max-height: none;
        height: auto;
    }
}

@media (max-width: 950px) and (orientation: landscape) and (min-width: 500px) {
    .opening-overlay {
        justify-content: center;
        gap: clamp(10px, 2.5dvh, 20px);
    }
    .opening-logo {
        width: 250px;
        max-width: 80vw;
        max-height: none;
        height: auto;
    }
    .opening-overlay .play-entry-button {
        width: clamp(200px, 30vw, 400px);
        position: relative;
        top: -30px;
    }
    .opening-volume-note {
        font-size: clamp(12px, 1.7vw, 18px);
        line-height: 1.1;
        right: clamp(12px, 3vw, 28px);
        bottom: 8px;
    }
    .login-action-card {
        min-height: clamp(260px, 78dvh, 360px);
    }
    .login-action-figure--signup,
    .login-action-figure--guest {
        max-height: clamp(104px, 19vw, 162px);
    }
    .character-stage-overlay {
        min-height: calc(100dvh - 50px);
    }
    .character-options {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        align-items: end;
        justify-items: center;
        width: min(94vw, 750px);
        gap: clamp(12px, 3vw, 40px);
        margin-top: 30px;
    }
    .character-option img {
        height: clamp(232px, 48vw, 440px);
        max-height: 56dvh;
        max-width: 100%;
        object-fit: contain;
    }
    .character-option--bear img {
        height: clamp(232px, 32vw, 304px);
    }
    .character-option--rabbit img {
        height: clamp(264px, 36vw, 348px);
    }
    .character-option--duck img {
        height: clamp(232px, 32vw, 304px);
    }
    .character-next-button--arrow {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(20px, env(safe-area-inset-bottom));
        min-width: 130px;
        height: 44px;
        font-size: 16px;
        padding-left: 16px;
        padding-right: 16px;
        border: 2px solid var(--wood-border);
        border-radius: 12px;
    }
    .character-next-button--arrow::before,
    .character-next-button--arrow::after {
        display: none !important;
    }
    .character-next-button--arrow span {
        display: block;
        transform: none;
    }
    .unity-frame-wrapper {
        min-height: calc(100dvh - 50px);
        padding: 4px;
    }
    .unity-frame-shell {
        width: min(100%, calc((100dvh - 58px) * 21 / 9));
        max-width: none;
        border-radius: 8px;
    }
    .unity-fullscreen-button {
        right: 8px;
        bottom: 8px;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 23px;
    }
    .unity-frame-wrapper:fullscreen,
    .unity-frame-wrapper:-webkit-full-screen,
    .unity-frame-wrapper.unity-fallback-fullscreen {
        padding: 12px;
        margin-top: 0 !important;
    }
    .unity-frame-wrapper:fullscreen .unity-frame-shell,
    .unity-frame-wrapper:-webkit-full-screen .unity-frame-shell,
    .unity-frame-wrapper.unity-fallback-fullscreen .unity-frame-shell {
        width: min(calc(100vw - 24px), calc((100dvh - 24px) * 21 / 9));
        height: min(calc(100dvh - 24px), calc((100vw - 24px) * 9 / 21));
    }
    .parent-auth-page {
        min-height: calc(100dvh - 58px);
        padding: 42px 10px 10px;
    }
    .parent-auth-stage {
        min-height: calc(100dvh - 100px);
        align-items: flex-start;
        padding-top: 90px;
    }
    .parent-auth-card {
        width: 340px;
        padding: 34px 30px 20px;
    }
    .parent-auth-card h1 {
        margin-bottom: 14px;
        font-size: 34px;
    }
    .parent-login-mascot {
        top: -84px;
        width: 112px;
    }
    .parent-link-button {
        height: 36px;
        min-width: 152px;
        font-size: 15px;
    }
    .parent-dashboard-page {
        min-height: 100dvh;
        padding: clamp(70px, 10dvh, 90px) 8vw 10px;
    }
    .parent-dashboard-shell {
        height: calc(100dvh - 100px);
        min-height: 238px;
    }
    .parent-dashboard-header {
        height: 36px;
        padding-inline: 16px;
    }
    .parent-dashboard-header h1 {
        font-size: 19px;
    }
    .parent-soft-select {
        height: 30px;
        min-width: 122px;
        border-radius: 12px;
    }
    .parent-soft-select--lesson {
        min-width: 154px;
    }
    .parent-soft-select select {
        font-size: 13px;
    }
    .parent-empty-state img {
        width: 92px;
        max-height: 82px;
    }
    .about-page {
        padding: 18px;
    }
    .about-panel {
        grid-template-columns: 1fr 190px;
        padding: 26px 34px 22px;
        gap: 20px;
    }
    .about-mascot {
        top: -44px;
        width: 86px;
    }
    .about-header h1 {
        font-size: 32px;
    }
    .about-details {
        gap: 8px;
        margin: 18px 0 14px;
    }
    .about-details div {
        padding: 8px 12px;
    }
    .about-logo {
        width: 190px;
        padding: 12px;
    }
}

@media (max-width: 760px) and (orientation: portrait) {
    .login-action-card {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding: 14px 16px 16px;
        background-size: 55%;
        min-height: 160px !important;
        width: 70%;
    }
    .login-cards-shell {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        min-height: 80dvh;
        height: auto;
    }
    .login-action-title {
        margin: 0;
        font-size: clamp(22px, 6vw, 28px);
    }
    .login-action-figure {
        max-height: 70px;
        max-width: 70%;
        margin: 0 auto;
    }
    .opening-overlay {
        padding-top: 120px;
        gap: 16px;
    }
    .opening-logo {
        width: 800px;
        max-width: 80vw;
        max-height: none;
        height: auto;
    }
    .opening-overlay .play-entry-button {
        width: min(58vw, 292px);
    }
    .opening-volume-note {
        left: 16px;
        right: 16px;
        text-align: center;
        font-size: clamp(16px, 4.6vw, 22px);
        padding-inline: 12px;
    }
    .character-stage-overlay {
        padding: 18px 14px 96px;
    }
    .character-options {
        width: min(92vw, 420px);
        gap: 12px;
        margin-top: 80px;
    }
    .character-option--bear img {
        height: clamp(248px, 76vw, 344px);
    }
    .character-option--rabbit img {
        height: clamp(284px, 90vw, 404px);
    }
    .character-option--duck img {
        height: clamp(248px, 76vw, 344px);
    }
}

@media (max-width: 700px) and (orientation: portrait) {
    .parent-auth-page,
    .parent-dashboard-page {
        min-height: 100dvh;
    }
    .parent-auth-page {
        padding: 100px 14px 24px;
        align-items: flex-start;
    }
    .parent-auth-stage {
        min-height: auto;
    }
    .parent-auth-card {
        width: min(92vw, 360px);
        padding: 42px 24px 24px;
    }
    .parent-login-mascot {
        top: -86px;
        width: 112px;
    }
    .parent-dashboard-page {
        padding: clamp(70px, 10dvh, 90px) 12px 14px;
    }
    .parent-dashboard-actions,
    .parent-dashboard-header-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .practice-set-header {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
        padding: 8px 10px;
        font-size: 16px;
    }
    .practice-header-round {
        font-size: 17px;
    }
    .parent-dashboard-actions {
        gap: 8px;
    }
    .parent-dashboard-shell {
        height: calc(100dvh - 120px);
        min-height: 390px;
    }
    .parent-dashboard-header-row {
        flex-direction: column;
        gap: 6px;
        padding: 10px 12px;
    }
    .parent-dashboard-title {
        font-size: 20px;
    }
    .parent-soft-select,
    .parent-soft-select--lesson,
    .parent-soft-select--sort {
        min-width: min(78vw, 210px);
    }
    .parent-empty-state {
        min-height: 260px;
        padding: 18px;
    }
    .parent-empty-state img {
        width: 92px;
        max-height: 116px;
    }
    .parent-practice-scroll {
        padding-inline: 12px;
    }
    .practice-answer {
        min-width: 82px;
    }
    .character-stage-overlay {
        grid-template-rows: auto 1fr auto;
        padding: 18px 12px 92px;
    }
    .character-options {
        flex-wrap: wrap;
        gap: 10px 18px;
        margin-top: 60px;
    }
    .character-option img {
        height: clamp(284px, 86vw, 440px);
        max-height: none;
        max-width: 100%;
        object-fit: contain;
    }
    .character-option--duck img {
        height: clamp(284px, 86vw, 440px);
    }
    .character-next-button--arrow {
        right: 20px;
        bottom: 20px;
        margin-bottom: -10px;
        min-width: 140px;
        height: 48px;
        font-size: 19px;
        padding-left: 18px;
        padding-right: 18px;
        border: 2px solid var(--wood-border);
        border-radius: 14px;
    }
    .character-next-button--arrow::before,
    .character-next-button--arrow::after {
        display: none !important;
    }
    .character-next-button--arrow span {
        display: block;
        transform: none;
    }
    .about-page {
        align-items: flex-start;
        padding: 24px 14px 18px;
    }
    .about-panel {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 30px 18px 4px;
    }
    .about-mascot {
        top: -62px;
        right: 50%;
        width: 104px;
        transform: translateX(50%);
    }
    .about-details div {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .about-logo {
        width: min(100%, 260px);
        order: -1;
    }
}

@media (max-width: 700px) {
    :root {
        --btn-width: 180px;
        --btn-height: 58px;
    }
    .character-screen {
        padding: 10px;
    }
    .parent-info-grid {
        grid-template-columns: 1fr;
    }
    .character-options {
        gap: 14px;
        padding-inline: 12px;
    }
    .character-next-button {
        min-width: 132px;
        height: 56px;
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .auth-choice-screen--home .auth-form-panel form {
        grid-template-columns: 1fr;
        width: min(100%, 380px);
        padding: 24px 20px;
    }
    .auth-choice-screen--home .auth-form-panel form > .auth-field-wrap {
        grid-column: 1 / -1;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .auth-form-panel form,
    .auth-form-panel .auth-box {
        width: min(100%, 340px);
        padding: 10px 15px;
        gap: 10px;
    }
}

@media (orientation: portrait) {
    .character-stage {
        width: min(100%, 94vw);
    }
    .auth-form-panel {
        min-height: auto;
        padding-top: 20px;
        padding-bottom: 25px;
    }
    .about-wrapper {
        margin-top: 135px;
        width: 95vw;
        max-width: 440px;
    }
    .about-panel {
        padding: 35px 15px 15px 15px;
    }
    .about-content {
        gap: 2px;
    }
    .about-girl--side {
        display: none;
    }
    .about-girl--top {
        display: block;
        top: -4px;
        height: clamp(160px, 28dvh, 200px);
        width: auto;
    }
    .about-girl-left.about-girl--top {
        left: 50%;
        transform: translateX(-100%) translateY(calc(-70% + 4px)) scale(1.15);
    }
    .about-girl-right.about-girl--top {
        right: 50%;
        transform: translateX(100%) translateY(calc(-70% + 4px));
    }
}

/* =========================================
   Mobile OS Layout Offsets
   ========================================= */
body.is-ios .opening-overlay,
body.is-ios .login-cards-shell,
body.is-ios .auth-form-panel,
body.is-ios .character-stage-overlay,
body.is-ios .parent-auth-card,
body.is-ios .parent-auth-stage,
body.is-ios .parent-dashboard-page > *,
body.is-ios .unity-frame-shell {
    position: relative;
}

body.is-android .opening-overlay,
body.is-android .login-cards-shell,
body.is-android .auth-form-panel,
body.is-android .character-stage-overlay,
body.is-android .parent-auth-card,
body.is-android .parent-auth-stage,
body.is-android .parent-dashboard-page > * {
    position: relative;
    top: -20px;
}

@supports (-webkit-touch-callout: none) {
    body:not(.is-ios) .opening-overlay,
    body:not(.is-ios) .login-cards-shell,
    body:not(.is-ios) .auth-form-panel,
    body:not(.is-ios) .character-stage-overlay,
    body:not(.is-ios) .parent-auth-card,
    body:not(.is-ios) .parent-auth-stage,
    body:not(.is-ios) .parent-dashboard-page > *,
    body:not(.is-ios) .unity-frame-shell {
        position: relative;
        top: -40px;
    }
}

/* =========================================
   Parent Dashboard UI Refinements (Mockup)
   ========================================= */

.practice-answer {
    padding: 6px 18px;
    border-radius: 50px;
    background: #e2e2e2;
    color: #000;
    font-weight: 500;
    font-size: 16px;
    border: none;
}

.practice-answer--correct {
    background: #8de399 !important;
    color: #000 !important;
    border: none;
    box-shadow: none;
}

.practice-answer--wrong {
    background: #ff6b6b !important;
    color: #000 !important;
    text-decoration: none !important;
    border: none;
    box-shadow: none;
}

.practice-question-row {
    padding: 14px 20px;
    border-bottom: 1px solid #dcdcdc;
    background: transparent;
    margin: 0;
    border-radius: 0;
    border-right: none !important;
}

.practice-set-card > :last-child {
    border-bottom: none;
}

.practice-question-label {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #000;
    text-align: right;
}

.practice-question-row strong {
    display: block;
    margin-bottom: 10px;
    font-size: 17px;
    color: #000;
    text-align: right;
}

.practice-answer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.practice-set-header,
.practice-set-header strong,
.practice-set-header span,
.practice-type,
.practice-success-row,
.practice-mistake-label,
.practice-mistake-row strong,
.parent-sort-control {
    color: #000 !important;
}


.practice-unanswered-text {
    color: #555;
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0 0 0;
    font-style: italic;
}

/* Dashboard Stats Grid */
.parent-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

@media (max-width: 600px) {
    .parent-stats-grid {
        grid-template-columns: 1fr;
    }
}

.parent-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border: 1.5px solid transparent;
    text-align: center;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 8px;
}

.stat-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.stat-card-icon {
    font-size: 18px;
}

.stat-card-main-val {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 2px;
    line-height: 1;
}

.stat-card-subtitle {
    margin: 0;
    font-size: 16px;
    color: #666;
    font-weight: 500;
    min-height: 20px;
}

/* Purple Theme (Level) */
.stat-card-purple {
    border-color: rgba(218, 1, 178, 0.1);
}
.stat-card-purple .stat-card-header h3,
.stat-card-purple .stat-card-icon {
    color: #DA01B2;
}
.stat-card-purple .stat-card-main-val {
    color: #000;
}

/* Green Theme (Success Rate) */
.stat-card-green {
    border-color: rgba(0, 107, 60, 0.1);
}
.stat-card-green .stat-card-header h3,
.stat-card-green .stat-card-icon,
.stat-card-green .stat-card-main-val {
    color: #006B3C;
}

/* Blue Theme (Activity) */
.stat-card-blue {
    border-color: rgba(0, 134, 223, 0.1);
}
.stat-card-blue .stat-card-header h3,
.stat-card-blue .stat-card-icon,
.stat-card-blue .stat-card-main-val {
    color: #0048DF;
}

/* Activity Breakdown */
.stat-activity-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 4px;
    margin-top: 10px;
    width: 100%;
}
.stat-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 16px;
    color: #555;
    font-weight: 600;
}
.breakdown-num {
    color: #0048DF;
    font-weight: 800;
    font-size: 16px;
}

/* Progress Bar */
.stat-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
}

.stat-progress-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.stat-node-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    margin-bottom: 6px;
    transition: all 0.3s;
}

.stat-progress-node.completed .stat-node-circle {
    background: #DA01B2;
    border-color: #DA01B2;
}

.stat-node-label {
    font-size: 16px;
    color: #888;
    font-weight: 600;
}

.stat-progress-node.completed .stat-node-label {
    color: #DA01B2;
}

.stat-progress-line {
    height: 3px;
    background: #ddd;
    flex: 1;
    margin: 0 4px;
    transform: translateY(-9px);
    transition: background 0.3s;
}

.stat-progress-line.completed {
    background: #DA01B2;
}

.parent-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.parent-edit-pin-textbtn {
    background: none;
    border: none;
    color: #9d5c2f;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: opacity 0.2s;
}

.parent-edit-pin-textbtn:hover {
    opacity: 0.8;
}

.parent-edit-pin-textbtn .oi {
    font-size: 16px;
}

