/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }

/* Countdown progress bar (used in PlaySession & ActiveSession) */
.countdown-bar-track {
    height: 7px;
    border-radius: 4px;
    background: var(--surface-secondary, #e5e7eb);
    overflow: hidden;
}
.countdown-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--primary, #4f46e5);
    transition: width 0.48s linear, background-color 0.4s;
}
.countdown-bar--urgent  { background: #dc2626; }
.countdown-label        { font-size: 0.85rem; color: var(--text-muted, #6b7280); }
.countdown-label--urgent { color: #dc2626; font-weight: 600; }





body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--body-bg);
}

h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }
a { color: var(--primary); }

h1:focus { outline: none; }

/* ?? Design tokens ?????????????????????????????????????????????????????????? */
:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --primary:        #4f46e5;
    --primary-hover:  #4338ca;
    --sidebar-bg:     #18181b;
    --sidebar-text:   #a1a1aa;
    --body-bg:        #f4f4f5;
    --surface:        #ffffff;
    --text:           #18181b;
    --text-muted:     #71717a;
    --border:         #e4e4e7;
    --danger:         #dc2626;
    --success:        #16a34a;
    --radius:         8px;
}

/* ?? App shell ?????????????????????????????????????????????????????????????? */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ?? Sidebar ???????????????????????????????????????????????????????????????? */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e1b4b 0%, #18181b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25) 0%, transparent 100%);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.45);
}

.sidebar-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.sidebar-nav { flex: 1; padding: 0.75rem; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(165, 180, 252, 0.5);
    padding: 1rem 0.5rem 0.3rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    border-left: 2px solid transparent;
    color: rgba(161, 161, 170, 0.85) !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #fff !important;
    border-left-color: rgba(165, 180, 252, 0.4);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.85) 0%, rgba(99, 102, 241, 0.7) 100%);
    color: #fff !important;
    border-left-color: #a5b4fc;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.nav-icon {
    width: 18px;
    font-size: 0.95rem;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.18s;
}

