    :root {
      --navy:     #060f2e;
      --navy-m:   #0d1b4b;
      --navy-l:   #152660;
      --teal:     #5bc8e8;
      --teal-d:   #3aa8cc;
      --mint:     #9dd4ce;
      --mint-l:   #c4e8e3;
      --gold:     #f5c842;
      --gold-d:   #d4a820;
      --white:    #ffffff;
      --aurora1:  #2dd4bf;
      --aurora2:  #6366f1;
      --aurora3:  #0ea5e9;
      --font-t: 'Outfit', sans-serif;
      --font-b: 'Fredoka', sans-serif;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; overflow: hidden; }
    body {
      font-family: var(--font-b);
      background: var(--navy);
      display: flex;
      justify-content: center;
      -webkit-font-smoothing: antialiased;
      -webkit-tap-highlight-color: transparent;
      overscroll-behavior: none;
    }
    button { cursor: pointer; border: none; background: none; font-family: var(--font-t); touch-action: manipulation; }
    input  { font-family: var(--font-b); }

    /* ══ App shell ══ */
    #app {
      position: relative;
      width: 100%;
      max-width: 430px;
      min-height: 100dvh;
      overflow: hidden;
      background: var(--navy);
    }

    /* ══ Aurora background ══ */
    .aurora {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }
    .aurora::before {
      content: '';
      position: absolute;
      top: -20%;
      left: -30%;
      width: 160%;
      height: 55%;
      will-change: transform;
      background: radial-gradient(ellipse at 40% 50%, rgba(45,212,191,.12) 0%, rgba(99,102,241,.08) 40%, transparent 70%),
                  radial-gradient(ellipse at 70% 30%, rgba(14,165,233,.1) 0%, transparent 60%);
      animation: aurora 8s ease-in-out infinite alternate;
    }
    .aurora::after {
      content: '';
      position: absolute;
      top: 5%;
      right: -20%;
      width: 80%;
      height: 40%;
      will-change: transform;
      background: radial-gradient(ellipse, rgba(99,102,241,.07) 0%, transparent 65%);
      animation: aurora 11s ease-in-out infinite alternate-reverse;
    }
    @keyframes aurora {
      from { transform: translateX(0) scaleY(1); }
      to   { transform: translateX(4%) scaleY(1.06); }
    }

    /* ══ Stars layer ══ */
    .stars-bg {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 0;
    }
    .star-dot {
      position: absolute;
      border-radius: 50%;
      background: white;
      animation: twinkle var(--d, 3s) ease-in-out infinite alternate;
      will-change: transform, opacity;
    }
    @keyframes twinkle {
      from { opacity: var(--min, .15); transform: scale(1); }
      to   { opacity: var(--max, .7);  transform: scale(1.3); }
    }

    /* ══ Snowflakes ══ */
    .snow {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }
    .flake {
      position: absolute;
      top: -10px;
      color: rgba(255,255,255,.78);
      font-size: var(--sz, 10px);
      animation: fall var(--dur, 8s) linear infinite;
      animation-delay: var(--delay, 0s);
      text-shadow: 0 0 8px rgba(91,200,232,.6);
      will-change: transform, opacity;
    }
    @keyframes fall {
      0%   { transform: translateY(-20px) rotate(0deg); opacity: .9; }
      75%  { opacity: .7; }
      100% { transform: translateY(110dvh) rotate(360deg); opacity: 0; }
    }

    /* ══ Bottom diagonal shape ══ */
    .bg-shape {
      position: absolute;
      bottom: 0; left: 0; right: 0;
      height: 18%;
      background: linear-gradient(135deg, var(--mint) 0%, var(--mint-l) 100%);
      clip-path: polygon(0 65%, 100% 0%, 100% 100%, 0 100%);
      pointer-events: none;
      z-index: 0;
    }
    .bg-shape::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 100%);
    }

    /* ══ Screen ══ */
    .screen {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      padding: 36px 22px 56px;
      overflow-y: auto;
      animation: fadeIn .4s ease-out;
    }
    .content {
      position: relative;
      z-index: 2;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    /* ══ Zone badge ══ */
    .zone-badge {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      animation: fadeIn .4s ease-out;
    }
    .zone-pill {
      font-family: var(--font-b);
      font-weight: 600;
      font-size: .8rem;
      color: var(--teal);
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .zone-emoji { display: none; }

    /* ══ Snowflake progress ══ */
    .crystals {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .crystal {
      font-size: 1.1rem;
      line-height: 1;
      transition: transform .3s, filter .3s, opacity .3s;
      user-select: none;
    }
    .crystal::before { content: '❄'; }
    .crystal.done  { color: var(--gold); transform: scale(1.1); filter: drop-shadow(0 0 4px rgba(245,200,66,.7)); opacity: 1; }
    .crystal.active{ color: var(--teal); transform: scale(1.25); filter: drop-shadow(0 0 6px rgba(91,200,232,.9)); opacity: 1; animation: snowSpin 6s linear infinite; }
    .crystal.empty { color: rgba(255,255,255,.25); opacity: 1; }
    @keyframes snowSpin {
      from { transform: scale(1.25) rotate(0deg); }
      to   { transform: scale(1.25) rotate(360deg); }
    }

    /* ══ Title ══ */
    .title {
      font-family: var(--font-t);
      font-weight: 900;
      color: var(--white);
      font-size: clamp(1.9rem, 7.5vw, 2.5rem);
      line-height: 1.12;
      text-align: center;
      text-shadow: 0 2px 24px rgba(91,200,232,.3);
      animation: fadeIn .4s ease-out .05s both;
    }

    /* ══ Mission label ══ */
    .mission-label {
      font-family: var(--font-t);
      font-weight: 700;
      color: var(--teal);
      font-size: 1rem;
      text-align: center;
      letter-spacing: .05em;
      animation: fadeIn .4s ease-out;
    }

    /* ══ Mountain decoration ══ */
    .mountain-deco {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      pointer-events: none;
      z-index: 0;
      overflow: hidden;
    }
    .mountain-deco img {
      width: 100%;
      height: auto;
      display: block;
    }

    /* ══ Description ══ */
    .desc {
      font-family: var(--font-b);
      color: rgba(255,255,255,.85);
      font-size: 1.1rem;
      line-height: 1.6;
      text-align: center;
      padding: 0 4px;
      animation: fadeIn .4s ease-out .1s both;
    }

    /* ══ Answer choices ══ */
    .choices {
      display: flex;
      flex-direction: column;
      gap: 10px;
      animation: slideUp .4s ease-out .15s both;
    }
    .choice-btn {
      width: 100%;
      background: rgba(255,255,255,.85);
      border: none !important;
      color: #0d1b4b;
      font-family: var(--font-b);
      font-weight: 700;
      font-size: 1.05rem;
      padding: 16px 20px;
      border-radius: 24px;
      transition: background .15s, transform .1s;
      text-align: left;
      box-shadow: 0 4px 12px rgba(0,0,0,.18);
    }
    .choice-btn::before {
      content: '→ ';
      opacity: .7;
      font-size: .9em;
    }
    .choice-btn:active  { transform: scale(.97); background: #f0f0f0; }
    .choice-btn:hover   { background: #f0f0f0; }
    .choice-btn:disabled{ opacity: .45; cursor: not-allowed; }

    /* ══ Text input ══ */
    .text-input {
      width: 100%;
      background: rgba(255,255,255,.1);
      border: 1.5px solid rgba(255,255,255,.25) !important;
      color: var(--white);
      font-size: 1.1rem;
      padding: 15px 18px;
      border-radius: 16px;
      outline: none;
    }
    .text-input::placeholder { color: rgba(255,255,255,.35); }
    .text-input:focus { border-color: rgba(91,200,232,.6) !important; box-shadow: 0 0 0 3px rgba(91,200,232,.15); }
    .submit-btn {
      width: 100%;
      background: var(--teal);
      color: var(--navy);
      font-weight: 800;
      font-size: 1.1rem;
      padding: 15px;
      border-radius: 16px;
      transition: transform .1s, background .1s;
    }
    .submit-btn:active { transform: scale(.97); }
    .submit-btn:disabled { opacity: .5; }

    /* ══ Hint ══ */
    .hint-btn {
      align-self: flex-start;
      background: none;
      border: 1px solid rgba(91,200,232,.35) !important;
      color: var(--teal);
      font-family: var(--font-b);
      font-weight: 500;
      font-size: .85rem;
      padding: 6px 14px;
      border-radius: 99px;
      transition: background .15s;
    }
    .hint-btn:hover { background: rgba(91,200,232,.1); }
    .hint-box {
      background: rgba(135,206,235,.22);
      border: none;
      border-radius: 12px;
      padding: 12px 14px;
      font-family: var(--font-b);
      font-size: .88rem;
      color: rgba(255,255,255,.85);
      line-height: 1.55;
      animation: slideUp .3s ease-out;
    }

    /* ══ Feedback SUCCESS ══ */
    .feedback-success {
      text-align: center;
      animation: burst .45s cubic-bezier(.34,1.56,.64,1);
      padding: 6px 0;
    }
    .feedback-success .fs-stars { display: none; }
    .feedback-success .fs-msg {
      font-family: var(--font-t);
      font-size: 1.1rem;
      color: var(--gold);
    }
    .feedback-success .fs-char {
      font-size: .8rem;
      color: rgba(255,255,255,.45);
      margin-top: 4px;
      display: block;
    }

    /* ══ Feedback ERROR ══ */
    .feedback-error {
      display: flex;
      flex-direction: column;
      gap: 10px;
      animation: shake .45s ease-out;
    }
    .feedback-error .msg {
      text-align: center;
      color: rgba(255,120,120,.9);
      font-size: .95rem;
      line-height: 1.5;
    }
    .feedback-error .msg .err-icon { display: none; }
    .retry-btn {
      width: 100%;
      background: rgba(255,255,255,.1);
      border: 1px solid rgba(255,255,255,.25) !important;
      color: var(--white);
      font-weight: 700;
      font-size: 1.1rem;
      padding: 15px;
      border-radius: 16px;
      transition: background .12s, transform .1s;
    }
    .retry-btn:active { transform: scale(.97); }
    .retry-btn:hover  { background: rgba(255,255,255,.18); }

    /* ══ Bottom row (character + bubble + arrow) ══ */
    .bottom-row {
      position: relative;
      display: flex;
      align-items: flex-end;
      gap: 10px;
      margin-top: auto;
      flex-shrink: 0;
      min-height: 220px;
      padding-bottom: 4px;
    }
    .character-wrap {
      flex-shrink: 0;
      animation: charEntrance .6s cubic-bezier(.34,1.3,.64,1);
    }
    @keyframes charEntrance {
      from { opacity: 0; transform: translateY(24px) scale(.92); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    .character-wrap img { height: 200px; width: auto; filter: drop-shadow(0 8px 28px rgba(0,0,0,.5)); max-width: 110px; object-fit: contain; object-position: bottom; }
    .character-wrap .char-nino   { height: 175px; }
    .character-wrap .char-arki   { height: 190px; }
    .character-wrap .char-adelie { height: 180px; }

    /* Speech bubble */
    .char-bubble {
      flex: 1;
      background: rgba(8,18,55,.72);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(255,255,255,.18);
      border-radius: 16px 16px 16px 4px;
      padding: 13px 16px;
      font-family: var(--font-b);
      font-size: .95rem;
      color: rgba(255,255,255,.95);
      font-weight: 500;
      line-height: 1.55;
      position: relative;
      margin-bottom: 20px;
      box-shadow: 0 8px 24px rgba(0,0,0,.35);
      animation: fadeIn .35s ease-out both;
    }
    .char-bubble::before {
      content: '';
      position: absolute;
      bottom: 12px;
      left: -9px;
      width: 0; height: 0;
      border-top: 7px solid transparent;
      border-right: 10px solid rgba(8,18,55,.72);
      border-bottom: 7px solid transparent;
    }

    .arrow-btn {
      position: absolute;
      bottom: 8px;
      right: 0;
      transition: opacity .3s, transform .3s, filter .3s;
    }
    .arrow-btn.active {
      opacity: 1;
      animation: arrowPulse 1.8s ease-in-out infinite;
      filter: drop-shadow(0 0 12px rgba(91,200,232,.6));
    }
    .arrow-btn.inactive { opacity: .15; pointer-events: none; transform: scale(.88); }
    .arrow-btn svg { width: 64px; height: 64px; }
    @keyframes arrowPulse {
      0%, 100% { transform: translateX(0) scale(1); }
      50%       { transform: translateX(5px) scale(1.05); }
    }

    /* ══ Corner logo badge (top-right, question screen only) ══ */
    .corner-logo-badge {
      position: absolute;
      top: -32px;
      right: -32px;
      width: 108px;
      height: 108px;
      background: #fff;
      border-radius: 50%;
      overflow: hidden;
      z-index: 20;
      box-shadow: -3px 3px 18px rgba(0,0,0,.28);
      pointer-events: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .corner-logo-badge img {
      width: 66px;
      height: auto;
      margin-top: 16px;
      margin-right: 26px;
    }

    /* ══ Mini score header ══ */
    .score-header {
      position: absolute;
      top: 14px;
      left: 16px;
      z-index: 2;
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .score-header .sh-icon { display: none; }
    .score-header .sh-val  { font-family: var(--font-t); font-size: 1rem; color: var(--gold); }

    /* ══ CTA buttons ══ */
    .cta-btn {
      width: 100%;
      background: var(--white);
      color: var(--navy);
      font-family: var(--font-t);
      font-weight: 800;
      font-size: 1.25rem;
      padding: 19px 28px;
      border-radius: 28px;
      box-shadow: 0 6px 28px rgba(0,0,0,.25), 0 0 0 0 rgba(91,200,232,0);
      transition: transform .12s, box-shadow .2s;
      text-align: center;
      animation: pop .4s cubic-bezier(.34,1.56,.64,1) .2s both;
    }
    .cta-btn:active { transform: scale(.97); }
    .cta-btn:hover  { box-shadow: 0 6px 28px rgba(0,0,0,.25), 0 0 0 6px rgba(91,200,232,.15); }

    .cta-btn-secondary {
      width: 100%;
      background: rgba(255,255,255,.1);
      border: 1.5px solid rgba(255,255,255,.25) !important;
      color: var(--white);
      font-family: var(--font-t);
      font-weight: 700;
      font-size: 1.1rem;
      padding: 15px 24px;
      border-radius: 28px;
      transition: background .15s, transform .1s;
      text-align: center;
    }
    .cta-btn-secondary:active { transform: scale(.97); }
    .cta-btn-secondary:hover  { background: rgba(255,255,255,.16); }

    /* ══ Score badge ══ */
    .score-badge {
      background: linear-gradient(135deg, rgba(245,200,66,.15), rgba(91,200,232,.1));
      border: 1px solid rgba(245,200,66,.3);
      border-radius: 24px;
      padding: 20px 36px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      align-self: center;
      animation: pop .5s cubic-bezier(.34,1.56,.64,1) .1s both;
      box-shadow: 0 0 40px rgba(245,200,66,.1);
    }
    .score-num { font-family: var(--font-t); font-weight: 800; color: var(--gold); font-size: 4rem; line-height: 1; text-shadow: 0 0 20px rgba(245,200,66,.4); }
    .score-sub { font-size: .85rem; color: rgba(255,255,255,.45); }

    /* ══ Stars row ══ */
    .stars-row { display: flex; justify-content: center; gap: 4px; font-size: 1.6rem; }
    .stars-row span { animation: pop .35s ease-out both; }

    /* ══ Chars trio ══ */
    .chars-row {
      display: flex;
      align-items: flex-end;
      justify-content: center;
      gap: 4px;
    }
    .chars-row .char-img    { height: 115px; width: auto; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
    .chars-row .char-arki   { height: 130px; }
    .chars-row .char-nino   { height: 88px; max-width: 160px; object-fit: contain; object-position: center; }
    .chars-row .char-adelie { height: 110px; }

    /* ══ Intro specifics ══ */
    .intro-badge {
      align-self: center;
      font-family: var(--font-b);
      font-weight: 600;
      font-size: .8rem;
      color: var(--gold);
      letter-spacing: .16em;
      text-transform: uppercase;
      animation: fadeIn .5s ease-out;
    }
    /* ══ Rule items ══ */
    .rule-item {
      display: flex;
      align-items: center;
      gap: 18px;
      animation: slideUp .4s ease-out both;
    }
    .rule-item:nth-child(1) { animation-delay: .05s; }
    .rule-item:nth-child(2) { animation-delay: .12s; }
    .rule-item:nth-child(3) { animation-delay: .19s; }
    .rule-num {
      font-family: var(--font-t);
      font-weight: 900;
      font-size: 3rem;
      color: var(--teal);
      line-height: 1;
      flex-shrink: 0;
      width: 56px;
      text-align: right;
      opacity: .7;
    }
    .rule-title {
      font-family: var(--font-t);
      font-weight: 800;
      font-size: 1.15rem;
      color: var(--white);
      line-height: 1.25;
      margin: 0;
    }

    /* ══ Final screen ══ */
    .order-badge {
      align-self: center;
      background: linear-gradient(135deg, var(--gold-d), var(--gold));
      border-radius: 18px;
      padding: 14px 24px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      animation: pop .5s cubic-bezier(.34,1.56,.64,1) .05s both;
      box-shadow: 0 0 40px rgba(245,200,66,.3);
    }
    .order-badge .ob-icon { font-size: 2rem; }
    .order-badge .ob-title { font-family: var(--font-t); font-weight: 800; font-size: .75rem; color: var(--navy); letter-spacing: .08em; text-transform: uppercase; }

    /* ══ Diploma (new white design) ══ */
    .diploma-outer {
      width: 100%;
      display: flex;
      justify-content: center;
      padding-top: 50px;
      position: relative;
    }
    .diploma-medal-wrap {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      z-index: 10;
      pointer-events: none;
    }
    #diploma-card {
      background: #fff;
      border: 7px solid #1a3a8f;
      width: 100%;
      max-width: 340px;
      padding: 52px 20px 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 6px;
      position: relative;
      animation: pop .4s cubic-bezier(.34,1.56,.64,1);
      clip-path: polygon(22px 0%,calc(100% - 22px) 0%,100% 22px,100% calc(100% - 22px),calc(100% - 22px) 100%,22px 100%,0% calc(100% - 22px),0% 22px);
    }
    .diploma-main-title {
      font-family: var(--font-t); font-weight: 900;
      font-size: 2.5rem; color: #d63050;
      letter-spacing: .04em; line-height: 1;
    }
    .diploma-sub-title {
      font-family: 'Caveat', cursive; font-weight: 600;
      font-size: 1.45rem; color: #1a3a8f; line-height: 1.2;
      margin-bottom: 4px;
    }
    .diploma-congrats {
      font-family: 'Caveat', cursive; font-weight: 500;
      font-size: 1rem; color: #2255aa;
      line-height: 1.5; max-width: 260px;
      font-style: italic;
    }
    .diploma-recipient { font-size: .78rem; color: #aaa; margin-top: 8px; }
    .diploma-name-display {
      font-family: var(--font-t); font-weight: 800;
      font-size: 1.8rem; color: #1a3a8f; line-height: 1.1;
    }
    .diploma-bottom-row {
      width: 100%; display: flex;
      align-items: flex-end; justify-content: space-between;
      margin-top: 10px; gap: 4px;
    }
    .diploma-bottom-row img.char-img { height: 110px !important; width: auto; }
    .diploma-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 4px; max-width: 130px; overflow: hidden; }
    .diploma-footer-text { font-size: .55rem; color: #aaa; letter-spacing: .08em; text-transform: uppercase; }
    .diploma-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
    .dl-btn {
      width: 100%;
      background: linear-gradient(135deg, var(--gold-d), var(--gold));
      color: var(--navy);
      font-family: var(--font-t);
      font-weight: 800;
      font-size: 1.05rem;
      padding: 15px;
      border-radius: 14px;
      transition: transform .1s;
    }
    .dl-btn:active { transform: scale(.97); }
    .print-btn {
      width: 100%;
      background: rgba(255,255,255,.1);
      border: 1px solid rgba(255,255,255,.2) !important;
      color: var(--white);
      font-family: var(--font-t);
      font-weight: 700;
      font-size: .95rem;
      padding: 13px;
      border-radius: 14px;
      transition: background .15s;
    }
    .replay-link {
      font-family: var(--font-b);
      color: rgba(255,255,255,.35);
      font-size: .85rem;
      background: none;
      border: none !important;
      padding: 6px;
      text-align: center;
    }
    .diploma-name-input {
      width: 100%;
      max-width: 300px;
      background: rgba(255,255,255,.1);
      border: 1.5px solid rgba(255,255,255,.25) !important;
      color: var(--white);
      font-size: 1.2rem;
      padding: 15px 18px;
      border-radius: 14px;
      outline: none;
      text-align: center;
    }
    .diploma-name-input::placeholder { color: rgba(255,255,255,.3); }
    .diploma-name-input:focus { border-color: rgba(245,200,66,.5) !important; box-shadow: 0 0 0 3px rgba(245,200,66,.1); }
    .name-section { display: flex; flex-direction: column; align-items: center; gap: 14px; }

    /* ══ Paw tracks ══ */
    .paw-track {
      position: absolute; bottom: 62px; left: 0; right: 0;
      display: flex; align-items: flex-end; justify-content: center;
      gap: 0; pointer-events: none; z-index: 3; height: 36px;
      padding: 0 16px;
    }
    .paw-stamp {
      font-size: 1.35rem; line-height: 1;
      animation: pawPop .4s cubic-bezier(.34,1.56,.64,1) both;
      filter: drop-shadow(0 0 5px rgba(91,200,232,.5));
      opacity: .75;
    }
    .paw-stamp:nth-child(even) { transform: rotate(12deg) translateY(-3px); }
    .paw-stamp:nth-child(odd)  { transform: rotate(-8deg) translateY(2px); }
    @keyframes pawPop {
      from { opacity:0; transform: scale(0) rotate(-20deg); }
      to   { opacity:.75; }
    }

    /* ══ Ice crack overlay ══ */
    #crack-overlay {
      position: fixed; inset: 0; z-index: 9997;
      pointer-events: none; overflow: hidden;
    }
    .crack-svg {
      position: absolute; inset: 0; width: 100%; height: 100%;
      animation: crackIn .12s ease-out forwards;
    }
    @keyframes crackIn {
      from { opacity:0; transform:scale(.96); }
      to   { opacity:1; transform:scale(1); }
    }
    @keyframes crackOut {
      0%   { opacity:1; }
      70%  { opacity:.6; }
      100% { opacity:0; }
    }
    .crack-flash {
      position: absolute; inset: 0;
      background: rgba(180,220,255,.18);
      animation: crackFlash .25s ease-out forwards;
    }
    @keyframes crackFlash {
      0%   { opacity:1; }
      100% { opacity:0; }
    }

    /* ══ Cinema intro ══ */
    .cinema-screen {
      position: fixed; inset: 0; z-index: 9999;
      background: #020b18;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      overflow: hidden;
    }
    @keyframes cinemaFadeIn  { from { opacity:0 } to { opacity:1 } }
    @keyframes cinemaFadeOut { from { opacity:1; transform:scale(1) } to { opacity:0; transform:scale(1.04) } }
    @keyframes auroraSwipe {
      0%   { transform: translateX(-110%) skewX(-12deg); opacity:0; }
      8%   { opacity:.8; }
      92%  { opacity:.5; }
      100% { transform: translateX(210%) skewX(-12deg); opacity:0; }
    }
    @keyframes loadBarFill { from { width:0% } to { width:100% } }
    @keyframes blinkCursor { 0%,100%{opacity:1} 50%{opacity:0} }

    .cinema-coords {
      position:absolute; top:32px; right:24px;
      font-family:var(--font-t); font-size:.65rem; letter-spacing:.22em;
      color:rgba(91,200,232,.45);
      animation: cinemaFadeIn .8s .4s both;
    }
    .cinema-date {
      position:absolute; top:32px; left:24px;
      font-family:var(--font-t); font-size:.65rem; letter-spacing:.18em;
      color:rgba(255,255,255,.18);
      animation: cinemaFadeIn .8s .4s both;
    }
    .cinema-subtitle {
      font-family:var(--font-t); font-size:.72rem; letter-spacing:.45em;
      color:rgba(91,200,232,.55); text-transform:uppercase;
      animation: cinemaFadeIn .7s .2s both;
      margin-bottom:14px;
    }
    .cinema-title {
      font-family:var(--font-t); font-weight:900;
      font-size: clamp(2.6rem, 13vw, 5.2rem);
      line-height:.9; text-align:center; letter-spacing:.04em;
      min-height:2.4em; position:relative;
    }
    .cinema-title .ct-line1 {
      display:block; font-size:.52em; letter-spacing:.35em;
      color:rgba(255,255,255,.45); margin-bottom:6px;
    }
    .cinema-title .ct-line2 { display:block; color:#fff; }
    .cinema-cursor {
      display:inline-block; width:3px; height:.85em;
      background:var(--teal); vertical-align:middle; margin-left:3px;
      animation: blinkCursor .7s infinite;
    }
    .cinema-aurora {
      position:absolute; inset:0; pointer-events:none; overflow:hidden;
    }
    .cinema-aurora::before {
      content:''; position:absolute; top:28%; left:0; right:0; height:200px;
      background: linear-gradient(90deg,
        transparent 0%,
        rgba(91,200,232,.08) 15%,
        rgba(91,200,232,.28) 35%,
        rgba(157,212,206,.35) 50%,
        rgba(91,200,232,.28) 65%,
        rgba(91,200,232,.08) 85%,
        transparent 100%);
      filter:blur(28px);
      animation: auroraSwipe 2.8s 1.4s ease-in-out forwards;
    }
    .cinema-loading {
      margin-top:52px; display:flex; flex-direction:column;
      align-items:center; gap:10px;
      animation: cinemaFadeIn .5s 2.6s both;
    }
    .cinema-load-label {
      font-family:var(--font-t); font-size:.6rem; letter-spacing:.28em;
      color:rgba(255,255,255,.25); text-transform:uppercase;
    }
    .cinema-load-track {
      width:180px; height:2px; background:rgba(255,255,255,.08);
      border-radius:2px; overflow:hidden;
    }
    .cinema-load-bar {
      height:100%;
      background:linear-gradient(90deg, var(--teal), var(--gold));
      border-radius:2px;
      animation: loadBarFill 1.6s 2.8s cubic-bezier(.4,0,.2,1) both;
    }

    /* ══ Animations ══ */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes slideUp {
      from { opacity: 0; transform: translateY(18px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes pop {
      from { opacity: 0; transform: scale(.88); }
      to   { opacity: 1; transform: scale(1); }
    }
    @keyframes burst {
      0%   { opacity: 0; transform: scale(.8); }
      60%  { transform: scale(1.04); }
      100% { opacity: 1; transform: scale(1); }
    }
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%       { transform: translateX(-7px); }
      40%       { transform: translateX(7px); }
      60%       { transform: translateX(-5px); }
      80%       { transform: translateX(4px); }
    }
    @keyframes confettiFall {
      0%   { transform: translateY(-30px) translateX(0) rotate(0deg) scale(1); opacity: 1; }
      60%  { opacity: 1; }
      100% { transform: translateY(380px) translateX(var(--dx)) rotate(var(--rot)) scale(.6); opacity: 0; }
    }
    @keyframes slideOut {
      from { opacity: 1; transform: translateX(0); }
      to   { opacity: 0; transform: translateX(-40px); }
    }
    @keyframes slideIn {
      from { opacity: 0; transform: translateX(40px); }
      to   { opacity: 1; transform: translateX(0); }
    }

    /* ══ Dancing trio ══ */
    @keyframes danceBounce {
      0%   { transform: translateY(0) rotate(0deg) scaleX(1); }
      18%  { transform: translateY(-22px) rotate(-5deg) scaleX(.96); }
      32%  { transform: translateY(0) rotate(3deg) scaleX(1.06); }
      46%  { transform: translateY(-12px) rotate(-2deg) scaleX(.98); }
      60%  { transform: translateY(0) rotate(1deg) scaleX(1.03); }
      75%  { transform: translateY(-5px) rotate(-1deg) scaleX(1); }
      100% { transform: translateY(0) rotate(0deg) scaleX(1); }
    }
    @keyframes danceGlow {
      0%, 100% { filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
      18%      { filter: drop-shadow(0 18px 24px rgba(91,200,232,.45)) drop-shadow(0 0 12px rgba(91,200,232,.3)); }
    }
    .chars-row.dancing .char-img {
      transform-origin: bottom center;
      animation: danceBounce 1.5s ease-in-out infinite, danceGlow 1.5s ease-in-out infinite;
    }
    .chars-row.dancing .char-img:nth-child(1) { animation-delay: 0s,    0s; }
    .chars-row.dancing .char-img:nth-child(2) { animation-delay: 0.25s, 0.25s; }
    .chars-row.dancing .char-img:nth-child(3) { animation-delay: 0.5s,  0.5s; }

    /* ══ Guide selection ══ */
    .guide-select-grid {
      display: flex; gap: 6px; width: 100%;
    }
    .guide-card {
      flex: 1; display: flex; flex-direction: column;
      align-items: center; gap: 6px;
      cursor: pointer; padding: 6px 2px 10px;
      transition: transform .2s;
    }
    .guide-card:active { transform: scale(.95); }
    .guide-img-wrap {
      transition: transform .25s, filter .25s;
    }
    .guide-card.selected .guide-img-wrap {
      transform: scale(1.08) translateY(-4px);
      filter: drop-shadow(0 0 14px rgba(91,200,232,.65));
    }
    .guide-card-name {
      font-family: var(--font-t); font-weight: 800;
      font-size: .92rem;
      color: rgba(255,255,255,.85);
      transition: color .2s;
    }
    .guide-card.selected .guide-card-name { color: var(--teal); }
    .guide-card-role {
      font-size: .65rem; color: rgba(255,255,255,.55);
      text-align: center; line-height: 1.3;
      transition: color .2s;
    }
    .guide-card.selected .guide-card-role { color: rgba(91,200,232,.75); }
    .guide-dot {
      width: 5px; height: 5px; border-radius: 50%;
      background: transparent; transition: background .2s, box-shadow .2s;
    }
    .guide-card.selected .guide-dot {
      background: var(--teal);
      box-shadow: 0 0 7px rgba(91,200,232,.7);
    }

    /* ══ Countdown overlay ══ */
    #countdown-overlay {
      position: fixed; inset: 0; z-index: 9998;
      background: rgba(2,11,24,.88);
      display: flex; align-items: center; justify-content: center;
      backdrop-filter: blur(4px);
      pointer-events: none;
    }
    @keyframes cdPop {
      0%   { opacity:0; transform: scale(.4); }
      40%  { opacity:1; transform: scale(1.15); }
      65%  { transform: scale(.95); }
      100% { opacity:1; transform: scale(1); }
    }
    @keyframes cdFadeOut {
      from { opacity:1; transform:scale(1); }
      to   { opacity:0; transform:scale(1.3); }
    }
    .countdown-num {
      font-family: var(--font-t); font-weight: 900;
      font-size: clamp(5rem, 28vw, 10rem);
      line-height: 1; text-align: center;
      animation: cdPop .45s cubic-bezier(.34,1.56,.64,1) both;
      text-shadow: 0 0 60px currentColor;
    }
    .countdown-mission {
      font-family: var(--font-t); font-weight: 900;
      font-size: clamp(2rem, 12vw, 4rem);
      color: var(--gold); letter-spacing: .08em;
      animation: cdPop .5s cubic-bezier(.34,1.56,.64,1) both;
      text-shadow: 0 0 40px rgba(245,200,66,.6);
      text-align: center;
    }

    /* ══ Guide bubble in-game ══ */
    .guide-bubble {
      position: relative;
      border-radius: 18px 18px 18px 4px;
      padding: 12px 16px;
      font-family: var(--font-b);
      font-size: 1rem;
      font-style: italic;
      line-height: 1.5;
      animation: fadeIn .3s ease-out;
    }
    .guide-bubble.correct {
      background: #87ceeb;
      border-color: #87ceeb;
      color: #0d1b4b;
    }
    .guide-bubble.wrong {
      background: #87ceeb;
      border-color: #87ceeb;
      color: #0d1b4b;
    }
    .guide-bubble.correct::before { border-right-color: #87ceeb; }
    .guide-bubble.wrong::before   { border-right-color: #87ceeb; }
    .bubble-text { display: block; font-weight: 500; }

    /* ══ Partner banner ══ */
    .partner-banner {
      position: fixed;
      bottom: 0; left: 0; right: 0;
      z-index: 50;
      pointer-events: none;
      background: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 20px;
      padding: 6px 16px;
      box-shadow: 0 -2px 10px rgba(0,0,0,.12);
      height: 48px;
    }
    .partner-banner img {
      height: 28px;
      width: auto;
      object-fit: contain;
      opacity: .9;
    }

    /* ══ Briefing screen — Journal d'explorateur ══ */

    /* Grand numéro fantôme en arrière-plan */
    .briefing-bg-num {
      position: absolute;
      top: -4%;
      right: -6%;
      font-family: var(--font-t);
      font-weight: 900;
      font-size: 68vw;
      color: rgba(91,200,232,.045);
      line-height: 1;
      pointer-events: none;
      z-index: 0;
      user-select: none;
    }

    /* Label zone — teal, compact */
    .briefing-zone-tag {
      font-family: var(--font-t);
      font-weight: 800;
      font-size: .72rem;
      color: var(--teal);
      letter-spacing: .14em;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .briefing-zone-tag span { color: var(--gold); font-size: .8rem; }

    /* Instructions "va sur place" */
    .briefing-goto {
      font-family: var(--font-b);
      font-weight: 700;
      font-size: .95rem;
      color: var(--gold);
      letter-spacing: .01em;
      text-align: center;
    }

    /* Nom de zone */
    .briefing-zone-name {
      font-family: var(--font-t);
      font-weight: 900;
      font-size: clamp(1.85rem, 8.5vw, 2.5rem);
      color: #fff;
      line-height: 1.1;
      text-align: center;
    }

    /* Photo style polaroïd incliné */
    .briefing-polaroid {
      width: calc(100% - 24px);
      max-width: 310px;
      margin: 0 auto;
      background: #fff;
      padding: 9px 9px 38px;
      border-radius: 3px;
      box-shadow: -4px 6px 0 rgba(0,0,0,.18), 0 12px 40px rgba(0,0,0,.55);
      transform: rotate(-2deg);
      position: relative;
      z-index: 1;
      flex-shrink: 0;
    }
    .briefing-polaroid img {
      width: 100%;
      aspect-ratio: 4/3;
      object-fit: cover;
      display: block;
      border-radius: 1px;
    }
    .briefing-polaroid .briefing-ph {
      width: 100%;
      aspect-ratio: 4/3;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: #dde6f0;
      border-radius: 1px;
    }
    .briefing-polaroid .briefing-ph-icon { font-size: 2.6rem; opacity: .35; }
    .briefing-polaroid .briefing-ph-label {
      font-size: .65rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: #aab;
      font-family: var(--font-b);
    }
    /* Légende handwriting sous la photo */
    .briefing-polaroid-label {
      position: absolute;
      bottom: 0; left: 0; right: 0;
      text-align: center;
      padding: 6px 8px 8px;
      font-family: 'Caveat', cursive;
      font-size: 1.1rem;
      color: #3a4a6a;
      font-weight: 600;
      line-height: 1.2;
    }

    /* Guide + bulle */
    .briefing-char-row {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      z-index: 1;
      padding: 0 4px;
    }
    .briefing-char-bubble {
      background: rgba(255,255,255,.1);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-radius: 16px 16px 16px 4px;
      padding: 11px 15px;
      font-family: var(--font-b);
      font-size: .88rem;
      color: rgba(255,255,255,.9);
      font-weight: 500;
      line-height: 1.45;
      flex: 1;
    }

    /* Bouton CTA */
    .briefing-cta {
      width: 100%;
      background: var(--gold);
      color: var(--navy);
      font-family: var(--font-t);
      font-weight: 900;
      font-size: 1.05rem;
      padding: 17px 20px;
      border-radius: 22px;
      border: none;
      cursor: pointer;
      transition: transform .15s, box-shadow .15s;
      box-shadow: 0 5px 28px rgba(245,200,66,.42);
      flex-shrink: 0;
      z-index: 1;
      letter-spacing: .01em;
    }
    .briefing-cta:active { transform: scale(.97); }
    .briefing-cta:hover  { box-shadow: 0 8px 34px rgba(245,200,66,.62); }

    /* ══ Briefing — alerte animée ══ */
    .briefing-flash {
      position: absolute;
      inset: 0;
      background: rgba(220, 50, 50, .22);
      pointer-events: none;
      z-index: 10;
      animation: briefFlash .7s ease-out forwards;
    }
    @keyframes briefFlash {
      0%   { opacity: 1; }
      100% { opacity: 0; pointer-events: none; }
    }
    @keyframes openingLine {
      0%   { width: 0; opacity: 0; }
      100% { width: 160px; opacity: 1; }
    }
    @keyframes openingProgress {
      0%   { width: 0%; }
      100% { width: 100%; }
    }
    .character-wrap { pointer-events: none; }

    .briefing-alert-header {
      display: flex;
      align-items: center;
      gap: 14px;
      padding-top: 8px;
      animation: fadeIn .3s ease-out;
    }

    .beacon-wrap {
      position: relative;
      width: 42px;
      height: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .beacon-ring {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      border: 2px solid rgba(255, 80, 80, .7);
      animation: beaconPulse 1.5s ease-out infinite;
    }
    .beacon-ring-2 { animation-delay: .55s; }
    @keyframes beaconPulse {
      0%   { transform: scale(.5); opacity: 1; }
      100% { transform: scale(2.4); opacity: 0; }
    }
    .beacon-icon {
      font-size: 1.25rem;
      position: relative;
      z-index: 1;
      animation: beaconShake .9s cubic-bezier(.36,.07,.19,.97) both;
    }
    @keyframes beaconShake {
      0%,100% { transform: rotate(0deg); }
      15%     { transform: rotate(-18deg); }
      35%     { transform: rotate(14deg); }
      55%     { transform: rotate(-10deg); }
      75%     { transform: rotate(6deg); }
      90%     { transform: rotate(-3deg); }
    }

    .briefing-alert-row {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      animation: slideUp .5s cubic-bezier(.34,1.3,.64,1) .2s both;
    }
    .briefing-alert-char {
      height: 120px;
      width: auto;
      filter: drop-shadow(0 6px 20px rgba(0,0,0,.5));
      flex-shrink: 0;
    }
    .briefing-alert-char.char-nino  { height: 95px; }
    .briefing-alert-char.char-arki  { height: 130px; }

    .briefing-alert-bubble {
      flex: 1;
      background: rgba(255,255,255,.08);
      border-radius: 16px 16px 16px 4px;
      padding: 12px 14px;
      position: relative;
      animation: fadeIn .4s ease-out .45s both;
    }
    .briefing-alert-bubble::before {
      content: '';
      position: absolute;
      bottom: 14px;
      left: -8px;
      border-top: 6px solid transparent;
      border-right: 9px solid rgba(255,255,255,.08);
      border-bottom: 6px solid transparent;
    }
    .bubble-char-name {
      display: block;
      font-family: var(--font-t);
      font-weight: 800;
      font-size: .65rem;
      color: rgba(255, 160, 100, .9);
      letter-spacing: .14em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .briefing-alert-bubble p {
      font-family: var(--font-b);
      font-size: .9rem;
      color: rgba(255,255,255,.9);
      line-height: 1.55;
      min-height: 3em;
      margin: 0;
    }

    /* ══ Intro relay ══ */
    .intro-header {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      padding-top: 20px;
      animation: fadeIn .5s ease-out both;
    }
    .intro-logo {
      height: 56px;
      width: auto;
      filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
    }
    .intro-relay-row {
      display: flex;
      align-items: flex-end;
      gap: 10px;
      opacity: 0;
      transform: translateY(12px);
      transition: opacity .4s ease-out, transform .4s cubic-bezier(.34,1.3,.64,1);
    }
    .intro-relay-char {
      width: auto;
      flex-shrink: 0;
      filter: drop-shadow(0 5px 14px rgba(0,0,0,.55));
    }
    .intro-bubble {
      flex: 1;
      background: rgba(8, 18, 48, .72);
      border: 1px solid rgba(255,255,255,.14);
      border-radius: 14px 14px 14px 4px;
      padding: 12px 15px;
      position: relative;
      backdrop-filter: blur(6px);
    }
    .intro-bubble::before {
      content: "";
      position: absolute;
      bottom: 13px;
      left: -8px;
      border-top: 6px solid transparent;
      border-right: 9px solid rgba(8, 18, 48, .72);
      border-bottom: 6px solid transparent;
    }
    .intro-bubble-name {
      display: block;
      font-family: var(--font-t);
      font-weight: 800;
      font-size: .58rem;
      color: rgba(255, 160, 90, .95);
      letter-spacing: .15em;
      text-transform: uppercase;
      margin-bottom: 5px;
    }
    .intro-bubble-text {
      font-family: var(--font-b);
      font-size: .92rem;
      color: #fff;
      line-height: 1.5;
      min-height: 1.6em;
      margin: 0;
    }

    /* ══ Print ══ */
    @media print {
      body > * { display: none !important; }
      #diploma-card { display: flex !important; border: 2px solid var(--gold) !important; }
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    /* ══ Duel mode ══ */
    .duel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .duel-col { display: flex; flex-direction: column; gap: 6px; }
    .duel-label { text-align: center; font-size: .75rem; color: rgba(255,255,255,.5); margin-bottom: 2px; }
    .duel-btn {
      width: 100%;
      background: rgba(255,255,255,.85);
      border: none !important;
      color: #0d1b4b;
      font-family: var(--font-b);
      font-weight: 700;
      font-size: .88rem;
      padding: 11px 10px;
      border-radius: 18px;
      transition: background .15s, transform .1s;
      text-align: left;
      box-shadow: 0 3px 8px rgba(0,0,0,.15);
    }
    .duel-btn::before { content: '→ '; opacity: .7; font-size: .85em; }
    .duel-btn:active  { transform: scale(.97); background: #f0f0f0; }
    .duel-btn:hover   { background: #f0f0f0; }
    .duel-btn:disabled{ opacity: .35; cursor: not-allowed; }
    .duel-btn.duel-correct { background: #c8f0c8; border: 2px solid #4caf50 !important; }
    .duel-btn.duel-wrong   { background: #f0c8c8; border: 2px solid #e57373 !important; opacity: .7; }
    .duel-btn.duel-waiting { background: rgba(91,200,232,.25); border: 2px solid rgba(91,200,232,.6) !important; }
    .duel-score-bar { display: flex; justify-content: space-between; padding: 0 4px; margin-bottom: 4px; }
    .duel-score-item { font-family: var(--font-t); font-weight: 800; font-size: 1.1rem; color: var(--white); }
    .duel-score-item span { color: var(--gold); font-size: 1.4rem; }
