/* ===== Reset & Blazor defaults ===== */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "Произошла ошибка."; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(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; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: 0.82rem; margin-bottom: 10px; }
.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ===== LP Design Tokens ===== */
:root {
    --lp-primary:      #7B5CF5;
    --lp-primary-dark: #3D1FA0;
    --lp-accent:       #FF9800;
    --lp-success:      #4CAF50;
    --lp-error:        #e50000;
    --lp-header-h:     56px;
    --lp-tabs-h:       64px;
    --lp-bg:           #f4f4f8;
}

/* ===== App Shell ===== */
.lp-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--lp-bg);
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

/* ===== Header ===== */
.lp-header {
    height: var(--lp-header-h);
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(61,31,160,0.3);
    z-index: 10;
}
.lp-header-brand {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lp-header-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    flex-shrink: 0;
}
.lp-header-status { display: flex; align-items: center; gap: 10px; }
.lp-lives { color: white; font-size: 0.78rem; }
.lp-lp   { color: rgba(255,255,255,0.88); font-size: 0.78rem; font-weight: 600; }

/* ===== Content ===== */
.lp-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 16px calc(var(--lp-tabs-h) + 16px);
    -webkit-overflow-scrolling: touch;
}
.lp-content.full { padding: 0; }

/* ===== Bottom Tabs ===== */
.lp-tabs {
    height: var(--lp-tabs-h);
    background: white;
    border-top: 1px solid #e8e8f0;
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
    z-index: 10;
}
.lp-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #b0b0c0;
    gap: 1px;
    padding: 6px 0 4px;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
}
.lp-tab.active { color: var(--lp-primary); }
.tab-icon  { font-size: 1.3rem; line-height: 1; }
.tab-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.lp-tab-indicator { width: 20px; height: 3px; background: var(--lp-primary); border-radius: 2px; margin-top: 2px; }

/* ===== Loading / Spinner ===== */
.lp-loading {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; color: var(--lp-primary);
    font-size: 1rem; background: var(--lp-bg);
}
.lp-spinner-wrap { text-align: center; padding: 40px 20px; color: #b0b0c0; font-size: 0.9rem; }

/* ===== Cards ===== */
.lp-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.lp-empty-state {
    text-align: center; color: #b0b0c0; padding: 36px 20px;
    background: white; border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); font-size: 0.88rem; line-height: 1.6;
}