.nav-icon--blue  { color: #60a5fa; }
.nav-icon--purple { color: #c084fc; }
.nav-icon--cyan  { color: #22d3ee; }
.nav-icon--green { color: #4ade80; }

.nav-link.active .nav-icon,
.nav-link.active .nav-icon--blue,
.nav-link.active .nav-icon--purple,
.nav-link.active .nav-icon--cyan,
.nav-link.active .nav-icon--green { color: #fff; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-footer a { color: #a5b4fc; text-decoration: none; }
.sidebar-footer a:hover { text-decoration: underline; }

/* ?? Main area ?????????????????????????????????????????????????????????????? */
.main-area {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
}

.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 1rem;
    flex-shrink: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.topbar-user a { color: var(--primary); text-decoration: none; font-weight: 500; }
.topbar-user a:hover { text-decoration: underline; }



.page-content {
    flex: 1;
    background:
        linear-gradient(150deg,
            rgba(255, 220, 220, 0.88) 0%,
            rgba(255, 235, 230, 0.86) 50%,
            rgba(255, 215, 225, 0.88) 100%),
        url('/images/background.png') center / cover no-repeat;
}

.page-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}




/* ?? Typography ????????????????????????????????????????????????????????????? */
.page-header {
    margin-bottom: 1.75rem;
    padding: 0 0 1.25rem 1.25rem;
    border-left: 4px solid var(--primary);
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.page-header p { margin-top: 0.3rem; color: var(--text-muted); font-size: 0.875rem; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

/* ?? Cards ?????????????????????????????????????????????????????????????????? */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h2 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ?? Buttons ???????????????????????????????????????????????????????????????? */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none !important;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #6366f1); color: #fff; border: none; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), var(--primary)); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--body-bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success); color: #fff; border: none; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

/* ?? Alerts ????????????????????????????????????????????????????????????????? */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* ?? Badges ????????????????????????????????????????????????????????????????? */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-draft     { background: #fef9c3; color: #854d0e; }
.badge-published { background: #dcfce7; color: #166534; }
.badge-archived  { background: #f4f4f5; color: #71717a; }

/* ?? Reorder list ??????????????????????????????????????????????????????????? */
.reorder-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.reorder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.reorder-index { font-weight: 600; color: var(--text-muted); min-width: 1.5rem; text-align: right; }
.reorder-text  { flex: 1; }
.reorder-actions { display: flex; gap: 0.25rem; }
.reorder-actions-bar { display: flex; gap: 0.5rem; }

/* ?? Form validation ???????????????????????????????????????????????????????? */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.8rem; }

/* ?? Page actions header ???????????????????????????????????????????????????? */
.page-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.75rem;
}

.page-actions-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-start; }
.page-actions h1 { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* ?? Empty state ???????????????????????????????????????????????????????????? */
.empty-state { text-align: center; padding: 2.5rem 1.5rem; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state h2 { margin-bottom: 0.25rem; }
.empty-state p { color: var(--text-muted); font-size: 0.875rem; margin: 0.25rem 0 1.25rem; }

/* ?? Quiz list ?????????????????????????????????????????????????????????????? */
.quiz-list { display: flex; flex-direction: column; gap: 0.5rem; }

.quiz-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.quiz-row:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }
.quiz-row-main { flex: 1; min-width: 0; }
.quiz-row-title { font-weight: 600; color: var(--text); margin-bottom: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-row-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-row-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.775rem; color: var(--text-muted); flex-wrap: wrap; }
.quiz-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ?? Forms ?????????????????????????????????????????????????????????????????? */
.form-field { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text); margin-bottom: 0.4rem; }
.required { color: var(--danger); margin-left: 0.15rem; }

.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.form-input.input-error { border-color: var(--danger); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; display: block; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; align-items: center; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-field { flex: 1; min-width: 120px; }

/* ?? Section header ????????????????????????????????????????????????????????? */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.section-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.section-header-actions { display: flex; gap: 0.5rem; }

/* ?? Quiz detail meta ??????????????????????????????????????????????????????? */
.quiz-meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ?? Question cards ????????????????????????????????????????????????????????? */
.question-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }

.question-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.question-num { font-weight: 700; color: var(--text-muted); font-size: 0.9rem; min-width: 1.5rem; padding-top: 0.1rem; flex-shrink: 0; text-align: right; }
.question-body { flex: 1; min-width: 0; }
.question-text { font-size: 0.9rem; color: var(--text); margin-bottom: 0.3rem; }
.question-meta { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; font-size: 0.775rem; color: var(--text-muted); }
.question-actions { flex-shrink: 0; }

/* ?? Add question panel ????????????????????????????????????????????????????? */
.add-question-panel {
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 0.75rem;
}

.add-question-panel h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; color: var(--text); }
.option-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 0.5rem; }
.option-row { display: flex; align-items: center; gap: 0.5rem; }
.option-row .form-input { flex: 1; }
.option-row label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.option-row input[type="radio"], .option-row input[type="checkbox"] { flex-shrink: 0; cursor: pointer; width: 15px; height: 15px; }

/* ?? Session: join code display ????????????????????????????????????????????? */
.join-code-display {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    padding: 1rem 0 0.25rem;
}

.join-code-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-top: 0.25rem;
}

/* ?? Session: QR panel ?????????????????????????????????????????????????????? */
.session-invite {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.session-invite-code { flex: 1; min-width: 200px; }
.session-invite-qr   { flex-shrink: 0; }
.session-invite-qr img {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

/* ?? Session: waiting room list ????????????????????????????????????????????? */
.waiting-list { display: flex; flex-direction: column; gap: 0.4rem; }

.waiting-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.875rem;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.waiting-row-name { flex: 1; font-size: 0.9rem; font-weight: 500; }
.waiting-row-badge { font-size: 0.75rem; }

.badge-waiting  { background: #fef9c3; color: #854d0e; }
.badge-admitted { background: #dcfce7; color: #166534; }

/* ?? Session: participant waiting room ?????????????????????????????????????? */
.waiting-room-hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
}

.waiting-room-hero .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.5rem;
}

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

.admitted-hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    color: var(--success);
}

.admitted-hero .check { font-size: 3rem; margin-bottom: 0.75rem; }

.participants-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
}

.participant-chip {
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
}

/* ?? Home layout (full-width, no sidebar) ??????????????????????????????????? */
.home-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #dbecff 0%, #f0eaff 55%, #ffedf6 100%);
}

.home-nav {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    position: sticky;
    top: 0;
    z-index: 50;
}

.home-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none !important;
    flex-shrink: 0;
}

.home-nav-brand span:first-child { font-size: 1.4rem; line-height: 1; }

.home-nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
    margin-left: 1rem;
}

.home-nav-links a {
    color: var(--text);
    text-decoration: none !important;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}

.home-nav-links a:hover { background: rgba(0, 0, 0, 0.07); }

.home-nav-user { margin-left: auto; }

.home-main { flex: 1; }

/* ?? Informax brand components (global) ?????????????????????????????????????? */

