/* =====================================================================
   MonMoon - Core Stylesheet
   Warm, premium, emotionally-engaging UI inspired by high-end dating
   products. Light by default with a cosy warm night mode.
   (Visual layer only - all class hooks, markup & logic are unchanged.)
   ===================================================================== */

:root {
    /* Surfaces & neutrals (warm) */
    --color-bg: #fff8f3;          /* warm cream */
    --color-surface: #ffffff;
    --color-surface-alt: #faf6f2; /* light beige */
    --color-cream: #fff8f3;
    --color-beige: #faf6f2;

    /* Text */
    --color-text: #2b2b2b;        /* rich charcoal */
    --color-text-muted: #6b7280;  /* muted grey */

    /* Brand */
    --color-primary: #ff6b6b;     /* coral */
    --color-primary-dark: #d6455c;/* deeper coral - readable for links/text */
    --color-secondary: #ff8fa3;   /* soft rose */

    /* Warm accents */
    --color-peach: #ffd6ba;
    --color-lavender: #cdb4db;
    --color-accent: #f4c95d;      /* gold */

    /* Semantic */
    --color-success: #3fae86;
    --color-error: #e3576c;

    --color-border: #f0e3d8;      /* soft warm border */
    --color-border-strong: #e7d3c4;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #ff6b6b 0%, #ff8fa3 100%);
    --gradient-warm: linear-gradient(135deg, #ffd6ba 0%, #ff8fa3 55%, #cdb4db 100%);

    /* Radii (generous, premium) */
    --radius-sm: 14px;
    --radius: 22px;
    --radius-lg: 28px;

    /* Shadows (soft, layered) */
    --shadow-sm: 0 2px 10px rgba(43, 43, 43, 0.05);
    --shadow: 0 16px 40px -18px rgba(120, 70, 60, 0.22);
    --shadow-lg: 0 28px 64px -24px rgba(120, 70, 60, 0.32);
    --shadow-glow: 0 14px 30px -8px rgba(255, 107, 107, 0.45);

    /* Motion */
    --transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-fast: 0.18s cubic-bezier(0.22, 1, 0.36, 1);

    /* Type */
    --font-display: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
    --color-bg: #1a1419;          /* warm near-black plum */
    --color-surface: #241b22;
    --color-surface-alt: #2e232c;
    --color-cream: #241b22;
    --color-beige: #2e232c;

    --color-text: #f5ede7;        /* warm off-white */
    --color-text-muted: #b7a8a2;

    --color-primary: #ff7e7e;
    --color-primary-dark: #ff9aa6;
    --color-secondary: #ff9db0;

    --color-peach: #b98a73;
    --color-lavender: #b79ec7;
    --color-accent: #f4c95d;

    --color-success: #56c79c;
    --color-error: #ff7488;

    --color-border: #3a2c36;
    --color-border-strong: #4a3a44;

    --gradient-primary: linear-gradient(135deg, #ff7e7e 0%, #ff9db0 100%);
    --gradient-warm: linear-gradient(135deg, #4a2f3a 0%, #5a2f3f 55%, #3a2c46 100%);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 14px 34px -8px rgba(255, 126, 126, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    transition: background var(--transition), color var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Layered, warm decorative background (CSS-only, fixed, no DOM) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(42rem 42rem at 12% -8%, rgba(255, 214, 186, 0.55), transparent 60%),
        radial-gradient(38rem 38rem at 92% 2%, rgba(205, 180, 219, 0.40), transparent 60%),
        radial-gradient(46rem 46rem at 78% 108%, rgba(255, 143, 163, 0.22), transparent 55%),
        radial-gradient(40rem 40rem at 0% 100%, rgba(244, 201, 93, 0.16), transparent 55%);
}
[data-theme="dark"] body::before {
    background:
        radial-gradient(42rem 42rem at 12% -8%, rgba(255, 126, 126, 0.16), transparent 60%),
        radial-gradient(38rem 38rem at 92% 2%, rgba(183, 158, 199, 0.14), transparent 60%),
        radial-gradient(46rem 46rem at 78% 108%, rgba(255, 157, 176, 0.12), transparent 55%);
}

::selection { background: rgba(255, 107, 107, 0.22); color: var(--color-text); }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--color-primary-dark); text-decoration: none; transition: color var(--transition-fast); }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }

/* Accessible focus ring for keyboard users */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------------------------------------------------------------------
   Header / Navigation - floating glass bar
   --------------------------------------------------------------------- */
.site-header {
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    padding-top: 14px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
[data-theme="dark"] .header-inner {
    background: rgba(36, 27, 34, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

.brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark { flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(255, 107, 107, 0.35)); }

.logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.1em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 7px 14px;
    border-radius: 999px;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.main-nav a:hover {
    color: var(--color-primary-dark);
    background: rgba(255, 107, 107, 0.10);
    text-decoration: none;
}

/* ---------------------------------------------------------------------
   Page content / footer
   --------------------------------------------------------------------- */
.page-content {
    flex: 1;
    padding: 40px 24px 72px;
}

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 28px 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    text-align: center;
}
.site-footer a { font-weight: 600; }

/* ---------------------------------------------------------------------
   Alerts / Flash messages
   --------------------------------------------------------------------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    animation: fadeInUp 0.4s ease both;
}
.alert-error { background: rgba(227, 87, 108, 0.12); color: var(--color-error); border-color: rgba(227, 87, 108, 0.3); }
.alert-success { background: rgba(63, 174, 134, 0.13); color: var(--color-success); border-color: rgba(63, 174, 134, 0.3); }
.alert-info { background: rgba(205, 180, 219, 0.18); color: #8a6fb0; border-color: rgba(205, 180, 219, 0.4); }

/* ---------------------------------------------------------------------
   Cards / Surfaces
   --------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.5s ease both;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: 0.7; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.16);
}

textarea { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 6px; }

/* ---------------------------------------------------------------------
   Buttons - premium pill CTAs
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    border: none;
    background: var(--gradient-primary);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition-fast), filter var(--transition-fast);
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px -8px rgba(255, 107, 107, 0.55);
    filter: brightness(1.03);
    text-decoration: none;
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }

.btn-secondary {
    background: var(--color-peach);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: #ffc9a6; filter: none; box-shadow: var(--shadow); }
[data-theme="dark"] .btn-secondary { color: #fff; }

.btn-outline {
    background: var(--color-surface);
    color: var(--color-primary-dark);
    border: 1.5px solid rgba(255, 107, 107, 0.45);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover { background: rgba(255, 107, 107, 0.08); filter: none; box-shadow: var(--shadow); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.6);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-ghost:hover { transform: translateY(-2px) rotate(-12deg); box-shadow: var(--shadow); filter: none; }
[data-theme="dark"] .btn-ghost { background: rgba(255, 255, 255, 0.08); }

.btn-danger { background: linear-gradient(135deg, #e3576c, #ff7488); box-shadow: 0 14px 30px -8px rgba(227, 87, 108, 0.45); }
.btn-danger:hover { box-shadow: 0 18px 38px -8px rgba(227, 87, 108, 0.55); }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------------------------------------------------------------------
   Auth pages
   --------------------------------------------------------------------- */
.auth-wrapper {
    max-width: 440px;
    margin: 48px auto;
}

.auth-wrapper h1 { text-align: center; }
.auth-links { text-align: center; margin-top: 14px; font-size: 0.92rem; }

/* ---------------------------------------------------------------------
   Hero / Home
   --------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 84px 24px 72px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}
/* Soft decorative blobs */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    animation: floatBlob 9s ease-in-out infinite alternate;
}
.hero::before {
    width: 320px; height: 320px;
    top: -60px; left: -40px;
    background: radial-gradient(circle, var(--color-peach), transparent 70%);
}
.hero::after {
    width: 360px; height: 360px;
    bottom: -90px; right: -50px;
    background: radial-gradient(circle, var(--color-secondary), transparent 70%);
    animation-delay: -4s;
}
.hero > * { position: relative; z-index: 1; }