/* ===== Typography ===== */
.lp-section-title {
    font-size: 0.68rem; font-weight: 700; color: #b0b0c0;
    text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 8px;
}
.lp-page-title { font-size: 1.15rem; font-weight: 700; color: #1a1a2e; margin: 0 0 14px; }

/* ===== Back Button ===== */
.lp-back-btn {
    background: none; border: none; color: var(--lp-primary);
    font-size: 0.88rem; font-weight: 600; cursor: pointer;
    padding: 0; margin-bottom: 10px; display: flex; align-items: center; gap: 4px;
    font-family: inherit;
}

/* ===== Alphabet Grid ===== */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px;
    margin-bottom: 4px;
}
.letter-card {
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; font-weight: 700; color: white;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.letter-card:active { transform: scale(0.9); }

/* ===== Book Grid ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.book-card {
    background: white; border-radius: 14px; padding: 14px 10px 12px;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: pointer; transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.book-card:not(.locked):active { transform: scale(0.96); }
.book-card.locked { opacity: 0.4; cursor: not-allowed; }
.book-card.selected { border: 2.5px solid var(--lp-primary); background: #ede7ff; }
.book-number { font-size: 2rem; font-weight: 800; color: var(--lp-primary); line-height: 1; }
.book-title  { font-size: 0.7rem; color: #9e9e9e; margin-top: 3px; }
.book-lock   { font-size: 1.1rem; margin-top: 8px; }
.book-progress-bar { height: 3px; background: #eee; border-radius: 2px; margin-top: 10px; overflow: hidden; }
.book-progress-fill { height: 100%; background: linear-gradient(90deg, var(--lp-primary), #b39ddb); border-radius: 2px; }

.overall-progress-bar { height: 12px; background: #eee; border-radius: 7px; overflow: hidden; margin-top: 4px; }
.overall-progress-fill { height: 100%; background: linear-gradient(90deg, var(--lp-primary), #b39ddb); border-radius: 7px; transition: width 0.3s; }
.overall-progress-label { text-align: center; font-size: 0.8rem; color: #9e9e9e; margin-top: 8px; font-weight: 600; }

/* ===== Dictionary ===== */
.lp-search {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e0e0e0; border-radius: 10px;
    font-size: 0.95rem; margin-bottom: 10px;
    outline: none; box-sizing: border-box; font-family: inherit;
}
.lp-search:focus { border-color: var(--lp-primary); }
.word-list { list-style: none; padding: 0; margin: 0; }
.word-item {
    display: flex; align-items: center; gap: 12px;
    background: white; border-radius: 10px; padding: 10px 12px;
    margin-bottom: 7px; box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}
.word-svg { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.word-svg svg { width: 44px; height: 44px; }
.word-name { font-size: 0.95rem; font-weight: 600; color: #1a1a2e; }
.word-meta  { font-size: 0.7rem; color: #c8c8d8; }

/* ===== Pagination ===== */
.lp-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }

/* ===== Buttons ===== */
.lp-btn {
    padding: 9px 20px; border-radius: 9px; border: none;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    background: var(--lp-primary); color: white;
    transition: opacity 0.15s; font-family: inherit;
}
.lp-btn:disabled { background: #e0e0e0; color: #b0b0c0; cursor: not-allowed; }
.lp-btn-sm   { padding: 7px 14px; font-size: 0.8rem; }
.lp-btn-full { width: 100%; }
.lp-btn-primary {
    display: block; width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    color: white; border: none; border-radius: 12px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    margin-top: 10px; transition: opacity 0.15s; font-family: inherit;
}
.lp-btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

/* ===== Awards ===== */
.award-grid, .market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.award-card, .market-card {
    background: white; border-radius: 12px; padding: 12px 8px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.award-card.not-achieved { filter: grayscale(1); opacity: 0.45; }
.award-svg { width: 54px; height: 54px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; }
.award-svg svg { width: 54px; height: 54px; }
.award-title { font-size: 0.6rem; color: #424242; line-height: 1.35; }
.market-price { font-size: 0.72rem; font-weight: 700; color: var(--lp-accent); margin-top: 5px; }
.lp-badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700;
    background: rgba(123,92,245,0.1); color: var(--lp-primary);
}

/* ===== Subjects ===== */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}
.subject-card {
    background: white; border-radius: 14px; padding: 14px 10px 12px;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: pointer; transition: transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.subject-card:active { transform: scale(0.96); }
.subject-ring {
    position: relative; width: 68px; height: 68px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
}
.subject-ring-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.subject-ring-track { fill: none; stroke: #ece9f4; stroke-width: 5; }
.subject-ring-fill  { fill: none; stroke: var(--lp-success); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.3s ease; }
.subject-svg { width: 60px; height: 60px; margin: 0; display: flex; align-items: center; justify-content: center; }
.subject-svg svg { width: 60px; height: 60px; }
.subject-name   { font-size: 0.78rem; color: #1a1a2e; line-height: 1.35; }
.subject-passed { font-size: 0.66rem; color: var(--lp-success); margin-top: 4px; font-weight: 700; }

/* ===== Lesson Cards ===== */
.lesson-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}
.lesson-card {
    background: white; border-radius: 16px; padding: 24px 12px 20px;
    text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    cursor: pointer; border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.lesson-card:active { transform: scale(0.96); border-color: var(--lp-primary); }
.lesson-icon { font-size: 2.2rem; margin-bottom: 10px; }
.lesson-name { font-size: 0.88rem; font-weight: 700; color: #1a1a2e; }
.lesson-desc { font-size: 0.68rem; color: #b0b0c0; margin-top: 5px; line-height: 1.4; }

/* ===== Topic word list ===== */
.topic-word-list { list-style: none; padding: 0; margin: 0; }
.topic-word-row {
    display: grid; grid-template-columns: 34px 1fr 1fr 40px;
    align-items: center; gap: 10px;
    background: white; border-radius: 10px; padding: 8px 12px;
    margin-bottom: 7px; box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}
.topic-word-num   { font-size: 0.78rem; font-weight: 700; color: #b0b0c0; text-align: center; }
.topic-word-study { font-size: 0.95rem; font-weight: 700; color: #1a1a2e; overflow-wrap: anywhere; }
.topic-word-trans { font-size: 0.88rem; color: #757575; overflow-wrap: anywhere; }
.topic-word-speak {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--lp-primary); color: white; font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(123,92,245,0.3); -webkit-tap-highlight-color: transparent;
}
.topic-word-speak:active { transform: scale(0.92); }

/* ===== Settings ===== */
.settings-label {
    font-size: 0.72rem; color: #b0b0c0; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.lp-input, .lp-select {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid #e8e8f0; border-radius: 10px;
    font-size: 0.95rem; outline: none; box-sizing: border-box;
    margin-bottom: 12px; font-family: inherit;
}
.lp-input:focus, .lp-select:focus { border-color: var(--lp-primary); }
.lp-select { background: white; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23b0b0c0'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.lp-success-msg { color: var(--lp-success); text-align: center; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }

/* ===== Registration ===== */
.lp-register-wrap {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; align-items: center;
    padding: 24px 16px;
    background: linear-gradient(145deg, var(--lp-primary) 0%, var(--lp-primary-dark) 100%);
    box-sizing: border-box;
}
.lp-register-card {
    /* auto top/bottom margins center the card when it's shorter than the viewport,
       and collapse to 0 (instead of clipping the top, as justify-content:center would)
       once it's taller than the viewport and needs to scroll from the top. */
    margin: auto 0;
    background: white; border-radius: 22px; padding: 28px 24px;
    width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}
.lp-register-logo   { text-align: center; font-size: 2.8rem; margin-bottom: 4px; }
.lp-register-title  { font-size: 1.4rem; font-weight: 800; color: var(--lp-primary-dark); text-align: center; margin: 0 0 4px; }
.lp-register-subtitle { font-size: 0.82rem; color: #b0b0c0; text-align: center; margin: 0 0 22px; }
.lp-field-label { font-size: 0.78rem; color: #757575; font-weight: 600; margin-bottom: 4px; }
.lp-register-switch { text-align: center; font-size: 0.85rem; color: #757575; margin: 16px 0 0; }
.lp-register-switch a { color: var(--lp-primary); font-weight: 700; text-decoration: none; }

/* ===== Login ===== */
.login-tabs { display: flex; gap: 6px; background: #f4f4f8; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.login-tab {
    flex: 1; padding: 9px 0; border: none; border-radius: 8px; background: transparent;
    font-size: 0.85rem; font-weight: 700; color: #9e9e9e; cursor: pointer; font-family: inherit;
}
.login-tab.active { background: white; color: var(--lp-primary-dark); box-shadow: 0 1px 5px rgba(0,0,0,0.08); }
.login-remember { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #757575; margin: 6px 0 16px; cursor: pointer; }
.qr-login-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.qr-login-image { width: 220px; height: 220px; border-radius: 12px; border: 1px solid #f0f0f0; margin-bottom: 14px; }
.qr-login-hint { font-size: 0.8rem; color: #9e9e9e; line-height: 1.5; margin: 0; }

/* ===== Game – Top Bar ===== */
.game-topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.game-lives { font-size: 0.88rem; color: #e50000; font-weight: 700; }

/* ===== Game – Result Card ===== */
.game-result-card {
    background: white; border-radius: 20px; padding: 32px 24px;
    text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    margin: 16px 0;
}
.game-result-icon  { font-size: 3rem; margin-bottom: 12px; }
.game-result-title { font-size: 1.2rem; font-weight: 800; color: #1a1a2e; margin-bottom: 6px; }
.game-result-sub   { font-size: 0.88rem; color: #9e9e9e; margin-bottom: 18px; }

/* ===== Game – Cards (shared) ===== */
.game-card {
    background: white; border-radius: 14px; padding: 10px;
    text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
    -webkit-tap-highlight-color: transparent; overflow: hidden;
}
.game-card:active         { transform: scale(0.96); }
.game-card.matched        { border: 2.5px solid var(--lp-success); background: #e8f5e9; }
.game-card.wrong-flash    { border: 2.5px solid var(--lp-error);   background: #ffebee; animation: flash 0.35s; }
.game-card.correct-answer { border: 2.5px solid var(--lp-success); background: #e8f5e9; }
.game-card.wrong-answer   { border: 2.5px solid var(--lp-error);   background: #ffebee; }
.game-card.selected       { border: 2.5px solid var(--lp-primary); background: #ede7ff; }
.game-card-svg  { width: 70px; height: 70px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; }
.game-card-svg svg { width: 70px; height: 70px; }
.game-card-label { font-size: 0.72rem; color: #424242; line-height: 1.3; }

@keyframes flash {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ===== Game – 4-card & 3-col grids ===== */
.game-cards-grid4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.game-cards-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

/* ===== FindMe – Target area ===== */
.game-find-target {
    background: white; border-radius: 14px; padding: 14px;
    text-align: center; margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.game-find-target-svg  { width: 90px; height: 90px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; }
.game-find-target-svg svg { width: 90px; height: 90px; }
.game-find-target-word { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; }

/* ===== Sequence Game ===== */
.seq-top-area {
    background: white; border-radius: 14px; padding: 16px;
    margin-bottom: 12px; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.seq-countdown {
    font-size: 3rem; font-weight: 800; color: var(--lp-primary);
    animation: seq-pop 0.25s ease-out;
}
@keyframes seq-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}
.seq-top-text   { font-size: 0.88rem; color: #9e9e9e; margin-bottom: 6px; }
.seq-round-info { font-size: 0.8rem; color: var(--lp-primary); font-weight: 700; }
.seq-card {
    background: white; border-radius: 12px; padding: 8px 4px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    cursor: pointer; position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s;
}
.seq-card:active { transform: scale(0.94); }
.seq-card.correct-answer { border: 2px solid var(--lp-success); background: #e8f5e9; }
.seq-card.wrong-answer   { border: 2px solid var(--lp-error);   background: #ffebee; }
.seq-badge {
    position: absolute; top: 6px; right: 6px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--lp-primary); color: white;
    font-size: 0.7rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* ===== Rocket Game ===== */
.rocket-progress {
    background: white;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.rocket-track {
    position: relative;
    height: 18px;
    border-radius: 10px;
    background: #e8e8f0;
    overflow: hidden;
}
.rocket-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lp-accent), var(--lp-success));
    border-radius: 10px;
    transition: width 0.28s ease;
}
.rocket-ship {
    position: absolute;
    top: -5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lp-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 7px rgba(61,31,160,0.25);
    transition: left 0.28s ease;
}
.rocket-round {
    margin-top: 8px;
    color: var(--lp-primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}
.rocket-stage {
    background:
        radial-gradient(circle at 18% 28%, rgba(255,255,255,0.8) 0 10px, transparent 11px),
        linear-gradient(180deg, #dff5ff 0%, #fff8e6 100%);
    border-radius: 16px;
    min-height: 220px;
    padding: 18px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.rocket-stage.rocket-boost {
    animation: rocket-boost 0.35s ease-out;
}
.rocket-target {
    text-align: center;
}
.rocket-target-svg {
    width: 128px;
    height: 128px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rocket-target-svg svg {
    width: 128px;
    height: 128px;
}
.rocket-target-hint {
    font-size: 0.72rem;
    color: #9e9e9e;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.rocket-target-translation {
    margin-top: 4px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a2e;
}
.rocket-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.rocket-option {
    min-height: 58px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: white;
    color: #1a1a2e;
    font-size: 0.9rem;
    font-weight: 800;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    word-break: break-word;
}
.rocket-option:active {
    transform: scale(0.96);
    border-color: var(--lp-primary);
}
.rocket-option:disabled {
    cursor: default;
}
.rocket-option.correct-answer {
    border-color: var(--lp-success);
    background: #e8f5e9;
}
.rocket-option.wrong-answer {
    border-color: var(--lp-error);
    background: #ffebee;
}
@keyframes rocket-boost {
    0% { transform: translateY(0); }
    45% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

/* ===== Zombie Arena ===== */
.zombie-arena {
    min-height: 100vh;
    color: #f7f7f2;
    background:
        radial-gradient(circle at 50% 35%, rgba(100, 210, 120, 0.2), transparent 28%),
        linear-gradient(145deg, #15180f 0%, #262116 45%, #0d1110 100%);
    padding: 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}
.zombie-hud {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 54px;
}
.zombie-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.34);
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.zombie-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.zombie-title span {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.zombie-title small {
    color: #b7c7a9;
    font-size: 0.72rem;
    font-weight: 700;
}
.zombie-hp {
    display: flex;
    gap: 5px;
}
.zombie-hp span {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.12);
}
.zombie-hp span.live {
    background: #e14d42;
    box-shadow: 0 0 12px rgba(225,77,66,0.55);
}
.zombie-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 50%, rgba(226, 191, 89, 0.16) 0 12%, transparent 13%),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 60px),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.22));
    box-shadow: inset 0 0 50px rgba(0,0,0,0.48), 0 16px 35px rgba(0,0,0,0.35);
    overflow: hidden;
}
.zombie-stage.cleared {
    animation: zombie-clear 0.3s ease-out;
}
.zombie-stage.hit {
    animation: zombie-hit 0.28s ease-out;
}
.zombie-wavebar {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 16px;
    height: 7px;
    border-radius: 6px;
    background: rgba(255,255,255,0.14);
    overflow: hidden;
}
.zombie-wavefill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #e4c15c, #71d05d);
    transition: width 0.24s ease;
}
.zombie-target {
    position: absolute;
    left: 50%;
    top: 48%;
    width: min(210px, 56vw);
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}
.zombie-target-svg {
    width: 132px;
    height: 132px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(0,0,0,0.22), 0 12px 30px rgba(0,0,0,0.35);
}
.zombie-target-svg svg {
    width: 104px;
    height: 104px;
}
.zombie-target-label {
    color: #b7c7a9;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.zombie-target-word {
    color: white;
    font-size: 1.35rem;
    font-weight: 950;
    text-shadow: 0 2px 10px rgba(0,0,0,0.65);
    word-break: break-word;
}
.zombie-ring {
    position: absolute;
    inset: 54px 14px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: min(26vw, 120px) 14px;
    align-items: center;
    justify-items: center;
}
.zombie-enemy {
    width: min(150px, 39vw);
    min-height: 84px;
    border: 2px solid rgba(173, 217, 117, 0.34);
    border-radius: 16px;
    background: linear-gradient(180deg, #31472f, #172016);
    color: #f7f7f2;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.zombie-enemy:nth-child(odd) {
    animation: zombie-sway-a 1.8s ease-in-out infinite;
}
.zombie-enemy:nth-child(even) {
    animation: zombie-sway-b 2s ease-in-out infinite;
}
.zombie-enemy:active {
    transform: scale(0.94);
}
.zombie-enemy:disabled {
    cursor: default;
}
.zombie-enemy.correct-answer {
    border-color: #8ef173;
    background: linear-gradient(180deg, #3f8f34, #1d411b);
}
.zombie-enemy.wrong-answer {
    border-color: #ff695d;
    background: linear-gradient(180deg, #82362f, #351210);
}
.zombie-face {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #9ac46d;
    color: #182015;
    font-size: 1rem;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
}
.zombie-word {
    font-size: 0.88rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
}
.zombie-message {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}
.zombie-message-kicker {
    color: #b7c7a9;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.zombie-message-title {
    font-size: 2rem;
    font-weight: 950;
    text-transform: uppercase;
}
.zombie-message-sub {
    color: #d6dfc8;
    font-size: 0.95rem;
    font-weight: 700;
}
.zombie-message.danger .zombie-message-title {
    color: #ff7469;
}
.zombie-message.win .zombie-message-title {
    color: #9ff083;
}
.zombie-action {
    min-width: 190px;
    min-height: 46px;
    border: none;
    border-radius: 12px;
    background: #e4c15c;
    color: #16180f;
    font-size: 0.9rem;
    font-weight: 950;
    font-family: inherit;
    cursor: pointer;
}
.zombie-action.ghost {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.28);
}
@keyframes zombie-clear {
    0% { box-shadow: inset 0 0 50px rgba(0,0,0,0.48), 0 0 0 rgba(113,208,93,0); }
    60% { box-shadow: inset 0 0 50px rgba(0,0,0,0.48), 0 0 32px rgba(113,208,93,0.45); }
    100% { box-shadow: inset 0 0 50px rgba(0,0,0,0.48), 0 16px 35px rgba(0,0,0,0.35); }
}
@keyframes zombie-hit {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
@keyframes zombie-sway-a {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-5px) rotate(1deg); }
}
@keyframes zombie-sway-b {
    0%, 100% { transform: translateY(0) rotate(1deg); }
    50% { transform: translateY(5px) rotate(-1deg); }
}

@media (min-width: 768px) {
    .zombie-arena {
        padding: 22px;
    }
    .zombie-target-svg {
        width: 154px;
        height: 154px;
    }
    .zombie-target-svg svg {
        width: 122px;
        height: 122px;
    }
    .zombie-enemy {
        width: 172px;
        min-height: 96px;
    }
}

/* ===== Listen Game – Progress ===== */
.listen-progress-wrap { margin-bottom: 10px; }
.listen-progress-bar  { height: 5px; background: #e0e0e8; border-radius: 3px; overflow: hidden; }
.listen-progress-fill { height: 100%; background: linear-gradient(90deg, var(--lp-primary), #b39ddb); border-radius: 3px; transition: width 0.3s; }
.listen-progress-text { font-size: 0.72rem; color: #b0b0c0; text-align: right; margin-top: 2px; }

/* ===== Listen Game – Target row ===== */
.listen-target-row {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin: 14px 0;
}
.listen-speak-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--lp-primary); border: none; color: white;
    font-size: 1.2rem; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(123,92,245,0.3);
    -webkit-tap-highlight-color: transparent;
}
.listen-target-word { font-size: 1.3rem; font-weight: 800; color: #1a1a2e; }

/* ===== Steps Game – 3-col layout ===== */
.steps-layout {
    display: grid;
    grid-template-columns: 52px 1fr 62px;
    gap: 8px;
    align-items: start;
}
.steps-lifelines {
    display: flex; flex-direction: column; gap: 10px; padding-top: 10px;
}
.lifeline-btn {
    width: 44px; height: 44px; border-radius: 10px;
    border: 2px solid var(--lp-primary); background: white;
    color: var(--lp-primary); font-size: 0.72rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent; flex-shrink: 0;
    transition: opacity 0.15s;
}
.lifeline-btn.used { border-color: #e0e0e0; color: #c0c0c0; cursor: not-allowed; }
.steps-center { min-width: 0; }
.steps-svg-wrap {
    width: 100px; height: 100px; margin: 0 auto 8px;
    display: flex; align-items: center; justify-content: center;
}
.steps-svg-wrap svg { width: 100px; height: 100px; }
.steps-translation { text-align: center; font-size: 1rem; font-weight: 700; color: #1a1a2e; margin-bottom: 10px; }

/* ===== Audience panel ===== */
.audience-panel {
    background: #f9f9fd; border-radius: 12px; padding: 12px;
    margin-bottom: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.audience-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.audience-row.audience-correct .audience-letter { color: var(--lp-success); }
.audience-letter { font-size: 0.78rem; font-weight: 700; width: 14px; flex-shrink: 0; color: #757575; }
.audience-bar-wrap { flex: 1; height: 12px; background: #e8e8f0; border-radius: 6px; overflow: hidden; }
.audience-bar { height: 100%; background: var(--lp-primary); border-radius: 6px; transition: width 0.5s; }
.audience-correct .audience-bar { background: var(--lp-success); }
.audience-pct { font-size: 0.72rem; color: #757575; width: 30px; text-align: right; flex-shrink: 0; }

/* ===== Answer Options (Steps + Letter Test) ===== */
.answer-option {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 12px;
    background: white; border: 2px solid #e8e8f0; border-radius: 10px;
    font-size: 0.88rem; color: #1a1a2e; cursor: pointer;
    margin-bottom: 7px; text-align: left; transition: border-color 0.15s;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.answer-option:active    { border-color: var(--lp-primary); }
.answer-option.correct-answer { border-color: var(--lp-success); background: #e8f5e9; }
.answer-option.wrong-answer   { border-color: var(--lp-error);   background: #ffebee; }
.answer-option.selected       { border-color: var(--lp-primary); background: #ede7ff; }
.answer-letter { font-weight: 700; color: var(--lp-primary); min-width: 16px; }
.answer-word   { flex: 1; }

/* ===== Steps Ladder ===== */
.steps-ladder {
    display: flex; flex-direction: column; gap: 3px;
}
.step-item {
    padding: 3px 5px; border-radius: 4px;
    font-size: 0.6rem; font-weight: 600; text-align: center;
    background: #e8e8f0; color: #9e9e9e;
    border: 1px solid transparent;
}
.step-item.passed    { background: #e8f5e9; color: var(--lp-success); }
.step-item.current   { background: var(--lp-primary); color: white; border-color: var(--lp-primary-dark); }
.step-item.milestone { border: 1px solid var(--lp-accent); }
.step-item.milestone.passed { background: #fff3e0; color: var(--lp-accent); border-color: var(--lp-accent); }
.step-num { display: block; }

/* ===== Letter Selection ===== */
.letter-hero { text-align: center; margin: 10px 0 18px; }
.letter-hero-circle {
    width: 90px; height: 90px; border-radius: 50%;
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    color: white; font-size: 2.8rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px; box-shadow: 0 4px 18px rgba(123,92,245,0.35);
}
.letter-hero-label { font-size: 0.82rem; color: #9e9e9e; }

.letter-preview-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 18px;
}
.letter-preview-card {
    background: white; border-radius: 12px; padding: 8px 4px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.letter-preview-svg  { width: 54px; height: 54px; margin: 0 auto 4px; display: flex; align-items: center; justify-content: center; }
.letter-preview-svg svg { width: 54px; height: 54px; }
.letter-preview-name { font-size: 0.66rem; color: #424242; line-height: 1.3; }

.letter-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

/* ===== Letter Test ===== */
.letter-test-card {
    background: white; border-radius: 16px; padding: 20px;
    text-align: center; margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.letter-test-svg  { width: 110px; height: 110px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.letter-test-svg svg { width: 110px; height: 110px; }
.letter-test-word { font-size: 1.3rem; font-weight: 800; color: #1a1a2e; }
.letter-options-list { display: flex; flex-direction: column; gap: 2px; }

/* ===== Letter Recall ===== */
.recall-card {
    background: white; border-radius: 16px; padding: 20px;
    text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.recall-svg  { width: 120px; height: 120px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.recall-svg svg { width: 120px; height: 120px; }
.recall-translation { font-size: 1.1rem; color: #757575; margin-bottom: 16px; }
.recall-revealed    { font-size: 1.4rem; font-weight: 800; color: var(--lp-primary); margin-bottom: 4px; }
.recall-btn {
    flex: 1; padding: 12px; border-radius: 10px; border: none;
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
    font-family: inherit; -webkit-tap-highlight-color: transparent;
}
.recall-correct { background: var(--lp-success); color: white; }
.recall-wrong   { background: #e0e0e0; color: #424242; }

/* ===== Outline button variant ===== */
.lp-btn-outline {
    background: transparent; color: var(--lp-primary);
    border: 2px solid var(--lp-primary);
}
.lp-btn-outline:disabled { border-color: #e0e0e0; color: #b0b0c0; }

/* ===== Site Layout ===== */
.site-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #f0f0f8;
}
.site-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--lp-primary) 0%, var(--lp-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 16px rgba(61,31,160,0.25);
}
.site-sidebar-brand {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}
.site-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}
.site-brand-name {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.site-nav-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
}
.site-nav-list li { display: block; }
.site-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: pointer;
    letter-spacing: 0.2px;
}
.site-nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}
.site-nav-link.active {
    background: rgba(255,255,255,0.18);
    color: white;
    border-left-color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.site-nav-icon { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
.site-nav-logo { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }

/* ===== Sidebar logout + confirmation modal ===== */
.site-logout-link {
    background: none; border: none; width: 100%; text-align: left;
    font: inherit; letter-spacing: 0.2px; cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
}
.site-logout-link:hover { background: rgba(255,255,255,0.12); color: white; }

.confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 300; padding: 20px;
}
.confirm-modal {
    background: white; border-radius: 16px; padding: 24px;
    max-width: 340px; width: 100%; text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.confirm-modal-title { font-size: 1.05rem; font-weight: 800; color: #1a1a2e; margin: 0 0 8px; }
.confirm-modal-sub   { font-size: 0.85rem; color: #9e9e9e; margin: 0 0 20px; }
.confirm-modal-actions { display: flex; gap: 10px; }
.confirm-modal-actions .lp-btn,
.confirm-modal-actions .lp-btn-outline {
    flex: 1; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
}
.site-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.site-main-full { width: 100%; }
.site-body-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* ===== Site Home Page ===== */
.site-home {
    padding: 40px 32px;
    max-width: 800px;
}
.site-home-hero { margin-bottom: 36px; }
.site-home-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 0 0 8px;
}
.site-home-sub {
    font-size: 1rem;
    color: #9e9e9e;
    margin: 0;
}
.site-home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.site-home-card {
    background: white;
    border-radius: 18px;
    padding: 28px 20px 24px;
    text-align: center;
    box-shadow: 0 3px 16px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.site-home-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}
.site-home-card-icon {
    width: 72px; height: 72px;
    border-radius: 16px;
    margin: 0 auto 14px;
    display: block;
}
.site-home-card-emoji { font-size: 3rem; display: block; margin-bottom: 10px; }
.site-home-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.site-home-card-desc {
    font-size: 0.78rem;
    color: #9e9e9e;
    line-height: 1.5;
}

/* ===== Generic site page ===== */
.site-page-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}
.site-page-hero { max-width: 400px; }
.site-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a2e;
    margin: 12px 0 8px;
}
.site-page-sub { font-size: 0.95rem; color: #9e9e9e; }

/* ===== LP App inside site layout ===== */
.lp-app {
    height: 100%;
}

/* ===== Mobile/Hamburger elements (hidden by default on desktop) ===== */
.site-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}
.site-mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 48px;
    background: linear-gradient(135deg, var(--lp-primary), var(--lp-primary-dark));
    border-bottom: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 2px 10px rgba(61,31,160,0.3);
    flex-shrink: 0;
}
.site-hamburger {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    font-family: inherit;
    border-radius: 6px;
    transition: background 0.15s;
}
.site-hamburger:hover { background: rgba(255,255,255,0.1); }
.site-mobile-title {
    text-decoration: none;
    color: white;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.lp-hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    font-family: inherit;
    border-radius: 6px;
    transition: background 0.15s;
    margin-right: 2px;
}
.lp-hamburger:hover { background: rgba(255,255,255,0.15); }

/* ===== Responsive breakpoints ===== */

/* Mobile (≤767px): drawer sidebar, full-width LP */
@media (max-width: 767px) {
    .site-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(.4,0,.2,1);
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    }
    .site-sidebar.open {
        transform: translateX(0);
    }
    .site-mobile-header {
        display: flex;
    }
    .lp-hamburger {
        display: block;
    }
    .lp-app {
        max-width: 100%;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    .lp-loading {
        height: 100%;
    }
}

/* Desktop (≥768px): static sidebar, wider LP content */
/* ===== Exam ===== */
.exam-page {
    padding: 24px 20px 40px;
    max-width: 640px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}
.exam-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.exam-count-btn {
    padding: 10px 0; border-radius: 10px; border: 1.5px solid #e0e0e0;
    background: white; color: #1a1a2e; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: transform 0.1s;
}
.exam-count-btn:active { transform: scale(0.94); }
.exam-count-btn.selected { border-color: var(--lp-primary); background: #ede7ff; color: var(--lp-primary-dark); }

.exam-quiz-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.exam-quiz-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center;
    background: white; border-radius: 12px; padding: 12px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.exam-quiz-translation { font-size: 0.95rem; font-weight: 600; color: #1a1a2e; }
.exam-quiz-input {
    width: 100%; padding: 9px 12px; border: 1.5px solid #e0e0e0; border-radius: 9px;
    font-size: 0.9rem; outline: none; box-sizing: border-box; font-family: inherit;
}
.exam-quiz-input:focus { border-color: var(--lp-primary); }

.exam-mistakes-list { display: flex; flex-direction: column; gap: 7px; }
.exam-mistake-row {
    background: white; border-radius: 10px; padding: 10px 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}
.exam-mistake-translation { font-size: 0.8rem; color: #9e9e9e; margin-bottom: 4px; }
.exam-mistake-answers { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; font-weight: 600; }
.exam-mistake-entered { color: var(--lp-error); text-decoration: line-through; }
.exam-mistake-arrow { color: #c8c8d8; }
.exam-mistake-correct { color: var(--lp-success); }

@media (min-width: 768px) {
    .site-overlay  { display: none !important; }
    .site-sidebar  { transform: none !important; position: static; z-index: auto; box-shadow: none; }
    .site-mobile-header { display: none !important; }
    .lp-hamburger  { display: none !important; }

    .lp-app {
        max-width: none;
        margin: 0;
        box-shadow: none;
        border-radius: 0;
    }
    .lp-content {
        padding: 24px 32px calc(var(--lp-tabs-h) + 24px);
    }
    .lp-loading {
        height: 100%;
    }

    /* Wider grids on desktop */
    .book-grid         { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .letter-grid       { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
    .game-cards-grid2  { grid-template-columns: repeat(4, 1fr); }
    .game-cards-grid4  { grid-template-columns: repeat(4, 1fr); }

    /* Site home: bigger padding on desktop */
    .site-home {
        padding: 52px 48px;
    }
}

/* ===== User avatar ===== */
.user-avatar {
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
}
.user-avatar svg, .user-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-avatar-fallback {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--lp-accent); color: white; font-weight: 800; font-size: 0.9em;
}

/* ===== Sidebar user card ===== */
.site-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.site-user-name {
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-mobile-user { margin-left: auto; display: flex; align-items: center; }

/* ===== Avatar picker (Registration) ===== */
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.avatar-picker-item {
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 2px;
    background: #f4f4f8;
    cursor: pointer;
    aspect-ratio: 1;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.avatar-picker-item svg { width: 100%; height: 100%; display: block; }
.avatar-picker-item.selected {
    border-color: var(--lp-primary);
    box-shadow: 0 0 0 2px rgba(123,92,245,0.25);
}
.avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.avatar-upload-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--lp-primary);
    border: 1.5px dashed var(--lp-primary);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}
.avatar-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