/* ?? Branded buttons ???????????????????????????????????????????????????????? */
.informax-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.12s, box-shadow 0.12s;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.informax-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,0,0,0.3); }
.informax-btn--white  { background: #fff;    color: #cc0000; }
.informax-btn--yellow { background: #FFD700; color: #1a0000; }

/* ?? Section title ?????????????????????????????????????????????????????????? */
.informax-section-title { margin-bottom: 1.25rem; }
.informax-section-title h2 { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.informax-section-title p { margin-top: 0.3rem; color: var(--text-muted); font-size: 0.875rem; }

/* ?? Feature cards ?????????????????????????????????????????????????????????? */
.informax-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 16px;
    padding: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.informax-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.informax-card--blue   { background: linear-gradient(135deg, #1a7fe8, #0055b3); }
.informax-card--orange { background: linear-gradient(135deg, #ff8c00, #e05800); }
.informax-card--green  { background: linear-gradient(135deg, #00b359, #007a38); }
.informax-card--purple { background: linear-gradient(135deg, #7b2fbe, #4c0e99); }
.informax-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.informax-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.informax-card-avatar {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
    margin-right: -0.25rem;
    transition: transform 0.15s;
}
.informax-card:hover .informax-card-avatar { transform: translateY(-4px) scale(1.06); }
.informax-card h2 { font-size: 1.05rem; font-weight: 800; color: #fff; margin-bottom: 0.4rem; }
.informax-card p  { font-size: 0.875rem; color: rgba(255,255,255,0.85); margin-bottom: 1.25rem; }
.informax-card-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.22);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none !important;
    transition: background 0.15s;
    align-self: flex-start;
}
.informax-card-btn:hover { background: rgba(255,255,255,0.38); }

/* ?? CTA banner ????????????????????????????????????????????????????????????? */
.informax-cta-banner {
    margin-top: 2rem;
    background: linear-gradient(135deg, #7b2fbe, #4c0e99);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(123,47,190,0.35);
}
.informax-cta-trophy { font-size: 2.5rem; margin-bottom: 0.75rem; }
.informax-cta-banner h2 { font-size: 1.7rem; font-weight: 900; color: #fff; margin-bottom: 0.5rem; }
.informax-cta-banner p  { color: rgba(255,255,255,0.87); font-size: 1rem; margin-bottom: 1.5rem; }
/* Participant avatar (used in host, active-session, waiting-room) */
.participant-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.35rem;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
    margin-right: 5px;
}

/* ?? Countdown progress bar (session pages) ????????????????????????????????????????? */
.countdown-bar-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.countdown-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.45s linear, background 0.3s;
}

.countdown-bar--urgent {
    background: var(--danger);
}

.countdown-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.countdown-label--urgent {
    color: var(--danger);
}

/* ?? Mobile portrait: icon-only sidebar ????????????????????????????????????? */
@media (max-width: 768px) and (orientation: portrait) {
    :root {
        --sidebar-width: 54px;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 1rem 0;
        gap: 0;
    }

    .sidebar-brand-name,
    .nav-section-label,
    .nav-label {
        display: none;
    }

    .sidebar-nav {
        padding: 0.4rem;
    }

    .nav-link {
        justify-content: center;
        padding: 0.6rem 0;
        gap: 0;
        border-left: 2px solid transparent;
    }

    .nav-icon {
        width: auto;
        font-size: 1.1rem;
    }

    .sidebar-footer {
        align-items: center;
        padding: 0.5rem 0;
        gap: 0.25rem;
    }

    .sidebar-footer a {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius);
        transition: background 0.15s;
    }

    .sidebar-footer a:hover {
        background: rgba(99, 102, 241, 0.15);
        text-decoration: none !important;
    }
}

/* 覧 Mobile: general (all orientations) 覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧覧 */
@media (max-width: 768px) {
    /* Tighten page padding */
    .page-inner {
        padding: 1rem;
    }

    /* Topbar: allow wrapping & reduce padding */
    .topbar {
        padding: 0 0.75rem;
        gap: 0.5rem;
        height: auto;
        min-height: var(--topbar-height);
        flex-wrap: wrap;
    }

    /* Page actions: stack title + buttons */
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions h1 {
        font-size: 1.3rem;
    }

    .page-actions-buttons {
        justify-content: flex-start;
    }

    /* Page header */
    .page-header {
        padding: 0 0 1rem 0.75rem;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    /* Card grid: single column on small screens */
    .card-grid {
        grid-template-columns: 1fr;
    }

    /* Quiz rows: stack on narrow screens */
    .quiz-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .quiz-row-actions {
        align-self: flex-end;
    }

    /* Question cards: stack */
    .question-card {
        flex-direction: column;
        gap: 0.35rem;
    }

    .question-num {
        text-align: left;
    }

    /* Option rows: wrap inputs */
    .option-row {
        flex-wrap: wrap;
    }

    /* Reorder items: tighter */
    .reorder-item {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.6rem 0.75rem;
    }

    /* Session invite: stack code + QR */
    .session-invite {
        flex-direction: column;
        gap: 1rem;
    }

    .join-code-display {
        font-size: 2rem;
    }

    /* Section header: stack */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Form actions: allow wrapping */
    .form-actions {
        flex-wrap: wrap;
    }

    /* Buttons: allow shrinking text for tight spaces */
    .btn {
        font-size: 0.8rem;
        padding: 0.45rem 0.75rem;
    }

    /* Empty state: less padding */
    .empty-state {
        padding: 1.5rem 1rem;
    }

    /* Informax branded cards: stack avatar below text */
    .informax-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .informax-card-avatar {
        margin-right: 0;
    }

    .informax-card-btn {
        align-self: center;
    }

    /* CTA banner: smaller padding */
    .informax-cta-banner {
        padding: 1.5rem 1rem;
    }

    .informax-cta-banner h2 {
        font-size: 1.3rem;
    }

    /* Branded buttons */
    .informax-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Home-layout nav: tighter */
    .home-nav {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .home-nav-links {
        margin-left: 0.25rem;
        gap: 0;
    }

    .home-nav-links a {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Waiting room */
    .waiting-room-hero {
        padding: 2rem 1rem 1.5rem;
    }
}

