/* ============================================
   Chulbul Preschool - Redesigned UI
   Modern, colorful, kid-friendly design
   ============================================ */

/* Force light mode — prevent dark mode from changing colors */
:root { color-scheme: light only; }
@media (prefers-color-scheme: dark) {
    :root { color-scheme: light only; }
    html, body { background: #FFF9F3 !important; color: #1F2937 !important; }
}

/* ---------- CSS Variables ---------- */
:root {
    /* Primary palette - Warm Orange */
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8F66;
    --primary-lightest: #FFF3ED;
    --primary-gradient: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    --primary-gradient-h: linear-gradient(90deg, #FF6B35 0%, #F7931E 100%);

    /* Secondary - Golden */
    --secondary: #F7931E;
    --secondary-dark: #E07A00;
    --secondary-light: #FFB347;

    /* Accent colors */
    --green: #2ECC71;
    --green-dark: #27AE60;
    --green-light: #E8F8F0;
    --blue: #3498DB;
    --blue-dark: #2E86C1;
    --blue-light: #EBF5FB;
    --purple: #9B59B6;
    --purple-light: #F4ECF7;
    --red: #E74C3C;
    --red-light: #FDEDEC;
    --pink: #E91E63;
    --teal: #1ABC9C;

    /* Text */
    --brown: #4A1B0C;
    --brown-light: #854F0B;
    --text-primary: #2C2C2C;
    --text-secondary: #666666;
    --text-hint: #999999;
    --text-white: #FFFFFF;

    /* Game colors */
    --correct: #2ECC71;
    --correct-light: #E8F8F0;
    --incorrect: #E74C3C;
    --incorrect-light: #FDEDEC;

    /* Status */
    --present: #2ECC71;
    --absent: #E74C3C;
    --late: #F39C12;
    --holiday: #9B59B6;

    /* Surfaces */
    --bg: #FFF9F3;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-warm: #FFF3E0;
    --bg-overlay: rgba(0, 0, 0, 0.5);
    --bg-overlay-light: rgba(0, 0, 0, 0.15);

    /* Borders */
    --border: #F0E6DC;
    --border-light: #F8F0E8;
    --divider: #F5EDE5;

    /* Shadows */
    --shadow-sm: 0 1px 4px rgba(74, 27, 12, 0.06);
    --shadow-md: 0 2px 10px rgba(74, 27, 12, 0.08);
    --shadow-lg: 0 4px 20px rgba(74, 27, 12, 0.12);
    --shadow-xl: 0 8px 32px rgba(74, 27, 12, 0.16);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-xs: 11px;
    --font-sm: 13px;
    --font-md: 15px;
    --font-lg: 17px;
    --font-xl: 20px;
    --font-xxl: 24px;
    --font-hero: 32px;

    /* Safe areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Layout */
    --app-bar-height: 56px;
    --bottom-nav-height: 64px;
    --fab-size: 56px;
}


/* ---------- Reset / Normalize ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* Prevent overscroll bounce on iOS */
html, body { overscroll-behavior: none; }


/* ---------- Layout ---------- */
#app {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
}

#page-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

.page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    animation: pageFadeIn 0.25s ease-out;
    background: var(--bg);
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-with-bar {
    padding-top: calc(var(--app-bar-height) + var(--safe-top));
}

.page-with-bottom-nav {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
}

.page-content {
    padding: var(--space-md);
}


/* ---------- App Bar ---------- */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--app-bar-height) + var(--safe-top));
    padding-top: var(--safe-top);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    z-index: 100;
    gap: 12px;
}

.app-bar-back {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: var(--text-white);
    font-size: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.app-bar-back:active { background: rgba(255,255,255,0.3); }

.app-bar-title {
    flex: 1;
    color: var(--text-white);
    font-size: var(--font-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-bar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.app-bar-btn:active { background: rgba(255,255,255,0.3); }

.app-bar-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.app-bar-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Green app bar variant (for teacher) */
.app-bar-green {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
}


/* ---------- Bottom Navigation ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-light);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    gap: 2px;
    border: none;
    background: none;
    color: var(--text-hint);
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s;
    min-width: 56px;
    position: relative;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}


/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 0.5px solid var(--border-light);
    margin-bottom: var(--space-md);
    transition: transform 0.15s, box-shadow 0.15s;
}
.card:active { transform: scale(0.985); }

.card-padded {
    padding: var(--space-md);
}

.card-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--space-md);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.card-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

.card-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-sm);
}


/* ---------- Stat Cards ---------- */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    border: 0.5px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
    font-size: var(--font-xxl);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: var(--font-xs);
    color: var(--text-hint);
    margin-top: 4px;
}


/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}
.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(255, 107, 53, 0.2);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--brown);
    border: 1.5px solid var(--border);
}
.btn-secondary:active { background: var(--bg); }