.hero h1 {
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    line-height: 1.1;
    background: linear-gradient(120deg, var(--color-primary), var(--color-secondary) 55%, var(--color-lavender));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.4em;
}
.hero p { font-size: 1.15rem; color: var(--color-text-muted); max-width: 620px; margin: 0 auto 30px; }
.hero .actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.feature-list {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-top: 56px;
}
.feature-list .card { text-align: center; }
.feature-list .card:nth-child(2) { animation-delay: 0.08s; }
.feature-list .card:nth-child(3) { animation-delay: 0.16s; }
.feature-list .card:nth-child(4) { animation-delay: 0.24s; }
.feature-list .icon {
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: var(--gradient-warm);
    box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------- */
.stats-row {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 28px;
}
.stat-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-box:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-box .value {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-box .label { color: var(--color-text-muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

.session-list { display: flex; flex-direction: column; gap: 14px; }
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 22px;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.session-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.session-item .meta { color: var(--color-text-muted); font-size: 0.85rem; }
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-waiting { background: rgba(244, 201, 93, 0.22); color: #8a6400; }
.badge-active { background: rgba(63, 174, 134, 0.16); color: var(--color-success); }
.badge-completed { background: rgba(205, 180, 219, 0.25); color: #8a6fb0; }
.badge-abandoned { background: rgba(227, 87, 108, 0.14); color: var(--color-error); }

/* ---------------------------------------------------------------------
   Session game screens
   --------------------------------------------------------------------- */
.session-code-box {
    text-align: center;
    padding: 36px;
}
.session-code-box .code {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 14px 0;
}
.share-link {
    word-break: break-all;
    background: var(--color-surface-alt);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
    border: 1px solid var(--color-border);
}

.round-header {
    text-align: center;
    margin-bottom: 28px;
}
.round-header .round-label {
    color: var(--color-primary-dark);
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}
.question-card {
    text-align: center;
    padding: 44px 28px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 214, 186, 0.5), transparent 60%),
        radial-gradient(circle at 90% 100%, rgba(255, 143, 163, 0.28), transparent 60%),
        var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}
.question-card h2 { font-size: 1.7rem; }

.timer {
    font-family: var(--font-display);
    font-size: 2.7rem;
    font-weight: 800;
    text-align: center;
    margin: 18px 0;
    color: var(--color-primary);
    transition: color var(--transition);
}
.timer.low { color: var(--color-error); }

.answer-status {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 22px 0;
    flex-wrap: wrap;
}
.answer-status .status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 0.9rem;
}
.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--color-border-strong);
}
.status-dot.done { background: var(--color-success); }
.status-dot.waiting { background: var(--color-accent); animation: pulse 1.2s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.82); }
}

/* Next-step prompts: ready / continue-or-stop / choose-next-question */
.question-choice-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}
.ai-note {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    font-style: italic;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 14px 0;
}
.custom-question-form {
    margin-top: 8px;
    text-align: left;
}

/* Choice countdown (10s to pick the next question) */
.choice-countdown { font-size: 0.95rem; }
.choice-timer { font-weight: 800; color: var(--color-primary); font-family: var(--font-display); }
.choice-timer.low { color: var(--color-error); }
.choice-expired-note { font-style: italic; margin-top: 10px; }

/* Question type picker (custom question form) */
.question-type-options {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 0;
    cursor: pointer;
}
.radio-label input { width: auto; margin: 0; }

.mcq-option-inputs {
    margin: 4px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mcq-option-inputs label { margin-bottom: 0; }

/* MCQ answer options */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0;
}
.mcq-option {
    display: block;
    width: 100%;
    padding: 16px 20px;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}
