:root {
    /* IMS Brand Palette */
    --bg: #e6edf7;
    --app-bg: linear-gradient(160deg,#04080f 0%,#060e1c 50%,#030710 100%);
    --surface: #f2f6fc;
    --surface-2: #dce7f5;
    --ink: #1c2333;
    --ink-2: #44546a;
    --ink-3: #7a8fa6;
    --accent: #44546a;        /* IMS steel blue */
    --accent-light: #4472c4;  /* IMS medium blue */
    --accent-glow: #dce8f8;
    --gold: #ffc000;          /* IMS gold */
    --gold-light: #fff8d6;
    --orange: #ed7d31;        /* IMS orange */
    --green: #166534;
    --green-light: #dcfce7;
    --purple: #5b21b6;
    --purple-light: #ede9fe;
    --border: #c8d6eb;
    --shadow: 0 2px 16px rgba(28,35,51,0.09);
    --shadow-lg: 0 8px 40px rgba(28,35,51,0.14);
    --radius: 12px;
    --radius-sm: 8px;
  }

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

  html { scroll-behavior: smooth; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
  }

  /* ── NAV ── */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    background: rgba(4, 10, 22, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(68, 114, 196, 0.18);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
  }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  /* Push page content below the fixed nav */
  .page { padding-top: 64px; }

  .nav-logo {
    font-family: 'Lora', serif;
    font-size: 1rem; font-weight: 700;
    color: #a0c8f0;
    cursor: pointer;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 200px;
  }

  .nav-links { display: flex; gap: 0.25rem; align-items: center; }

  .nav-link {
    background: none; border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem; font-weight: 500;
    color: rgba(160, 195, 240, 0.6);
    padding: 0.4rem 0.85rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .nav-link:hover { background: rgba(68,114,196,0.15); color: #a0c8f0; }
  .nav-link.active { background: rgba(68,114,196,0.28); color: #c8dff8; }
  .nav-link.ims-premium-locked,
  .mobile-bottom-nav-link.ims-premium-locked {
    position: relative;
  }
  .nav-link.ims-premium-locked::after,
  .mobile-bottom-nav-link.ims-premium-locked::after {
    content: '🔒';
    font-size: 0.62rem;
    margin-left: 0.35rem;
    opacity: 0.72;
    vertical-align: middle;
  }

  /* ── MOBILE BOTTOM NAV ── */
  .mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    background: rgba(4, 10, 22, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68, 114, 196, 0.22);
    padding: 0.35rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom));
    gap: 0.1rem;
  }

  .mobile-bottom-nav-link {
    flex: 1 1 0;
    min-width: 0;
    background: none;
    border: none;
    color: rgba(160, 195, 240, 0.65);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.1;
    padding: 0.38rem 0.2rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
  }
  .mobile-bottom-nav-link .mbn-icon {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-bottom-nav-link .mbn-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
  .mobile-bottom-nav-link .mbn-label {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .mobile-bottom-nav-link.active {
    color: #c8dff8;
    background: rgba(68,114,196,0.24);
  }

  .nav-discord {
    background: #5865F2; color: #fff;
    border: none; border-radius: 99px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem; font-weight: 600;
    padding: 0.45rem 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 0.4rem;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-discord:hover { background: #4752c4; transform: translateY(-1px); }

  /* ── NAV AUTH ── */
  .nav-auth-btn {
    background: rgba(68,114,196,0.18); color: #a0c8f0;
    border: 1px solid rgba(68,114,196,0.3); border-radius: 99px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem; font-weight: 600;
    padding: 0.38rem 1rem;
    cursor: pointer; transition: all 0.2s;
    white-space: nowrap;
  }
  .nav-auth-btn:hover { background: rgba(68,114,196,0.32); color: #c8dff8; }
  .nav-user-pill {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(68,114,196,0.13); border: 1px solid rgba(68,114,196,0.25);
    border-radius: 99px; padding: 0.25rem 0.7rem 0.25rem 0.25rem;
    cursor: pointer; transition: all 0.2s;
    position: relative;
  }
  .nav-user-pill:hover { background: rgba(68,114,196,0.24); }
  .nav-user-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    background: linear-gradient(135deg,#4472c4,#44546a);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: #fff; flex-shrink: 0;
  }
  .nav-user-name { font-family:'DM Sans',sans-serif; font-size:0.78rem; font-weight:600; color:#c8dff8; }
  .nav-user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: rgba(4,12,28,0.97); border: 1px solid rgba(68,114,196,0.25);
    border-radius: 12px; padding: 0.5rem; min-width: 160px;
    backdrop-filter: blur(20px); z-index: 300; display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  .nav-user-dropdown.open { display: block; }
  .nav-user-dropdown-item {
    display: block; width: 100%; text-align: left;
    background: none; border: none; border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 500;
    color: rgba(160,195,240,0.7); padding: 0.5rem 0.75rem;
    cursor: pointer; transition: all 0.18s;
  }
  .nav-user-dropdown-item:hover { background: rgba(68,114,196,0.18); color: #c8dff8; }
  .nav-user-dropdown-item.danger { color: rgba(255,120,100,0.7); }
  .nav-user-dropdown-item.danger:hover { background: rgba(255,80,60,0.12); color: #ff8070; }
  /* Auth Modal */
  .nav-auth-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .nav-auth-overlay.open { opacity: 1; pointer-events: all; }
  .nav-auth-modal {
    background: linear-gradient(160deg,#0b1a2e,#0d2040);
    border: 1px solid rgba(68,114,196,0.28);
    border-radius: 18px; padding: 2rem 2rem 1.5rem;
    width: min(420px, 92vw); box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    transform: translateY(16px); transition: transform 0.2s;
  }
  .nav-auth-overlay.open .nav-auth-modal { transform: translateY(0); }

  .premium-gate-overlay {
    position: fixed; inset: 0; z-index: 550;
    background: rgba(2, 8, 20, 0.72); backdrop-filter: blur(7px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
    padding: 1rem;
  }
  .premium-gate-overlay.open { opacity: 1; pointer-events: all; }
  .premium-gate-modal {
    width: min(520px, 94vw);
    background: linear-gradient(155deg, rgba(10,22,44,0.95), rgba(8,16,34,0.96));
    border: 1px solid rgba(85, 145, 255, 0.28);
    border-radius: 20px;
    padding: 1.35rem 1.35rem 1.15rem;
    box-shadow: 0 30px 80px rgba(0,0,0,0.62), 0 0 0 1px rgba(0,212,255,0.08) inset;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.2s ease;
  }
  .premium-gate-overlay.open .premium-gate-modal { transform: translateY(0) scale(1); }
  .premium-gate-lock {
    width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(0,212,255,0.14), rgba(68,114,196,0.2));
    border: 1px solid rgba(0,212,255,0.35);
    color: #7ee5ff; font-size: 1.45rem;
    box-shadow: 0 10px 30px rgba(0,212,255,0.16);
    flex-shrink: 0;
  }
  .premium-gate-pill {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.09em;
    text-transform: uppercase; color: rgba(126,229,255,0.78);
    padding: 0.24rem 0.58rem; border-radius: 999px;
    border: 1px solid rgba(126,229,255,0.3);
    background: rgba(0,212,255,0.08);
    display: inline-flex; align-items: center; gap: 0.3rem;
  }
  .premium-gate-title {
    margin-top: 0.55rem;
    font-family: 'Lora', serif; font-size: 1.28rem; color: #d6e9ff; font-weight: 700;
  }
  .premium-gate-copy {
    margin-top: 0.35rem;
    color: rgba(173, 206, 244, 0.84); font-size: 0.86rem; line-height: 1.6;
  }
  .premium-gate-actions { display:flex; gap:0.65rem; justify-content:flex-end; margin-top:1.1rem; flex-wrap:wrap; }
  .premium-gate-btn {
    border-radius: 12px; border: 1px solid transparent; cursor: pointer;
    font-family:'DM Sans',sans-serif; font-size:0.82rem; font-weight:700;
    padding: 0.58rem 1rem; transition: all 0.18s ease;
  }
  .premium-gate-btn-close {
    background: rgba(140,170,220,0.08); border-color: rgba(140,170,220,0.28); color: rgba(185,210,240,0.86);
  }
  .premium-gate-btn-close:hover { background: rgba(140,170,220,0.16); color: #d4e7ff; }
  .premium-gate-btn-cta {
    background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(68,114,196,0.3));
    border-color: rgba(0,212,255,0.4); color: #9ff0ff;
    box-shadow: 0 8px 24px rgba(0,212,255,0.18);
  }
  .premium-gate-btn-cta:hover { transform: translateY(-1px); background: linear-gradient(135deg, rgba(0,212,255,0.3), rgba(68,114,196,0.38)); }

  /* ── HAMBURGER ── */
  .nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: none;
    border: 1px solid rgba(68,114,196,0.25);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s;
  }
  .nav-hamburger:hover { border-color: rgba(68,114,196,0.6); }
  .nav-hamburger span {
    display: block;
    width: 18px; height: 2px;
    background: rgba(160,195,240,0.7);
    border-radius: 2px;
    transition: all 0.25s ease;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ── PAGE TRANSITIONS ── */
  .page { display: none; animation: fadeIn 0.4s ease; }
  .page.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

  /* ── HERO ── */
  .hero {
    position: relative; overflow: hidden;
    padding: 6rem 2rem 5rem;
    text-align: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .hero-bg {
    position: absolute; inset: 0; z-index: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
  }

  .hero-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--gold-light); color: var(--gold);
    border: 1px solid #fcd34d;
    border-radius: 99px; padding: 0.3rem 0.85rem;
    font-size: 0.78rem; font-weight: 600;
    letter-spacing: 0.02em; text-transform: uppercase;
    margin-bottom: 1.5rem;
    position: relative; z-index: 1;
    animation: slideDown 0.6s ease both;
  }

  .hero h1 {
    font-family: 'Lora', serif;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--ink);
    max-width: 700px; margin: 0 auto 1.25rem;
    position: relative; z-index: 1;
    animation: slideDown 0.6s 0.1s ease both;
  }

  .hero h1 em { font-style: italic; color: var(--accent); }

  .hero p {
    font-size: 1.1rem; color: var(--ink-2);
    max-width: 520px; margin: 0 auto 2.5rem;
    position: relative; z-index: 1;
    animation: slideDown 0.6s 0.2s ease both;
  }

  .hero-cta {
    display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap;
    position: relative; z-index: 1;
    animation: slideDown 0.6s 0.3s ease both;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── BUTTONS ── */
  .btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border-radius: 99px; border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
  }
  .btn-primary { background: #44546a; color: #fff; }
  .btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30,58,138,0.3); }
  .btn-discord { background: #5865F2; color: #fff; }
  .btn-discord:hover { background: #4752C4; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(88,101,242,0.3); }
  .btn-outline { background: transparent; color: #4472c4; border: 1.5px solid #4472c4; }
  .btn-outline:hover { background: rgba(68,114,196,0.08); transform: translateY(-2px); }

  /* ── SECTIONS ── */
  .section { padding: 5rem 2rem; }
  .section-inner { max-width: 1100px; margin: 0 auto; }

  .section-label {
    font-family: 'Lora', serif;
    letter-spacing: 0.1em;
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.75rem;
  }

  .section-title {
    font-family: 'Lora', serif;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700; letter-spacing: -0.025em;
    line-height: 1.2; color: var(--ink);
    margin-bottom: 1rem;
  }

  .section-subtitle {
    font-size: 1rem; color: var(--ink-2);
    max-width: 560px; margin-bottom: 3rem;
  }

  /* ── ABOUT ── */
  .about { background: var(--bg); }

  .about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: center;
  }

  .about-stat-row { display: flex; gap: 2rem; margin-top: 2rem; }
  .stat { text-align: center; }
  .stat-num {
    font-family: 'Lora', serif;
    font-size: 2rem; font-weight: 700; color: var(--accent);
    line-height: 1;
  }
  .stat-label { font-size: 0.8rem; color: var(--ink-3); margin-top: 0.25rem; }

  .about-list { list-style: none; }
  .about-list li {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem; color: var(--ink-2);
  }
  .about-list li:last-child { border-bottom: none; }
  .about-list .icon { font-size: 1.1rem; margin-top: 0.05rem; flex-shrink: 0; }

  /* ── FEATURE CARDS ── */
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
  }

  .feat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.25s;
    cursor: default;
  }
  .feat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
  }

  .feat-icon { font-size: 2rem; margin-bottom: 0.75rem; }
  .feat-title { font-family: 'Lora', serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; }
  .feat-desc { font-size: 0.85rem; color: var(--ink-2); line-height: 1.5; }

  /* ── CTA BANNER ── */
  .cta-banner {
    background: #44546a;
    border-radius: var(--radius);
    padding: 3rem 2rem; text-align: center;
    position: relative; overflow: hidden;
  }

  .cta-banner::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
  }

  .cta-banner h2 {
    font-family: 'Lora', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700; color: #fff;
    letter-spacing: -0.02em; margin-bottom: 0.75rem;
    font-style: italic;
  }

  .cta-banner p { color: rgba(255,255,255,0.75); font-size: 0.95rem; margin-bottom: 1.75rem; }

  /* ── SUBJECT PAGE ── */
  .subj-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 3.5rem 2rem 3rem;
  }

  .subj-hero-inner { max-width: 1100px; margin: 0 auto; }

  .breadcrumb {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.8rem; color: var(--ink-3); margin-bottom: 1rem;
  }
  .breadcrumb button {
    background: none; border: none; color: var(--accent);
    font-size: 0.8rem; cursor: pointer; font-family: inherit;
    padding: 0;
  }
  .breadcrumb button:hover { text-decoration: underline; }

  .subj-hero h1 {
    font-family: 'Lora', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700; letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
  }

  .subj-hero p { color: var(--ink-2); font-size: 0.95rem; max-width: 600px; }

  .year-tabs {
    display: flex; gap: 0.5rem;
    margin-top: 1.5rem; flex-wrap: wrap;
  }

  .year-tab {
    background: none; border: 1.5px solid var(--border);
    border-radius: 99px; padding: 0.35rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; color: var(--ink-2);
  }
  .year-tab.active { background: #4472c4; border-color: #4472c4; color: #fff; font-family: 'Lora', serif; font-size: 1rem; letter-spacing: 0.06em; }
  .year-tab:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

  /* ── SUBJECT SECTIONS ── */
  .subjects-container { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }

  .subject-block { margin-bottom: 3.5rem; }

  .subject-header {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
  }

  .subject-icon-wrap {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
  }

  .subject-header h2 {
    font-family: 'Lora', serif;
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  }

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

  .resource-card {
    background: #f2f6fc;
    border: 1px solid #c8d6eb;
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all 0.2s;
  }
  .resource-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c8c0b8; }

  .resource-card-tag {
    display: inline-block;
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.2rem 0.55rem; border-radius: 4px;
    margin-bottom: 0.6rem;
  }

  .tag-books     { background: #dce8f8; color: #44546a; }
  .tag-review    { background: var(--green-light); color: var(--green); }
  .tag-practicals{ background: var(--gold-light); color: var(--gold); }
  .tag-cases     { background: #fee2e2; color: #991b1b; }
  .tag-anki      { background: var(--purple-light); color: var(--purple); }
  .tag-videos    { background: #fce7f3; color: #9d174d; }
  .tag-questions { background: #f0fdf4; color: #15803d; }
  .tag-other     { background: var(--surface-2); color: var(--ink-2); }

  .resource-card h4 {
    font-family: 'Lora', serif;
    font-size: 0.95rem; font-weight: 700;
    margin-bottom: 0.5rem; color: var(--ink);
  }

  .resource-list { list-style: none; }
  .resource-list li {
    font-size: 0.875rem; color: var(--ink-2);
    padding: 0.22rem 0;
    display: flex; align-items: flex-start; gap: 0.4rem;
  }
  .resource-list li::before { content: '·'; color: var(--ink-3); margin-top: 0.02rem; flex-shrink: 0; }

  /* ── SUGGESTIONS ── */
  .suggestions-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 4rem 2rem;
  }

  .suggestions-inner { max-width: 680px; margin: 0 auto; }

  .suggestions-inner h3 {
    font-family: 'Lora', serif;
    font-size: 1.4rem; font-weight: 700;
    margin-bottom: 0.4rem;
  }

  .suggestions-inner p { color: var(--ink-2); font-size: 0.9rem; margin-bottom: 1.5rem; }

  .suggestions-form { display: flex; flex-direction: column; gap: 0.75rem; }

  .suggestions-textarea {
    width: 100%;
    min-height: 130px;
    padding: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; color: var(--ink);
    resize: vertical; line-height: 1.6;
    transition: border-color 0.2s;
    outline: none;
  }
  .suggestions-textarea:focus { border-color: var(--accent); }
  .suggestions-textarea::placeholder { color: var(--ink-3); }

  .suggestions-submit {
    align-self: flex-start;
    background: #44546a; color: #fff; border: none;
    border-radius: 99px; padding: 0.65rem 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
  }
  .suggestions-submit:hover { background: var(--accent-light); transform: translateY(-1px); }

  .suggestions-success {
    display: none;
    background: var(--green-light);
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: var(--green);
    font-size: 0.9rem; font-weight: 500;
  }
  .suggestions-success.show { display: block; animation: fadeIn 0.3s ease; }

  /* ── FOOTER ── */
  footer {
    background: var(--ink);
    padding: 2.5rem 2rem;
    text-align: center;
  }

  footer .footer-logo {
    font-family: 'Lora', serif;
    font-size: 1rem; font-weight: 700;
    color: #fff; margin-bottom: 0.5rem;
  }

  footer p { color: rgba(255,255,255,0.45); font-size: 0.8rem; margin-bottom: 1.25rem; }

  footer .footer-links { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

  /* ── PROGRESS BAR ── */
  .progress-section { background: var(--surface-2); }

  .progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem; margin-top: 0.5rem;
  }

  .progress-card {
    background: #f2f6fc;
    border: 1px solid #c8d6eb;
    border-radius: var(--radius);
    padding: 1.25rem;
  }

  .progress-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 0.75rem;
  }

  .progress-title { font-weight: 600; font-size: 0.9rem; }
  .progress-pct { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--accent); font-weight: 600; }

  .progress-bar-bg {
    height: 6px; background: var(--border);
    border-radius: 99px; overflow: hidden;
  }
  .progress-bar-fill {
    height: 100%; background: #44546a;
    border-radius: 99px;
    transition: width 1s ease;
  }

  /* Dark overrides for progress tracker cards */
  #page-progress .progress-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(68,114,196,0.18);
  }
  #page-progress .progress-title    { color: #d0e4ff; }
  #page-progress .progress-pct      { color: #7ab3e0; }
  #page-progress .progress-bar-bg   { background: rgba(68,114,196,0.15); }
  #page-progress .progress-bar-fill { background: linear-gradient(90deg,#4472c4,#5b9bd5); }

  /* ── RESPONSIVE ── */
  @media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-stat-row { justify-content: center; }
    #nav-links-desktop { display: none; }
    .nav-hamburger { display: flex; }
    /* Hide Discord text on mobile — only show icon */
    .nav-discord span { display: none; }
    .nav-discord { padding: 0.45rem 0.7rem; }
    /* Hide Sign Up button on mobile to save space; login still accessible via More menu */
    #nav-auth-logged-out .nav-auth-btn:last-child { display: none; }
    #nav-auth-logged-out .nav-auth-btn { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
    /* Compact user pill on mobile */
    .nav-user-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Compact XP pill on mobile */
    #nav-xp-pill { font-size: 0.65rem; padding: 0.22rem 0.55rem; }
    .nav-right { gap: 0.25rem; }
    .resource-grid { grid-template-columns: 1fr; }
    .hero { padding: 4rem 1.25rem 3rem; }
    .section { padding: 3.5rem 1.25rem; }
    nav { padding: 0 1.25rem; }
    .subjects-container { padding: 2rem 1.25rem; }
    .nav-logo { font-size: 0.85rem; max-width: 150px; }
    .nav-left { gap: 0.4rem; }
    .mobile-bottom-nav { display: flex; }
    .page { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  }

  /* ── DIVIDER ── */
  .divider { height: 1px; background: var(--border); margin: 0; }

  /* ── YEAR CONTENT PANELS ── */
  .year-panel { display: none; }
  .year-panel.active { display: block; }

  /* ── SCROLL ANIMATE ── */
  .reveal {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.visible { opacity: 1; transform: translateY(0); }

  /* ══════════════════════════════════════════
     CHERRY BLOSSOM HOME
  ══════════════════════════════════════════ */

  /* Override body bg for home page feel */
  #page-home {
    min-height: 100vh;
    background: linear-gradient(160deg, #06101e 0%, #0d1e35 40%, #112540 70%, #071325 100%);
    position: relative;
  }

  .blossom-hero {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem 1.5rem;
    overflow: hidden;
  }

  .blossom-glow {
    position: absolute; inset: 0; z-index: 0;
    background:
      radial-gradient(ellipse 70% 55% at 20% 50%, rgba(68,114,196,0.22) 0%, transparent 65%),
      radial-gradient(ellipse 55% 45% at 80% 45%, rgba(91,155,213,0.16) 0%, transparent 60%),
      radial-gradient(ellipse 45% 40% at 50% 15%, rgba(255,192,0,0.1) 0%, transparent 55%),
      radial-gradient(ellipse 60% 50% at 50% 80%, rgba(17,37,64,0.8) 0%, transparent 70%);
    pointer-events: none;
  }

  .blossom-hero-inner {
    position: relative; z-index: 2;
    max-width: 680px; width: 100%;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 0;
    background: rgba(8, 3, 18, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(68,114,196,0.12);
    border-radius: 24px;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .blossom-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: #ffc000;
    margin-bottom: 0.5rem;
    display: inline-flex; align-items: center; gap: 0.5rem;
  }

  .blossom-title {
    font-family: 'Lora', serif;
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #f5e6ec;
    margin-bottom: 0.75rem;
    opacity: 0; animation: blossomFade 0.7s 0.2s ease forwards;
  }

  .blossom-title em {
    font-style: normal;
    background: linear-gradient(135deg, #ffc000 0%, #ed7d31 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255,192,0,0.25));
  }


  .home-streak-chip-wrap { margin: 0 0 0.5rem; }
  .home-streak-chip {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
    color: #ffe6cf;
    background: rgba(237,125,49,0.2);
    border: 1px solid rgba(237,125,49,0.35);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    margin-bottom: 0.35rem;
  }
  .home-streak-chip-sub {
    font-size: 0.75rem;
    color: rgba(245,230,236,0.62);
  }
  .blossom-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; line-height: 1.6;
    color: rgba(200, 218, 240, 0.85);
    max-width: 540px;
    margin: 0 auto 1rem;
  }

  .blossom-cta-row {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.65rem; margin-bottom: 0.75rem;
    opacity: 0; animation: blossomFade 0.7s 0.4s ease forwards;
  }

  /* ── PRIMARY DISCORD CTA ── */
  .discord-cta-wrap {
    display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
    width: 100%; max-width: 400px;
  }

  .blossom-btn-primary {
    display: flex; align-items: center; justify-content: center;
    gap: 0.9rem;
    background: linear-gradient(135deg, #5865F2 0%, #404EED 50%, #3a45d4 100%);
    color: #fff;
    border: none; border-radius: 14px;
    padding: 1.05rem 2.2rem;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em;
    text-decoration: none; cursor: pointer;
    box-shadow:
      0 0 0 0 rgba(88,101,242,0.7),
      0 6px 28px rgba(88,101,242,0.55),
      0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
    position: relative; overflow: hidden;
    animation: discordPulse 2.8s ease-in-out infinite;
  }

  @keyframes discordPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(88,101,242,0.55), 0 6px 28px rgba(88,101,242,0.45), 0 2px 8px rgba(0,0,0,0.3); }
    50%      { box-shadow: 0 0 0 10px rgba(88,101,242,0), 0 8px 36px rgba(88,101,242,0.65), 0 2px 8px rgba(0,0,0,0.3); }
  }

  /* Shimmer sweep */
  .blossom-btn-primary::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.15) 50%, transparent 65%);
    transform: translateX(-100%);
    transition: transform 0s;
  }
  .blossom-btn-primary:hover::before {
    transform: translateX(200%);
    transition: transform 0.55s ease;
  }

  .blossom-btn-primary:hover {
    background: linear-gradient(135deg, #6976f5, #5865F2, #4752d6);
    box-shadow: 0 0 0 3px rgba(88,101,242,0.35), 0 10px 40px rgba(88,101,242,0.7), 0 2px 8px rgba(0,0,0,0.3);
    transform: translateY(-3px) scale(1.015);
    animation: none;
  }
  .blossom-btn-primary:active {
    transform: translateY(0) scale(0.98);
  }

  .dc-btn-left { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
  .dc-btn-label { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
  .dc-btn-sub {
    font-size: 0.72rem; font-weight: 500; opacity: 0.82;
    display: flex; align-items: center; gap: 0.35rem;
  }
  .dc-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #57F287;
    box-shadow: 0 0 4px #57F287;
    animation: livePulse 1.5s ease-in-out infinite;
    display: inline-block;
  }
  @keyframes livePulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.75); }
  }

  /* Social proof strip */
  .cta-social-proof {
    display: flex; align-items: center; gap: 0.6rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.74rem; color: rgba(160,195,240,0.65);
  }
  .cta-sp-avatars {
    display: flex;
  }
  .cta-sp-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid rgba(10,25,50,0.8);
    margin-right: -6px;
    font-size: 0.6rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff;
  }
  .cta-sp-text { margin-left: 10px; }

  /* ── SECONDARY (demoted) ── */
  .blossom-btn-secondary {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: none;
    color: rgba(160,195,240,0.5);
    border: none;
    padding: 0.3rem 0.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem; font-weight: 500;
    cursor: pointer; letter-spacing: 0.01em;
    transition: color 0.2s;
    text-decoration: underline; text-decoration-color: transparent;
    text-underline-offset: 3px;
  }
  .blossom-btn-secondary:hover {
    color: rgba(180,210,250,0.8);
    text-decoration-color: rgba(180,210,250,0.4);
  }

  /* Guide cards */
  .blossom-guide-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem;
    width: 100%;
    margin-bottom: 2rem;
    opacity: 0; animation: blossomFade 0.7s 0.5s ease forwards;
  }

  .blossom-guide-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(68,114,196,0.18);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    min-height: 48px;
    display: flex; align-items: center; gap: 0.85rem;
    cursor: pointer; text-align: left;
    transition: all 0.25s;
    backdrop-filter: blur(12px);
    font-family: 'DM Sans', sans-serif;
  }
  .blossom-guide-card:hover {
    background: rgba(68,114,196,0.1);
    border-color: rgba(255,192,0,0.45);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(68,114,196,0.18);
  }

  .bgc-icon { font-size: 1.5rem; flex-shrink: 0; }

  .bgc-body { flex: 1; }
  .bgc-title {
    font-weight: 600; font-size: 0.9rem;
    color: #f5e6ec; margin-bottom: 0.2rem;
  }
  .bgc-subjects { font-size: 0.75rem; color: rgba(245,230,236,0.45); }

  .bgc-arrow { color: rgba(255,192,0,0.7); font-size: 1rem; flex-shrink: 0; transition: transform 0.2s; }
  .blossom-guide-card:hover .bgc-arrow { transform: translateX(4px); color: #ffc000; }

  .blossom-footnote {
    font-size: 0.75rem;
    color: rgba(200,220,255,0.35);
    letter-spacing: 0.05em;
    opacity: 0; animation: blossomFade 0.7s 0.65s ease forwards;
  }

  /* Footer */
  .blossom-footer {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid rgba(68,114,196,0.12);
    background: rgba(0,0,0,0.2);
    font-size: 0.78rem; color: rgba(245,230,236,0.35);
    flex-wrap: wrap;
  }

  .blossom-footer-link {
    color: rgba(255,192,0,0.55);
    text-decoration: none; font-size: 0.78rem;
    transition: color 0.2s;
  }
  .blossom-footer-link:hover { color: #ffc000; }

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

  @media (max-width: 540px) {
    .blossom-guide-cards { grid-template-columns: 1fr; }
  }

  /* Desktop: restore generous spacing */
  @media (min-width: 768px) {
    .blossom-hero { padding: 2.5rem 2rem 2rem; }
    .blossom-hero-inner { padding: 2rem 2.5rem 1.75rem; }
    .blossom-title { font-size: clamp(2rem, 4vw, 2.6rem); }
    .blossom-subtitle { font-size: 0.95rem; }
    .blossom-cta-row { margin-bottom: 1rem; }
  }


  /* ── HOME PROGRESS SECTION ── */
  .home-progress-section {
    position: relative; z-index: 2;
    padding: 1.5rem 1.5rem 2rem;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68,114,196,0.2);
  }

  .home-progress-inner { max-width: 680px; margin: 0 auto; }

  .home-progress-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
  }

  .home-progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: #ffc000;
  }

  .home-progress-full-btn {
    background: none; border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem; color: rgba(255,192,0,0.55);
    cursor: pointer; transition: color 0.2s;
  }
  .home-progress-full-btn:hover { color: #5b9bd5; }

  .home-progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
  }

  .home-prog-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(68,114,196,0.14);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
  }

  .home-prog-name {
    font-size: 0.78rem; font-weight: 600;
    color: #f0d0dc; margin-bottom: 0.4rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .home-prog-bar-bg {
    height: 4px; background: rgba(255,255,255,0.1);
    border-radius: 99px; overflow: hidden; margin-bottom: 0.3rem;
  }

  .home-prog-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4472c4, #5b9bd5);
    border-radius: 99px;
    transition: width 1s ease;
  }

  .home-prog-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem; color: rgba(255,192,0,0.55);
  }

  .home-social-section {
    position: relative;
    z-index: 2;
    padding: 1rem 1.25rem 1.6rem;
    background: rgba(0,0,0,0.62);
    border-top: 1px solid rgba(68,114,196,0.18);
    border-bottom: 1px solid rgba(68,114,196,0.14);
    backdrop-filter: blur(14px);
  }
  .home-social-inner { max-width: 1040px; margin: 0 auto; }
  .home-social-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 0.7rem; margin-bottom: 0.7rem; }
  .habit-home-grid { grid-template-columns: 1.5fr 1fr; align-items: stretch; }
  .home-social-card { background: rgba(255,255,255,0.07); border: 1px solid rgba(68,114,196,0.2); border-radius: 14px; padding: 0.85rem 0.95rem; }
  .home-social-kicker { font-family: 'JetBrains Mono', monospace; font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,192,0,0.72); margin-bottom: 0.4rem; }
  .home-momentum-streak { color: #f5e6ec; font-size: 1.25rem; font-weight: 700; margin-bottom: 0.15rem; }
  .home-momentum-meta { color: rgba(245,230,236,0.58); font-size: 0.78rem; margin-bottom: 0.55rem; }
  .home-primary-cta { border: 1px solid rgba(68,114,196,0.35); background: rgba(68,114,196,0.22); color: #c8dff8; border-radius: 99px; padding: 0.4rem 0.8rem; font-size: 0.74rem; font-weight: 700; cursor: pointer; }
  .home-social-headline { font-size: 0.88rem; color: #f5e6ec; font-weight: 600; margin-bottom: 0.25rem; }
  .home-social-detail { font-size: 0.77rem; color: rgba(245,230,236,0.56); line-height: 1.45; }
  .home-pulse-row { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 0.2rem; margin-bottom: 0.8rem; scrollbar-width: thin; }
  .home-pulse-chip { flex: 0 0 auto; border-radius: 999px; border: 1px solid rgba(155,109,255,0.28); background: rgba(155,109,255,0.1); color: rgba(220,208,255,0.92); font-size: 0.71rem; padding: 0.34rem 0.64rem; white-space: nowrap; font-family: 'DM Sans', sans-serif; }
  .home-feed-list { display: flex; flex-direction: column; gap: 0.42rem; }
  .home-feed-item { font-size: 0.76rem; line-height: 1.4; color: rgba(245,230,236,0.6); border-bottom: 1px solid rgba(68,114,196,0.12); padding-bottom: 0.35rem; }
  .home-feed-item:last-child { border-bottom: none; padding-bottom: 0; }
  .home-feed-item strong { color: #f5e6ec; font-weight: 700; }
  .home-feed-time { color: rgba(140,170,220,0.62); }

  .home-path-card { display:flex; flex-direction:column; gap:0.5rem; }
  .home-path-option {
    width:100%; display:flex; justify-content:space-between; align-items:center;
    background: rgba(68,114,196,0.14);
    border:1px solid rgba(68,114,196,0.35);
    border-radius:12px; padding:0.75rem 0.85rem;
    min-height:48px;
    color:#f5e6ec; font-family:'DM Sans',sans-serif; font-size:0.88rem; font-weight:700;
    cursor:pointer;
  }
  .home-path-option em { font-style:normal; font-size:0.65rem; color:rgba(160,195,240,0.72); font-weight:600; }
  .home-path-option:hover { background: rgba(68,114,196,0.24); }
  .home-mini-progress { margin-top:0.35rem; font-size:0.72rem; color:rgba(255,192,0,0.72); font-family:'JetBrains Mono',monospace; }
  .home-return-card { display:flex; flex-direction:column; justify-content:center; gap:0.5rem; }
  .home-micro-banner {
    margin-bottom:0.8rem; border-radius:12px; border:1px solid rgba(255,192,0,0.35);
    background: rgba(255,192,0,0.09); color:#ffe6cf; padding:0.58rem 0.75rem;
    font-size:0.78rem;
  }
  .home-soft-social-card { display:flex; align-items:center; justify-content:space-between; gap:0.8rem; }
  .hero-cta-dual { display:flex; gap:0.65rem; width:100%; max-width:440px; }
  .hero-cta-dual > * { flex:1; }
  .hero-pill-btn-solid { background: rgba(68,114,196,0.35); border-color: rgba(68,114,196,0.6); }
  .hero-social-proof { font-size:0.8rem; color:rgba(200,218,240,0.78); }
  .home-see-more-wrap { text-align:center; margin: 0.25rem 0 0.65rem; }
  .home-see-more-btn { border:1px solid rgba(68,114,196,0.35); background:rgba(68,114,196,0.18); color:#c8dff8; border-radius:999px; padding:0.5rem 1rem; font-size:0.75rem; font-weight:700; cursor:pointer; }
  #home-more-modules[hidden] { display:none !important; }

  @media (max-width: 960px) { .home-social-grid, .habit-home-grid { grid-template-columns: 1fr; } }

  @media (max-width: 480px) {
    .home-progress-grid { grid-template-columns: repeat(2, 1fr); }
  }


  /* ── DISCORD LIVE STATS ── */
  .discord-stats {
    display: flex; align-items: center; gap: 0;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(68,114,196,0.25);
    border-radius: 99px;
    padding: 0.4rem 1rem;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(10px);
    flex-wrap: wrap; justify-content: center;
    gap: 0.2rem;
  }

  .ds-stat {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0 0.6rem;
  }

  .ds-divider {
    width: 1px; height: 16px;
    background: rgba(68,114,196,0.18);
  }

  .ds-dot {
    width: 8px; height: 8px;
    border-radius: 50%; flex-shrink: 0;
  }
  .ds-dot-online  { background: #23a55a; box-shadow: 0 0 6px #23a55a; }
  .ds-dot-members { background: #5865F2; box-shadow: 0 0 6px rgba(88,101,242,0.7); }
  .ds-dot-subjects{ background: #5b9bd5; box-shadow: 0 0 6px rgba(255,192,0,0.7); }

  .ds-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem; font-weight: 600;
    color: #f5e6ec;
  }
  .ds-num.loading { color: rgba(200,220,255,0.35); }

  .ds-label {
    font-size: 0.75rem; color: rgba(245,230,236,0.5);
  }

  @keyframes statPulse {
    0%,100% { opacity: 1; } 50% { opacity: 0.4; }
  }
  .ds-num.loading { animation: statPulse 1.2s infinite; }

  /* ── HOME SUGGESTIONS ── */
  .home-suggestions-section {
    position: relative; z-index: 2;
    padding: 2.5rem 1.5rem 3rem;
    background: rgba(0,0,0,0.62);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68,114,196,0.1);
  }

  .home-suggestions-inner {
    max-width: 560px; margin: 0 auto; text-align: center;
  }

  .home-sug-title {
    font-family: 'Lora', serif;
    font-size: 1.2rem; font-weight: 700;
    color: #f5e6ec; margin-bottom: 0.4rem;
  }

  .home-sug-sub {
    font-size: 0.85rem; color: rgba(245,230,236,0.5);
    margin-bottom: 1.25rem;
  }

  .home-sug-form {
    display: flex; flex-direction: column; gap: 0.75rem;
    align-items: center;
  }

  .home-sug-textarea {
    width: 100%; min-height: 100px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(68,114,196,0.18);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; color: #f5e6ec;
    resize: vertical; outline: none; line-height: 1.6;
    transition: border-color 0.2s;
  }
  .home-sug-textarea::placeholder { color: rgba(200,220,255,0.35); }
  .home-sug-textarea:focus { border-color: rgba(68,114,196,0.5); }

  .home-sug-btn {
    background: linear-gradient(135deg, #4472c4, #2a5aad);
    color: #fff; border: none; border-radius: 99px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; font-weight: 600;
    padding: 0.65rem 1.5rem;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(68,114,196,0.35);
  }
  .home-sug-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(68,114,196,0.5);
  }
  .home-sug-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }


  /* ── GRANULAR CHECKLIST ────────────────────────────────── */
  .cl-subject-block {
    background: #f2f6fc;
    border: 1px solid #c8d6eb;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 70px;
  }

  .cl-subject-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
  }

  .cl-subject-name {
    font-family: 'Lora', serif;
    font-size: 1.05rem; font-weight: 700;
    color: var(--ink);
  }

  .cl-subject-meta {
    display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0;
  }

  .cl-subject-bar-bg {
    width: 90px; height: 6px;
    background: var(--border); border-radius: 99px; overflow: hidden;
  }
  .cl-subject-bar-fill {
    height: 100%; background: linear-gradient(90deg, #4472c4, #5b9bd5);
    border-radius: 99px; transition: width 0.8s ease;
  }

  .cl-subject-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem; font-weight: 600; color: #4472c4;
    min-width: 36px; text-align: right;
  }

  .cl-section {
    margin-bottom: 1rem;
  }

  .cl-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  .cl-section-name {
    font-size: 0.82rem; font-weight: 600;
    color: var(--ink-2);
    letter-spacing: 0.01em;
  }

  .cl-section-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: var(--ink-3);
  }

  .cl-topics-flat {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
  }

  .cl-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.28rem 0.6rem;
    cursor: pointer; font-size: 0.78rem;
    color: var(--ink-2);
    transition: all 0.15s;
    user-select: none;
  }
  .cl-chip:hover { border-color: #4472c4; color: #44546a; background: #dce8f8; }
  .cl-chip input[type=checkbox] { accent-color: var(--accent); cursor: pointer; width: 13px; height: 13px; }

  .cl-chip-done {
    background: var(--green-light);
    border-color: #86efac;
    color: var(--green);
    text-decoration: line-through;
    opacity: 0.8;
  }
  .cl-chip-done:hover { border-color: var(--green); background: var(--green-light); color: var(--green); }


  /* ── STUDY GUIDE + PROGRESS dark-background overrides ── */
  #page-guide .subj-hero,
  #page-progress .subj-hero {
    background: rgba(6, 16, 30, 0.5);
    border-bottom: 1px solid rgba(68, 114, 196, 0.18);
  }
  #page-guide .subj-hero h1,
  #page-progress .subj-hero h1     { color: #f0f6ff; }
  #page-guide .subj-hero p,
  #page-progress .subj-hero p      { color: rgba(160, 195, 240, 0.65); }
  #page-guide .breadcrumb,
  #page-progress .breadcrumb       { color: rgba(140, 170, 220, 0.45); }
  #page-guide .breadcrumb button,
  #page-progress .breadcrumb button{ color: #7ab3e0; }
  #page-guide .year-tab,
  #page-progress .year-tab {
    background: rgba(255,255,255,0.05);
    border-color: rgba(68,114,196,0.25);
    color: rgba(160,195,240,0.55);
  }
  #page-guide .year-tab.active,
  #page-progress .year-tab.active {
    background: #4472c4; border-color: #4472c4; color: #fff;
  }
  #page-guide .year-tab:hover:not(.active),
  #page-progress .year-tab:hover:not(.active) {
    border-color: rgba(68,114,196,0.5); color: #a0c8f0; background: rgba(68,114,196,0.12);
  }
  #page-guide .subject-header h2  { color: #e0eeff; }
  #page-guide .subject-header div { color: rgba(140,170,220,0.5) !important; }
  #page-guide .subject-icon-wrap  { background: rgba(68,114,196,0.15) !important; }
  #page-guide .resource-card {
    background: rgba(255,255,255,0.04);
    border-color: rgba(68,114,196,0.18);
  }
  #page-guide .resource-card:hover {
    background: rgba(68,114,196,0.09);
    border-color: rgba(68,114,196,0.35);
    transform: translateY(-2px);
  }
  #page-guide .resource-card h4   { color: #d0e4ff; }
  #page-guide .resource-list li   { color: rgba(160,195,240,0.7); }
  #page-guide .resource-list li::before { color: rgba(68,114,196,0.5); }
  #page-guide .tag-books     { background: rgba(68,114,196,0.18); color: #7ab3e0; }
  #page-guide .tag-review    { background: rgba(45,158,87,0.15);  color: #57f287; }
  #page-guide .tag-practicals{ background: rgba(255,192,0,0.12);  color: #ffc000; }
  #page-guide .tag-cases     { background: rgba(224,92,110,0.14); color: #f08090; }
  #page-guide .tag-anki      { background: rgba(122,90,171,0.15); color: #b09fdb; }
  #page-guide .tag-videos    { background: rgba(237,125,49,0.14); color: #ed7d31; }
  #page-guide .tag-questions { background: rgba(45,158,87,0.12);  color: #57f287; }
  #page-guide .tag-other     { background: rgba(255,255,255,0.06); color: rgba(160,195,240,0.55); }

  #page-guide .suggestions-section,
  #page-progress .suggestions-section {
    background: rgba(6, 14, 28, 0.55);
    border-top: 1px solid rgba(68, 114, 196, 0.16);
  }
  #page-guide .suggestions-inner h3,
  #page-progress .suggestions-inner h3   { color: #e0eeff; }
  #page-guide .suggestions-inner p,
  #page-progress .suggestions-inner p    { color: rgba(160, 195, 240, 0.55); }
  #page-guide .suggestions-textarea,
  #page-progress .suggestions-textarea {
    background: rgba(255,255,255,0.05);
    border-color: rgba(68,114,196,0.22);
    color: #d0e4ff;
  }
  #page-guide .suggestions-textarea::placeholder,
  #page-progress .suggestions-textarea::placeholder { color: rgba(140,170,220,0.3); }
  #page-guide .suggestions-textarea:focus,
  #page-progress .suggestions-textarea:focus { border-color: rgba(68,114,196,0.5); }
  #page-guide .suggestions-success,
  #page-progress .suggestions-success {
    background: rgba(45,158,87,0.1);
    border-color: rgba(45,158,87,0.3);
    color: #57f287;
  }
  #page-progress .subjects-container { color: #e0eeff; }
  #page-progress .section-label      { color: rgba(255,192,0,0.78); }
  #page-progress .cl-subject-block {
    background: rgba(255,255,255,0.04);
    border-color: rgba(68,114,196,0.18);
  }
  #page-progress .cl-subject-name    { color: #d0e4ff; }
  #page-progress .cl-subject-bar-bg  { background: rgba(68,114,196,0.15); }
  #page-progress .cl-subject-pct     { color: #7ab3e0; }
  #page-progress .cl-section-name    { color: rgba(160,195,240,0.7); }
  #page-progress .cl-section-count   { color: rgba(140,170,220,0.4); }
  #page-progress .cl-chip {
    background: rgba(255,255,255,0.05);
    border-color: rgba(68,114,196,0.2);
    color: rgba(160,195,240,0.65);
  }
  #page-progress .cl-chip:hover      { border-color: #4472c4; color: #a0c8f0; background: rgba(68,114,196,0.14); }
  #page-progress .cl-chip-done {
    background: rgba(45,158,87,0.12);
    border-color: rgba(45,158,87,0.3);
    color: #57f287;
  }
  #page-progress div[style*="background: var(--surface)"] {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(68,114,196,0.18) !important;
    color: #e0eeff;
  }
  #page-progress [style*="color: var(--ink)"],
  #page-progress [style*="font-family:'Lora'"] { color: #d0e4ff !important; }
  #page-home {
    background: linear-gradient(160deg, #06101e 0%, #0d1e35 40%, #112540 70%, #071325 100%) !important;
  }

  /* Shift accent glow to teal-blue instead of pink */
  .blossom-eyebrow { color: #ffc000 !important; letter-spacing: 0.16em; }
  .blossom-title em {
    background: linear-gradient(135deg, #ffc000, #ed7d31) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; filter: drop-shadow(0 0 18px rgba(255,192,0,0.3));
  }
  .blossom-btn-primary {
    background: linear-gradient(135deg, #4472c4, #2a5aad) !important;
    box-shadow: 0 4px 24px rgba(68,114,196,0.45) !important;
  }
  .blossom-btn-primary:hover {
    background: linear-gradient(135deg, #5b85d0, #3a6bc0) !important;
    box-shadow: 0 8px 32px rgba(68,114,196,0.6) !important;
  }
  .blossom-guide-card:hover {
    border-color: rgba(126,200,227,0.5) !important;
    box-shadow: 0 8px 32px rgba(26,110,168,0.25) !important;
  }
  .discord-stats { border-color: rgba(68,114,196,0.3) !important; }
  .ds-dot-online  { background: #23a55a; box-shadow: 0 0 6px #23a55a; }
  .ds-dot-members { background: #4472c4; box-shadow: 0 0 6px rgba(68,114,196,0.7) !important; }
  .home-sug-textarea { border-color: rgba(68,114,196,0.2) !important; }
  .home-sug-textarea:focus { border-color: rgba(68,114,196,0.5) !important; }
  .home-sug-btn {
    background: linear-gradient(135deg, #4472c4, #2a5aad);
    box-shadow: 0 4px 16px rgba(68,114,196,0.35);
  }
  .home-sug-btn:hover { box-shadow: 0 6px 24px rgba(68,114,196,0.5) !important; }
  .home-prog-bar-fill { background: linear-gradient(90deg, #4472c4, #ffc000) !important; }

  /* ══ MOTIVATIONAL BUBBLE — slides in from side ══ */
  #mascot-wrap {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    /* JS sets top + peek-right / peek-left */
  }

  #mascot-bubble {
    background: rgba(6, 16, 30, 0.93);
    backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255,192,0,0.38);
    border-radius: 14px;
    padding: 0.95rem 1.2rem;
    max-width: 240px;
    min-width: 150px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(68,114,196,0.12);
    position: relative;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.34,1.2,0.64,1);
  }
  #mascot-bubble p {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.83rem; line-height: 1.6;
    color: #deeaf8; margin: 0;
  }

  /* ── FROM RIGHT: bubble slides in from right edge ── */
  #mascot-wrap.peek-right {
    right: 0; left: auto;
  }
  #mascot-wrap.peek-right #mascot-bubble {
    transform: translateX(calc(100% + 16px));
    border-radius: 14px 4px 4px 14px;
  }
  #mascot-wrap.peek-right.peeking #mascot-bubble {
    opacity: 1;
    transform: translateX(0);
  }
  /* Small notch on right edge */
  #mascot-wrap.peek-right #mascot-bubble::after {
    content: '';
    position: absolute;
    top: 50%; right: -1px;
    transform: translateY(-50%);
    width: 4px; height: 28px;
    background: rgba(255,192,0,0.5);
    border-radius: 0 4px 4px 0;
  }

  /* ── FROM LEFT: bubble slides in from left edge ── */
  #mascot-wrap.peek-left {
    left: 0; right: auto;
  }
  #mascot-wrap.peek-left #mascot-bubble {
    transform: translateX(calc(-100% - 16px));
    border-radius: 4px 14px 14px 4px;
  }
  #mascot-wrap.peek-left.peeking #mascot-bubble {
    opacity: 1;
    transform: translateX(0);
  }
  /* Small notch on left edge */
  #mascot-wrap.peek-left #mascot-bubble::after {
    content: '';
    position: absolute;
    top: 50%; left: -1px;
    transform: translateY(-50%);
    width: 4px; height: 28px;
    background: rgba(255,192,0,0.5);
    border-radius: 4px 0 0 4px;
  }

  @media (max-width: 480px) {
    #mascot-bubble { max-width: 180px; font-size: 0.78rem; padding: 0.75rem 1rem; }
  }


  /* ══ MEDICAL WORDLE ══════════════════════════════════════════ */
  .wordle-section {
    position: relative; z-index: 2;
    padding: 2rem 1.5rem 2.5rem;
    background: rgba(0,0,0,0.32);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68,114,196,0.2);
  }
  .wordle-outer {
    max-width: 1020px; margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
  }
  .wordle-inner { width: 100%; }
  @media (max-width: 800px) {
    .wordle-outer { grid-template-columns: 1fr; }
  }

  .wordle-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 0.4rem; gap: 1rem;
  }
  .wordle-title-block {}
  .wordle-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: #ffc000; margin-bottom: 0.25rem;
  }
  .wordle-title {
    font-family: 'Lora', serif;
    font-size: 1.25rem; font-weight: 700;
    color: #f0f6ff; margin: 0 0 0.2rem;
  }
  .wordle-tagline {
    font-size: 0.78rem; color: rgba(180,200,240,0.6);
    font-style: italic; margin: 0;
  }
  .wordle-new-btn {
    background: rgba(68,114,196,0.15);
    border: 1px solid rgba(68,114,196,0.3);
    border-radius: 8px; padding: 0.4rem 0.85rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem; color: #7ab3e0;
    cursor: pointer; white-space: nowrap;
    transition: all 0.2s; flex-shrink: 0;
  }
  .wordle-new-btn:hover { background: rgba(68,114,196,0.28); color: #b4d4f0; }

  /* Grid */
  .wordle-grid {
    display: grid; grid-template-rows: repeat(6, 1fr);
    gap: 5px; margin: 1.25rem auto 1rem;
    width: fit-content;
  }
  .wordle-row { display: flex; gap: 5px; }
  .wordle-cell {
    width: 52px; height: 52px;
    border: 2px solid rgba(68,114,196,0.25);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Lora', serif;
    font-size: 1.3rem; font-weight: 700;
    color: #f0f6ff;
    text-transform: uppercase;
    background: rgba(10,25,50,0.7);
    transition: border-color 0.15s, background 0.3s, transform 0.1s;
    position: relative;
    user-select: none;
  }
  .wordle-cell.filled { border-color: rgba(91,155,213,0.5); }
  .wordle-cell.pop { animation: cellPop 0.1s ease; }
  @keyframes cellPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
  }
  .wordle-cell.flip { animation: cellFlip 0.5s ease forwards; }
  @keyframes cellFlip {
    0%   { transform: rotateX(0deg); }
    50%  { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
  }
  .wordle-cell.correct  { background: #1a6b3a; border-color: #2d9e57; color: #fff; }
  .wordle-cell.present  { background: #7a5a00; border-color: #ffc000; color: #fff; }
  .wordle-cell.absent   { background: rgba(30,40,60,0.9); border-color: rgba(60,80,120,0.3); color: rgba(180,200,240,0.5); }
  .wordle-cell.shake    { animation: cellShake 0.45s ease; }
  @keyframes cellShake {
    0%,100%{ transform:translateX(0); }
    20%    { transform:translateX(-6px); }
    40%    { transform:translateX(6px); }
    60%    { transform:translateX(-4px); }
    80%    { transform:translateX(4px); }
  }

  /* Keyboard */
  .wordle-kb { margin-top: 0.75rem; }
  .wordle-kb-row {
    display: flex; justify-content: center;
    gap: 5px; margin-bottom: 5px;
  }
  .wordle-key {
    height: 44px; min-width: 36px; padding: 0 6px;
    border: none; border-radius: 6px;
    background: rgba(68,114,196,0.18);
    color: #c8daf0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s, color 0.15s;
    text-transform: uppercase;
  }
  .wordle-key:hover { background: rgba(68,114,196,0.32); }
  .wordle-key.wide  { min-width: 58px; font-size: 0.72rem; }
  .wordle-key.correct { background: #1a6b3a; color: #fff; }
  .wordle-key.present { background: #7a5a00; color: #fff; }
  .wordle-key.absent  { background: rgba(20,30,50,0.8); color: rgba(140,160,200,0.4); }

  /* Status */
  .wordle-status {
    text-align: center; min-height: 1.5rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; color: rgba(180,210,255,0.8);
    margin: 0.5rem 0 0.25rem;
    transition: opacity 0.3s;
  }
  .wordle-status.win  { color: #2d9e57; font-weight: 600; }
  .wordle-status.lose { color: #e05c6e; font-weight: 600; }

  /* Hint */
  .wordle-hint {
    text-align: center;
    font-size: 0.72rem; color: rgba(140,170,220,0.55);
    font-style: italic; margin-top: 0.5rem;
  }

  /* ── POST-GAME PANEL ───────────────────────────────────────── */
  .wordle-postgame {
    margin-top: 1.2rem;
    padding: 1.25rem 1rem;
    background: rgba(10,25,50,0.6);
    border: 1px solid rgba(68,114,196,0.2);
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.4s ease;
  }
  .wordle-pg-result {
    font-size: 1.6rem; font-weight: 700;
    font-family: 'Lora', serif;
    margin-bottom: 0.3rem;
    color: #e0eeff;
  }
  .wordle-pg-word {
    font-size: 2rem; font-weight: 800; letter-spacing: 0.18em;
    font-family: 'Lora', serif; color: #7ab3e0;
    margin-bottom: 0.2rem;
  }
  .wordle-pg-def {
    font-size: 0.78rem; color: rgba(140,170,220,0.65);
    font-style: italic; margin-bottom: 0.9rem;
  }
  .wordle-pg-feedback {
    font-size: 0.82rem; color: rgba(160,195,240,0.8);
    background: rgba(68,114,196,0.1);
    border-radius: 8px; padding: 0.6rem 0.9rem;
    margin-bottom: 1rem; line-height: 1.5;
  }
  .wordle-pg-share-row {
    position: relative; display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
  }
  .wordle-share-btn {
    background: rgba(68,114,196,0.22); border: 1px solid rgba(68,114,196,0.35);
    color: #a0c8f0; border-radius: 8px;
    padding: 0.45rem 1rem; font-size: 0.8rem; cursor: pointer;
    transition: background 0.15s;
  }
  .wordle-share-btn:hover { background: rgba(68,114,196,0.38); }
  .wordle-share-copied {
    position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + 4px);
    font-size: 0.75rem; color: #2d9e57;
    opacity: 0; transition: opacity 0.3s; white-space: nowrap;
  }
  .wordle-share-copied.visible { opacity: 1; }
  .wordle-countdown-wrap {
    border-top: 1px solid rgba(68,114,196,0.15);
    padding-top: 0.8rem;
  }
  .wordle-countdown-label {
    font-size: 0.7rem; color: rgba(140,170,220,0.5);
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
  }
  .wordle-countdown {
    font-size: 1.5rem; font-weight: 700; letter-spacing: 0.1em;
    font-family: 'JetBrains Mono', monospace; color: #5b9bd5;
  }

  /* ── STATS MODAL ───────────────────────────────────────────── */
  .wordle-stats-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 300; backdrop-filter: blur(4px);
  }
  .wordle-stats-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 301;
    background: #0d1e35; border: 1px solid rgba(68,114,196,0.3);
    border-radius: 16px; padding: 2rem 1.75rem 1.75rem;
    width: min(380px, 92vw);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: fadeIn 0.2s ease;
  }
  .wordle-stats-close {
    position: absolute; top: 0.8rem; right: 0.9rem;
    background: none; border: none; color: rgba(140,170,220,0.5);
    font-size: 1.1rem; cursor: pointer; padding: 0.3rem;
  }
  .wordle-stats-close:hover { color: #a0c8f0; }
  .wordle-stats-title {
    text-align: center; font-family: 'Lora', serif;
    color: #e0eeff; font-size: 1.1rem; margin: 0 0 1.25rem;
  }
  .wordle-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem; margin-bottom: 1.5rem;
  }
  .wordle-stat-box {
    text-align: center;
    background: rgba(68,114,196,0.1);
    border-radius: 10px; padding: 0.7rem 0.3rem;
  }
  .wordle-stat-num {
    font-size: 1.5rem; font-weight: 700;
    font-family: 'Lora', serif; color: #7ab3e0;
    line-height: 1;
  }
  .wordle-stat-lbl {
    font-size: 0.58rem; color: rgba(140,170,220,0.55);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-top: 0.3rem;
  }
  .wordle-dist-title {
    text-align: center; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(140,170,220,0.5); margin-bottom: 0.75rem;
  }
  .wordle-dist { display: flex; flex-direction: column; gap: 0.35rem; }
  .wordle-dist-row {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem;
  }
  .wordle-dist-label {
    width: 14px; text-align: right;
    color: rgba(160,195,240,0.7); flex-shrink: 0;
  }
  .wordle-dist-bar-wrap {
    flex: 1; background: rgba(255,255,255,0.06);
    border-radius: 4px; height: 20px; overflow: hidden;
  }
  .wordle-dist-bar {
    height: 100%; background: rgba(68,114,196,0.5);
    border-radius: 4px; min-width: 2px;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 6px;
    font-size: 0.72rem; color: #c8deff; font-weight: 600;
    transition: width 0.5s ease;
  }
  .wordle-dist-bar.highlight { background: #1a6b3a; }

  @media (max-width: 480px) {
    .wordle-cell { width: 42px; height: 42px; font-size: 1.1rem; }
    .wordle-key  { height: 40px; min-width: 30px; font-size: 0.75rem; }
    .wordle-key.wide { min-width: 50px; }
    .wordle-stats-grid { grid-template-columns: repeat(2, 1fr); }
  }


  /* ══ FLASHCARD ════════════════════════════════════════════════ */
  .flashcard-panel {
    display: flex; flex-direction: column;
    gap: 0;
  }
  .flashcard-header { margin-bottom: 0.9rem; }

  .fc-card {
    width: 100%;
    perspective: 1000px;
    cursor: pointer;
    min-height: 280px;
    margin-bottom: 1rem;
  }
  .fc-inner {
    position: relative;
    width: 100%; min-height: 280px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4,0.2,0.2,1);
  }
  .fc-card.flipped .fc-inner { transform: rotateY(180deg); }

  .fc-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: rgba(8,20,42,0.85);
    border: 1.5px solid rgba(68,114,196,0.28);
    border-radius: 14px;
    padding: 1.5rem 1.4rem;
    display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  }
  .fc-back {
    transform: rotateY(180deg);
    background: rgba(8,28,18,0.9);
    border-color: rgba(45,158,87,0.35);
  }

  .fc-subject-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    padding: 0.22rem 0.65rem;
    border-radius: 99px;
    margin-bottom: 1rem;
    display: inline-block;
  }
  .fc-subject-tag-back { background: rgba(45,158,87,0.18); color: #2d9e57; border: 1px solid rgba(45,158,87,0.3); }

  /* Subject colour coding */
  .tag-anatomy     { background: rgba(68,114,196,0.2);  color: #7ab3e0; border: 1px solid rgba(68,114,196,0.35); }
  .tag-physiology  { background: rgba(91,155,213,0.2);  color: #90c4e8; border: 1px solid rgba(91,155,213,0.35); }
  .tag-biochemistry{ background: rgba(255,192,0,0.15);  color: #ffd44d; border: 1px solid rgba(255,192,0,0.3);  }
  .tag-pathology   { background: rgba(224,92,110,0.18); color: #f08090; border: 1px solid rgba(224,92,110,0.3); }
  .tag-pharmacology{ background: rgba(120,80,200,0.2);  color: #b090e8; border: 1px solid rgba(120,80,200,0.3); }
  .tag-microbiology{ background: rgba(45,158,87,0.18);  color: #5ecb85; border: 1px solid rgba(45,158,87,0.3);  }

  .fc-question {
    font-family: 'Lora', serif;
    font-size: 1.05rem; font-weight: 600; line-height: 1.6;
    color: #e8f0fa; flex: 1;
  }
  .fc-answer {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem; line-height: 1.65;
    color: #c8f0d8; flex: 1;
  }
  .fc-tap-hint {
    font-size: 0.9rem; color: rgba(120,160,220,0.45);
    font-style: italic; margin-top: 1.25rem;
    align-self: flex-end;
  }
  .fc-source {
    font-size: 0.68rem; color: rgba(90,160,110,0.6);
    font-style: italic; margin-top: 1rem;
    align-self: flex-end;
  }

  /* Flip animation */
  @keyframes fcEntrance {
    from { opacity:0; transform: translateY(12px) scale(0.97); }
    to   { opacity:1; transform: translateY(0) scale(1); }
  }
  .fc-card.new-card { animation: fcEntrance 0.4s ease forwards; }

  .fc-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem;
  }
  .fc-btn {
    border: none; border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: 'DM Sans', sans-serif; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: all 0.18s;
  }
  .fc-btn-skip  { background: rgba(68,114,196,0.15); color: #7ab3e0; border: 1px solid rgba(68,114,196,0.25); }
  .fc-btn-skip:hover  { background: rgba(68,114,196,0.28); }
  .fc-btn-know  { background: rgba(45,158,87,0.18); color: #5ecb85; border: 1px solid rgba(45,158,87,0.3); }
  .fc-btn-know:hover  { background: rgba(45,158,87,0.32); }
  .fc-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem; color: rgba(140,170,220,0.5);
    flex: 1; text-align: center;
  }

  /* ══ PLAY PAGE ═══════════════════════════════════════════════ */
  #page-medwordle, #page-guide, #page-progress, #page-pearls, #page-ward {
    min-height: 100vh;
    background: linear-gradient(160deg, #06101e 0%, #0d1e35 40%, #112540 70%, #071325 100%);
  }
  .play-page-wrap {
    position: relative; z-index: 2;
    padding-top: 0; /* below nav handled by .page */
  }

  /* ── FLAIR PANEL ── */
  .flair-panel {
    position: relative;
    width: 100%;
    border-bottom: 1px solid rgba(68,114,196,0.18);
    background: rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
  }
  .flair-inner {
    display: flex;
  }

  /* Flair card variants */
  .flair-card {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 120px;
    align-items: stretch;
  }

  /* Poster style flair block */
  .flair-block {
    padding: 1.75rem 2rem;
    display: flex; flex-direction: column; justify-content: center;
    border-right: 1px solid rgba(68,114,196,0.12);
  }
  .flair-block:last-child { border-right: none; }

  .flair-block.accent-blue  { background: rgba(68,114,196,0.08); }
  .flair-block.accent-gold  { background: rgba(255,192,0,0.06); }
  .flair-block.accent-green { background: rgba(45,158,87,0.07); }
  .flair-block.accent-dark  { background: rgba(5,12,24,0.5); }
  .flair-block.accent-red   { background: rgba(224,92,110,0.07); }

  .flair-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase;
    opacity: 0.55; margin-bottom: 0.5rem;
    color: #c8daf0;
  }
  .flair-stat {
    font-family: 'Lora', serif;
    font-size: 2.8rem; font-weight: 700; line-height: 1;
    color: #ffc000;
    margin-bottom: 0.3rem;
  }
  .flair-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem; color: rgba(180,210,240,0.7);
    line-height: 1.45;
  }
  .flair-quote {
    font-family: 'Lora', serif;
    font-size: 1.05rem; font-style: italic; font-weight: 600;
    color: #e8f0fa; line-height: 1.55;
    margin-bottom: 0.5rem;
  }
  .flair-attr {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem; color: rgba(140,170,220,0.5);
    letter-spacing: 0.04em;
  }
  .flair-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background: rgba(255,192,0,0.12);
    color: #ffc000;
    border: 1px solid rgba(255,192,0,0.25);
    margin-bottom: 0.6rem;
    width: fit-content;
  }
  .flair-headline {
    font-family: 'Lora', serif;
    font-size: 1.3rem; font-weight: 700;
    color: #f0f6ff; line-height: 1.35;
    margin-bottom: 0.45rem;
  }
  .flair-body {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem; color: rgba(160,195,240,0.65);
    line-height: 1.55;
  }


  /* ── GAMES GRID ── */
  .play-games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 680px;
    margin: 0 auto;
  }

  .play-card {
    padding: 2rem 2.5rem 2.5rem;
    border-right: none;
    border-top: 1px solid rgba(68,114,196,0.15);
    background: rgba(0,0,0,0.22);
    backdrop-filter: blur(10px);
  }
  .play-card-header { margin-bottom: 1.2rem; }

  @media(max-width:800px) {
    .play-card { padding: 1.5rem; }
  }
  /* ── HOME STUDY GUIDES SECTION ── */
  .home-guides-section {
    position: relative; z-index: 2;
    padding: 1.5rem 1.5rem 2rem;
    background: rgba(0,0,0,0.56);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68,114,196,0.2);
  }
  .home-guides-inner { max-width: 680px; margin: 0 auto; }

  /* ── HERO SECONDARY ROW (pill buttons) ── */
  .hero-secondary-row {
    display: flex; gap: 0.65rem; flex-wrap: wrap; justify-content: center;
    margin-bottom: 1.5rem;
    opacity: 0; animation: blossomFade 0.7s 0.6s ease forwards;
  }
  .hero-pill-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 99px;
    padding: 0.5rem 1.1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 600;
    color: rgba(200,220,255,0.85);
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
  }
  .hero-pill-btn:hover {
    background: rgba(68,114,196,0.2);
    border-color: rgba(68,114,196,0.45);
    color: #fff;
    transform: translateY(-1px);
  }

  /* ── HOME FLASHCARD SECTION ── */
  .home-fc-section {
    position: relative; z-index: 2;
    padding: 1.5rem 1.5rem 2rem;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(68,114,196,0.2);
  }
  .home-fc-inner { max-width: 680px; margin: 0 auto; }
  .home-fc-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; gap: 1rem;
  }
  .hfc-card {
    width: 100%; perspective: 1000px;
    cursor: pointer; min-height: 200px; margin-bottom: 1rem;
  }
  .hfc-inner {
    position: relative; width: 100%; min-height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4,0.2,0.2,1);
  }
  .hfc-card.flipped .hfc-inner { transform: rotateY(180deg); }
  .hfc-front {
    background: rgba(8,20,42,0.85);
    border: 1.5px solid rgba(68,114,196,0.28);
  }
  .hfc-back {
    transform: rotateY(180deg);
    background: rgba(8,28,18,0.9);
    border: 1.5px solid rgba(45,158,87,0.35);
  }
  .hfc-card.new-card { animation: fcEntrance 0.4s ease forwards; }

  /* ══════════════════════════════════════════════════════════
     THE WARD — Complete Hospital Study System
  ══════════════════════════════════════════════════════════ */
  #page-ward { min-height:100vh; background:var(--app-bg); color:#e0eeff; font-family:'DM Sans',sans-serif; position:relative; }
  .ward-wrap { position:relative; z-index:2; min-height:100vh; display:flex; flex-direction:column; }

  /* AUTH */
  .ward-auth { position:absolute; inset:0; top:64px; display:flex; align-items:center; justify-content:center; padding:2rem; z-index:10; }
  .ward-auth-card { background:rgba(6,14,28,0.96); border:1px solid rgba(68,114,196,0.28); border-radius:18px; padding:2.5rem; width:100%; max-width:390px; backdrop-filter:blur(24px); box-shadow:0 24px 80px rgba(0,0,0,0.6); }
  .ward-auth-eyebrow { font-family:'JetBrains Mono',monospace; font-size:0.58rem; letter-spacing:0.2em; text-transform:uppercase; color:#ffc000; opacity:0.75; margin-bottom:0.3rem; text-align:center; }
  .ward-auth-title { font-family:'Lora',serif; font-size:1.7rem; font-weight:700; color:#f0f6ff; margin-bottom:0.2rem; text-align:center; }
  .ward-auth-sub { font-size:0.76rem; color:rgba(255,192,0,0.78); margin-bottom:1.5rem; text-align:center; }
  .ward-auth-tabs { display:flex; gap:4px; margin-bottom:1.5rem; background:rgba(255,255,255,0.04); border-radius:10px; padding:4px; }
  .ward-auth-tab { flex:1; padding:0.48rem; border:none; border-radius:7px; font-family:'DM Sans',sans-serif; font-size:0.82rem; font-weight:600; cursor:pointer; transition:all 0.2s; background:transparent; color:rgba(255,192,0,0.78); }
  .ward-auth-tab.active { background:rgba(68,114,196,0.25); color:#a0c8f0; }
  .ward-field-label { font-size:0.68rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:rgba(140,170,220,0.4); margin-bottom:0.3rem; display:block; }
  .ward-field-input { width:100%; box-sizing:border-box; background:rgba(255,255,255,0.05); border:1px solid rgba(68,114,196,0.22); border-radius:9px; padding:0.62rem 0.9rem; font-family:'DM Sans',sans-serif; font-size:0.88rem; color:#e0eeff; outline:none; transition:border-color 0.2s; margin-bottom:0.8rem; }
  .ward-field-input::placeholder { color:rgba(140,170,220,0.22); }
  .ward-field-input:focus { border-color:rgba(68,114,196,0.5); }
  .ward-field-hint { font-size:0.66rem; color:rgba(140,170,220,0.3); margin-top:-0.55rem; margin-bottom:0.8rem; }
  .ward-auth-submit { width:100%; padding:0.72rem; border:none; border-radius:10px; background:linear-gradient(135deg,rgba(68,114,196,0.38),rgba(68,114,196,0.22)); border:1px solid rgba(68,114,196,0.38); color:#a0c8f0; font-family:'DM Sans',sans-serif; font-size:0.88rem; font-weight:700; cursor:pointer; transition:all 0.2s; margin-bottom:0.7rem; letter-spacing:0.03em; }
  .ward-auth-submit:hover { background:linear-gradient(135deg,rgba(68,114,196,0.52),rgba(68,114,196,0.32)); color:#c8dff8; }
  .ward-auth-msg { font-size:0.76rem; text-align:center; min-height:1.2rem; padding:0.28rem; border-radius:6px; color:var(--gold); background:rgba(255,192,0,0.08); }
  .ward-auth-msg.error  { color:#f08090; background:rgba(224,92,110,0.1); }
  .ward-auth-msg.success{ color:#57f287; background:rgba(87,242,135,0.08); }

  /* TOPBAR */
  .ward-topbar { display:flex; align-items:center; justify-content:space-between; padding:0.62rem 1.4rem; background:rgba(0,0,0,0.5); backdrop-filter:blur(14px); border-bottom:1px solid rgba(68,114,196,0.14); gap:0.6rem; flex-wrap:wrap; }
  .ward-user-pill { display:flex; align-items:center; gap:0.45rem; background:rgba(68,114,196,0.1); border:1px solid rgba(68,114,196,0.2); border-radius:99px; padding:0.28rem 0.7rem 0.28rem 0.4rem; }
  .ward-user-avatar { width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; }
  .ward-user-name { font-size:0.78rem; font-weight:600; color:#c8daf0; }
  .ward-tier-badge { display:inline-flex; align-items:center; gap:0.35rem; background:rgba(255,192,0,0.1); border:1px solid rgba(255,192,0,0.2); border-radius:99px; padding:0.25rem 0.65rem; font-family:'JetBrains Mono',monospace; font-size:0.58rem; font-weight:700; letter-spacing:0.1em; color:#ffc000; }
  .ward-streak-pill { font-size:0.65rem; color:rgba(255,140,40,0.65); font-family:'JetBrains Mono',monospace; }
  .ward-topbar-right { display:flex; align-items:center; gap:0.45rem; flex-wrap:wrap; }
  .ward-top-btn { display:inline-flex; align-items:center; gap:0.3rem; border-radius:8px; padding:0.3rem 0.7rem; font-family:'DM Sans',sans-serif; font-size:0.7rem; font-weight:600; cursor:pointer; transition:all 0.2s; border:1px solid; }
  .ward-btn-room   { background:rgba(68,114,196,0.1); border-color:rgba(68,114,196,0.22); color:#7ab3e0; }
  .ward-btn-share  { background:rgba(255,192,0,0.1); border-color:rgba(255,192,0,0.22); color:#ffc000; }
  .ward-btn-logout { background:rgba(224,92,110,0.08); border-color:rgba(224,92,110,0.18); color:#f08090; }
  .ward-btn-share:hover  { background:rgba(255,192,0,0.18); }
  .ward-btn-logout:hover { background:rgba(224,92,110,0.16); }
  .ward-room-dot { width:6px; height:6px; border-radius:50%; background:#57f287; box-shadow:0 0 5px #57f287; animation:livePulse 1.5s ease-in-out infinite; }

  /* MAIN LAYOUT */
  .ward-main { display:flex; flex-direction:column; flex:1; }

  /* Top persistent bar */
  .ward-top-info-bar { display:flex; align-items:center; gap:0.75rem; flex-wrap:wrap; padding:0.6rem 1rem; background:rgba(0,0,0,0.28); border-bottom:1px solid rgba(68,114,196,0.1); }
  .ward-next-banner-inline { flex:1; display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; min-width:0; }
  .ward-room-quick-btns { display:flex; gap:0.45rem; flex-shrink:0; flex-wrap:wrap; }
  .ward-room-quick-btn { display:inline-flex; align-items:center; gap:0.28rem; border-radius:8px; padding:0.32rem 0.72rem; font-family:'DM Sans',sans-serif; font-size:0.7rem; font-weight:600; cursor:pointer; transition:all 0.2s; border:1px solid; white-space:nowrap; }
  .ward-rqb-create { background:rgba(68,114,196,0.1); border-color:rgba(68,114,196,0.22); color:#7ab3e0; }
  .ward-rqb-join   { background:rgba(255,192,0,0.08); border-color:rgba(255,192,0,0.2); color:#ffc000; }
  .ward-rqb-create:hover { background:rgba(68,114,196,0.2); }
  .ward-rqb-join:hover   { background:rgba(255,192,0,0.15); }
  .ward-rqb-leave  { background:rgba(224,92,110,0.08); border-color:rgba(224,92,110,0.18); color:#f08090; }

  /* Timer hero — full-width, centred */
  .ward-timer-hero { display:flex; flex-direction:column; align-items:center; padding:1.4rem 1.5rem 1.2rem; background:rgba(0,0,0,0.18); border-bottom:1px solid rgba(68,114,196,0.1); }

  /* Bottom panel */
  .ward-bottom-panel { display:flex; flex-direction:column; flex:1; }

  /* TIMER COL */
  .ward-timer-col { padding:1.25rem 1.4rem; border-right:1px solid rgba(68,114,196,0.1); display:flex; flex-direction:column; align-items:center; gap:0.65rem; overflow-y:auto; }

  /* Banners */
  .ward-resume-banner { width:100%; background:rgba(255,192,0,0.08); border:1px solid rgba(255,192,0,0.28); border-radius:10px; padding:0.65rem 0.85rem; display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; }
  .ward-resume-text  { font-size:0.76rem; color:#ffd966; flex:1; }
  .ward-resume-btn   { background:rgba(255,192,0,0.18); border:1px solid rgba(255,192,0,0.35); border-radius:7px; padding:0.28rem 0.65rem; font-size:0.7rem; font-weight:700; color:#ffc000; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all 0.2s; }
  .ward-resume-btn:hover { background:rgba(255,192,0,0.28); }
  .ward-burnout-banner { width:100%; background:rgba(224,92,110,0.09); border:1px solid rgba(224,92,110,0.28); border-radius:10px; padding:0.65rem 0.85rem; font-size:0.75rem; color:#f08090; display:none; }
  .ward-reminder-banner { width:100%; background:rgba(87,242,135,0.06); border:1px solid rgba(87,242,135,0.18); border-radius:10px; padding:0.6rem 0.85rem; font-size:0.73rem; color:rgba(87,242,135,0.75); display:none; align-items:center; gap:0.45rem; }

  /* Quick start */
  .ward-quick-row { display:flex; gap:0.45rem; width:100%; }
  .ward-quick-btn { flex:1; padding:0.45rem 0.65rem; border-radius:9px; font-family:'DM Sans',sans-serif; font-size:0.72rem; font-weight:700; cursor:pointer; transition:all 0.2s; border:1px solid; text-align:center; }
  .ward-quick-5min { background:rgba(87,242,135,0.09); border-color:rgba(87,242,135,0.22); color:#57f287; }
  .ward-quick-pomo { background:rgba(68,114,196,0.1); border-color:rgba(68,114,196,0.22); color:#7ab3e0; }
  .ward-quick-5min:hover { background:rgba(87,242,135,0.17); }
  .ward-quick-pomo:hover { background:rgba(68,114,196,0.18); }

  /* Mode tabs */
  .ward-mode-tabs { display:flex; gap:0.38rem; }
  .ward-mode-tab { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:7px; padding:0.32rem 0.72rem; font-family:'DM Sans',sans-serif; font-size:0.72rem; font-weight:600; color:rgba(160,195,240,0.42); cursor:pointer; transition:all 0.2s; }
  .ward-mode-tab.active { background:rgba(68,114,196,0.2); border-color:rgba(68,114,196,0.38); color:#7ab3e0; }

  /* Duration */
  .ward-duration-row { display:flex; align-items:center; gap:0.45rem; flex-wrap:wrap; justify-content:center; }
  .ward-dur-label { font-size:0.65rem; color:rgba(180,200,240,0.7); font-family:'JetBrains Mono',monospace; }
  .ward-dur-btn { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.1); border-radius:6px; padding:0.22rem 0.52rem; font-family:'DM Sans',sans-serif; font-size:0.7rem; font-weight:600; color:rgba(160,195,240,0.38); cursor:pointer; transition:all 0.2s; }
  .ward-dur-btn.active { background:rgba(68,114,196,0.18); border-color:rgba(68,114,196,0.38); color:#7ab3e0; }

  /* Timer display */
  .ward-time { font-family:'JetBrains Mono',monospace; font-size:5rem; font-weight:700; color:#f0f6ff; letter-spacing:0.04em; line-height:1; text-shadow:0 0 40px rgba(68,114,196,0.45); }
  .ward-time.focusing { color:#57f287; text-shadow:0 0 40px rgba(87,242,135,0.38); }
  .ward-time.on-break { color:#ffc000; text-shadow:0 0 40px rgba(255,192,0,0.32); }
  .ward-phase-label { font-family:'JetBrains Mono',monospace; font-size:0.6rem; font-weight:700; letter-spacing:0.2em; text-transform:uppercase; color:rgba(180,210,255,0.65); }
  .ward-phase-label.focusing { color:#57f287; }
  .ward-phase-label.on-break { color:#ffc000; }

  /* Start button */
  .ward-start-btn { width:148px; height:148px; border-radius:50%; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.22rem; background:radial-gradient(circle,rgba(68,114,196,0.2) 0%,rgba(68,114,196,0.06) 100%); box-shadow:0 0 0 1.5px rgba(68,114,196,0.26),0 0 32px rgba(68,114,196,0.1); transition:all 0.25s cubic-bezier(0.34,1.2,0.64,1); animation:wardBtnPulse 3s ease-in-out infinite; }
  @keyframes wardBtnPulse { 0%,100%{ box-shadow:0 0 0 1.5px rgba(68,114,196,0.26),0 0 32px rgba(68,114,196,0.1); } 50%{ box-shadow:0 0 0 8px rgba(68,114,196,0),0 0 50px rgba(68,114,196,0.22); } }
  .ward-start-btn:hover { transform:scale(1.06); animation:none; background:radial-gradient(circle,rgba(68,114,196,0.34) 0%,rgba(68,114,196,0.12) 100%); }
  .ward-start-btn.running    { background:radial-gradient(circle,rgba(87,242,135,0.17) 0%,rgba(87,242,135,0.05) 100%); box-shadow:0 0 0 1.5px rgba(87,242,135,0.35),0 0 42px rgba(87,242,135,0.16); animation:none; }
  .ward-start-btn.break-mode { background:radial-gradient(circle,rgba(255,192,0,0.17) 0%,rgba(255,192,0,0.05) 100%); box-shadow:0 0 0 1.5px rgba(255,192,0,0.35),0 0 42px rgba(255,192,0,0.16); animation:none; }
  .ward-time.paused    { color:#ffc000; text-shadow:0 0 30px rgba(255,192,0,0.28); opacity:0.8; }
  .ward-phase-label.paused { color:#ffc000; opacity:0.7; }
  .ward-start-btn.paused { background:radial-gradient(circle,rgba(255,192,0,0.17) 0%,rgba(255,192,0,0.05) 100%); box-shadow:0 0 0 1.5px rgba(255,192,0,0.3),0 0 32px rgba(255,192,0,0.1); animation:none; }
  .ward-btn-icon  { font-size:2rem; line-height:1; }
  .ward-btn-label { font-family:'DM Sans',sans-serif; font-size:0.66rem; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:rgba(160,195,240,0.5); }
  .ward-start-btn.running .ward-btn-label { color:rgba(87,242,135,0.72); }

  /* Session dots */
  .ward-session-dots { display:flex; gap:5px; }
  .ward-session-dot { width:8px; height:8px; border-radius:50%; background:rgba(68,114,196,0.16); border:1px solid rgba(68,114,196,0.26); transition:all 0.4s; }
  .ward-session-dot.done    { background:#4472c4; box-shadow:0 0 6px rgba(68,114,196,0.5); }
  .ward-session-dot.current { background:#57f287; box-shadow:0 0 8px rgba(87,242,135,0.52); animation:livePulse 1s ease-in-out infinite; }

  /* Today strip */
  .ward-today-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:0.45rem; width:100%; }
  .ward-today-stat { text-align:center; }
  .ward-today-num { font-family:'JetBrains Mono',monospace; font-size:1.05rem; font-weight:700; color:#ffc000; display:block; }
  .ward-today-lbl { font-size:0.6rem; color:rgba(180,200,240,0.65); letter-spacing:0.06em; text-transform:uppercase; }

  /* Tier progress bar */
  .ward-progress-bar-wrap { width:100%; }
  .ward-progress-label { font-size:0.65rem; color:rgba(140,170,220,0.38); margin-bottom:0.3rem; display:flex; justify-content:space-between; }
  .ward-progress-bar-bg   { background:rgba(68,114,196,0.1); border-radius:99px; height:5px; overflow:hidden; }
  .ward-progress-bar-fill { height:100%; border-radius:99px; background:linear-gradient(90deg,#4472c4,#57f287); transition:width 0.8s ease; }

  /* REFLECTION MODAL */
  .ward-reflection-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.72); z-index:3000; display:flex; align-items:center; justify-content:center; padding:1.5rem; backdrop-filter:blur(6px); }
  .ward-reflection-card { background:rgba(6,14,28,0.98); border:1px solid rgba(68,114,196,0.28); border-radius:16px; padding:2rem; width:100%; max-width:420px; box-shadow:0 30px 80px rgba(0,0,0,0.7); }
  .ward-reflection-title { font-family:'Lora',serif; font-size:1.15rem; font-weight:700; color:#f0f6ff; margin-bottom:0.3rem; }
  .ward-reflection-sub    { font-size:0.76rem; color:rgba(255,192,0,0.78); margin-bottom:1.1rem; }
  .ward-reflection-textarea { width:100%; box-sizing:border-box; min-height:85px; resize:vertical; background:rgba(255,255,255,0.04); border:1px solid rgba(68,114,196,0.2); border-radius:9px; padding:0.62rem 0.82rem; font-family:'DM Sans',sans-serif; font-size:0.84rem; color:#e0eeff; outline:none; margin-bottom:0.9rem; transition:border-color 0.2s; }
  .ward-reflection-textarea:focus { border-color:rgba(68,114,196,0.42); }
  .ward-reflection-btns { display:flex; gap:0.65rem; }
  .ward-reflection-save { flex:1; padding:0.62rem; border:none; border-radius:9px; background:linear-gradient(135deg,rgba(87,242,135,0.18),rgba(87,242,135,0.09)); border:1px solid rgba(87,242,135,0.28); color:#57f287; font-family:'DM Sans',sans-serif; font-size:0.84rem; font-weight:700; cursor:pointer; transition:all 0.2s; }
  .ward-reflection-skip { padding:0.62rem 1.1rem; border-radius:9px; cursor:pointer; background:transparent; border:1px solid rgba(140,170,220,0.14); font-family:'DM Sans',sans-serif; font-size:0.8rem; color:rgba(140,170,220,0.38); transition:all 0.2s; }

  /* ACHIEVEMENT TOAST */
  .ward-achievement-toast { position:fixed; bottom:2rem; right:2rem; z-index:4000; background:rgba(6,14,28,0.97); border:1px solid rgba(255,192,0,0.38); border-radius:14px; padding:0.9rem 1.3rem; box-shadow:0 8px 40px rgba(0,0,0,0.6); display:flex; align-items:center; gap:0.8rem; transform:translateY(120%); opacity:0; transition:all 0.4s cubic-bezier(0.34,1.2,0.64,1); max-width:300px; pointer-events:none; }
  .ward-achievement-toast.show { transform:translateY(0); opacity:1; }
  .ward-toast-emoji { font-size:1.75rem; }
  .ward-toast-label { font-size:0.58rem; font-family:'JetBrains Mono',monospace; letter-spacing:0.15em; text-transform:uppercase; color:#ffc000; }
  .ward-toast-name  { font-size:0.88rem; font-weight:700; color:#f0f6ff; }
  .ward-toast-desc  { font-size:0.7rem; color:rgba(255,192,0,0.78); margin-top:0.1rem; }

  /* RIGHT PANEL */
  .ward-right-col { display:flex; flex-direction:column; overflow:hidden; }
  .ward-panel-tabs { display:flex; border-bottom:1px solid rgba(68,114,196,0.12); background:rgba(0,0,0,0.2); flex-shrink:0; }
  .ward-panel-tab { flex:1; padding:0.6rem 0.4rem; border:none; background:transparent; font-family:'DM Sans',sans-serif; font-size:0.68rem; font-weight:600; color:rgba(140,170,220,0.38); cursor:pointer; transition:all 0.2s; border-bottom:2px solid transparent; }
  .ward-panel-tab.active { color:#a0c8f0; border-bottom-color:#4472c4; background:rgba(68,114,196,0.06); }
  .ward-panel-content { flex:1; overflow-y:auto; padding:1.1rem 1.25rem; -webkit-overflow-scrolling:touch; }
  .ward-panel-section { display:none; }
  .ward-panel-section.active { display:block; }
  .ward-section-h { font-size:0.66rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:rgba(180,200,240,0.68); margin-bottom:0.6rem; display:block; }

  /* HOSPITAL MAP */
  /* Hospital diagram */
  .ward-hospital-wrap { width:100%; position:relative; }
  .ward-next-banner { background:rgba(6,14,28,0.85); border:1px solid rgba(68,114,196,0.2); border-radius:12px; padding:0.7rem 0.85rem; margin-bottom:0.85rem; display:flex; flex-direction:column; gap:0.55rem; }
  .ward-next-row { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; }
.ward-next-row--combined { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.ward-next-row--combined::-webkit-scrollbar { display:none; }
.ward-next-row--combined .ward-next-label,
.ward-next-row--combined .ward-next-chip { flex-shrink:0; }
  .ward-next-label { font-family:'JetBrains Mono',monospace; font-size:0.56rem; font-weight:700; letter-spacing:0.15em; text-transform:uppercase; color:rgba(140,170,220,0.35); white-space:nowrap; }
  .ward-next-chip { display:inline-flex; align-items:center; gap:0.3rem; background:rgba(68,114,196,0.12); border:1px solid rgba(68,114,196,0.22); border-radius:99px; padding:0.2rem 0.6rem; font-size:0.7rem; font-weight:600; color:#a0c8f0; }
  .ward-next-chip:not(.badge):first-of-type { background:rgba(255,192,0,0.15); border-color:rgba(255,192,0,0.45); color:#ffd966; box-shadow:0 0 0.8rem rgba(255,192,0,0.45), 0 0 1.6rem rgba(255,192,0,0.25); font-weight:700; }
  .ward-next-chip.badge { background:rgba(255,192,0,0.1); border-color:rgba(255,192,0,0.22); color:#ffd966; }
  #ward-hospital-svg { width:100%; height:auto; display:block; }
  .hbuild { transition: opacity 0.6s ease, filter 0.6s ease; }
  .hbuild.locked   { opacity:0.12; filter:saturate(0); }
  .hbuild.unlocked { opacity:1;    filter:none; }
  @keyframes cellUnlock { 0%{opacity:0.12} 50%{filter:drop-shadow(0 0 18px rgba(255,192,0,0.9))} 100%{opacity:1} }
  .hbuild.just-unlocked { animation:cellUnlock 1s ease forwards; }
  .ward-unlock-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: radial-gradient(circle at 50% 30%, rgba(255,192,0,0.2), rgba(4,10,20,0.92));
    display: flex; align-items: center; justify-content: center;
    padding: 1.2rem; backdrop-filter: blur(3px);
  }
  .ward-unlock-card {
    position: relative; width: min(520px, 96vw);
    border-radius: 20px; border: 1px solid rgba(255,192,0,0.42);
    background: linear-gradient(160deg, rgba(24,31,54,0.95), rgba(10,16,30,0.96));
    box-shadow: 0 24px 100px rgba(0,0,0,0.65), 0 0 80px rgba(255,192,0,0.15);
    padding: 2rem 1.5rem 1.3rem; text-align: center; overflow: hidden;
  }
  .ward-unlock-title { font-family:'Lora',serif; font-size:1.7rem; color:#ffe08a; margin-bottom:0.4rem; }
  .ward-unlock-sub { font-size:0.88rem; color:rgba(200,218,240,0.82); margin-bottom:1rem; }
  .ward-unlock-area { font-family:'JetBrains Mono',monospace; font-size:0.9rem; letter-spacing:0.08em; color:#ffc000; margin-bottom:1.1rem; }
  .ward-unlock-dismiss { border:none; border-radius:99px; background:rgba(255,192,0,0.18); border:1px solid rgba(255,192,0,0.35); color:#ffd966; padding:0.55rem 1.2rem; font-weight:700; cursor:pointer; }
  .ward-confetti { position:absolute; width:7px; height:14px; top:-16px; opacity:0.92; border-radius:2px; animation:wardConfettiFall linear forwards; }
  @keyframes wardConfettiFall { to { transform: translateY(125vh) rotate(720deg); opacity: 0.15; } }

  /* STATS */
  .ward-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.55rem; margin-bottom:0.9rem; }
  .ward-stats-card { background:rgba(255,255,255,0.04); border:1px solid rgba(68,114,196,0.14); border-radius:10px; padding:0.8rem; }
  .ward-stats-num  { font-family:'JetBrains Mono',monospace; font-size:1.3rem; font-weight:700; color:#ffc000; }
  .ward-stats-lbl  { font-size:0.62rem; color:rgba(180,200,240,0.68); text-transform:uppercase; letter-spacing:0.07em; margin-top:0.18rem; }
  .ward-activity-bars { display:flex; align-items:flex-end; gap:3px; height:50px; margin-top:0.6rem; }
  .ward-activity-bar { flex:1; border-radius:3px 3px 0 0; min-height:3px; background:rgba(68,114,196,0.45); transition:height 0.6s ease; }
  .ward-activity-bar.today { background:#57f287; }

  /* LEADERBOARD */
  .ward-lb-tabs { display:flex; gap:0.38rem; margin-bottom:0.75rem; }
  .ward-lb-tab { padding:0.28rem 0.65rem; border-radius:7px; font-size:0.7rem; font-weight:600; cursor:pointer; transition:all 0.2s; border:1px solid; font-family:'DM Sans',sans-serif; background:rgba(255,255,255,0.04); border-color:rgba(255,255,255,0.1); color:rgba(140,170,220,0.38); }
  .ward-lb-tab.active { background:rgba(68,114,196,0.2); border-color:rgba(68,114,196,0.38); color:#7ab3e0; }
  .ward-lb-entry { display:flex; align-items:center; gap:0.58rem; padding:0.55rem 0.68rem; border-radius:9px; border:1px solid rgba(68,114,196,0.1); margin-bottom:0.4rem; transition:border-color 0.3s; }
  .ward-lb-entry.me { border-color:rgba(255,192,0,0.28); background:rgba(255,192,0,0.05); }
  .ward-lb-rank   { font-family:'JetBrains Mono',monospace; font-size:0.78rem; font-weight:700; width:20px; text-align:center; color:rgba(180,200,240,0.68); flex-shrink:0; }
  .ward-lb-avatar { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; flex-shrink:0; }
  .ward-lb-name   { flex:1; font-size:0.8rem; font-weight:600; color:#c8daf0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ward-lb-hrs    { font-family:'JetBrains Mono',monospace; font-size:0.72rem; color:#ffc000; flex-shrink:0; }

  /* FRIENDS */
  .ward-add-friend { display:flex; gap:0.45rem; margin-bottom:0.8rem; }
  .ward-friend-input { flex:1; background:rgba(255,255,255,0.05); border:1px solid rgba(68,114,196,0.2); border-radius:8px; padding:0.42rem 0.72rem; font-family:'DM Sans',sans-serif; font-size:0.78rem; color:#e0eeff; outline:none; }
  .ward-friend-input::placeholder { color:rgba(140,170,220,0.22); }
  .ward-friend-add-btn { padding:0.42rem 0.8rem; border-radius:8px; background:rgba(68,114,196,0.18); border:1px solid rgba(68,114,196,0.32); color:#7ab3e0; font-size:0.76rem; font-weight:700; cursor:pointer; font-family:'DM Sans',sans-serif; transition:all 0.2s; }
  .ward-friend-add-btn:hover { background:rgba(68,114,196,0.28); border-color:rgba(68,114,196,0.5); }
  .ward-friend-msg { font-size:0.68rem; margin-top:0.25rem; display:none; font-family:'DM Sans',sans-serif; line-height:1.4; }
  .ward-lb-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:0.55rem; }
  .ward-lb-header-title { font-size:0.68rem; font-weight:700; color:rgba(185,165,255,.6); font-family:'JetBrains Mono',monospace; letter-spacing:0.08em; text-transform:uppercase; }
  .ward-lb-add-friend-btn { font-size:0.68rem; padding:0.28rem 0.65rem; }
  .ward-friends-empty { text-align:center; line-height:1.7; }

  /* BADGES */
  .ward-badge-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0.55rem; }
  .ward-badge-cell { background:rgba(255,255,255,0.04); border:1px solid rgba(68,114,196,0.1); border-radius:10px; padding:0.6rem 0.45rem; text-align:center; transition:all 0.3s; }
  .ward-badge-cell.earned { border-color:rgba(255,192,0,0.28); background:rgba(255,192,0,0.07); }
  .ward-badge-cell.locked { opacity:0.28; filter:grayscale(0.6); }
  .ward-badge-emoji { font-size:1.35rem; margin-bottom:0.25rem; }
  .ward-badge-name  { font-size:0.6rem; font-weight:700; color:#c8daf0; }
  .ward-badge-desc  { font-size:0.55rem; color:rgba(140,170,220,0.3); margin-top:0.12rem; line-height:1.3; }

  /* SQUAD */
  .ward-squad-section-title { font-family:'JetBrains Mono',monospace; font-size:0.57rem; letter-spacing:0.15em; text-transform:uppercase; color:rgba(140,170,220,0.32); margin-bottom:0.6rem; }
  .ward-squad-room-code { font-family:'JetBrains Mono',monospace; font-size:1rem; font-weight:700; color:#ffc000; letter-spacing:0.1em; margin-bottom:0.45rem; }
  .ward-status-msg { font-size:0.7rem; color:rgba(140,170,220,0.4); font-style:italic; text-align:center; padding:0.4rem 0; }
  .ward-status-msg.error   { color:rgba(224,92,110,0.7); font-style:normal; }
  .ward-status-msg.success { color:rgba(87,242,135,0.7); font-style:normal; }
  .ward-member-status { font-family:'JetBrains Mono',monospace; font-size:0.56rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; padding:0.16rem 0.45rem; border-radius:99px; flex-shrink:0; }
  .status-focusing { background:rgba(87,242,135,0.14); color:#57f287; border:1px solid rgba(87,242,135,0.28); }
  .status-idle     { background:rgba(140,170,220,0.07); color:rgba(140,170,220,0.38); border:1px solid rgba(140,170,220,0.14); }
  .status-break    { background:rgba(255,192,0,0.1); color:#ffc000; border:1px solid rgba(255,192,0,0.24); }

  /* ═══════════════════ DAILY PEARLS ═══════════════════ */
  #page-pearls {
    min-height: 100vh;
    background: linear-gradient(160deg, #06101e 0%, #0d1e35 40%, #112540 70%, #071325 100%);
  }
  .pearls-wrap {
    max-width: 580px; margin: 0 auto; padding: 2.5rem 1.25rem 5rem;
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
  }
  .pearls-hero-eyebrow {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(100,160,220,0.5);
  }
  .pearls-hero-title {
    font-family: 'Lora', serif; font-size: 1.9rem; font-weight: 700;
    color: #c8dff8; text-align: center; line-height: 1.2;
  }
  .pearls-hero-sub {
    font-size: 0.85rem; color: rgba(140,175,220,0.55); text-align: center;
  }
  /* Progress bar */
  .pearls-progress-row {
    width: 100%; display: flex; align-items: center; gap: 0.75rem;
  }
  .pearls-progress-label {
    font-family: 'JetBrains Mono', monospace; font-size: 0.72rem;
    color: rgba(140,175,220,0.5); white-space: nowrap;
  }
  .pearls-progress-track {
    flex: 1; height: 4px; background: rgba(68,114,196,0.15);
    border-radius: 99px; overflow: hidden;
  }
  .pearls-progress-fill {
    height: 100%; background: linear-gradient(90deg,#4472c4,#5b9bd5);
    border-radius: 99px; transition: width 0.4s ease;
  }
  .pearls-pip-row {
    display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: center;
  }
  .pearls-pip {
    width: 28px; height: 6px; border-radius: 3px;
    background: rgba(68,114,196,0.15); transition: background 0.3s;
  }
  .pearls-pip.done { background: #4472c4; }
  .pearls-pip.easy { background: #2d9e57; }
  .pearls-pip.medium { background: #ffc000; }
  .pearls-pip.hard { background: #e05c5c; }
  /* Card flip */
  .pearls-scene {
    width: 100%; cursor: pointer;
  }
  .pearls-card-inner {
    width: 100%;
  }
  /* Simple show/hide faces — no transforms, no opacity, no absolute positioning */
  .pearls-card-face {
    display: block;
    width: 100%; border-radius: 18px;
    padding: 2rem 1.75rem; box-sizing: border-box;
    border: 1px solid rgba(68,114,196,0.22);
    background: linear-gradient(145deg,rgba(13,28,58,0.9),rgba(8,18,38,0.95));
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  }
  #pearls-back {
    display: none;
    background: linear-gradient(145deg,rgba(15,35,70,0.95),rgba(10,22,50,0.98));
    border-color: rgba(68,114,196,0.35);
  }
  .pearls-tag-row {
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
  }
  .pearls-subject-tag {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 0.2rem 0.55rem;
    border-radius: 99px; border: 1px solid;
  }
  .pearls-diff-tag {
    font-size: 0.6rem; font-weight: 600; letter-spacing: 0.06em;
    padding: 0.18rem 0.5rem; border-radius: 99px;
  }
  .diff-easy   { background: rgba(45,158,87,0.15); color:#2d9e57; border:1px solid rgba(45,158,87,0.3); }
  .diff-medium { background: rgba(255,192,0,0.12); color:#ffc000; border:1px solid rgba(255,192,0,0.3); }
  .diff-hard   { background: rgba(224,92,92,0.12); color:#e05c5c; border:1px solid rgba(224,92,92,0.3); }
  .pearls-question {
    font-family: 'Lora', serif; font-size: 1.15rem; font-weight: 600;
    color: #ddeeff; line-height: 1.55; margin-bottom: 0.9rem;
  }
  .pearls-tap-hint {
    font-size: 0.72rem; color: rgba(140,175,220,0.35); display: flex;
    align-items: center; gap: 0.35rem; margin-top: 0.5rem;
  }
  .pearls-answer-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(100,180,255,0.45); margin-bottom: 0.6rem;
  }
  .pearls-answer {
    font-size: 0.95rem; color: #b8d8f8; line-height: 1.65;
  }
  /* Rating buttons */
  .pearls-rate-row {
    display: none; gap: 0.6rem; width: 100%; justify-content: center;
  }
  .pearls-rate-row.visible { display: flex; }
  .pearls-rate-btn {
    flex: 1; max-width: 130px; padding: 0.65rem 0.5rem;
    border-radius: 12px; border: 1px solid; font-family: 'DM Sans',sans-serif;
    font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.18s;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  }
  .pearls-rate-btn span { font-size: 0.62rem; font-weight: 500; opacity: 0.7; }
  .prb-easy   { background:rgba(45,158,87,0.12); border-color:rgba(45,158,87,0.3); color:#2d9e57; }
  .prb-easy:hover   { background:rgba(45,158,87,0.25); }
  .prb-medium { background:rgba(255,192,0,0.1); border-color:rgba(255,192,0,0.28); color:#ffc000; }
  .prb-medium:hover { background:rgba(255,192,0,0.22); }
  .prb-hard   { background:rgba(224,92,92,0.1); border-color:rgba(224,92,92,0.28); color:#e05c5c; }
  .prb-hard:hover   { background:rgba(224,92,92,0.22); }
  /* Completion screen */
  .pearls-complete {
    text-align: center; padding: 1.5rem 1rem;
    background: linear-gradient(145deg,rgba(13,28,58,0.85),rgba(8,18,38,0.9));
    border: 1px solid rgba(68,114,196,0.25); border-radius: 18px;
    width: 100%;
  }
  .pearls-complete-emoji { font-size: 3rem; margin-bottom: 0.75rem; }
  .pearls-complete-title {
    font-family:'Lora',serif; font-size:1.4rem; font-weight:700; color:#c8dff8;
    margin-bottom: 0.4rem;
  }
  .pearls-complete-sub {
    font-size:0.85rem; color:rgba(140,175,220,0.55); margin-bottom:1.25rem;
  }
  .pearls-streak-badge {
    display:inline-flex; align-items:center; gap:0.4rem;
    background:rgba(255,192,0,0.1); border:1px solid rgba(255,192,0,0.25);
    border-radius:99px; padding:0.35rem 1rem; font-size:0.82rem;
    font-weight:700; color:#ffd966; margin-bottom:1.25rem;
  }
  .pearls-complete-breakdown {
    display:flex; gap:0.6rem; justify-content:center; flex-wrap:wrap;
    margin-bottom:1.25rem;
  }
  .pcb-item {
    padding:0.4rem 0.85rem; border-radius:8px;
    font-size:0.75rem; font-weight:700; border:1px solid;
  }
  .pearls-comeback {
    font-size:0.8rem; color:rgba(140,175,220,0.4);
  }
  .pearls-comeback strong { color:rgba(140,175,220,0.7); }
  /* Login gate */
  .pearls-gate {
    text-align:center; padding:2.5rem 1.5rem;
    background:rgba(255,255,255,0.03); border:1px solid rgba(68,114,196,0.2);
    border-radius:18px; max-width:360px; margin:0 auto;
  }
  @media(max-width:600px){
    .pearls-card-face { padding: 1.5rem 1.25rem; }
    .pearls-question  { font-size: 1rem; }
  }

  /* ══════════════════════════════════════════════════════════════
     COMPREHENSIVE MOBILE RESPONSIVENESS
     Covers: Ward, Pearls, Wordle, Home, Study Guide, Progress, Nav
  ══════════════════════════════════════════════════════════════ */

  /* ── GLOBAL TOUCH TARGETS ── */
  @media (max-width: 768px) {
    /* Minimum touch target size for interactive elements */
    button, .ward-top-btn, .ward-quick-btn, .ward-mode-tab,
    .ward-panel-tab, .ward-lb-tab, .ward-dur-btn {
      min-height: 36px;
    }
    /* Prevent text size inflation on iOS */
    body { -webkit-text-size-adjust: 100%; }
  }

  /* ── NAV AUTH MODAL ── */
  @media (max-width: 480px) {
    .nav-auth-modal { padding: 1.5rem 1.25rem 1.25rem; border-radius: 14px; }
  }

  /* ── STUDY GUIDE: Year tabs horizontal scroll ── */
  @media (max-width: 600px) {
    .year-tabs {
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-bottom: 4px;
      gap: 0.4rem;
    }
    .year-tabs::-webkit-scrollbar { display: none; }
    .year-tab { white-space: nowrap; flex-shrink: 0; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
    .year-tab.active { font-size: 0.85rem; }
    .subjects-container { padding: 1.25rem 1rem; }
    .subject-block { margin-bottom: 2.5rem; }
  }

  /* ── PROGRESS PAGE ── */
  @media (max-width: 600px) {
    .progress-grid { grid-template-columns: 1fr; }
    .progress-card { padding: 1rem; }
  }

  /* ══ WARD: All breakpoints ══ */

  /* Ward topbar - collapse on mobile */
  @media (max-width: 600px) {
    .ward-topbar {
      padding: 0.5rem 0.9rem;
      gap: 0.4rem;
    }
    .ward-user-name { display: none; }          /* hide username, show avatar only */
    .ward-top-btn .wbtn-txt { display: none; } /* icon-only buttons */
    .ward-top-btn { padding: 0.3rem 0.52rem; min-height: 34px; }
    .ward-topbar-right { gap: 0.3rem; }
    .ward-tier-badge { display: none; }         /* hide tier badge from topbar */
    .ward-streak-pill { display: none; }        /* hide streak pill */
  }

  /* Ward timer hero - scale down on mobile */
  @media (max-width: 600px) {
    .ward-timer-hero { padding: 1rem 0.9rem 0.9rem; }
    .ward-time { font-size: clamp(2.8rem, 14vw, 5rem); }
    .ward-start-btn { width: 120px; height: 120px; }
    .ward-btn-icon { font-size: 1.6rem; }
    .ward-mode-tabs { gap: 0.25rem; }
    .ward-mode-tab { padding: 0.28rem 0.55rem; font-size: 0.66rem; }
    .ward-today-strip { gap: 0.35rem; }
    .ward-today-num { font-size: 0.9rem; }
  }

  /* Ward panel tabs - fit 5 tabs on small screens */
  @media (max-width: 600px) {
    .ward-panel-tabs {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .ward-panel-tabs::-webkit-scrollbar { display: none; }
    .ward-panel-tab {
      white-space: nowrap;
      flex-shrink: 0;
      padding: 0.5rem 0.6rem;
      font-size: 0.62rem;
    }
    .ward-panel-content { padding: 0.9rem 0.85rem; }
  }

  /* Ward auth card - full width on mobile */
  @media (max-width: 500px) {
    .ward-auth { padding: 1rem; align-items: flex-start; padding-top: 4rem; }
    .ward-auth-card { padding: 1.5rem 1.25rem; border-radius: 14px; }
    .ward-auth-title { font-size: 1.4rem; }
  }

  /* Ward achievement toast - full width on mobile */
  @media (max-width: 500px) {
    .ward-achievement-toast {
      bottom: 1rem; right: 0.75rem; left: 0.75rem;
      max-width: none;
    }
  }

  /* Ward reflection modal */
  @media (max-width: 500px) {
    .ward-reflection-card { padding: 1.5rem 1.25rem; }
    .ward-reflection-btns { flex-direction: column; }
    .ward-reflection-skip { order: 2; text-align: center; }
  }

  /* Ward stats grid - already 2 col, fine */
  /* Ward badge grid - reduce to 2 columns */
  @media (max-width: 500px) {
    .ward-badge-grid { grid-template-columns: repeat(2, 1fr); }
  }

  /* Ward mode tabs row + quick starts — stack vertically */
  @media (max-width: 400px) {
    .ward-time { font-size: clamp(2.4rem, 18vw, 3.5rem); }
    .ward-start-btn { width: 104px; height: 104px; }
  }

  /* ══ DAILY CLINICAL PEARLS ══ */

  /* Rate buttons: allow wrapping on very small screens */
  @media (max-width: 420px) {
    .pearls-rate-row { flex-wrap: wrap; gap: 0.4rem; }
    .pearls-rate-btn { flex: 1 1 calc(50% - 0.2rem); max-width: none; min-height: 52px; }
    /* Put "Hard" as a full-width bottom button */
    .prb-hard { flex: 1 1 100%; }
  }

  /* Pearls wrap padding on mobile */
  @media (max-width: 480px) {
    .pearls-wrap { padding: 1.5rem 0.9rem 4rem; gap: 1rem; }
    .pearls-hero-title { font-size: 1.5rem; }
    .pearls-question { font-size: 0.95rem; }
    .pearls-answer { font-size: 0.88rem; }
    .pearls-complete { padding: 1.25rem 0.9rem; }
  }

  /* ══ HOME PAGE ══ */

  /* Home page mobile tweaks */
  @media (max-width: 480px) {
    .blossom-hero-inner { padding: 1.25rem 1rem 1rem; }
    .blossom-subtitle { font-size: 0.82rem; }
    .home-soft-social-card { flex-direction: column; align-items:flex-start; }
  }

  /* ══ MEDWORDLE ══ */

  /* Wordle grid tight on small phones */
  @media (max-width: 360px) {
    .wordle-key { height: 38px; min-width: 26px; font-size: 0.7rem; }
    .wordle-key.wide { min-width: 44px; }
  }

  /* ══ GENERAL SCROLLING ── */
  @media (max-width: 768px) {
    /* Prevent page from bouncing/pulling on iOS overscroll in fixed pages */
    #page-ward { overscroll-behavior: none; }
    /* Give touch targets breathing room in the Ward bottom panel */
    .ward-lb-entry { padding: 0.65rem 0.55rem; }
    .ward-add-friend { flex-direction: column; }
    .ward-friend-input { width: 100%; }
    .ward-friend-add-btn { width: 100%; text-align: center; }
    .ward-lb-add-friend-btn { width: auto; }
  }

  /* ══ NAV MOBILE: ensure modal always fits ══ */
  @media (max-width: 380px) {
    .nav-auth-modal { width: 96vw; padding: 1.25rem 1rem; }
    .ward-auth-card { padding: 1.25rem 1rem; }
  }

/* ══════════════════════════════════════════════════════════════
   ══  COMPANION SYSTEM
   ══════════════════════════════════════════════════════════════ */

#companion-container {
  position: fixed;
  bottom: 100px;
  right: 16px;
  z-index: 998;
  cursor: pointer;
}

.companion-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface, #f2f6fc);
  border: 2px solid var(--border, #c8d6eb);
  border-radius: var(--radius, 12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.companion-wrapper:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.companion-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius, 12px) - 2px);
  overflow: hidden;
}

.companion-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.companion-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.companion-mood {
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 1.4rem;
  background: white;
  border: 2px solid var(--border, #c8d6eb);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 2s ease-in-out infinite;
}

.companion-level {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-light, #4472c4);
  color: white;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Mood states */
.companion-container.companion-mood-happy .companion-wrapper {
  border-color: var(--gold, #ffc000);
  box-shadow: 0 0 16px rgba(255, 192, 0, 0.3);
}

.companion-container.companion-mood-neutral .companion-wrapper {
  border-color: var(--border, #c8d6eb);
}

.companion-container.companion-mood-tired .companion-wrapper {
  opacity: 0.7;
  border-color: var(--ink-3, #7a8fa6);
}

/* Glow during Study Together */
.companion-container.companion-glow .companion-wrapper {
  animation: companionGlow 0.8s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

@keyframes companionGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(0, 229, 255, 0.4); }
  50% { box-shadow: 0 0 24px rgba(0, 229, 255, 0.7); }
}

/* ── COMPANION MODAL ──── */
.companion-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.companion-modal-overlay[style*="display: flex"] {
  display: flex;
}

.companion-modal {
  position: relative;
  background: white;
  border-radius: var(--radius, 12px);
  padding: 2rem;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

.companion-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-2, #44546a);
  padding: 0.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.companion-modal-close:hover {
  background: var(--surface, #f2f6fc);
  color: var(--ink, #1c2333);
}

.companion-modal-emoji {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 1rem;
}

.companion-modal-name {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink, #1c2333);
  margin-bottom: 0.5rem;
}

.companion-modal-desc {
  text-align: center;
  color: var(--ink-2, #44546a);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.companion-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.companion-stat {
  background: var(--surface, #f2f6fc);
  border: 1px solid var(--border, #c8d6eb);
  border-radius: var(--radius-sm, 8px);
  padding: 1rem 0.75rem;
  text-align: center;
}

.stat-label {
  color: var(--ink-3, #7a8fa6);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  color: var(--accent-light, #4472c4);
  font-size: 1.5rem;
  font-weight: 700;
}

.companion-flavor {
  background: var(--surface-2, #dce7f5);
  border-left: 3px solid var(--accent-light, #4472c4);
  padding: 1rem;
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--ink, #1c2333);
  line-height: 1.6;
}

.companion-flavor p {
  margin: 0 0 0.5rem 0;
}

.companion-flavor p:last-child {
  margin-bottom: 0;
}

.companion-modal-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent-light, #4472c4);
  color: white;
  border: none;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.companion-modal-btn:hover {
  background: var(--accent, #44546a);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(68, 114, 196, 0.3);
}

.companion-modal-btn:active {
  transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  #companion-container {
    bottom: 80px;
    right: 12px;
  }

  .companion-wrapper {
    width: 60px;
    height: 60px;
  }

  .companion-modal {
    width: 95vw;
    padding: 1.5rem;
  }

  .companion-stats-grid {
    gap: 0.75rem;
  }

  .companion-stat {
    padding: 0.8rem 0.5rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }
}
