  :root{
    --page:#FFFFFF; --ink:#1F2430; --ink-soft:#6B7280;
    --accent:#9B7EDE; --tint:#F3EFFB; --shadow:rgba(155,126,222,.26); --deep:#4E3F8B;
    --yes:#2FBF87; --no:#E0453C;
    --display:"Bricolage Grotesque",system-ui,sans-serif;
    --hand:"Caveat",cursive; --ui:"Chivo",system-ui,sans-serif;
  }
  *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
  [hidden]{display:none !important}
  body{
    margin:0; min-height:100svh; font-family:var(--ui); color:var(--ink); background:var(--page);
    display:flex; flex-direction:column; align-items:center;
    padding:max(10px,env(safe-area-inset-top)) 16px max(20px,env(safe-area-inset-bottom));
  }
  header,main{width:100%; max-width:620px}
  .topbar{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:2px}
  .home{font-family:var(--hand); font-size:21px; color:var(--ink-soft); text-decoration:none}
  .rules-btn{border:0; background:var(--tint); color:var(--deep); cursor:pointer; font-family:var(--ui);
    font-size:13px; font-weight:700; padding:8px 14px; border-radius:99px}
  .eyebrow{font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:var(--deep); margin:0 0 2px; font-weight:700}
  h1{font-family:var(--display); font-weight:800; font-size:clamp(34px,9vw,48px); letter-spacing:-.03em; margin:0 0 14px; line-height:1}

  /* ---- pick a topic ---- */
  .choose{display:grid; grid-template-columns:1fr; gap:12px; padding-bottom:16px}
  .choose-lead{font-family:var(--hand); font-size:24px; color:var(--ink-soft); margin:0 0 2px; grid-column:1 / -1}
  .choice{
    display:grid; grid-template-columns:auto 1fr; grid-template-rows:auto auto; column-gap:14px; align-items:center;
    text-align:left; cursor:pointer; border:0; border-radius:20px; padding:15px 18px;
    background:#fff; color:var(--ink); box-shadow:0 10px 24px var(--c-shadow); font-family:var(--ui);
    transition:transform .14s, box-shadow .14s;
  }
  .choice .ico{grid-row:1 / span 2; font-size:28px; line-height:1; width:42px; text-align:center}
  .choice .t{font-family:var(--display); font-weight:800; font-size:20px; letter-spacing:-.02em; color:var(--c-deep)}
  .choice .d{font-size:13px; line-height:1.4; color:var(--ink-soft); margin-top:2px}
  .choice:active{transform:translateY(2px)}
  @media (hover:hover){ .choice:hover{transform:translateY(-2px); box-shadow:0 14px 30px var(--c-shadow)} }
  .choice:focus-visible{outline:3px solid var(--ink); outline-offset:3px}

  /* ---- a question ---- */
  .game{display:flex; flex-direction:column; gap:12px; padding-bottom:16px}
  .gamebar{display:flex; align-items:center; gap:10px}
  .back{border:0; background:none; cursor:pointer; font-family:var(--hand); font-size:20px; color:var(--ink-soft); padding:0}
  .topic{flex:1; text-align:center; font-weight:700; color:var(--deep); font-size:14px}
  .count{font-size:13px; font-weight:700; color:var(--deep); font-variant-numeric:tabular-nums}
  .bar{display:block; height:8px; border-radius:99px; background:var(--tint); overflow:hidden}
  .bar i{display:block; height:100%; width:0; background:var(--accent); border-radius:99px; transition:width .3s}
  .qeyebrow{font-family:var(--hand); font-size:19px; color:var(--ink-soft); margin:2px 0 -4px}
  .card{background:var(--tint); border-radius:22px; padding:22px 20px; box-shadow:0 12px 26px var(--shadow)}
  .qbig{font-family:var(--display); font-weight:800; font-size:clamp(30px,9vw,44px); letter-spacing:-.02em;
    color:var(--deep); text-align:center; margin-bottom:10px; line-height:1.05}
  .eq{font-variant-numeric:tabular-nums}
  .swatch-q{display:inline-block; width:min(38vw,140px); aspect-ratio:1; border-radius:24px; background:var(--swatch,#ccc);
    box-shadow:0 10px 24px rgba(31,36,48,.18), inset 0 0 0 1.5px rgba(31,36,48,.12)}
  .qtext .hint{font-family:var(--hand); font-size:.95em; color:var(--ink-soft); font-weight:600}
  a.choice{text-decoration:none}
  .qtext{margin:0; font-size:clamp(18px,4.8vw,22px); line-height:1.4; text-align:center; text-wrap:balance; font-weight:400}
  .qtext b{color:var(--deep)}

  .options{display:grid; gap:10px}
  .opt{
    border:0; cursor:pointer; text-align:left; font-family:var(--ui); font-size:17px; font-weight:700; color:var(--ink);
    background:#fff; border-radius:16px; padding:15px 18px; box-shadow:0 6px 16px var(--shadow); line-height:1.3;
    transition:transform .1s, box-shadow .12s, opacity .2s;
  }
  .opt:active{transform:translateY(2px)}
  .opt:disabled{cursor:default}
  .opt.right{background:var(--yes); color:#fff; box-shadow:0 8px 18px rgba(47,191,135,.4)}
  .opt.wrong{background:var(--no); color:#fff; box-shadow:0 8px 18px rgba(224,69,60,.35)}
  .opt.dim{opacity:.45; box-shadow:none}
  .opt:focus-visible{outline:3px solid var(--ink); outline-offset:2px}

  .why{background:#fff; border-radius:16px; padding:14px 18px; font-size:15.5px; line-height:1.5;
    box-shadow:0 6px 16px rgba(47,191,135,.22); border-left:6px solid var(--yes)}
  .why.bad{box-shadow:0 6px 16px rgba(224,69,60,.18); border-left-color:var(--no)}
  .why .verdict{font-family:var(--display); font-weight:800; color:var(--yes); margin-right:4px}
  .why.bad .verdict{color:var(--no)}
  .why b{color:var(--deep)}
  .next{align-self:flex-end; border:0; cursor:pointer; font-family:var(--ui); font-size:16px; font-weight:700;
    color:#fff; background:var(--accent); border-radius:99px; padding:13px 24px; box-shadow:0 8px 18px var(--shadow)}
  .next:active{transform:translateY(2px)}

  /* ---- the end ---- */
  .finish{display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:40px 20px;
    background:var(--tint); border-radius:24px; box-shadow:0 14px 30px var(--shadow)}
  .finish h2{font-family:var(--display); font-weight:800; font-size:clamp(34px,9vw,52px); margin:0; color:var(--deep)}
  .finish .stat{font-weight:700; color:var(--deep); font-size:17px}
  .finish p{font-family:var(--hand); font-size:24px; margin:0; color:var(--ink-soft)}
  .finish .row{display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:10px}
  .finish button{border:0; cursor:pointer; font-family:var(--ui); font-size:15px; font-weight:700;
    padding:12px 20px; border-radius:99px; color:#fff; background:var(--accent); box-shadow:0 8px 18px var(--shadow)}
  .finish button.alt{background:#fff; color:var(--deep)}

  /* ---- the rules sheet ---- */
  .sheet-wrap{position:fixed; inset:0; z-index:50; display:flex; align-items:flex-end; justify-content:center;
    background:rgba(31,36,48,.28); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px)}
  .sheet{position:relative; width:100%; max-width:620px; max-height:min(86svh,720px); overflow:auto; background:#fff;
    border-radius:26px 26px 0 0; padding:26px 22px max(26px,env(safe-area-inset-bottom)); box-shadow:0 -16px 44px var(--shadow);
    font-size:15px; line-height:1.5; animation:rise .22s ease}
  @keyframes rise{from{transform:translateY(24px); opacity:0}}
  .sheet-close{position:absolute; top:12px; right:14px; width:36px; height:36px; border:0; border-radius:50%;
    background:var(--tint); color:var(--deep); font-size:24px; line-height:1; cursor:pointer; display:grid; place-items:center}
  .sheet h3{font-family:var(--display); font-weight:800; font-size:21px; letter-spacing:-.02em; margin:18px 0 8px; color:var(--deep); padding-right:40px}
  .sheet h3:first-child{margin-top:0}
  .sheet p{margin:0 0 8px; text-wrap:pretty}
  .sheet p i{font-style:normal; font-weight:700; color:var(--ink-soft)}
  .sheet p b, .sheet .ex b{color:var(--accent)}
  .sheet .ex{font-family:var(--display); font-weight:800; font-size:18px; color:var(--deep)}
  .sheet table{border-collapse:separate; border-spacing:0; width:100%; margin:4px 0 10px}
  .sheet th{font-family:var(--display); font-weight:800; color:var(--deep); text-align:left; padding:5px 12px 5px 0; vertical-align:top; line-height:1.2}
  .sheet td{padding:6px 10px; background:var(--tint); border-radius:10px; text-wrap:pretty}
  .sheet tbody tr + tr td{border-top:3px solid #fff}
  .sheet .wide{overflow-x:auto; margin:4px 0 10px}
  .sheet .wide table{margin:0; min-width:420px}
  .sheet thead th{font-family:var(--ui); font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--deep)}
  body.sheet-open{overflow:hidden}

  @media (min-width:700px){
    body{justify-content:center; padding-left:24px; padding-right:24px}
    .choose{grid-template-columns:1fr 1fr; gap:14px}
    .choice .t{font-size:21px}
    .opt{font-size:18px}
    .sheet-wrap{align-items:center; padding:24px}
    .sheet{border-radius:26px; padding:30px}
  }