.btn-green {
    background: linear-gradient(135deg, #27AE60, #2ECC71);
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.btn-danger {
    background: var(--red);
    color: var(--text-white);
}

.btn-ghost {
    background: none;
    color: var(--primary);
    border: none;
    padding: 8px 16px;
}

.btn-block { width: 100%; }

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-lg);
    min-height: 52px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

.btn-pill {
    border-radius: 24px;
    padding: 8px 18px;
    font-size: var(--font-sm);
}


/* ---------- Forms ---------- */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder {
    color: var(--text-hint);
}

.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    color: var(--text-primary);
    background: var(--bg-white);
    resize: vertical;
    min-height: 100px;
    outline: none;
    transition: border-color 0.2s;
}
.form-textarea:focus { border-color: var(--primary); }

.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--font-md);
    color: var(--text-primary);
    background: var(--bg-white);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    outline: none;
}
.form-select:focus { border-color: var(--primary); }

.form-phone-input {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-white);
    transition: border-color 0.2s;
}
.form-phone-input:focus-within { border-color: var(--primary); }

.form-phone-prefix {
    padding: 14px;
    font-size: var(--font-md);
    color: var(--text-secondary);
    background: var(--bg);
    border-right: 1px solid var(--border);
    font-weight: 600;
    flex-shrink: 0;
}

.form-phone-input input {
    flex: 1;
    border: none;
    padding: 14px;
    font-size: var(--font-md);
    outline: none;
    background: transparent;
}


/* ---------- Avatar ---------- */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-white);
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }
.avatar-xxl { width: 100px; height: 100px; font-size: 36px; }

