:root{
  --tl-red:#e30a17;
  --tl-red-dark:#8d1018;
  --tl-blue:#006aa7;
  --tl-yellow:#fecc02;
  --tl-ink:#1a1617;
  --tl-muted:#716467;
  --tl-line:#eddcdf;
  --tl-bg:#fffafa;
}
.tl-app{min-height:76vh;position:relative;overflow:hidden;background:radial-gradient(circle at 85% 10%,rgba(255,255,255,.16),transparent 25%),linear-gradient(145deg,#4a0d14 0%,#a50f1b 45%,#e30a17 100%);padding:36px 18px 46px;font-family:inherit;color:var(--tl-ink)}
.tl-app *{box-sizing:border-box}.tl-bg-orb{position:absolute;border-radius:50%;border:1px solid rgba(255,255,255,.13);pointer-events:none}.tl-orb-1{width:520px;height:520px;right:-180px;top:-220px}.tl-orb-2{width:340px;height:340px;left:-170px;bottom:-120px}
.tl-shell{width:min(760px,100%);margin:0 auto;position:relative;z-index:2}.tl-shell-wide{width:min(1220px,100%)}
.tl-topbar,.tl-host-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.tl-brand{color:#fff;font-weight:950;font-size:25px;letter-spacing:-.03em}.tl-brand span{color:var(--tl-yellow)}.tl-brand b{font-size:12px;background:#fff;color:var(--tl-red-dark);border-radius:999px;padding:5px 8px;margin-left:7px;vertical-align:middle}
.tl-top-actions,.tl-host-tools{display:flex;align-items:center;gap:8px}.tl-icon-btn,.tl-sound-toggle{appearance:none;border:1px solid rgba(255,255,255,.26);background:rgba(255,255,255,.12);color:#fff;border-radius:999px;min-height:38px;padding:8px 12px;font:inherit;font-size:12px;font-weight:900;cursor:pointer;backdrop-filter:blur(8px);transition:.18s ease}.tl-icon-btn{min-width:40px;font-size:18px;padding:6px 10px}.tl-icon-btn:hover,.tl-sound-toggle:hover{background:rgba(255,255,255,.20);transform:translateY(-1px)}
.tl-audio-panel{display:flex;gap:22px;flex-wrap:wrap;align-items:center;background:rgba(255,255,255,.96);border-radius:15px;padding:12px 16px;margin:-8px 0 16px auto;width:max-content;max-width:100%;box-shadow:0 12px 30px rgba(50,8,14,.16)}.tl-audio-panel[hidden]{display:none}.tl-audio-panel label{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:850;color:var(--tl-muted)}.tl-audio-panel input{accent-color:var(--tl-red)}.tl-mini-btn{appearance:none;border:1px solid var(--tl-line);background:#fff;color:var(--tl-red-dark);border-radius:999px;padding:7px 11px;font:inherit;font-size:11px;font-weight:850;cursor:pointer}
.tl-panel{background:rgba(255,255,255,.985);border-radius:28px;padding:34px;box-shadow:0 28px 80px rgba(57,9,16,.28)}.tl-join-panel{text-align:center}.tl-kicker{font-size:12px;font-weight:900;letter-spacing:.08em;color:var(--tl-red-dark);text-transform:uppercase}.tl-panel h1,.tl-panel h2{letter-spacing:-.035em;margin:12px 0}.tl-panel h1{font-size:clamp(34px,5vw,54px)}.tl-panel h2{font-size:32px}.tl-lead{color:var(--tl-muted);font-size:17px;line-height:1.65}
.tl-join-panel form{display:grid;gap:9px;text-align:left;max-width:430px;margin:26px auto 0}.tl-join-panel label{font-weight:850;font-size:13px}.tl-join-panel input{width:100%;height:56px;border:1px solid var(--tl-line);border-radius:14px;padding:0 16px;font-size:18px;outline:0;background:#fff}.tl-join-panel input:focus{border-color:var(--tl-red);box-shadow:0 0 0 4px rgba(227,10,23,.09)}
.tl-device-note{display:flex;flex-direction:column;gap:7px;margin:22px auto 0;max-width:520px;padding:14px 16px;background:#fff8f8;border:1px solid #f0dfe1;border-radius:14px;color:var(--tl-muted);font-size:13px;text-align:left}
.tl-btn{appearance:none;border:0;border-radius:14px;min-height:50px;padding:13px 20px;font:inherit;font-weight:900;cursor:pointer;transition:.18s ease}.tl-btn:hover{transform:translateY(-2px)}.tl-btn:disabled{opacity:.45;cursor:not-allowed;transform:none}.tl-btn-primary{background:var(--tl-red);color:#fff;box-shadow:0 12px 28px rgba(227,10,23,.22)}.tl-btn-secondary{background:#fff;color:var(--tl-red-dark);border:1px solid var(--tl-line)}.tl-btn-big{font-size:20px;min-height:60px;padding:15px 30px}
.tl-alert{margin-top:16px;padding:13px 15px;border-radius:12px}.tl-alert-error{background:#fff0f1;color:#99151d;border:1px solid #f1c9cc}.tl-stage{text-align:center}.tl-wait-icon{width:70px;height:70px;border-radius:50%;display:grid;place-items:center;margin:0 auto 18px;background:#eaf7ef;color:#167647;font-size:34px;font-weight:900}.tl-score-mini{display:inline-flex;margin-top:18px;border-radius:999px;background:#fff3f4;color:#8d1018;padding:9px 14px;font-weight:900}
.tl-player-top,.tl-host-qtop{display:flex;justify-content:space-between;align-items:center;gap:15px;color:var(--tl-muted);font-weight:850}.tl-question{font-size:clamp(26px,5vw,42px)!important;margin:24px auto!important;max-width:880px}.tl-question-host{font-size:clamp(32px,4.6vw,58px)!important}.tl-timer{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:var(--tl-red);color:#fff;font-size:25px;font-weight:950;box-shadow:0 10px 26px rgba(227,10,23,.2)}
.tl-keyboard-hint{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;margin:-8px auto 18px;padding:8px 12px;border-radius:999px;background:#fff6f6;color:var(--tl-muted);font-size:12px;font-weight:750}.tl-keyboard-hint kbd{display:inline-grid;place-items:center;min-width:26px;height:25px;padding:0 6px;border:1px solid #d8ccce;border-bottom-width:2px;border-radius:6px;background:#fff;color:var(--tl-ink);font:inherit;font-weight:900}
.tl-options{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-top:12px}.tl-option{min-height:82px;border:0;border-radius:17px;padding:16px;color:#fff;font:inherit;font-size:17px;font-weight:900;display:flex;align-items:center;gap:13px;text-align:left;box-shadow:0 9px 22px rgba(15,23,42,.10);transition:.14s ease}button.tl-option{cursor:pointer}button.tl-option:hover{transform:translateY(-2px)}button.tl-option:disabled{cursor:default;opacity:.83}.tl-option>span{width:38px;height:38px;flex:0 0 38px;border-radius:10px;background:rgba(255,255,255,.20);display:grid;place-items:center}.tl-option>b{flex:1}.tl-option>small{display:none;min-width:31px;height:31px;border-radius:8px;background:rgba(255,255,255,.17);place-items:center;font-size:13px}.tl-key-pressed{transform:scale(.97)!important;outline:5px solid rgba(255,255,255,.75)!important}
.tl-red{background:#e30a17!important}.tl-blue{background:#006aa7!important}.tl-yellow{background:#d7a500!important}.tl-whiteopt{background:#fff!important;color:#251e20!important;border:2px solid #dfd3d5!important}.tl-whiteopt>span,.tl-whiteopt>small{background:#f1e8e9!important}.tl-answer-locked{margin-top:18px;font-weight:850;color:#167647}.tl-result{padding:20px}.tl-result-icon{width:86px;height:86px;border-radius:50%;display:grid;place-items:center;margin:0 auto;font-size:52px;font-weight:950}.is-correct .tl-result-icon{background:#e7f6ed;color:#147346}.is-wrong .tl-result-icon{background:#fff0f1;color:#b21621}.tl-points-earned{font-size:30px;font-weight:950;color:var(--tl-red)}
.tl-status-pill{background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.2);border-radius:999px;padding:8px 12px;font-size:12px;font-weight:900}.tl-host-stage{min-height:600px;display:flex;flex-direction:column;justify-content:center}.tl-lobby-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:38px;align-items:center}.tl-lobby-main{text-align:center}.tl-lobby-code-label{font-size:16px;color:var(--tl-muted);font-weight:850;text-transform:uppercase;letter-spacing:.06em}.tl-game-code{font-size:clamp(76px,10vw,138px);font-weight:950;letter-spacing:.08em;line-height:1;color:var(--tl-red);margin:12px 0 18px}
.tl-join-instructions{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-width:760px;margin:20px auto}.tl-join-instructions>div{border:1px solid var(--tl-line);border-radius:14px;padding:13px;background:#fffafa;text-align:left}.tl-join-instructions b,.tl-join-instructions span{display:block}.tl-join-instructions span{margin-top:4px;color:var(--tl-muted);font-size:12px;line-height:1.45}.tl-player-count{font-weight:900;color:var(--tl-muted);margin:14px}.tl-player-cloud{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:18px auto 28px;max-width:900px}.tl-player-cloud span{background:#fff3f4;color:#7f1018;border:1px solid #f0d1d4;border-radius:999px;padding:9px 14px;font-weight:850}
.tl-qr-card{border:1px solid var(--tl-line);background:#fff;border-radius:22px;padding:20px;box-shadow:0 18px 42px rgba(44,12,16,.08)}.tl-qr{width:220px;min-height:220px;margin:0 auto 14px;display:grid;place-items:center}.tl-qr img,.tl-qr canvas{max-width:100%;height:auto!important}.tl-qr-card strong,.tl-qr-card small{display:block}.tl-qr-card small{margin-top:6px;color:var(--tl-muted);word-break:break-word}.tl-qr-fallback{color:var(--tl-muted);font-size:13px;padding:25px}
.tl-host-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:30px}.tl-options-host .tl-option{font-size:22px;min-height:105px}.tl-chart{height:250px;display:flex;align-items:flex-end;justify-content:center;gap:22px;margin:30px auto 18px;max-width:850px}.tl-bar-wrap{width:min(160px,22%);display:flex;flex-direction:column;align-items:center;gap:6px}.tl-bar{width:100%;min-height:10px;border-radius:14px 14px 5px 5px;display:flex;align-items:flex-start;justify-content:center;padding-top:10px;color:#fff;font-size:22px}.tl-bar-wrap>span{font-weight:950}.tl-bar-wrap small{font-size:11px;color:var(--tl-muted);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.is-correct-bar{outline:5px solid #2fb36f;outline-offset:3px}.tl-correct-answer{font-size:22px;font-weight:850;color:#147346}.tl-explanation{font-size:17px;color:var(--tl-muted)}
.tl-leaderboard{list-style:none;padding:0;margin:24px auto;max-width:760px;display:grid;gap:9px}.tl-leaderboard li{display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:12px;background:#fffafa;border:1px solid #f0e0e2;border-radius:14px;padding:12px 15px;text-align:left}.tl-rank{width:32px;height:32px;border-radius:9px;background:#fff0f1;color:#8d1018;display:grid;place-items:center;font-weight:950}.tl-leaderboard li strong{color:var(--tl-red)}.tl-podium{display:flex;align-items:flex-end;justify-content:center;gap:12px;margin:30px auto}.tl-podium-card{width:30%;min-height:150px;border-radius:20px 20px 8px 8px;background:#fff5f5;border:1px solid #eedbdd;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:18px}.tl-place-1{min-height:210px;order:2;background:#fff8d8}.tl-place-2{min-height:175px;order:1}.tl-place-3{order:3;background:#fff1e7}.tl-medal{font-size:42px}.tl-podium-card strong{font-size:20px}.tl-podium-card span{margin-top:6px;color:var(--tl-muted);font-weight:900}.tl-finish-title{font-size:80px}.tl-muted{color:#817477}.tl-simple-note{padding:20px;background:#fff;border:1px solid #eee;border-radius:12px}
@media(min-width:900px){.tl-options .tl-option>small{display:grid}}
@media(max-width:900px){.tl-lobby-layout{grid-template-columns:1fr}.tl-qr-card{max-width:290px;margin:0 auto}.tl-host-stage{min-height:560px}}
@media(max-width:700px){.tl-app{padding:20px 12px 34px}.tl-panel{padding:24px 18px;border-radius:22px}.tl-options{grid-template-columns:1fr}.tl-game-code{font-size:68px}.tl-options-host .tl-option{font-size:18px;min-height:78px}.tl-podium{gap:6px}.tl-podium-card{width:33%;padding:10px}.tl-player-top,.tl-host-qtop{font-size:12px}.tl-timer{width:52px;height:52px;font-size:20px}.tl-join-instructions{grid-template-columns:1fr}.tl-keyboard-hint{display:none}.tl-status-pill{display:none}.tl-audio-panel{width:100%;justify-content:center}}
@media(max-width:480px){.tl-brand{font-size:20px}.tl-brand b{font-size:9px}.tl-game-code{font-size:54px}.tl-top-actions,.tl-host-tools{gap:5px}.tl-sound-toggle{padding:7px 9px}}


/* v0.3.1 – resilient connection status */
.tl-connection-notice{
  position:fixed;
  left:50%;
  top:18px;
  transform:translateX(-50%);
  z-index:999999;
  width:min(560px,calc(100% - 28px));
  padding:11px 14px;
  border-radius:14px;
  background:#fff8dc;
  border:1px solid #ead080;
  box-shadow:0 14px 38px rgba(49,31,7,.18);
  color:#5f4910;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:2px 9px;
  align-items:center;
  text-align:left;
}
.tl-connection-notice[hidden]{display:none!important}
.tl-connection-notice strong{font-size:13px}
.tl-connection-notice small{
  grid-column:2;
  font-size:11px;
  color:#806a2d;
}
.tl-connection-dot{
  grid-row:1 / span 2;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#d79a00;
  box-shadow:0 0 0 5px rgba(215,154,0,.13);
  animation:tlPulse 1.1s ease-in-out infinite;
}
@keyframes tlPulse{
  0%,100%{transform:scale(.85);opacity:.55}
  50%{transform:scale(1);opacity:1}
}


/* =========================================================
   v0.3.2 – tydlig markering av elevens valda svar
   ========================================================= */
.tl-option{
  position:relative;
  overflow:visible;
}

.tl-option.is-selected-answer{
  transform:scale(1.035)!important;
  opacity:1!important;
  filter:none!important;
  z-index:5;
  outline:6px solid #22c55e!important;
  outline-offset:4px;
  box-shadow:
    0 0 0 10px rgba(34,197,94,.15),
    0 18px 38px rgba(15,23,42,.20)!important;
  animation:tlAnswerSelected .34s cubic-bezier(.2,.9,.25,1.25);
}

.tl-option.is-selected-answer::after{
  content:"✓";
  position:absolute;
  top:-18px;
  right:-15px;
  width:46px;
  height:46px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#16a34a;
  color:#fff;
  border:4px solid #fff;
  box-shadow:0 9px 22px rgba(22,163,74,.35);
  font-size:26px;
  font-weight:950;
  line-height:1;
}

.tl-option.is-not-selected{
  opacity:.30!important;
  filter:saturate(.42) grayscale(.18);
  transform:scale(.975);
  box-shadow:none!important;
}

.tl-selected-badge{
  position:absolute!important;
  left:50%;
  bottom:-17px;
  transform:translateX(-50%);
  width:max-content!important;
  min-width:0!important;
  height:auto!important;
  padding:6px 11px!important;
  border-radius:999px!important;
  background:#16a34a!important;
  color:#fff!important;
  border:3px solid #fff!important;
  box-shadow:0 7px 18px rgba(22,163,74,.26);
  font-size:11px!important;
  font-weight:950!important;
  letter-spacing:.02em;
  white-space:nowrap;
  display:flex!important;
  align-items:center;
  gap:5px;
}

.tl-selected-badge b{
  color:#fff!important;
  font-size:14px;
}

.tl-selection-confirm{
  margin:32px auto 0;
  width:min(540px,100%);
  display:grid;
  grid-template-columns:48px 1fr;
  gap:12px;
  align-items:center;
  padding:15px 18px;
  border-radius:17px;
  background:#ecfdf3;
  border:2px solid #86efac;
  color:#14532d;
  text-align:left;
  box-shadow:0 10px 28px rgba(22,163,74,.11);
  animation:tlConfirmIn .28s ease-out;
}

.tl-selection-confirm > span{
  width:44px;
  height:44px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#16a34a;
  color:#fff;
  font-size:25px;
  font-weight:950;
}

.tl-selection-confirm strong{
  display:block;
  font-size:17px;
  line-height:1.2;
}

.tl-selection-confirm small{
  display:block;
  margin-top:4px;
  color:#3f6f50;
  font-size:12px;
}

@keyframes tlAnswerSelected{
  0%{transform:scale(.96)}
  60%{transform:scale(1.055)}
  100%{transform:scale(1.035)}
}

@keyframes tlConfirmIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

@media(max-width:700px){
  .tl-option.is-selected-answer{
    transform:scale(1.015)!important;
    outline-width:5px!important;
    outline-offset:2px;
  }
  .tl-option.is-not-selected{opacity:.24!important}
  .tl-selected-badge{bottom:-14px}
  .tl-selection-confirm{margin-top:29px}
}


/* v0.5 – media questions */
.tl-question-media{margin:18px auto 12px;max-width:760px;text-align:center}
.tl-question-media img{display:block;max-width:100%;max-height:360px;object-fit:contain;margin:0 auto;border-radius:18px;box-shadow:0 12px 30px rgba(30,15,18,.12)}
.tl-question-audio{margin:14px auto;max-width:560px}.tl-question-audio audio{width:100%}
.tl-speech-wrap{margin:12px auto}.tl-speak-btn{border:1px solid #e7d6d9;background:#fff3f4;color:#8d1018;border-radius:999px;padding:10px 15px;font:inherit;font-weight:900;cursor:pointer}
.tl-speak-btn:hover{background:#ffe7e9}

/* v0.5 – detailed report */
.tl-report{margin:34px auto 10px;max-width:1050px;text-align:left;border-top:1px solid #eadcdf;padding-top:28px}
.tl-report>h2{text-align:center}.tl-report-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:18px 0}
.tl-report-summary>div{background:#fffafa;border:1px solid #eedfe1;border-radius:15px;padding:16px;text-align:center}.tl-report-summary strong{display:block;font-size:27px;color:#e30a17}.tl-report-summary span{font-size:11px;color:#716467;font-weight:800}
.tl-report-highlights{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.tl-report-highlights>div{background:#fff7f0;border:1px solid #f0dfd2;border-radius:14px;padding:14px}.tl-report-highlights b,.tl-report-highlights span{display:block}.tl-report-highlights span{margin-top:5px;color:#716467;font-size:12px}
.tl-report-details{margin:12px 0;border:1px solid #eadcdf;border-radius:14px;background:#fff;overflow:hidden}.tl-report-details>summary{cursor:pointer;padding:13px 15px;font-weight:900;background:#fffafa}.tl-report-table-wrap{overflow:auto}.tl-report-table{width:100%;border-collapse:collapse;font-size:12px}.tl-report-table th,.tl-report-table td{padding:10px 12px;border-top:1px solid #f0e5e6;text-align:left;vertical-align:top}.tl-report-table th{color:#716467;background:#fff;font-weight:900}
@media(max-width:700px){.tl-report-summary{grid-template-columns:1fr 1fr}.tl-report-highlights{grid-template-columns:1fr}.tl-question-media img{max-height:280px}}


/* =========================================================
   v0.6 – visual polish for join, student and host views
   ========================================================= */
.tl-app{background:radial-gradient(circle at 80% 8%,rgba(255,255,255,.13),transparent 24%),linear-gradient(145deg,#10243b 0%,#0b4d86 42%,#e30a17 120%);padding-top:28px}
.tl-shell{width:min(820px,100%)}.tl-shell-wide{width:min(1260px,100%)}
.tl-panel{border:1px solid rgba(255,255,255,.85);box-shadow:0 26px 75px rgba(8,29,50,.24);border-radius:24px}
.tl-brand{letter-spacing:-.045em}.tl-brand b{background:#f7c600;color:#192231}
.tl-join-panel{max-width:620px;margin:34px auto 0;padding:42px}.tl-join-panel h1{font-size:clamp(36px,6vw,58px)}
.tl-join-panel input{border-color:#dde5ee;background:#fbfcfe}.tl-join-panel input:focus{border-color:#0a66e8;box-shadow:0 0 0 4px rgba(10,102,232,.10)}
.tl-btn-primary{background:#e30a17;box-shadow:0 10px 25px rgba(227,10,23,.18)}
.tl-options{gap:15px}.tl-option{border-radius:16px;min-height:88px;box-shadow:0 8px 18px rgba(20,31,48,.10)}button.tl-option:hover{transform:translateY(-3px);box-shadow:0 14px 26px rgba(20,31,48,.14)}
.tl-host-stage{border-radius:24px}.tl-qr-card{border-radius:18px}.tl-game-code{letter-spacing:.10em}.tl-player-cloud span{box-shadow:0 4px 10px rgba(43,22,25,.05)}
.tl-report-summary>div,.tl-report-highlights>div,.tl-report-details{box-shadow:0 6px 18px rgba(26,38,55,.04)}
@media(max-width:700px){.tl-join-panel{padding:28px 18px}.tl-panel{border-radius:19px}}


/* v0.6.2 Beta – safe game switching / stale-session recovery */
.tl-switch-game{
  position:fixed;
  left:18px;
  bottom:18px;
  z-index:99990;
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:40px;
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.25);
  border-radius:999px;
  background:#241a1c;
  color:#fff;
  box-shadow:0 10px 28px rgba(31,18,21,.20);
  font:inherit;
  font-size:11px;
  cursor:pointer;
  opacity:.90;
}
.tl-switch-game[hidden]{display:none!important}
.tl-switch-game:hover{opacity:1;transform:translateY(-1px)}
.tl-switch-game span{font-size:15px;line-height:1}
.tl-switch-game b{font-weight:900}
@media(max-width:700px){
  .tl-switch-game{left:10px;bottom:10px;min-height:38px;padding:7px 10px}
}


/* =========================================================
   v0.6.3 Beta – server-friendly live mode + redesigned final
   ========================================================= */
.tl-host-action-notice{
  position:fixed;
  right:18px;
  top:18px;
  z-index:1000000;
  width:min(390px,calc(100% - 30px));
  min-height:52px;
  padding:11px 14px;
  border-radius:14px;
  display:grid;
  grid-template-columns:34px 1fr;
  align-items:center;
  gap:9px;
  border:1px solid #dce5ee;
  background:#fff;
  color:#334155;
  box-shadow:0 16px 42px rgba(10,31,52,.18)
}
.tl-host-action-notice[hidden]{display:none!important}
.tl-host-action-notice>span{
  width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
  background:#edf4fb;color:#0b5f9f;font-weight:950
}
.tl-host-action-notice strong{font-size:12px;line-height:1.35}
.tl-host-action-notice.is-ok{background:#effbf4;border-color:#b9e6cb;color:#145a38}
.tl-host-action-notice.is-ok>span{background:#1f9d5c;color:#fff}
.tl-host-action-notice.is-error{background:#fff8e8;border-color:#efd493;color:#725415}
.tl-host-action-notice.is-error>span{background:#d69b13;color:#fff}
.tl-host-actions button.is-action-busy{opacity:.58!important;cursor:wait!important;transform:none!important}

/* Final screen shell */
.tl-final-screen{
  width:100%;
  max-width:1080px;
  margin:0 auto;
  text-align:center;
}
.tl-final-hero{
  position:relative;
  overflow:hidden;
  margin:-6px auto 26px;
  padding:26px 20px 24px;
  border-radius:22px;
  background:
    radial-gradient(circle at 78% 0%,rgba(254,204,2,.20),transparent 26%),
    linear-gradient(135deg,#fff9e2 0%,#fff 48%,#f7fbff 100%);
  border:1px solid #eadfbe;
}
.tl-final-trophy{
  width:76px;height:76px;margin:0 auto 10px;border-radius:22px;
  display:grid;place-items:center;font-size:46px;
  background:#fff;border:1px solid #f0df9f;
  box-shadow:0 12px 28px rgba(87,65,10,.10)
}
.tl-final-kicker{
  display:inline-flex;padding:6px 10px;border-radius:999px;
  background:#162a43;color:#fff;font-size:10px;font-weight:950;letter-spacing:.10em
}
.tl-final-hero h1{
  margin:9px 0 5px!important;
  font-size:clamp(34px,5vw,55px)!important;
  line-height:1!important;
}
.tl-final-hero p{
  margin:0;color:#6b7280;font-weight:800;font-size:14px
}
.tl-final-ranking{
  margin:0 auto 28px;
}

/* One-player final: never render as a thin podium column */
.tl-winner-solo{
  width:min(720px,100%);
  margin:0 auto 25px;
  padding:20px 22px;
  display:grid;
  grid-template-columns:76px 1fr auto;
  gap:18px;
  align-items:center;
  text-align:left;
  border-radius:20px;
  border:1px solid #ead993;
  background:linear-gradient(135deg,#fff9dd 0%,#fffdf4 55%,#fff 100%);
  box-shadow:0 14px 34px rgba(96,72,11,.09)
}
.tl-winner-crown{
  width:70px;height:70px;display:grid;place-items:center;
  border-radius:18px;background:#fff;font-size:42px;border:1px solid #f0df9f
}
.tl-winner-copy span{
  display:block;color:#9a6b00;font-size:10px;font-weight:950;
  letter-spacing:.10em;text-transform:uppercase
}
.tl-winner-copy strong{
  display:block;margin:3px 0 2px;font-size:clamp(24px,4vw,34px);
  color:#21191b;line-height:1.05
}
.tl-winner-copy small{color:#716467;font-weight:800}
.tl-winner-score{
  min-width:122px;padding:13px 17px;border-radius:16px;
  background:#162a43;color:#fff;font-size:30px;font-weight:950;text-align:center
}
.tl-winner-score span{
  display:block;margin-top:1px;font-size:9px;letter-spacing:.08em;text-transform:uppercase;color:#cbd5e1
}

/* Better podium for 2–3 players */
.tl-podium{
  width:min(850px,100%);
  gap:14px;
  margin:24px auto 28px
}
.tl-podium-card{
  width:31%;
  min-width:0;
  border-radius:20px;
  box-shadow:0 12px 28px rgba(38,25,28,.07)
}
.tl-podium-card small{
  margin-bottom:6px;color:#8c777b;font-size:9px;font-weight:950;letter-spacing:.08em
}
.tl-podium-count-2 .tl-podium-card{width:min(330px,45%)}
.tl-podium-count-2 .tl-place-1{order:1}
.tl-podium-count-2 .tl-place-2{order:2}

/* Report redesign */
.tl-report{
  margin:24px auto 0;
  max-width:980px;
  padding:26px;
  border:1px solid #e2e8f0;
  border-radius:22px;
  background:#f8fafc;
  text-align:left
}
.tl-report-heading{text-align:center;margin-bottom:18px}
.tl-report-heading>span{
  display:inline-flex;padding:5px 9px;border-radius:999px;background:#e9f2fb;
  color:#0b5f9f;font-size:9px;font-weight:950;letter-spacing:.10em
}
.tl-report-heading h2{margin:7px 0 4px!important;font-size:28px!important}
.tl-report-heading p{margin:0;color:#75808c;font-size:12px}
.tl-report-summary{gap:12px;margin:18px 0}
.tl-report-summary>div{
  position:relative;
  min-height:112px;
  padding:17px 12px;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:17px;
  box-shadow:0 7px 20px rgba(28,46,68,.04)
}
.tl-report-summary i{
  display:block;font-style:normal;font-size:20px;margin-bottom:5px
}
.tl-report-summary strong{font-size:27px;color:#e30a17}
.tl-report-summary span{color:#66717d}
.tl-report-highlights{gap:12px;margin:14px 0 18px}
.tl-report-highlights>div{
  display:grid;grid-template-columns:42px 1fr;gap:10px;align-items:start;
  padding:15px;background:#fff;border:1px solid #e2e8f0
}
.tl-report-highlights>div>i{
  width:40px;height:40px;border-radius:12px;display:grid;place-items:center;
  background:#f5f7fa;font-style:normal;font-size:20px
}
.tl-report-highlights b{font-size:12px}
.tl-report-highlights span{font-size:11px;line-height:1.5}
.tl-report-highlights .is-hard{border-color:#f0d8d9}
.tl-report-highlights .is-easy{border-color:#cde8d8}
.tl-report-details{
  margin:10px 0;
  border-color:#e2e8f0;
  border-radius:15px;
  box-shadow:none
}
.tl-report-details>summary{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:14px 15px;background:#fff;list-style:none
}
.tl-report-details>summary::-webkit-details-marker{display:none}
.tl-report-details>summary span{font-weight:950}
.tl-report-details>summary small{color:#8a949f;font-size:10px;font-weight:800}
.tl-report-table{font-size:11px}
.tl-report-table th{background:#f8fafc}
.tl-accuracy-pill{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:48px;padding:4px 7px;border-radius:999px;
  background:#edf8f1;color:#167046;font-weight:950
}

/* Next step block */
.tl-final-next{
  max-width:980px;
  margin:18px auto 0;
  padding:20px 22px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:24px;
  align-items:center;
  text-align:left;
  border-radius:20px;
  background:#162a43;
  color:#fff
}
.tl-final-next>div:first-child>span{
  color:#fecc02;font-size:9px;font-weight:950;letter-spacing:.10em
}
.tl-final-next h3{margin:4px 0 4px;font-size:21px}
.tl-final-next p{margin:0;max-width:570px;color:#cbd5e1;font-size:12px;line-height:1.5}
.tl-final-next .tl-host-actions{margin:0;flex-wrap:nowrap}
.tl-final-next .tl-btn-secondary{
  background:transparent;color:#fff;border-color:rgba(255,255,255,.30)
}
.tl-final-next .tl-btn-primary{white-space:nowrap}

@media(max-width:760px){
  .tl-host-action-notice{right:10px;top:10px;width:calc(100% - 20px)}
  .tl-winner-solo{
    grid-template-columns:58px 1fr;
    padding:16px
  }
  .tl-winner-crown{width:56px;height:56px;font-size:34px}
  .tl-winner-score{
    grid-column:1/-1;
    width:100%;
    min-width:0
  }
  .tl-podium{
    align-items:stretch;
    flex-direction:column;
    gap:9px
  }
  .tl-podium-card,
  .tl-podium-count-2 .tl-podium-card{
    width:100%;
    min-height:112px!important;
    order:initial!important;
    border-radius:16px
  }
  .tl-report{padding:18px 12px}
  .tl-report-summary{grid-template-columns:1fr 1fr}
  .tl-report-highlights{grid-template-columns:1fr}
  .tl-final-next{
    grid-template-columns:1fr;
    text-align:center;
    padding:20px 14px
  }
  .tl-final-next .tl-host-actions{
    width:100%;
    flex-direction:column
  }
  .tl-final-next .tl-btn{width:100%}
}


/* =========================================================
   v0.6.4 – visual refresh for question/reveal/leaderboard
   ========================================================= */
:root{
  --tl-surface:#ffffff;
  --tl-surface-soft:#f8fafc;
  --tl-surface-warm:#fff8f8;
  --tl-ink-2:#334155;
  --tl-shadow-soft:0 14px 36px rgba(15,23,42,.08);
  --tl-shadow-strong:0 26px 64px rgba(15,23,42,.14);
}
.tl-panel{
  border:1px solid rgba(255,255,255,.55);
  box-shadow:var(--tl-shadow-strong);
}
.tl-btn{
  letter-spacing:-.01em;
}
.tl-btn-primary{
  background:linear-gradient(135deg,#ff3241 0%,#e30a17 78%);
}
.tl-btn-secondary{
  background:#fff;
}
.tl-question{
  line-height:1.08!important;
}
.tl-player-top,.tl-host-qtop{
  color:#64748b;
}
.tl-score-mini{
  background:#fff6e6;
  color:#8d1018;
  border:1px solid #f2dfb2;
}
.tl-options{
  gap:16px;
  margin-top:18px;
}
.tl-option{
  border:1px solid rgba(255,255,255,.12);
  min-height:92px;
  padding:18px 18px;
  border-radius:20px;
  box-shadow:0 14px 32px rgba(15,23,42,.12);
}
.tl-option>span{
  border-radius:12px;
  font-weight:950;
}
.tl-option>b{
  line-height:1.25;
}
.tl-whiteopt{
  box-shadow:0 10px 22px rgba(15,23,42,.06)!important;
}
.tl-selection-confirm{
  margin-top:18px;
  border-radius:18px;
  background:#effaf2;
  border:1px solid #bde4ca;
  padding:14px 16px;
}
.tl-question-media{
  margin:0 auto 18px;
}
.tl-question-media img{
  max-width:min(100%,760px);
  border-radius:24px;
  border:1px solid #e5e7eb;
  box-shadow:var(--tl-shadow-soft);
}

/* Round shell */
.tl-round-shell,
.tl-reveal-shell,
.tl-board-shell{
  width:min(1040px,100%);
  margin:0 auto;
}
.tl-round-meta{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:14px;
  align-items:center;
  margin:0 auto 20px;
}
.tl-round-step,
.tl-timer-wrap{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:20px;
  min-height:90px;
  padding:16px 18px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:var(--tl-shadow-soft);
}
.tl-round-step span,
.tl-timer-wrap small{
  color:#64748b;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl-round-step strong{
  margin-top:6px;
  color:#0f172a;
  font-size:28px;
  font-weight:950;
}
.tl-timer-wrap{
  align-items:center;
  min-width:130px;
}
.tl-timer-wrap .tl-timer{
  margin-top:6px;
}
.tl-round-card{
  padding:28px 26px;
  border-radius:28px;
  background:linear-gradient(180deg,#ffffff 0%,#fffdfd 100%);
  border:1px solid #e7ebf0;
  box-shadow:var(--tl-shadow-strong);
}
.tl-options-host{
  margin-top:24px;
}
.tl-options-host .tl-option{
  border-width:0;
  min-height:112px;
}
.tl-action-bar{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:14px;
  margin-top:22px;
}
.tl-action-bar .tl-btn{
  min-width:190px;
}

/* Reveal redesign */
.tl-reveal-shell{
  text-align:left;
  padding:28px;
  border-radius:30px;
  background:linear-gradient(180deg,#ffffff 0%,#f9fbfd 100%);
  border:1px solid #e5ebf2;
  box-shadow:var(--tl-shadow-strong);
}
.tl-reveal-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:start;
  margin-bottom:18px;
}
.tl-reveal-kicker{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#fff1f2;
  color:#9f1239;
  font-size:10px;
  font-weight:950;
  letter-spacing:.09em;
}
.tl-reveal-count{
  min-width:150px;
  padding:16px 18px;
  border-radius:20px;
  background:#162a43;
  color:#fff;
  text-align:center;
  box-shadow:0 14px 32px rgba(22,42,67,.18);
}
.tl-reveal-count span{
  display:block;
  color:#cbd5e1;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl-reveal-count strong{
  display:block;
  margin-top:5px;
  font-size:28px;
  font-weight:950;
}
.tl-reveal-shell .tl-question-host{
  margin:10px 0 0!important;
  max-width:none;
  font-size:clamp(30px,4vw,50px)!important;
}
.tl-reveal-main{
  margin-top:10px;
  padding:20px 18px;
  border-radius:24px;
  background:#ffffff;
  border:1px solid #e7ebf0;
  box-shadow:var(--tl-shadow-soft);
}
.tl-chart{
  height:280px;
  align-items:flex-end;
  gap:18px;
  margin:12px auto 8px;
}
.tl-bar-wrap{
  width:min(170px,22%);
  gap:10px;
}
.tl-bar{
  border-radius:18px 18px 8px 8px;
  box-shadow:0 10px 20px rgba(15,23,42,.12);
  padding-top:12px;
}
.tl-bar-wrap>span{
  font-size:15px;
}
.tl-bar-wrap small{
  font-size:12px;
  white-space:normal;
  line-height:1.3;
  min-height:30px;
}
.tl-correct-answer{
  display:none;
}
.tl-correct-answer-card{
  margin-top:18px;
  padding:18px 20px;
  border-radius:20px;
  background:linear-gradient(135deg,#ebf9f0 0%,#f7fff9 100%);
  border:1px solid #bfe5ce;
  text-align:left;
}
.tl-correct-answer-card span{
  display:block;
  color:#166534;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl-correct-answer-card strong{
  display:block;
  margin-top:6px;
  color:#14532d;
  font-size:26px;
  line-height:1.15;
}
.tl-explanation-card{
  margin-top:18px;
  padding:18px 20px;
  border-radius:20px;
  background:#fff8f8;
  border:1px solid #f0d9dd;
}
.tl-explanation-card>span{
  display:block;
  margin-bottom:8px;
  color:#8d1018;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl-explanation{
  margin:0;
  color:#475569;
  font-size:16px;
  line-height:1.65;
}

/* Player result */
.tl-result-modern{
  max-width:760px;
  margin:0 auto;
  padding:28px 24px;
  border-radius:28px;
  background:linear-gradient(180deg,#fff 0%,#f9fbfd 100%);
  border:1px solid #e6ebf0;
  box-shadow:var(--tl-shadow-strong);
}
.tl-result-modern .tl-result-icon{
  box-shadow:var(--tl-shadow-soft);
}
.tl-result-kicker{
  display:inline-flex;
  margin:14px auto 0;
  padding:6px 10px;
  border-radius:999px;
  background:#fff1f2;
  color:#9f1239;
  font-size:10px;
  font-weight:950;
  letter-spacing:.09em;
}
.tl-player-result-box{
  margin-top:18px;
}
.tl-player-result-answer{
  text-align:left;
  background:#fff8f8;
  border:1px solid #f0d9dd;
  border-radius:18px;
  padding:16px 18px;
}
.tl-player-result-answer span{
  display:block;
  color:#8d1018;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:8px;
}
.tl-player-result-answer p{
  margin:0;
  color:#475569;
  line-height:1.6;
}
.tl-score-badges{
  margin-top:18px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}
.tl-score-badge{
  min-width:150px;
  padding:14px 16px;
  border-radius:18px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  box-shadow:var(--tl-shadow-soft);
}
.tl-score-badge span{
  display:block;
  color:#64748b;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.tl-score-badge strong{
  display:block;
  margin-top:6px;
  color:#0f172a;
  font-size:24px;
  line-height:1.1;
}

/* Leaderboard refresh */
.tl-board-shell{
  padding:26px 24px;
  border-radius:28px;
  background:linear-gradient(180deg,#ffffff 0%,#f9fbfd 100%);
  border:1px solid #e5ebf2;
  box-shadow:var(--tl-shadow-strong);
}
.tl-board-hero{
  text-align:center;
  margin-bottom:18px;
}
.tl-board-hero>span{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:#e9f2fb;
  color:#0b5f9f;
  font-size:10px;
  font-weight:950;
  letter-spacing:.09em;
}
.tl-board-hero h1,
.tl-board-hero h2{
  margin:10px 0 6px!important;
}
.tl-leaderboard li{
  background:#fff;
  border:1px solid #e5e9ef;
  box-shadow:var(--tl-shadow-soft);
}
.tl-rank{
  background:#fff7e6;
  color:#a16207;
}
.tl-podium-card{
  border:1px solid #e8edf3;
}
.tl-finished-player .tl-host-actions{
  margin-top:18px;
}

/* Matching reveal consistency */
.tl-reveal-main .tlm-solution,
.tl-player-result-box .tlm-solution{
  width:100%;
  margin:0;
}
.tl-reveal-main .tlm-solution-grid>div{
  background:#f0fbf5;
}

/* Responsive */
@media(max-width:760px){
  .tl-round-meta,
  .tl-reveal-header{
    grid-template-columns:1fr;
  }
  .tl-round-step,
  .tl-timer-wrap,
  .tl-reveal-count{
    min-width:0;
  }
  .tl-round-card,
  .tl-reveal-shell,
  .tl-board-shell,
  .tl-result-modern{
    padding:18px 14px;
    border-radius:22px;
  }
  .tl-chart{
    height:auto;
    gap:12px;
  }
  .tl-bar-wrap{
    width:100%;
  }
  .tl-bar{
    min-height:48px;
  }
  .tl-action-bar .tl-btn{
    width:100%;
  }
}


/* =========================================================
   v0.6.5 – final reliability / async report
   ========================================================= */
.tl-final-report-loader,
.tl-final-report-error{
  max-width:980px;
  margin:18px auto 0;
  padding:18px 20px;
  border-radius:18px;
  display:grid;
  align-items:center;
  text-align:left;
  gap:14px;
}
.tl-final-report-loader{
  grid-template-columns:42px 1fr;
  background:#f8fafc;
  border:1px solid #dfe7ef;
  color:#334155;
}
.tl-final-report-loader strong,
.tl-final-report-loader small,
.tl-final-report-error strong,
.tl-final-report-error small{
  display:block;
}
.tl-final-report-loader small{
  margin-top:3px;
  color:#718096;
  font-size:11px;
}
.tl-final-report-spinner{
  width:34px;
  height:34px;
  border-radius:50%;
  border:4px solid #dbe7f1;
  border-top-color:#0b5f9f;
  animation:tlFinalSpin .8s linear infinite;
}
@keyframes tlFinalSpin{
  to{transform:rotate(360deg)}
}
.tl-final-report-error{
  grid-template-columns:42px 1fr auto;
  background:#fff8e8;
  border:1px solid #ecd18a;
  color:#6b5315;
}
.tl-final-report-error-icon{
  width:36px;
  height:36px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#d89d16;
  color:#fff;
  font-size:20px;
  font-weight:950;
}
.tl-final-report-error small{
  margin-top:4px;
  color:#806b33;
  font-size:11px;
  line-height:1.45;
}
.tl-final-report-error .tl-btn{
  min-height:42px;
  padding:9px 14px;
  white-space:nowrap;
}
@media(max-width:760px){
  .tl-final-report-error{
    grid-template-columns:42px 1fr;
  }
  .tl-final-report-error .tl-btn{
    grid-column:1/-1;
    width:100%;
  }
}