.mcq-option:hover { border-color: var(--color-primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.mcq-option.selected {
    border-color: var(--color-primary);
    background: rgba(255, 107, 107, 0.10);
    color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

/* Reveal */
.reveal-grid {
    display: grid;
    gap: 22px;
    grid-template-columns: 1fr 1fr;
    margin: 22px 0;
}
@media (max-width: 700px) {
    .reveal-grid { grid-template-columns: 1fr; }
}
.reveal-answer {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s ease;
}
.reveal-answer .author {
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.reveal-answer img.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-border); }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes floatBlob {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(20px, -24px) scale(1.08); }
}

/* Discussion */
.comment-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.comment {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 18px 18px 18px 6px;
    padding: 12px 16px;
    max-width: 80%;
}
.comment.mine {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 18px 18px 6px 18px;
}
.comment.mine .meta { color: rgba(255, 255, 255, 0.85); }
.comment .meta { font-size: 0.74rem; color: var(--color-text-muted); margin-bottom: 4px; }
.comment-form { display: flex; gap: 12px; }
.comment-form textarea { flex: 1; min-height: 48px; }

/* Insights */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    border-left: 4px solid var(--color-secondary);
    background: var(--color-surface-alt);
}
.insight-item.similar { border-left-color: var(--color-success); }
.insight-item.different { border-left-color: var(--color-error); }

/* Profile */
.profile-pic {
    width: 104px; height: 104px; border-radius: 50%; object-fit: cover;
    border: 4px solid var(--color-surface);
    box-shadow: var(--shadow), 0 0 0 2px var(--color-primary);
}

/* Compatibility report */
.score-circle {
    width: 168px; height: 168px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 22px;
    background: conic-gradient(var(--color-primary) calc(var(--score) * 1%), var(--color-border) 0);
    position: relative;
    box-shadow: var(--shadow-glow);
}
.score-circle::before {
    content: "";
    position: absolute; inset: 13px;
    border-radius: 50%;
    background: var(--color-surface);
}
.score-circle span {
    position: relative;
    font-family: var(--font-display);
    font-size: 2.1rem; font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Tables (admin) */
table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--color-border); text-align: left; font-size: 0.9rem; }
th { background: var(--color-surface-alt); font-weight: 700; font-family: var(--font-display); }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: rgba(255, 107, 107, 0.05); }
tr:last-child td { border-bottom: none; }

.tabs { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.tabs a {
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.tabs a:hover { transform: translateY(-2px); text-decoration: none; box-shadow: var(--shadow-sm); }
.tabs a.active { background: var(--gradient-primary); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }

/* ---------------------------------------------------------------------
   Mobile (phones - iPhone, Xiaomi/Android, etc.)
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .page-content { padding: 24px 16px 56px; }

    .site-header { padding-top: 10px; }
    .header-inner { padding: 12px 16px; border-radius: var(--radius-sm); }
    .brand { font-size: 1.15rem; }
    .main-nav { gap: 2px; font-size: 0.9rem; width: 100%; justify-content: flex-start; }
    .main-nav a { padding: 6px 10px; }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.08rem; }

    .card { padding: 20px; }

    .hero { padding: 48px 18px 40px; }
    .hero p { font-size: 1.05rem; }
    .hero .actions { flex-direction: column; align-items: stretch; }
    .hero .actions .btn { width: 100%; }

    .question-card { padding: 28px 18px; }
    .question-card h2 { font-size: 1.3rem; }

    .timer { font-size: 2.2rem; margin: 14px 0; }

    .answer-status { gap: 12px; }
    .answer-status .status-pill { font-size: 0.8rem; padding: 8px 14px; }

    .mcq-option { padding: 14px 16px; font-size: 0.95rem; }

    .question-choice-options { flex-direction: column; }
    .question-choice-options .btn { width: 100%; }

    .reveal-answer { padding: 16px; }

    .comment { max-width: 90%; }
    .comment-form { flex-direction: column; }
    .comment-form .btn { width: 100%; }

    .session-code-box .code { font-size: 1.9rem; letter-spacing: 0.1em; word-break: break-all; }

    .score-circle { width: 140px; height: 140px; }
    .score-circle span { font-size: 1.7rem; }

    .session-item { flex-direction: column; align-items: flex-start; }

    .stats-row { grid-template-columns: repeat(2, 1fr); }

    /* Wide admin tables get a horizontal scrollbar instead of overflowing
       the viewport (the inner table-row-group keeps its natural width). */
    table { display: block; overflow-x: auto; white-space: nowrap; max-width: 100%; }
}

/* ---------------------------------------------------------------------
   Accessibility: honour reduced-motion preference
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    body::before { display: none; }
}