.avatar-orange { background: linear-gradient(135deg, #FFE0B2, #FFCC80); color: #E67E22; }
.avatar-pink { background: linear-gradient(135deg, #F8BBD0, #F48FB1); color: #C2185B; }
.avatar-green { background: linear-gradient(135deg, #C8E6C9, #A5D6A7); color: #2E7D32; }
.avatar-blue { background: linear-gradient(135deg, #BBDEFB, #90CAF9); color: #1565C0; }
.avatar-purple { background: linear-gradient(135deg, #D1C4E9, #B39DDB); color: #6A1B9A; }
.avatar-teal { background: linear-gradient(135deg, #B2DFDB, #80CBC4); color: #00695C; }
.avatar-red { background: linear-gradient(135deg, #FFCDD2, #EF9A9A); color: #C62828; }

/* Cycle colors for lists */
.avatar-0 { background: linear-gradient(135deg, #FFE0B2, #FFCC80); color: #E67E22; }
.avatar-1 { background: linear-gradient(135deg, #F8BBD0, #F48FB1); color: #C2185B; }
.avatar-2 { background: linear-gradient(135deg, #C8E6C9, #A5D6A7); color: #2E7D32; }
.avatar-3 { background: linear-gradient(135deg, #BBDEFB, #90CAF9); color: #1565C0; }
.avatar-4 { background: linear-gradient(135deg, #D1C4E9, #B39DDB); color: #6A1B9A; }
.avatar-5 { background: linear-gradient(135deg, #B2DFDB, #80CBC4); color: #00695C; }
.avatar-6 { background: linear-gradient(135deg, #FFCDD2, #EF9A9A); color: #C62828; }


/* ---------- List Items ---------- */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.15s;
}
.list-item:active { background: var(--bg); }
.list-item:last-child { border-bottom: none; }

.list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.list-avatar-lg { width: 56px; height: 56px; }

.list-content {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-subtitle {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-meta {
    font-size: var(--font-xs);
    color: var(--text-hint);
    margin-top: 2px;
}

.list-trailing {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}


/* ---------- Dashboard / Home Header ---------- */
.dashboard-header {
    background: var(--primary-gradient);
    padding: 12px var(--space-md) var(--space-md);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.dashboard-greeting {
    color: var(--text-white);
    font-size: var(--font-xl);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.dashboard-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: var(--font-sm);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}


/* ---------- Profile Header ---------- */
.profile-header {
    background: var(--primary-gradient);
    padding: 12px var(--space-md) 24px;
    text-align: center;
    position: relative;
}
/* When profile header follows an app-bar, eliminate the gap */
.page-with-bar > .page-content > .profile-header:first-child,
.page-with-bar > .profile-header {
    margin-top: -1px;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.8);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #E67E22;
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    margin: 0 auto;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.profile-name {
    color: var(--text-white);
    font-size: var(--font-xl);
    font-weight: 600;
    margin-top: 12px;
}

.profile-sub {
    color: rgba(255,255,255,0.85);
    font-size: var(--font-sm);
    margin-top: 4px;
}

.profile-info {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin: -16px var(--space-md) 0;
    padding: var(--space-md);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-md);
    border: 0.5px solid var(--border-light);
}


/* ---------- Action Grid (Home Page) ---------- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: var(--space-md);
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s;
    background: var(--bg-card);
    border: 0.5px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    min-height: 0;
}
.action-item:active { transform: scale(0.95); }

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
}


/* ---------- Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-white);
    background: var(--red);
}

.badge-sm {
    min-width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 4px;
}

.badge-success { background: var(--green); }
.badge-warning { background: var(--secondary); }


/* ---------- Tab Bar ---------- */
.tab-bar {
    display: flex;
    background: var(--bg-white);
    border-bottom: 1px solid var(--divider);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-hint);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s;
    min-height: 44px;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}


/* ---------- FAB (Floating Action Button) ---------- */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
    right: 20px;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab:active { transform: scale(0.9); }


/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: var(--space-xxl) var(--space-md);
    color: var(--text-hint);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: var(--font-sm);
    color: var(--text-hint);
    line-height: 1.5;
}


/* ---------- Chat ---------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    padding-top: calc(var(--app-bar-height) + var(--safe-top) + var(--space-md));
    padding-bottom: 80px;
    -webkit-overflow-scrolling: touch;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    margin-bottom: 6px;
    font-size: var(--font-md);
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.chat-bubble-mine {
    background: var(--primary);
    color: var(--text-white);
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.chat-bubble-other {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
    border-bottom-left-radius: 6px;
}

.chat-time {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
}

.chat-date-divider {
    text-align: center;
    padding: 12px 0;
}

.chat-date-divider span {
    background: var(--bg);
    padding: 4px 14px;
    border-radius: 12px;
    font-size: var(--font-xs);
    color: var(--text-hint);
    font-weight: 500;
}

.chat-input-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
    background: var(--bg-white);
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    z-index: 100;
}

.chat-input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: var(--font-md);
    max-height: 120px;
    resize: none;
    outline: none;
    background: var(--bg);
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--primary); }

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}
.chat-send-btn:active { transform: scale(0.9); }

.chat-attach-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-image-preview {
    max-width: 200px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}
.chat-image-preview img {
    width: 100%;
    border-radius: 12px;
}

.chat-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    cursor: pointer;
}


/* ---------- Attendance ---------- */
.attendance-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    justify-items: center;
}

.attendance-day {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    font-weight: 500;
    cursor: default;
}

.attendance-present { background: var(--correct-light); color: var(--correct); font-weight: 700; }
.attendance-absent { background: var(--incorrect-light); color: var(--incorrect); font-weight: 700; }
.attendance-late { background: #FFF3E0; color: var(--late); font-weight: 700; }
.attendance-holiday { background: var(--purple-light); color: var(--holiday); font-weight: 700; }
.attendance-day.today { box-shadow: 0 0 0 2px var(--primary); font-weight: 700; }

/* Mark attendance (teacher) */
.attendance-mark-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--divider);
    gap: 12px;
}

.attendance-mark-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.attendance-mark-btn {
    width: 40px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.attendance-mark-btn.present-active {
    background: var(--correct);
    border-color: var(--correct);
}
.attendance-mark-btn.absent-active {
    background: var(--incorrect);
    border-color: var(--incorrect);
}

.attendance-bulk-actions {
    display: flex;
    gap: 6px;
    padding: 12px var(--space-md) 8px;
}

.attendance-bulk-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--font-xs);
    font-weight: 600;
    border: 1.5px solid;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.attendance-bulk-btn.present-btn {
    border-color: var(--correct);
    color: var(--green-dark);
    background: var(--correct-light);
}
.attendance-bulk-btn.present-btn:active { background: var(--correct); color: #fff; }

.attendance-bulk-btn.absent-btn {
    border-color: var(--incorrect);
    color: var(--red);
    background: var(--incorrect-light);
}
.attendance-bulk-btn.absent-btn:active { background: var(--incorrect); color: #fff; }

.attendance-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--space-md);
    background: var(--bg);
    border-top: 0.5px solid var(--divider);
}


/* ---------- Gallery ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.gallery-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}


/* ---------- Calendar ---------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.calendar-header {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-hint);
    padding: 8px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-sm);
    border-radius: 50%;
    cursor: pointer;
}

.calendar-day.today {
    background: var(--primary);
    color: var(--text-white);
    font-weight: 700;
}

.calendar-day.event {
    background: var(--primary-lightest);
    color: var(--primary);
    font-weight: 600;
}


/* ---------- Splash Screen ---------- */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #FF6B35 0%, #F7931E 50%, #FFB347 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }

.splash-content { text-align: center; }

.splash-icon {
    margin-bottom: 16px;
}
.splash-icon img {
    border-radius: 22px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.splash-title {
    color: var(--text-white);
    font-size: var(--font-xxl);
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.splash-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: var(--font-md);
    margin-top: 4px;
}

.splash-loader {
    margin-top: 32px;
    color: rgba(255,255,255,0.8);
    font-size: var(--font-sm);
}


/* ---------- Spinner ---------- */
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.spinner-dark {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- Toast ---------- */
#toast {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 80px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-white);
    background: var(--text-primary);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    max-width: 90%;
    text-align: center;
    white-space: nowrap;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#toast.toast-success { background: var(--green-dark); }
#toast.toast-error { background: var(--red); }
#toast.toast-info { background: var(--blue-dark); }


/* ---------- Loader Overlay ---------- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#loader.active {
    display: flex;
}

.loader-content {
    text-align: center;
}


/* ---------- Offline Banner ---------- */
#offline-banner {
    position: fixed;
    top: var(--safe-top);
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: #333;
    color: #fff;
    font-size: var(--font-xs);
    text-align: center;
    z-index: 9999;
    font-weight: 500;
}


/* ---------- Upload Progress ---------- */
#upload-progress {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 16px);
    left: 16px;
    right: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 9000;
    border: 0.5px solid var(--border);
}

.progress-label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar-track {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s;
}


/* ---------- Wrapper / Login Page ---------- */
.wrapper-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--bg);
}

.wrapper-logo {
    margin-bottom: 8px;
}

.wrapper-tagline {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.wrapper-buttons {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wrapper-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--border);
    background: var(--bg-white);
    cursor: pointer;
    transition: transform 0.15s;
    width: 100%;
    text-align: left;
}
.wrapper-btn:active { transform: scale(0.97); }

.wrapper-btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-parent { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); color: var(--primary); }
.icon-teacher { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); color: var(--green-dark); }

.wrapper-btn-text {
    flex: 1;
}

.wrapper-btn-text > div:first-child {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
}

.wrapper-btn-subtitle {
    font-size: var(--font-xs);
    color: var(--text-hint);
    margin-top: 2px;
}

.wrapper-footer {
    margin-top: var(--space-xl);
    font-size: var(--font-xs);
    color: var(--text-hint);
    text-align: center;
}

/* Login header (combined — no separate app-bar) */
.page-login {
    min-height: 100vh;
    background: var(--bg);
}

.login-header {
    background: var(--primary-gradient);
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 24px;
    position: relative;
}
.login-header.green { background: linear-gradient(135deg, #27AE60, #2ECC71); }

.login-back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 16px;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
}

.login-header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-header-title {
    color: #fff;
    font-size: var(--font-lg);
    font-weight: 700;
}

.login-header-sub {
    color: rgba(255,255,255,0.8);
    font-size: var(--font-xs);
    margin-top: 2px;
}

.login-body {
    padding: var(--space-lg);
}

.login-mascot {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    object-fit: cover;
    background: rgba(255,255,255,0.15);
}

/* OTP Input */
.otp-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.otp-container .otp-input,
input.otp-input {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 52px !important;
    flex: 0 0 44px !important;
    text-align: center !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    border: 2px solid var(--border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--text-primary) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s;
}

.otp-container .otp-input:focus,
input.otp-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15) !important;
}


/* ---------- Games ---------- */
.games-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.games-category-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    border: 0.5px solid var(--border-light);
    transition: transform 0.15s;
    box-shadow: var(--shadow-sm);
}
.games-category-card:active { transform: scale(0.95); }

.games-category-icon {
    padding: 14px;
    text-align: center;
}

.games-category-icon .icon-circle {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.games-category-icon .icon-circle img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.games-category-label {
    padding: 8px 8px 10px;
    text-align: center;
}

.games-category-name {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.games-category-count {
    font-size: 10px;
    color: var(--text-hint);
    margin-top: 2px;
}

.games-welcome-banner {
    padding: 14px 16px;
    background: linear-gradient(135deg, #FFF3E0, #FFECB3);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 0.5px solid rgba(0,0,0,0.06);
}

.games-welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.games-welcome-avatar img { width: 40px; height: 40px; object-fit: contain; }


/* ---------- Leaderboard ---------- */
.lb-podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}
.lb-podium-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}
.lb-gold { background: linear-gradient(135deg, #FFD700, #FFA500); }
.lb-silver { background: linear-gradient(135deg, #C0C0C0, #8E8E8E); }
.lb-bronze { background: linear-gradient(135deg, #CD7F32, #8B4513); }
.lb-podium-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-podium-score { font-size: 11px; color: var(--text-hint); }

.lb-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    gap: 12px;
    border: 0.5px solid var(--border-light);
}

.lb-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.lb-row-name { font-size: var(--font-md); font-weight: 600; color: var(--text-primary); }
.lb-row-meta { font-size: var(--font-xs); color: var(--text-hint); margin-top: 2px; }
.lb-row-score { margin-left: auto; text-align: right; flex-shrink: 0; }
.lb-row-pts { font-size: var(--font-lg); font-weight: 700; color: var(--primary-dark); }
.lb-row-label { font-size: 10px; color: var(--text-hint); text-transform: uppercase; }
.lb-me { border: 2px solid var(--primary); background: var(--primary-lightest); }


/* ---------- Multi-Child Selector ---------- */
.child-picker {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 16px 24px 28px;
}

.child-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 80px;
    transition: transform 0.15s;
}
.child-picker-item:active { transform: scale(0.93); }

.child-picker-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 24px;
    font-weight: 600;
}
.child-picker-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.child-picker-name {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}


/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
}

.section-title {
    font-size: var(--font-md);
    font-weight: 700;
    color: var(--brown);
}

.section-action {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
}


/* ---------- Info Row ---------- */
.info-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
}
.info-row:last-child { border-bottom: none; }

.info-label {
    flex: 1;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.info-value {
    font-size: var(--font-md);
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}


/* ---------- Notification Item ---------- */
.notification-item {
    display: flex;
    gap: 12px;
    padding: var(--space-md);
    border-bottom: 1px solid var(--divider);
}

.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 5px;
}
.notification-dot.read { background: var(--border); }

.notification-content { flex: 1; }

.notification-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
}

.notification-body {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

.notification-time {
    font-size: var(--font-xs);
    color: var(--text-hint);
    margin-top: 4px;
}


/* ---------- Image Lightbox ---------- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: calc(var(--safe-top) + 12px);
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-hint { color: var(--text-hint); }
.text-white { color: var(--text-white); }
.text-success { color: var(--correct); }
.text-danger { color: var(--incorrect); }
.text-warning { color: var(--late); }

.font-xs { font-size: var(--font-xs); }
.font-sm { font-size: var(--font-sm); }
.font-md { font-size: var(--font-md); }
.font-lg { font-size: var(--font-lg); }
.font-xl { font-size: var(--font-xl); }
.font-bold { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.px-2 { padding-left: var(--space-md); padding-right: var(--space-md); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bg-white { background: var(--bg-white); }
.bg-warm { background: var(--bg-warm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow-md); }


/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    #page-container {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: var(--shadow-xl);
        min-height: 100vh;
    }

    .app-bar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    .chat-input-bar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }

    #toast {
        max-width: 400px;
    }
}


/* ---------- Touch Feedback ---------- */
@media (hover: none) and (pointer: coarse) {
    .card:active,
    .list-item:active,
    .action-item:active,
    .wrapper-btn:active,
    .games-category-card:active,
    .child-picker-item:active {
        background: var(--bg);
    }
}
