  :root {
    --navy: #13205A;
    --navy-deep: #0a1238;
    --volt: #FFC629;
    --yes: #3EE08F;
    --no: #FF6B6B;
    --ink: #F4F6FF;
    --muted: #A9B3DA;
    --coin: 240px;
    --thick: 16px;
  }
  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; margin: 0; }
  body {
    background: radial-gradient(120% 80% at 50% 35%, #1d2d78 0%, var(--navy) 45%, var(--navy-deep) 100%) fixed;
    background-color: var(--navy);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
  }
  .app {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto;
    padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
    max-width: 520px;
    margin: 0 auto;
  }

  /* Header */
  header { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 0; }
  .title { font-weight: 900; letter-spacing: .06em; font-size: 20px; }
  .title span { color: var(--volt); }
  .icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06); color: var(--ink); font-size: 18px; font-weight: 700; cursor: pointer;
  }

  /* Stage */
  .stage { position: relative; display: grid; place-items: center; perspective: 1000px; min-height: 300px; }
  .hint { position: absolute; top: 6%; width: 100%; text-align: center; color: var(--muted); font-size: 15px; transition: opacity .3s; }
  .scene { position: relative; width: var(--coin); height: var(--coin); transform-style: preserve-3d; cursor: pointer; }
  .shadow {
    position: absolute; left: 50%; top: 50%; width: calc(var(--coin) * .9); height: calc(var(--coin) * .9);
    margin: calc(var(--coin) * -.45) 0 0 calc(var(--coin) * -.45); border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0));
    transform: translate3d(10px, 22px, -40px); filter: blur(4px);
  }
  .coin { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
  .face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
  .face img { width: 100%; height: 100%; display: block; pointer-events: none; }
  .face.front { transform: translateZ(calc(var(--thick) / 2)); }
  .face.back  { transform: rotateX(180deg) translateZ(calc(var(--thick) / 2)); }
  .sheen {
    position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: soft-light;
    background: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.9) 50%, rgba(255,255,255,0) 65%);
    background-size: 300% 300%; background-position: var(--sx, 50%) 50%;
  }
  .rim { position: absolute; left: 50%; top: 50%; height: var(--thick); backface-visibility: hidden; -webkit-backface-visibility: hidden;
    background-image: url(coin/coin-edge.936d438f.svg); background-repeat: repeat-x; }

  /* Result */
  .result { text-align: center; min-height: 118px; display: grid; align-content: center; gap: 4px; }
  .verdict { font-size: 64px; font-weight: 900; letter-spacing: .04em; line-height: 1; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .35s cubic-bezier(.2,1.6,.4,1); }
  .verdict.show { opacity: 1; transform: none; }
  .verdict.yes { color: var(--yes); text-shadow: 0 0 30px rgba(62,224,143,.45); }
  .verdict.no  { color: var(--no);  text-shadow: 0 0 30px rgba(255,107,107,.45); }
  .sub { color: var(--muted); font-size: 14px; min-height: 20px; }
  .brandline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .4s .2s; }
  .brandline.show { opacity: .85; }
  .wordmark { font-weight: 900; letter-spacing: .14em; color: var(--ink); }
  .wordmark b { color: var(--volt); font-weight: 900; }
  .logo-img { height: 34px; width: auto; }
  .bmark { width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: #fff; vertical-align: -4px; margin-right: 4px; }

  /* Controls */
  .controls { display: grid; gap: 10px; padding: 8px 0 10px; }
  .buc {
    height: 76px; border: 0; border-radius: 22px; cursor: pointer;
    font-size: 30px; font-weight: 900; letter-spacing: .12em; color: var(--navy-deep);
    background: linear-gradient(180deg, #ffe07a 0%, var(--volt) 55%, #e9a800 100%);
    box-shadow: 0 6px 0 #a87800, 0 14px 30px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.6);
    transition: transform .08s, box-shadow .08s, filter .2s;
  }
  .buc:active { transform: translateY(5px); box-shadow: 0 1px 0 #a87800, 0 6px 16px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.6); }
  .buc:disabled { filter: saturate(.4) brightness(.85); cursor: default; }
  .share {
    height: 48px; border-radius: 16px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.07);
    color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer; visibility: hidden;
  }
  .share.show { visibility: visible; }

  /* Footer */
  footer { text-align: center; font-size: 12.5px; color: var(--muted); padding: 4px 0 14px; min-height: 34px; }
  footer a { color: var(--ink); text-decoration: none; font-weight: 700; transition: opacity .4s; }
  footer a:hover { text-decoration: underline; }

  /* Splash */
  .splash {
    position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; text-align: center;
    background: radial-gradient(100% 70% at 50% 45%, #1d2d78, var(--navy-deep)); transition: opacity .5s, visibility .5s;
  }
  .splash.gone { opacity: 0; visibility: hidden; }
  .splash .big { font-size: 44px; font-weight: 900; letter-spacing: .2em; }
  .splash .big b { color: var(--volt); }
  .splash .presents { color: var(--muted); letter-spacing: .3em; font-size: 12px; margin: 10px 0 26px; text-transform: uppercase; }
  .splash .mini { width: 120px; height: 120px; margin: 0 auto 18px; animation: spin 1.6s ease-in-out infinite; }
  .splash .name { font-weight: 800; font-size: 18px; letter-spacing: .08em; }
  .splash .logo-img { height: 84px; max-width: 88vw; }
  @keyframes spin { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg) } }

  /* About sheet */
  .sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(5,9,30,.6); display: none; align-items: flex-end; justify-content: center; }
  .sheet-wrap.open { display: flex; }
  .sheet {
    width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; background: #101a4b; border-radius: 22px 22px 0 0;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.15);
  }
  .sheet h2 { margin: 0 0 6px; font-size: 22px; }
  .sheet p { color: var(--muted); margin: 0 0 16px; line-height: 1.5; font-size: 14.5px; }
  .sites { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
  .sites a {
    display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px;
    background: rgba(255,255,255,.06); color: var(--ink); text-decoration: none; font-weight: 700;
  }
  .sites a span { color: var(--muted); font-weight: 400; font-size: 13px; }
  .close { width: 100%; height: 46px; border-radius: 14px; border: 0; background: var(--volt); color: var(--navy-deep); font-weight: 800; font-size: 16px; cursor: pointer; }

  .toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #fff; color: var(--navy-deep);
    padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 40; }
  .toast.show { opacity: 1; }

  @media (max-height: 680px) { :root { --coin: 190px; --thick: 13px; } .verdict { font-size: 52px; } .buc { height: 64px; } }
