/* :root {
      --bg-start: #0f172a;
      --bg-end: #1e3a8a;
      --card: rgba(255, 255, 255, 0.08);
      --accent: #38bdf8;
      --text-main: #f1f5f9;
      --text-muted: #94a3b8;
      --opt-bg: rgba(255, 255, 255, 0.06);
      --glass: rgba(255, 255, 255, 0.05);
    }

    * {
      box-sizing: border-box;
      font-family: 'Inter', Segoe UI, Helvetica, Arial, sans-serif;
    }

    html, body {
      height: 100%;
      margin: 0;
      background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
      color: var(--text-main);
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
    } */
        :root {
      --bg1: #1e1b4b;  /* Deep indigo */
      --bg2: #312e81;  /* Medium violet */
      --bg3: #3b82f6;  /* Blue accent */
      --card: rgba(255, 255, 255, 0.08);
      --accent: #60a5fa;
      --text-main: #f8fafc;
      --text-muted: #a5b4fc;
      --opt-bg: rgba(255, 255, 255, 0.07);
    }

    * {
      box-sizing: border-box;
      font-family: 'Inter', system-ui, sans-serif;
    }

    html, body {
      height: 100%;
      margin: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-main);
      background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.05), transparent 40%),
                  linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
      background-size: 200% 200%;
      animation: subtleGradient 16s ease-in-out infinite;
      overflow-x: hidden;
    }

    @keyframes subtleGradient {
      0% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
      100% { background-position: 0% 50%; }
    }
    .wrap {
      max-width: 900px;
      margin: 24px auto;
      padding: 20px;
      width: 100%;
    }

    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
    }

    h1 {
      font-size: 24px;
      font-weight: 700;
      color: #f8fafc;
      margin: 0;
    }

    p.lead {
      margin: 6px 0 0;
      color: var(--text-muted);
      font-size: 14px;
    }

    .card {
      background: var(--card);
      backdrop-filter: blur(10px);
      border-radius: 14px;
      padding: 18px;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    .controls {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .controls > * {
      background: var(--glass);
      border: 1px solid rgba(255, 255, 255, 0.06);
      padding: 8px 10px;
      border-radius: 8px;
      color: var(--text-muted);
    }

    select, input[type=number] {
      background: transparent;
      border: none;
      color: inherit;
      outline: none;
    }

    .row {
      display: flex;
      gap: 12px;
    }

    .left {
      flex: 1;
    }

    .right {
      width: 250px;
    }

    .question-area {
      min-height: 160px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    .kana {
      font-size: 64px;
      font-weight: 700;
      letter-spacing: 4px;
      color: #ffffff;
    }

    .question-text {
      margin-top: 10px;
      color: var(--text-muted);
    }

    .options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 14px;
      width: 100%;
    }

    .opt {
      color: #f8fafc;
      background: var(--opt-bg);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 12px;
      border-radius: 10px;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s ease;
    }

    .opt:hover {
      background: rgba(255, 255, 255, 0.12);
      transform: translateY(-3px);
    }

    .opt.correct {
      background: rgba(34, 197, 94, 0.2);
      border-color: #22c55e;
    }

    .opt.wrong {
      background: rgba(239, 68, 68, 0.2);
      border-color: #ef4444;
    }

    .meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 12px;
      color: var(--text-muted);
      font-size: 13px;
    }

    .btn {
      background: var(--accent);
      color: #0f172a;
      border: 0;
      padding: 8px 12px;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 600;
      transition: all 0.25s ease;
    }

    .btn:hover {
      background: #7dd3fc;
      transform: translateY(-2px);
    }

    .btn.ghost {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: var(--text-muted);
    }

    .results {
      display: none;
      flex-direction: column;
      gap: 8px;
    }

    .progress {
      height: 10px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 999px;
      overflow: hidden;
    }

    .progress > i {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, var(--accent), #818cf8);
      width: 0%;
      transition: width 0.3s ease;
    }

    footer {
      margin-top: 16px;
      color: var(--text-muted);
      font-size: 13px;
      text-align: center;
    }

    @media (max-width:720px) {
      .row { flex-direction: column; }
      .right { width: 100%; }
    }