    :root {
      --primary: #1e1f1f;
      --primary-dark: #1e1f1f;
      --secondary: #ffb703;
      --orange: #fb8500;
      --green: #22c55e;
      --red: #ef4444;
      --blue: #38bdf8;
      --ink: #2a2a29;
      --muted: #84817d;
      --surface: #ffffff;
      --background: #f2f5ff;
      --line: #efe9e1;
      --shadow: 0 18px 45px rgba(30,31,31,0.14);
    }

    * {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
    }

    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      overflow-y: auto;
      color: var(--ink);
      background: var(--background);
      font-family: "Nunito", "Segoe UI", Arial, sans-serif;
    }

    button,
    input {
      font: inherit;
    }

    button {
      cursor: pointer;
      border: 0;
    }

    .hidden {
      display: none !important;
    }

    .app-view {
      min-height: 100vh;
    }

    /* =========================
       TOPBAR
    ========================= */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      min-height: 72px;
      padding: 12px 7%;
      background: rgba(255, 255, 255, 0.9);
      border-bottom: 1px solid rgba(239,233,225,0.9);
      backdrop-filter: blur(14px);
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: var(--ink);
      font-size: 1.3rem;
      font-weight: 900;
      text-decoration: none;
    }

    .brand-icon {
      display: grid;
      width: 40px;
      height: 40px;
      place-items: center;
      border-radius: 13px;
      color: white;
      background: linear-gradient(135deg, var(--primary), #1e1f1f);
      box-shadow: 0 8px 18px rgba(30,31,31,0.3);
      font-size: 1.25rem;
    }

    .nav-links {
      display: flex;
      gap: 24px;
    }

    .nav-links a {
      color: var(--muted);
      font-size: 0.94rem;
      font-weight: 800;
      text-decoration: none;
    }

    .nav-links a:hover {
      color: var(--primary);
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      min-height: 44px;
      padding: 11px 18px;
      border-radius: 14px;
      font-weight: 900;
      transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

    .btn:hover {
      transform: translateY(-2px);
    }

    .btn-primary {
      color: white;
      background: linear-gradient(135deg, var(--primary), #ba9d7f);
      box-shadow: 0 11px 22px rgba(30,31,31,0.25);
    }

    .btn-primary:hover {
      box-shadow: 0 15px 28px rgba(30,31,31,0.34);
    }

    .btn-secondary {
      color: var(--primary);
      background: #efe9e1;
    }

    .btn-success {
      color: white;
      background: linear-gradient(135deg, #22c55e, #16a34a);
      box-shadow: 0 10px 22px rgba(34, 197, 94, 0.22);
    }

    .btn-danger {
      color: white;
      background: linear-gradient(135deg, #ef4444, #dc2626);
    }

    .btn-outline {
      color: var(--primary);
      background: white;
      border: 2px solid #e5e0d9;
    }


    /* =========================
       AUTH UI BARU
    ========================= */
    .auth-actions { display:flex; align-items:center; gap:10px; }
    .btn-link { min-height:44px; padding:10px 14px; color:var(--primary); background:transparent; font-weight:900; }
    .auth-divider { color:#d4ccc1; font-weight:900; }
    .auth-tabs { display:none; }
    .auth-tab { padding:11px; border-radius:10px; background:transparent; color:var(--muted); font-weight:900; }
    .auth-tab.active { color:var(--primary); background:#fff; box-shadow:0 3px 10px rgba(58,57,54,.08); }
    .form-step { display:grid; gap:14px; }
    .form-step.active { display:grid; gap:14px; }
    .step-indicator { display:flex; align-items:center; gap:8px; margin:0 0 18px; }
    .step-dot { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; color:#84817d; background:#efe9e1; font-size:.78rem; font-weight:1000; }
    .step-dot.active { color:#fff; background:var(--primary); }
    .step-line { flex:1; height:3px; background:#e5e0d9; }
    .field-group { display:grid; gap:7px; }
    .field-group label { font-size:.84rem; font-weight:900; color:var(--ink); }
    .password-wrap { position:relative; }
    .password-wrap input { padding-right:48px !important; }
    .toggle-password { position:absolute; right:7px; top:50%; transform:translateY(-50%); width:38px; height:38px; display:grid; place-items:center; border-radius:10px; color:var(--muted); background:#f6f3ee; }
    .auth-actions-bottom { display:flex; justify-content:flex-end; gap:10px; margin-top:4px; }
    .auth-note { padding:12px 14px; border-radius:14px; background:#f6f3ee; color:var(--muted); font-size:.82rem; line-height:1.55; }
    .auth-success { padding:12px 14px; border-radius:14px; background:#eaf9ef; color:#16713c; font-weight:900; line-height:1.5; }
    .hero-buttons { display:none; }
    .tutorial-section { padding:65px 8%; background:#f6f3ee; }
    .tutorial-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; max-width:1160px; margin:auto; }
    .tutorial-card { padding:24px; border:1px solid var(--line); border-radius:24px; background:#fff; box-shadow:0 10px 24px rgba(42,42,41,.05); }
    .tutorial-number { width:42px; height:42px; display:grid; place-items:center; margin-bottom:14px; border-radius:13px; color:#fff; background:var(--primary); font-weight:1000; }
    .tutorial-card h3 { margin:0 0 8px; }
    .tutorial-card p { margin:0; color:var(--muted); line-height:1.65; }
    .five-level-note { margin-top:12px; color:var(--muted); font-size:.88rem; font-weight:800; }
    @media(max-width:700px){ .auth-actions{gap:3px}.auth-divider{display:none}.auth-actions .btn{padding:9px 8px}.tutorial-grid{grid-template-columns:1fr;} }

    /* =========================
       LANDING PAGE
    ========================= */
    .hero {
      position: relative;
      display: grid;
      grid-template-columns: 1.05fr 0.95fr;
      align-items: center;
      gap: 54px;
      min-height: calc(100vh - 72px);
      padding: 64px 8%;
      overflow: hidden;
      background:
        radial-gradient(circle at 82% 14%, rgba(255, 183, 3, 0.26), transparent 20%),
        radial-gradient(circle at 15% 85%, rgba(56, 189, 248, 0.24), transparent 24%),
        linear-gradient(135deg, #f6f3ee 0%, #f9fbff 48%, #fff7de 100%);
    }

    .hero::before,
    .hero::after {
      position: absolute;
      z-index: 0;
      border-radius: 50%;
      content: "";
    }

    .hero::before {
      top: -150px;
      right: -110px;
      width: 350px;
      height: 350px;
      background: rgba(186,157,127,0.12);
    }

    .hero::after {
      bottom: -135px;
      left: -90px;
      width: 290px;
      height: 290px;
      background: rgba(251, 133, 0, 0.13);
    }

    .hero-content,
    .hero-visual {
      position: relative;
      z-index: 1;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 13px;
      border: 1px solid #e5e0d9;
      border-radius: 999px;
      color: var(--primary);
      background: rgba(255, 255, 255, 0.78);
      font-size: 0.86rem;
      font-weight: 900;
    }

    .hero h1 {
      max-width: 700px;
      margin: 17px 0;
      color: var(--ink);
      font-size: clamp(2.4rem, 5vw, 4.8rem);
      line-height: 1.08;
      letter-spacing: -1.8px;
    }

    .hero h1 span {
      color: var(--primary);
    }

    .hero p {
      max-width: 610px;
      margin: 0;
      color: var(--muted);
      font-size: 1.12rem;
      line-height: 1.8;
    }

    .hero-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 28px;
    }

    .hero-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      margin-top: 34px;
    }

    .stat {
      min-width: 130px;
      padding: 13px 16px;
      border: 1px solid rgba(229,224,217,0.8);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.7);
      box-shadow: 0 8px 20px rgba(42,42,41,0.05);
    }

    .stat strong {
      display: block;
      color: var(--primary);
      font-size: 1.2rem;
    }

    .stat span {
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 700;
    }

    .hero-visual {
      display: grid;
      min-height: 470px;
      place-items: center;
    }

    .visual-card {
      position: relative;
      width: min(100%, 510px);
      min-height: 390px;
      padding: 29px;
      overflow: hidden;
      border: 10px solid rgba(255, 255, 255, 0.9);
      border-radius: 34px;
      background: linear-gradient(140deg, #1e1f1f 0%, #ba9d7f 43%, #ba9d7f 100%);
      box-shadow: 0 28px 60px rgba(30,31,31,0.3);
    }

    .visual-card::before {
      position: absolute;
      top: -80px;
      right: -55px;
      width: 270px;
      height: 270px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.14);
      content: "";
    }

    .visual-card::after {
      position: absolute;
      bottom: -100px;
      left: -60px;
      width: 250px;
      height: 250px;
      border-radius: 50%;
      background: rgba(255, 205, 82, 0.35);
      content: "";
    }

    .visual-label {
      position: relative;
      z-index: 2;
      display: inline-block;
      padding: 8px 12px;
      border-radius: 999px;
      color: #1e1f1f;
      background: white;
      font-size: 0.82rem;
      font-weight: 900;
    }

    .illustration-boy {
      position: absolute;
      z-index: 2;
      right: 24px;
      bottom: 19px;
      width: 215px;
      height: 275px;
    }

    .head {
      position: absolute;
      top: 11px;
      left: 50px;
      width: 117px;
      height: 118px;
      border: 5px solid #583e47;
      border-radius: 47% 47% 44% 44%;
      background: #f6c89c;
    }

    .hair {
      position: absolute;
      top: 0;
      left: 44px;
      width: 124px;
      height: 58px;
      border-radius: 60px 60px 28px 28px;
      background: #553a40;
      transform: rotate(-4deg);
    }

    .eye {
      position: absolute;
      top: 61px;
      width: 9px;
      height: 12px;
      border-radius: 50%;
      background: #34292e;
    }

    .eye.left {
      left: 80px;
    }

    .eye.right {
      left: 129px;
    }

    .smile {
      position: absolute;
      top: 83px;
      left: 95px;
      width: 30px;
      height: 15px;
      border-bottom: 4px solid #a34b52;
      border-radius: 0 0 30px 30px;
    }

    .body {
      position: absolute;
      bottom: 0;
      left: 20px;
      width: 180px;
      height: 180px;
      border-radius: 80px 80px 25px 25px;
      background: #ffb703;
    }

    .shirt-logo {
      position: absolute;
      top: 139px;
      left: 86px;
      z-index: 4;
      color: white;
      font-size: 32px;
    }

    .book {
      position: absolute;
      z-index: 6;
      right: -9px;
      bottom: 48px;
      width: 112px;
      height: 78px;
      border: 5px solid #4a4a49;
      border-radius: 10px;
      background: #ffffff;
      box-shadow: 0 10px 15px rgba(42,42,41,0.16);
      transform: rotate(-14deg);
    }

    .book::after {
      position: absolute;
      top: 0;
      left: 50%;
      width: 4px;
      height: 100%;
      background: #d8def3;
      content: "";
    }

    .floating-number {
      position: absolute;
      z-index: 5;
      display: grid;
      width: 65px;
      height: 65px;
      place-items: center;
      border-radius: 18px;
      color: white;
      font-size: 1.65rem;
      font-weight: 1000;
      box-shadow: 0 12px 20px rgba(42,42,41,0.2);
    }

    .number-one {
      top: 85px;
      left: 34px;
      background: #fb8500;
      transform: rotate(-10deg);
    }

    .number-two {
      top: 160px;
      right: 34px;
      background: #38bdf8;
      transform: rotate(10deg);
    }

    .number-three {
      bottom: 38px;
      left: 25px;
      background: #ef476f;
      transform: rotate(10deg);
    }

    .feature-section {
      padding: 65px 8%;
      background: white;
    }

    .section-heading {
      max-width: 700px;
      margin: 0 auto 34px;
      text-align: center;
    }

    .section-heading h2 {
      margin: 0 0 10px;
      font-size: clamp(1.7rem, 3vw, 2.5rem);
    }

    .section-heading p {
      margin: 0;
      color: var(--muted);
      line-height: 1.7;
    }

    .feature-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
      max-width: 1160px;
      margin: auto;
    }

    .feature-card {
      padding: 25px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: white;
      box-shadow: 0 10px 24px rgba(42,42,41,0.05);
    }

    .feature-icon {
      display: grid;
      width: 52px;
      height: 52px;
      place-items: center;
      margin-bottom: 16px;
      border-radius: 17px;
      font-size: 1.45rem;
    }

    .feature-card:nth-child(1) .feature-icon {
      background: #efe9e1;
    }

    .feature-card:nth-child(2) .feature-icon {
      background: #dff8ec;
    }

    .feature-card:nth-child(3) .feature-icon {
      background: #fff0cf;
    }

    .feature-card h3 {
      margin: 0 0 8px;
      font-size: 1.1rem;
    }

    .feature-card p {
      margin: 0;
      color: var(--muted);
      line-height: 1.65;
    }

    /* =========================
       DASHBOARD SISWA
    ========================= */
    .dashboard {
      min-height: calc(100vh - 72px);
      padding: 42px 8% 70px;
      background:
        radial-gradient(circle at 9% 2%, rgba(186,157,127,0.12), transparent 19%),
        radial-gradient(circle at 90% 10%, rgba(255, 183, 3, 0.16), transparent 20%),
        var(--background);
    }

    .dashboard-header {
      display: flex;
      align-items: end;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 30px;
    }

    .dashboard-header h1 {
      margin: 0;
      font-size: clamp(1.8rem, 3vw, 2.6rem);
    }

    .dashboard-header p {
      margin: 8px 0 0;
      color: var(--muted);
      line-height: 1.6;
    }

    .student-profile {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: white;
    }

    .student-avatar {
      display: grid;
      width: 42px;
      height: 42px;
      place-items: center;
      border-radius: 50%;
      background: #ffe3a0;
      font-size: 1.35rem;
    }

    .student-profile small {
      display: block;
      color: var(--muted);
      font-weight: 700;
    }

    .student-profile strong {
      font-size: 0.95rem;
    }

    .progress-box {
      display: grid;
      grid-template-columns: auto 1fr auto;
      align-items: center;
      gap: 15px;
      max-width: 1180px;
      margin: 0 auto 28px;
      padding: 17px 20px;
      border: 1px solid #e5e0d9;
      border-radius: 20px;
      background: linear-gradient(110deg, #f6f3ee, #ffffff);
    }

    .progress-box span {
      font-size: 1.5rem;
    }

    .progress-box p {
      margin: 0 0 7px;
      font-weight: 900;
    }

    .progress-line {
      height: 11px;
      overflow: hidden;
      border-radius: 999px;
      background: #efe9e1;
    }

    .progress-fill {
      width: 33%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--primary), #1e1f1f);
      transition: width 0.3s ease;
    }

    .progress-value {
      color: var(--primary);
      font-size: 0.93rem;
      font-weight: 900;
    }

    .subject-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 25px;
      max-width: 1180px;
      margin: auto;
    }

    .subject-card {
      position: relative;
      min-height: 295px;
      padding: 29px;
      overflow: hidden;
      border: 0;
      border-radius: 28px;
      text-align: left;
      box-shadow: var(--shadow);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .subject-card:hover {
      transform: translateY(-7px);
      box-shadow: 0 24px 42px rgba(30,31,31,0.2);
    }

    .subject-card.math {
      color: white;
      background: linear-gradient(135deg, #1e1f1f 0%, #ba9d7f 100%);
    }

    .subject-card.logic {
      color: #173b4f;
      background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 100%);
    }

    .subject-card.picture {
      color: #4a2b0a;
      background: linear-gradient(135deg, #fcd34d 0%, #fb923c 100%);
    }

    .subject-card::before {
      position: absolute;
      top: -58px;
      right: -48px;
      width: 220px;
      height: 220px;
      border: 28px solid rgba(255, 255, 255, 0.16);
      border-radius: 50%;
      content: "";
    }

    .subject-card::after {
      position: absolute;
      bottom: -85px;
      right: 25px;
      width: 180px;
      height: 180px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.15);
      content: "";
    }

    .subject-card-content {
      position: relative;
      z-index: 2;
    }

    .card-game-tag {
      display: inline-flex;
      align-items: center;
      margin: -4px 0 10px;
      padding: 5px 9px;
      border-radius: 999px;
      background: rgba(255,255,255,.22);
      font-size: .68rem;
      font-weight: 1000;
      letter-spacing: .5px;
    }

    .game-mini-grid .subject-card {
      cursor: pointer;
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
    }

    .game-mini-grid .subject-card:focus-visible {
      outline: 4px solid rgba(30,31,31,.35);
      outline-offset: 3px;
    }

    .subject-icon {
      display: grid;
      width: 60px;
      height: 60px;
      place-items: center;
      margin-bottom: 25px;
      border-radius: 19px;
      background: rgba(255, 255, 255, 0.23);
      font-size: 1.75rem;
    }

    .subject-card h2 {
      margin: 0 0 8px;
      font-size: 1.8rem;
    }

    .subject-card p {
      max-width: 330px;
      margin: 0;
      line-height: 1.7;
      opacity: 0.92;
    }

    .play-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 23px;
      padding: 10px 13px;
      border-radius: 13px;
      color: inherit;
      background: rgba(255, 255, 255, 0.24);
      font-size: 0.9rem;
      font-weight: 1000;
    }

    .subject-decoration {
      position: absolute;
      right: 24px;
      bottom: 14px;
      z-index: 2;
      font-size: 6rem;
      font-weight: 1000;
      opacity: 0.3;
      transform: rotate(-8deg);
    }

    /* =========================
       LEVEL PAGE
    ========================= */
    .levels-page {
      min-height: calc(100vh - 72px);
      padding: 42px 8% 70px;
      background:
        linear-gradient(150deg, rgba(239,233,225,0.9), rgba(246, 249, 255, 0.9)),
        var(--background);
    }

    .page-head {
      display: flex;
      align-items: center;
      gap: 17px;
      max-width: 1180px;
      margin: 0 auto 31px;
    }

    .back-btn {
      display: grid;
      width: 44px;
      height: 44px;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 14px;
      color: var(--primary);
      background: white;
      font-size: 1.3rem;
    }

    .page-head h1 {
      margin: 0;
      font-size: 2rem;
    }

    .page-head p {
      margin: 6px 0 0;
      color: var(--muted);
    }

    .level-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 22px;
      max-width: 1180px;
      margin: auto;
    }

    .level-card {
      position: relative;
      min-height: 340px;
      padding: 27px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 27px;
      background: white;
      box-shadow: 0 12px 28px rgba(58,57,54,0.06);
    }

    .level-card.active {
      border: 2px solid #d4ccc1;
      box-shadow: 0 16px 36px rgba(30,31,31,0.15);
    }

    .level-card.locked {
      background: linear-gradient(145deg, #f6f3ee, #efe9e1);
    }

    .level-number {
      display: grid;
      width: 55px;
      height: 55px;
      place-items: center;
      border-radius: 18px;
      color: white;
      background: linear-gradient(135deg, var(--primary), #ba9d7f);
      font-size: 1.3rem;
      font-weight: 1000;
    }

    .locked .level-number {
      color: #84817d;
      background: #e0e3ee;
    }

    .level-card h2 {
      margin: 21px 0 10px;
      font-size: 1.35rem;
    }

    .level-card p {
      min-height: 53px;
      margin: 0;
      color: var(--muted);
      line-height: 1.65;
    }

    .game-preview {
      display: grid;
      height: 95px;
      place-items: center;
      margin: 18px 0;
      border-radius: 16px;
      background: #efe9e1;
      font-size: 2.5rem;
    }

    .locked .game-preview {
      filter: grayscale(1);
      opacity: 0.7;
    }

    .lock-badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      margin-top: 16px;
      padding: 9px 11px;
      border-radius: 12px;
      color: #84817d;
      background: #edf0f7;
      font-size: 0.82rem;
      font-weight: 900;
    }

    /* =========================
       GAME TEBAK GAMBAR
    ========================= */
    .picture-page {
      min-height: calc(100vh - 72px);
      padding: 28px 5% 55px;
      background: radial-gradient(circle at 10% 5%, rgba(251, 146, 60, 0.16), transparent 18%), #fffaf3;
    }

    .picture-layout {
      display: grid;
      grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
      gap: 22px;
      max-width: 1180px;
      margin: 20px auto 0;
      align-items: start;
    }

    .picture-levels, .picture-game-card {
      padding: 22px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: white;
      box-shadow: 0 12px 28px rgba(58,57,54,0.07);
    }

    .picture-level-title {
      margin-bottom: 12px;
      font-weight: 1000;
    }

    .picture-level-btn {
      display: block;
      width: 100%;
      margin-top: 10px;
      padding: 15px;
      border: 2px solid #efe9e1;
      border-radius: 16px;
      background: #fff;
      text-align: left;
    }

    .picture-level-btn.active {
      border-color: #f59e0b;
      background: #fff7df;
    }

    .picture-level-btn:disabled {
      cursor: not-allowed;
      opacity: .65;
      filter: grayscale(.25);
    }

    .picture-level-btn strong, .picture-level-btn small { display: block; }
    .picture-level-btn small { margin-top: 5px; color: var(--muted); line-height: 1.4; }

    .picture-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 15px;
      margin-bottom: 18px;
    }

    .picture-top h2 { margin: 0; }
    .picture-top p { margin: 6px 0 0; color: var(--muted); }
    .picture-score { padding: 10px 13px; border-radius: 13px; background: #fff5d8; white-space: nowrap; font-weight: 900; }

    .picture-question {
      padding: 20px;
      border: 2px solid #fde6b0;
      border-radius: 20px;
      background: linear-gradient(145deg, #fffaf0, #fff);
      text-align: center;
    }

    .picture-subject-tag {
      display: inline-flex; padding: 6px 10px; border-radius: 10px;
      color: #9a5b00; background: #ffedbd; font-size: .76rem; font-weight: 1000;
    }

    .picture-visual {
      display: grid; min-height: 150px; place-items: center; margin: 15px 0;
      border-radius: 18px; background: linear-gradient(135deg, #e0f2fe, #fef3c7);
      font-size: clamp(3.5rem, 9vw, 6.5rem); letter-spacing: 8px;
      box-shadow: inset 0 0 0 2px rgba(255,255,255,.7);
    }

    .picture-clue { margin: 10px auto 16px; max-width: 700px; font-size: 1.05rem; font-weight: 900; line-height: 1.5; }
    .picture-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; max-width: 720px; margin: auto; }
    .picture-option { padding: 13px; border: 2px solid #e5e7eb; border-radius: 13px; background: white; font-weight: 900; text-align: left; }
    .picture-option:hover:not(:disabled) { border-color: #f59e0b; background: #fffbeb; }
    .picture-option.correct { border-color: #22c55e; background: #dcfce7; }
    .picture-option.wrong { border-color: #ef4444; background: #fee2e2; }
    .picture-feedback { min-height: 48px; margin-top: 14px; padding: 11px; border-radius: 12px; background: #f6f3ee; color: #555d78; font-weight: 800; line-height: 1.45; }
    .picture-actions { margin-top: 15px; display: flex; align-items: center; gap: 14px; }
    .picture-progress { flex: 1; height: 10px; overflow: hidden; border-radius: 999px; background: #efe9e1; }
    .picture-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, #fb7185); transition: width .25s ease; }
    .picture-result { padding: 35px 20px; text-align: center; }
    .picture-result .result-emoji { font-size: 4rem; }

    /* =========================
       GAME ULAR TANGGA
    ========================= */
    .game-page {
      min-height: calc(100vh - 72px);
      padding: 28px 5% 55px;
      background:
        radial-gradient(circle at 10% 5%, rgba(255, 183, 3, 0.17), transparent 17%),
        radial-gradient(circle at 92% 4%, rgba(30,31,31,0.17), transparent 18%),
        #f7f9ff;
    }

    .game-layout {
      display: grid;
      grid-template-columns: minmax(0, 600px) minmax(280px, 340px);
      justify-content: center;
      align-items: start;
      gap: 22px;
      width: min(100%, 980px);
      margin: 20px auto 0;
    }

    .board-shell {
      width: min(100%, 600px);
      max-width: 600px;
      margin: 0 auto;
      padding: 12px;
      border: 6px solid #4a4a49;
      border-radius: 20px;
      background: #3a3936;
      box-shadow: 0 16px 34px rgba(58,57,54,0.20);
    }

    .board {
      position: relative;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      aspect-ratio: 1 / 1;
      overflow: hidden;
      border-radius: 10px;
      background: #fff8e8;
    }

    .cell {
      position: relative;
      display: flex;
      align-items: flex-start;
      justify-content: flex-start;
      min-width: 0;
      padding: 4px;
      border: 1px solid rgba(74,74,73,0.18);
      color: rgba(42,42,41,0.7);
      font-size: clamp(0.52rem, 0.9vw, 0.76rem);
      font-weight: 1000;
    }

    .cell:nth-child(4n + 1) {
      background: #fff0c6;
    }

    .cell:nth-child(4n + 2) {
      background: #dff7e9;
    }

    .cell:nth-child(4n + 3) {
      background: #efe9e1;
    }

    .cell:nth-child(4n) {
      background: #dcedff;
    }

    .cell.start {
      background: #9ae6b4 !important;
    }

    .cell.finish {
      background: #ffd166 !important;
    }

    .cell-ladder {
      box-shadow: inset 0 0 0 3px rgba(16, 185, 129, 0.38);
    }

    .cell-snake {
      box-shadow: inset 0 0 0 3px rgba(239, 68, 68, 0.38);
    }

    .board-svg {
      position: absolute;
      z-index: 4;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    @media (max-width: 1050px) {
      .game-layout {
        grid-template-columns: minmax(0, 560px) minmax(260px, 320px);
        width: min(100%, 920px);
      }
      .board-shell { max-width: 560px; }
    }

    @media (max-width: 850px) {
      .game-layout {
        grid-template-columns: 1fr;
        width: min(100%, 680px);
      }
      .board-shell { max-width: 560px; }
    }

    .player-token {
      position: absolute;
      z-index: 10;
      display: grid;
      width: clamp(22px, 4.1vw, 43px);
      height: clamp(22px, 4.1vw, 43px);
      place-items: center;
      border: 3px solid white;
      border-radius: 50%;
      color: white;
      background: radial-gradient(circle at 32% 28%, #8bd8ff, #2563eb 57%, #173b9d);
      box-shadow: 0 4px 0 #122461, 0 7px 14px rgba(23, 59, 157, 0.38);
      font-size: clamp(0.7rem, 1.4vw, 1.05rem);
      transition: left 0.48s ease, top 0.48s ease;
      transform: translate(-50%, -50%);
    }

    .game-panel {
      padding: 25px;
      border: 1px solid var(--line);
      border-radius: 24px;
      background: white;
      box-shadow: 0 12px 28px rgba(58,57,54,0.07);
    }

    .game-panel h2 {
      margin: 0 0 8px;
      font-size: 1.45rem;
    }

    .game-panel > p {
      margin: 0 0 19px;
      color: var(--muted);
      line-height: 1.65;
    }

    .score-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 18px;
    }

    .mini-stat {
      padding: 12px;
      border-radius: 15px;
      background: #f6f3ee;
    }

    .mini-stat small {
      display: block;
      margin-bottom: 4px;
      color: var(--muted);
      font-weight: 800;
    }

    .mini-stat strong {
      color: var(--primary);
      font-size: 1.25rem;
    }

    .question-box {
      min-height: 184px;
      padding: 18px;
      border: 2px solid #efe9e1;
      border-radius: 18px;
      background: linear-gradient(140deg, #f6f3ee, #f6f3ee);
    }

    .question-box .question-label {
      display: inline-flex;
      padding: 6px 9px;
      border-radius: 9px;
      color: var(--primary);
      background: #efe9e1;
      font-size: 0.75rem;
      font-weight: 1000;
    }

    .question-text {
      margin: 14px 0;
      font-size: 1.05rem;
      font-weight: 900;
      line-height: 1.5;
    }

    .answer-area {
      display: flex;
      gap: 9px;
    }

    .answer-area input {
      width: 100%;
      min-width: 0;
      padding: 11px 12px;
      border: 2px solid #e5e0d9;
      border-radius: 12px;
      outline: 0;
      font-weight: 800;
    }

    .answer-area input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 4px rgba(30,31,31,0.12);
    }

    .check-answer {
      min-width: 87px;
      color: white;
      border-radius: 12px;
      background: var(--primary);
      font-weight: 900;
    }

    .game-message {
      min-height: 48px;
      margin: 16px 0 10px;
      padding: 12px;
      border-radius: 13px;
      color: #4a4a49;
      background: #f6f3ee;
      font-size: 0.91rem;
      font-weight: 800;
      line-height: 1.45;
    }

    .dice-wrapper {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 15px;
      margin-top: 17px;
    }

    .dice {
      position: relative;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      grid-template-rows: repeat(3, 1fr);
      width: 76px;
      height: 76px;
      padding: 11px;
      border: 4px solid #3a3936;
      border-radius: 16px;
      background: linear-gradient(145deg, #ffffff, #f6f3ee);
      box-shadow:
        0 5px 0 #ba9d7f,
        0 12px 18px rgba(42,42,41,0.18);
      transition: transform 0.2s ease;
    }

    .dice.rolling {
      animation: rollDiceVisual 0.22s linear infinite;
    }

    .dice-dot {
      display: none;
      width: 13px;
      height: 13px;
      align-self: center;
      justify-self: center;
      border-radius: 50%;
      background: #3a3936;
      box-shadow: inset -1px -2px 0 rgba(0, 0, 0, 0.15);
    }

    .dot-1 {
      grid-column: 1;
      grid-row: 1;
    }

    .dot-2 {
      grid-column: 3;
      grid-row: 1;
    }

    .dot-3 {
      grid-column: 1;
      grid-row: 2;
    }

    .dot-4 {
      grid-column: 2;
      grid-row: 2;
    }

    .dot-5 {
      grid-column: 3;
      grid-row: 2;
    }

    .dot-6 {
      grid-column: 1;
      grid-row: 3;
    }

    .dice.show-1 .dot-4 {
      display: block;
    }

    .dice.show-2 .dot-1,
    .dice.show-2 .dot-6 {
      display: block;
    }

    .dice.show-3 .dot-1,
    .dice.show-3 .dot-4,
    .dice.show-3 .dot-6 {
      display: block;
    }

    .dice.show-4 .dot-1,
    .dice.show-4 .dot-2,
    .dice.show-4 .dot-6 {
      display: block;
    }

    .dice.show-4 .dot-5 {
      display: block;
      grid-column: 3;
      grid-row: 3;
    }

    .dice.show-5 .dot-1,
    .dice.show-5 .dot-2,
    .dice.show-5 .dot-4,
    .dice.show-5 .dot-6 {
      display: block;
    }

    .dice.show-5 .dot-5 {
      display: block;
      grid-column: 3;
      grid-row: 3;
    }

    .dice.show-6 .dot-1,
    .dice.show-6 .dot-2,
    .dice.show-6 .dot-3,
    .dice.show-6 .dot-5,
    .dice.show-6 .dot-6 {
      display: block;
    }

    .dice.show-6 .dot-4 {
      display: block;
      grid-column: 3;
      grid-row: 3;
    }

    .dice-value {
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      color: #3a3936;
      font-size: 1.4rem;
      font-weight: 1000;
      pointer-events: none;
    }

    .dice.show-1 .dice-value,
    .dice.show-2 .dice-value,
    .dice.show-3 .dice-value,
    .dice.show-4 .dice-value,
    .dice.show-5 .dice-value,
    .dice.show-6 .dice-value {
      display: none;
    }

  @keyframes rollDiceVisual {
    0% {
      transform: rotate(0deg) scale(1);
    }

    50% {
      transform: rotate(12deg) scale(1.06);
    }

    100% {
      transform: rotate(-12deg) scale(1);
    }
  }

    .roll-button:disabled {
      cursor: not-allowed;
      opacity: 0.5;
      transform: none;
      box-shadow: none;
    }

    .game-rules {
      margin-top: 20px;
      padding-top: 18px;
      border-top: 1px solid var(--line);
    }

    .game-rules h3 {
      margin: 0 0 9px;
      font-size: 1rem;
    }

    .game-rules p {
      margin: 0;
      color: var(--muted);
      font-size: 0.86rem;
      line-height: 1.65;
    }

    /* =========================
       MEMORY GAME
    ========================= */
    .memory-page {
      min-height: calc(100vh - 72px);
      padding: 34px 8% 70px;
      background: linear-gradient(135deg, #f6f3ee, #edf7ff);
    }

    .memory-layout {
      max-width: 1130px;
      margin: 21px auto 0;
    }

    .memory-info {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 22px;
      padding: 18px 20px;
      border: 1px solid #e5e0d9;
      border-radius: 20px;
      background: white;
    }

    .memory-info h2 {
      margin: 0;
      font-size: 1.25rem;
    }

    .memory-info p {
      margin: 5px 0 0;
      color: var(--muted);
    }

    .memory-score {
      display: flex;
      gap: 11px;
    }

    .memory-score div {
      padding: 9px 12px;
      border-radius: 12px;
      background: #f6f3ee;
      color: var(--primary);
      font-size: 0.85rem;
      font-weight: 900;
    }

    .memory-board {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
    }

    .memory-card {
      position: relative;
      min-height: 135px;
      padding: 0;
      border-radius: 19px;
      perspective: 1000px;
      background: transparent;
    }

    .memory-card-inner {
      position: absolute;
      inset: 0;
      transform-style: preserve-3d;
      transition: transform 0.42s ease;
    }

    .memory-card.flipped .memory-card-inner,
    .memory-card.matched .memory-card-inner {
      transform: rotateY(180deg);
    }

    .memory-front,
    .memory-back {
      position: absolute;
      display: grid;
      inset: 0;
      place-items: center;
      border-radius: 19px;
      backface-visibility: hidden;
    }

    .memory-front {
      border: 3px solid #efe9e1;
      color: white;
      background: linear-gradient(135deg, #1e1f1f, #ba9d7f);
      box-shadow: 0 9px 18px rgba(30,31,31,0.18);
      font-size: 2.1rem;
    }

    .memory-back {
      border: 3px solid #ffe0a1;
      color: #3a3936;
      background: #fff8e8;
      font-size: clamp(1rem, 2vw, 1.5rem);
      font-weight: 1000;
      transform: rotateY(180deg);
    }

    .memory-card.matched .memory-back {
      border-color: #47d67a;
      background: #e6faed;
    }

    /* =========================
       GAME LOGIKA SEDERHANA
    ========================= */
    .logic-page {
      min-height: calc(100vh - 72px);
      padding: 34px 6% 70px;
      background:
        radial-gradient(circle at 8% 4%, rgba(56, 189, 248, 0.18), transparent 19%),
        radial-gradient(circle at 92% 6%, rgba(186,157,127,0.16), transparent 20%),
        #f7fbff;
    }

    .logic-layout {
      max-width: 1100px;
      margin: 20px auto 0;
    }

    .logic-levels {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    .logic-level-btn {
      padding: 18px;
      border: 2px solid #dceef7;
      border-radius: 20px;
      text-align: left;
      background: white;
      box-shadow: 0 9px 22px rgba(39, 72, 100, 0.07);
      transition: transform 0.18s ease, border 0.18s ease, box-shadow 0.18s ease;
    }

    .logic-level-btn:hover:not(:disabled) {
      transform: translateY(-3px);
      border-color: #7dd3fc;
      box-shadow: 0 13px 28px rgba(39, 72, 100, 0.11);
    }

    .logic-level-btn.active {
      border-color: #38bdf8;
      background: linear-gradient(135deg, #f0fbff, #ffffff);
    }

    .logic-level-btn:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

    .logic-level-btn strong {
      display: block;
      margin-bottom: 5px;
      color: #17617d;
      font-size: 1.05rem;
    }

    .logic-level-btn small {
      color: var(--muted);
      line-height: 1.5;
    }

    .logic-game-card {
      padding: 28px;
      border: 1px solid #dceef7;
      border-radius: 26px;
      background: white;
      box-shadow: 0 16px 34px rgba(39, 72, 100, 0.09);
    }

    .logic-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 18px;
    }

    .logic-top h2 {
      margin: 0;
      font-size: 1.45rem;
    }

    .logic-score {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .logic-score span {
      padding: 9px 12px;
      border-radius: 12px;
      color: #17617d;
      background: #eaf9ff;
      font-size: 0.86rem;
      font-weight: 900;
    }

    .logic-question {
      padding: 23px;
      border-radius: 20px;
      background: linear-gradient(135deg, #f3fbff, #f6f3ee);
      border: 2px solid #e0eef8;
    }

    .logic-question-label {
      display: inline-flex;
      padding: 6px 10px;
      border-radius: 9px;
      color: #17617d;
      background: #dff6ff;
      font-size: 0.78rem;
      font-weight: 1000;
    }

    .logic-question-text {
      margin: 15px 0 18px;
      font-size: 1.18rem;
      line-height: 1.6;
      font-weight: 900;
    }

    .logic-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .logic-option {
      padding: 14px 16px;
      border: 2px solid #dfe8f2;
      border-radius: 14px;
      color: var(--ink);
      background: white;
      text-align: left;
      font-weight: 800;
      transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease;
    }

    .logic-option:hover:not(:disabled) {
      transform: translateY(-2px);
      border-color: #7dd3fc;
      background: #f3fbff;
    }

    .logic-option.correct {
      border-color: #22c55e;
      background: #e9faef;
    }

    .logic-option.wrong {
      border-color: #ef4444;
      background: #fff0f0;
    }

    .logic-feedback {
      min-height: 54px;
      margin-top: 17px;
      padding: 12px 14px;
      border-radius: 13px;
      color: #59627c;
      background: #f4f6fa;
      font-size: 0.91rem;
      font-weight: 800;
      line-height: 1.5;
    }

    .logic-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-top: 17px;
    }

    .logic-progress {
      flex: 1;
      height: 10px;
      overflow: hidden;
      border-radius: 999px;
      background: #e7eef5;
    }

    .logic-progress-fill {
      width: 0;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #38bdf8, #ba9d7f);
      transition: width 0.25s ease;
    }

    .logic-next {
      min-width: 125px;
      color: white;
      border-radius: 12px;
      background: #0ea5e9;
      font-weight: 900;
    }

    .logic-result {
      padding: 25px;
      border-radius: 20px;
      text-align: center;
      background: linear-gradient(135deg, #effaff, #f6f3ee);
      border: 2px solid #dceef7;
    }

    .logic-result .result-emoji {
      font-size: 3.2rem;
    }

    .logic-result h2 {
      margin: 9px 0 7px;
    }

    .logic-result p {
      margin: 0 0 18px;
      color: var(--muted);
      line-height: 1.6;
    }

    @media (max-width: 700px) {
      .logic-levels {
        grid-template-columns: 1fr;
      }

      .logic-options {
        grid-template-columns: 1fr;
      }

      .logic-top {
        align-items: flex-start;
        flex-direction: column;
      }

      .logic-game-card {
        padding: 19px;
      }

      .logic-question-text {
        font-size: 1.05rem;
      }
    }

    /* =========================
       MODAL
    ========================= */
    .modal-overlay {
      position: fixed;
      z-index: 100;
      display: grid;
      inset: 0;
      place-items: center;
      padding: 20px;
      background: rgba(30,31,31,0.58);
      backdrop-filter: blur(4px);
    }

    .modal {
      width: min(100%, 550px);
      max-height: calc(100vh - 40px);
      overflow-y: auto;
      padding: 30px;
      border-radius: 26px;
      background: white;
      box-shadow: 0 24px 75px rgba(20,20,19,0.34);
    }

    .modal-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 20px;
    }

    .modal h2 {
      margin: 0;
      font-size: 1.55rem;
    }

    .modal p {
      margin: 7px 0 0;
      color: var(--muted);
      line-height: 1.6;
    }

    .close-modal {
      display: grid;
      width: 35px;
      height: 35px;
      place-items: center;
      border-radius: 10px;
      color: var(--muted);
      background: #efe9e1;
      font-size: 1.25rem;
    }

    .role-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 13px;
    }

    .role-button {
      min-height: 141px;
      padding: 17px 10px;
      border: 2px solid #e5e0d9;
      border-radius: 18px;
      color: var(--ink);
      background: white;
      font-weight: 900;
      transition: border 0.18s ease, transform 0.18s ease, background 0.18s ease;
    }

    .role-button:hover {
      border-color: #ba9d7f;
      background: #f6f3ee;
      transform: translateY(-3px);
    }

    .role-button span {
      display: block;
      margin-bottom: 9px;
      font-size: 2rem;
    }

    .role-button small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-size: 0.73rem;
      font-weight: 700;
    }

    .simple-role-page {
      display: grid;
      min-height: calc(100vh - 72px);
      place-items: center;
      padding: 30px;
      text-align: center;
    }

    .simple-role-box {
      max-width: 550px;
      padding: 40px;
      border-radius: 28px;
      background: white;
      box-shadow: var(--shadow);
    }

    .simple-role-box h1 {
      margin: 0 0 10px;
    }

    .simple-role-box p {
      margin: 0 0 22px;
      color: var(--muted);
      line-height: 1.7;
    }


    /* ==================================================
       PORTAL & AKSES V2
    =================================================== */
    .login-form { display:grid; gap:14px; }
    .login-form label { font-size:.85rem; font-weight:900; color:var(--ink); }
    .login-form select, .login-form input {
      width:100%; min-height:48px; padding:12px 14px; border:2px solid #e5e0d9;
      border-radius:14px; background:#fff; outline:none; color:var(--ink); font-weight:800;
    }
    .login-form select:focus, .login-form input:focus {
      border-color:var(--primary); box-shadow:0 0 0 4px rgba(30,31,31,.10);
    }
    .login-note { padding:12px 14px; border-radius:14px; background:#f6f3ee; color:var(--muted); font-size:.82rem; line-height:1.5; }
    .login-error { min-height:0; padding:0; color:#b4232b; font-weight:900; font-size:.84rem; }
    .portal-shell { display:flex; min-height:calc(100vh - 72px); background:var(--background); }
    .portal-sidebar {
      width:240px; flex:0 0 240px; padding:24px 15px; background:#fff;
      border-right:1px solid var(--line); position:sticky; top:72px; height:calc(100vh - 72px);
    }
    .sidebar-user { padding:14px; margin-bottom:16px; border-radius:18px; background:#f6f3ee; }
    .sidebar-user small { display:block; color:var(--muted); font-weight:800; }
    .sidebar-user strong { display:block; margin-top:4px; }
    .side-nav { display:grid; gap:8px; }
    .side-nav button {
      display:flex; align-items:center; gap:11px; width:100%; padding:13px 14px;
      border-radius:14px; background:transparent; color:var(--muted); text-align:left; font-weight:900;
    }
    .side-nav button:hover, .side-nav button.active { background:#efe9e1; color:var(--primary); }
    .portal-content { flex:1; min-width:0; padding:34px 5%; min-height:calc(100vh - 72px); overflow:visible; }
    .portal-top { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:25px; }
    .portal-top h1 { margin:0; font-size:clamp(1.7rem,3vw,2.5rem); }
    .portal-top p { margin:7px 0 0; color:var(--muted); line-height:1.6; }
    .join-room-btn { white-space:nowrap; }
    .portal-view { max-width:1180px; margin:auto; }
    .portal-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
    .portal-stat, .score-card, .teacher-card, .admin-card {
      padding:20px; border:1px solid var(--line); border-radius:20px; background:#fff;
      box-shadow:0 9px 24px rgba(58,57,54,.05);
    }
    .portal-stat span { color:var(--muted); font-size:.82rem; font-weight:800; }
    .portal-stat strong { display:block; margin-top:6px; font-size:1.65rem; color:var(--primary); }
    .portal-panel { margin-top:20px; padding:23px; border:1px solid var(--line); border-radius:22px; background:#fff; }
    .portal-panel h2 { margin:0 0 8px; }
    .portal-panel > p { color:var(--muted); line-height:1.6; }
    .game-mini-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:16px; }
    .game-mini-grid .subject-card { min-height:190px; }
    .score-table { width:100%; border-collapse:collapse; margin-top:15px; }
    .score-table th,.score-table td { padding:12px 10px; border-bottom:1px solid var(--line); text-align:left; }
    .score-table th { color:var(--muted); font-size:.78rem; }
    .privacy-lock { display:inline-flex; gap:7px; align-items:center; padding:8px 11px; border-radius:11px; background:#eaf9ef; color:#16713c; font-size:.78rem; font-weight:900; }
    .room-modal { width:min(100%,520px); }
    .room-code { font-size:2rem; letter-spacing:5px; text-align:center; font-weight:1000; color:var(--primary); padding:15px; border-radius:16px; background:#f6f3ee; }
    .teacher-layout, .admin-layout { max-width:1180px; margin:auto; }
    .teacher-toolbar, .admin-toolbar { display:flex; gap:10px; flex-wrap:wrap; margin:15px 0; }
    .class-chip { padding:9px 12px; border-radius:12px; background:#efe9e1; color:var(--primary); font-weight:900; }
    .student-list { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:16px; }
    .student-item { padding:14px; border:1px solid var(--line); border-radius:15px; background:#fff; }
    .student-item small { display:block; color:var(--muted); margin-top:3px; }
    .security-banner { margin-bottom:20px; padding:14px 16px; border-radius:16px; background:#fff8df; color:#805b00; font-size:.84rem; line-height:1.55; }
    @media(max-width:900px){
      .portal-shell { display:block; }
      .portal-sidebar { width:100%; height:auto; position:static; border-right:0; border-bottom:1px solid var(--line); padding:10px; }
      .sidebar-user { display:none; }
      .side-nav { grid-template-columns:repeat(3,1fr); }
      .side-nav button { justify-content:center; flex-direction:column; padding:10px 6px; font-size:.75rem; }
      .portal-cards,.game-mini-grid,.student-list { grid-template-columns:1fr; }
    }
    @media(max-width:600px){
      .portal-content { padding:24px 5%; }
      .portal-top { align-items:flex-start; flex-direction:column; }
      .join-room-btn { width:100%; }
    }

    /* =========================
       RESPONSIVE
    ========================= */
    @media (max-width: 900px) {
      .nav-links {
        display: none;
      }

      .hero {
        grid-template-columns: 1fr;
        padding-top: 45px;
      }

      .hero-visual {
        min-height: 410px;
      }

      .feature-grid,
      .level-grid {
        grid-template-columns: 1fr;
      }

      .subject-grid {
        grid-template-columns: 1fr;
      }

      .game-layout {
        grid-template-columns: 1fr;
      }

      .board-shell {
        max-width: 680px;
        margin: auto;
      }

      .memory-board {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (max-width: 600px) {
      .topbar {
        padding: 10px 5%;
      }

      .brand {
        font-size: 1.08rem;
      }

      .brand-icon {
        width: 35px;
        height: 35px;
      }

      .topbar .btn {
        min-height: 39px;
        padding: 9px 12px;
        font-size: 0.82rem;
      }

      .hero,
      .dashboard,
      .levels-page,
      .memory-page {
        padding-right: 5%;
        padding-left: 5%;
      }

      .hero {
        gap: 30px;
      }

      .hero h1 {
        font-size: 2.5rem;
      }

      .hero p {
        font-size: 1rem;
      }

      .visual-card {
        min-height: 335px;
      }

      .hero-visual {
        min-height: 345px;
      }

      .illustration-boy {
        right: 5px;
        transform: scale(0.83);
        transform-origin: right bottom;
      }

      .floating-number {
        transform: scale(0.82);
      }

      .number-one {
        left: 10px;
      }

      .number-two {
        right: 9px;
      }

      .number-three {
        left: 4px;
      }

      .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
      }

      .progress-box {
        grid-template-columns: auto 1fr;
      }

      .progress-value {
        grid-column: 2;
      }

      .subject-card {
        min-height: 270px;
      }

      .page-head h1 {
        font-size: 1.45rem;
      }

      .game-page {
        padding: 22px 3% 45px;
      }

      .board-shell {
        padding: 7px;
        border-width: 5px;
        border-radius: 15px;
      }

      .cell {
        padding: 2px;
      }

      .game-panel {
        padding: 19px;
      }

      .memory-info {
        align-items: flex-start;
        flex-direction: column;
      }

      .memory-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
      }

      .memory-card {
        min-height: 100px;
      }

      .role-grid {
        grid-template-columns: 1fr;
      }

      .role-button {
        min-height: 84px;
        text-align: left;
      }

      .role-button span {
        display: inline;
        margin-right: 10px;
      }

      .role-button small {
        display: inline;
        margin-left: 4px;
      }
    }
    @media (max-width: 800px) {
      .picture-layout { grid-template-columns: 1fr; }
      .picture-top { flex-direction: column; }
      .picture-score { white-space: normal; }
      .picture-options { grid-template-columns: 1fr; }
    }
  
    .teacher-shell{display:flex;min-height:calc(100vh - 72px);}
    .teacher-sidebar{position:sticky;top:72px;left:0;height:calc(100vh - 72px);}
    .teacher-main{flex:1;min-width:0;overflow-x:hidden;}
    .teacher-section{scroll-margin-top:90px;margin-bottom:20px;}
    .teacher-menu{cursor:pointer;}
    .teacher-menu.active{background:#efe9e1;color:var(--primary);}
    @media(max-width:800px){.teacher-sidebar{width:190px;flex-basis:190px}.student-list{grid-template-columns:1fr}.portal-content{min-width:0}}

  
