:root {
    --tuf-navy: #0b1f4d;
    --tuf-navy-2: #12306f;
    --tuf-navy-3: #1b428f;
    --tuf-orange: #ff7a00;
    --tuf-white: #ffffff;

    /* Semantic tokens */
    --tuf-primary: var(--tuf-navy);
    --tuf-accent: var(--tuf-orange);
    --tuf-accent-hover: #e56d00;
    --tuf-surface: #ffffff;
    --tuf-background: #f3f5fa;
    --tuf-text: #1a2236;
    --tuf-muted: #5f6b85;
    --tuf-border: #dfe4ee;
    --tuf-success: #1e9e5a;
    --tuf-success-bg: #e1f7ea;
    --tuf-success-text: #0f5b33;
    --tuf-warning: #e08a00;
    --tuf-warning-bg: #fff1d9;
    --tuf-warning-text: #7a4a00;
    --tuf-danger: #d7263d;
    --tuf-danger-bg: #ffe3e3;
    --tuf-danger-text: #8a1020;
    --tuf-neutral-bg: #e9ecf3;

    /* Spacing */
    --sp-xs: .25rem;
    --sp-sm: .5rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2rem;
    --sp-xxl: 3rem;

    /* Radius / shadow */
    --tuf-radius: .75rem;
    --tuf-radius-lg: 1rem;
    --tuf-shadow: 0 1px 3px rgba(11, 31, 77, .08), 0 2px 10px rgba(11, 31, 77, .06);

    /* Typography (admin) */
    --fs-page-title: 1.75rem;
    --fs-section-title: 1.3rem;
    --fs-card-title: 1.1rem;
    --fs-body: 1rem;
    --fs-secondary: .875rem;
    --fs-label: .875rem;
    --fs-table: .95rem;
    --control-height: 2.5rem;
    --a-red: #d7263d;
    --a-blue: #1b6ec2;
    --a-green: #1e9e5a;
    --a-yellow: #e0a100;

    /* Typography (global) */
    --tuf-font: 'Segoe UI', system-ui, sans-serif;

    /* Layout */
    --tuf-content-max: 1200px;

    /* Radius (extra) */
    --tuf-radius-pill: 999px;

    /* Focus: follows the configurable accent color */
    --tuf-focus-ring: color-mix(in srgb, var(--tuf-accent) 45%, transparent);
    --tuf-focus-ring-soft: color-mix(in srgb, var(--tuf-accent) 25%, transparent);

    /* Breakpoints (custom properties cannot be used in media queries; keep in sync):
       sm 700px (phone), md 1100px (tablet / narrow desktop), lg 1280px (presenter single column), xl 2200px (large display) */
}

html, body { font-family: var(--tuf-font); }
body { color: var(--tuf-text); }

.tuf-header { background: var(--tuf-primary); color: #fff; padding: var(--sp-sm) var(--sp-lg); display: flex; gap: var(--sp-xs); align-items: center; flex-wrap: wrap; }
.tuf-header a { color: #fff; text-decoration: none; opacity: .8; padding: var(--sp-xs) var(--sp-md); border-radius: var(--tuf-radius); border-bottom: 3px solid transparent; font-weight: 600; }
.tuf-header a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.tuf-header a.active { opacity: 1; background: rgba(255, 255, 255, .14); border-bottom-color: var(--tuf-accent); }
.tuf-header .tuf-brand { margin-right: var(--sp-md); }
.tuf-subnav { background: var(--tuf-surface); border-bottom: 1px solid var(--tuf-border); padding: 0 var(--sp-lg); display: flex; gap: var(--sp-xs); overflow-x: auto; white-space: nowrap; }
.tuf-subnav a { color: var(--tuf-muted); text-decoration: none; padding: var(--sp-sm) var(--sp-md); border-bottom: 3px solid transparent; font-weight: 600; }
.tuf-subnav a:hover { color: var(--tuf-primary); background: var(--tuf-background); }
.tuf-subnav a.active { color: var(--tuf-primary); border-bottom-color: var(--tuf-accent); }
@media (max-width: 700px) { .tuf-subnav { padding: 0 var(--sp-sm); flex-wrap: wrap; white-space: normal; } }
.tuf-brand { font-weight: 800; font-size: 1.4rem; opacity: 1 !important; }
.tuf-brand span { color: var(--tuf-orange); }
.tuf-brand .brand-mark { color: inherit; }
main.tuf-content { padding: var(--sp-lg); max-width: var(--tuf-content-max); margin: 0 auto; overflow-wrap: anywhere; }

.tuf-card { background: var(--tuf-surface); border: 1px solid var(--tuf-border); border-radius: var(--tuf-radius-lg); padding: var(--sp-lg); box-shadow: var(--tuf-shadow); margin-bottom: var(--sp-md); }
.tuf-card > :last-child { margin-bottom: 0; }
.tuf-card h3, .tuf-card h4 { color: var(--tuf-primary); font-size: var(--fs-card-title); font-weight: 700; margin-bottom: var(--sp-md); }
.tuf-card.tuf-card-accent { border: 2px solid var(--tuf-accent); }
a > .tuf-card:hover { border-color: var(--tuf-accent); }
body:has(.tuf-header) { background: var(--tuf-background); }

/* Page header */
.tuf-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-md); flex-wrap: wrap; margin-bottom: var(--sp-lg); }
.tuf-page-title { font-size: var(--fs-page-title); font-weight: 800; color: var(--tuf-primary); margin: 0; }
.tuf-page-desc { color: var(--tuf-muted); font-size: var(--fs-body); margin: var(--sp-xs) 0 0; }
.tuf-page-actions { display: flex; gap: var(--sp-sm); flex-wrap: wrap; }

/* Buttons: .btn-tuf (primary), .btn-tuf-outline (secondary), .btn-tuf-danger, .btn-tuf-ghost */
.btn-tuf, .btn-tuf-outline, .btn-tuf-danger, .btn-tuf-ghost { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-xs); min-height: var(--control-height); padding: 0 var(--sp-md); border-radius: var(--tuf-radius); border: 2px solid transparent; font-size: var(--fs-body); font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn-tuf:focus-visible, .btn-tuf-outline:focus-visible, .btn-tuf-danger:focus-visible, .btn-tuf-ghost:focus-visible { outline: 3px solid var(--tuf-focus-ring); outline-offset: 2px; }
.btn-tuf { background: var(--tuf-accent); color: #fff; font-weight: 700; }
.btn-tuf:hover:not(:disabled) { background: var(--tuf-accent-hover); color: #fff; }
.btn-tuf-outline { background: transparent; color: var(--tuf-primary); border-color: var(--tuf-primary); }
.btn-tuf-outline:hover:not(:disabled) { background: var(--tuf-primary); color: #fff; }
.btn-tuf-danger { background: transparent; color: var(--tuf-danger); border-color: var(--tuf-danger); }
.btn-tuf-danger:hover:not(:disabled) { background: var(--tuf-danger); color: #fff; }
.btn-tuf-danger.solid { background: var(--tuf-danger); color: #fff; }
.btn-tuf-ghost { background: transparent; color: var(--tuf-muted); }
.btn-tuf-ghost:hover:not(:disabled) { background: var(--tuf-neutral-bg); color: var(--tuf-text); }
.btn-tuf:disabled, .btn-tuf-outline:disabled, .btn-tuf-danger:disabled, .btn-tuf-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-group-tuf { display: inline-flex; flex-wrap: wrap; gap: var(--sp-sm); align-items: center; }
.btn-group-tuf .btn-tuf-danger { margin-left: var(--sp-sm); }

/* Alerts (use <TufAlert>; .tuf-error / .tuf-ok / .tuf-warning remain the underlying classes) */
.tuf-warning { background: var(--tuf-warning-bg); color: var(--tuf-warning-text); border-radius: var(--tuf-radius); padding: var(--sp-sm) var(--sp-md); margin: var(--sp-md) 0; }
.tuf-error > ul:last-child, .tuf-ok > ul:last-child, .tuf-warning > ul:last-child { margin-bottom: 0; }
.tuf-error { background: var(--tuf-danger-bg); color: var(--tuf-danger-text); border-radius: var(--tuf-radius); padding: var(--sp-sm) var(--sp-md); margin: var(--sp-md) 0; }
.tuf-ok { background: var(--tuf-success-bg); color: var(--tuf-success-text); border-radius: var(--tuf-radius); padding: var(--sp-sm) var(--sp-md); margin: var(--sp-md) 0; }

/* Forms (admin) */
.tuf-content label { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--tuf-text); margin-bottom: var(--sp-xs); }
.tuf-content label:has(input[type=checkbox]) { display: flex; align-items: center; gap: var(--sp-sm); font-weight: 500; }
.tuf-content .form-control, .tuf-content .form-select { min-height: var(--control-height); border-radius: var(--tuf-radius); border-color: var(--tuf-border); }
box-shadow: 0 0 0 .2rem var(--tuf-focus-ring-soft); }
.tuf-help { color: var(--tuf-muted); font-size: var(--fs-secondary); margin-top: var(--sp-xs); }
.tuf-form-row { display: flex; gap: var(--sp-sm); align-items: center; flex-wrap: wrap; }
.tuf-form-row > .form-control { flex: 1; min-width: 12rem; }

/* Tables */
.tuf-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; font-size: var(--fs-table); margin-bottom: 0; }
.admin-table th { font-size: var(--fs-secondary); font-weight: 700; color: var(--tuf-muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 2px solid var(--tuf-border); padding: var(--sp-sm) var(--sp-md); }
.admin-table td { padding: var(--sp-sm) var(--sp-md); border-color: var(--tuf-border); overflow-wrap: anywhere; }
.admin-table tbody tr:hover { background: var(--tuf-background); }
.admin-table td.actions, .admin-table th.actions { text-align: right; white-space: nowrap; }
@media (max-width: 1100px) {
    .admin-table td.actions { white-space: normal; min-width: 14rem; }
    .admin-table td.actions .btn-group-tuf { justify-content: flex-end; }
}
.tuf-muted { color: var(--tuf-muted); font-size: var(--fs-secondary); }
@media (max-width: 700px) {
    .admin-table.stack thead { display: none; }
    .admin-table.stack tr, .admin-table.stack td { display: block; width: 100%; }
    .admin-table.stack tr { padding: var(--sp-sm) 0; border-bottom: 1px solid var(--tuf-border); }
    .admin-table.stack td { border: 0; padding: var(--sp-xs) var(--sp-md); }
    .admin-table.stack td.actions { text-align: left; white-space: normal; }
}

/* Status badges */
border-radius: var(--tuf-radius-pill); font-size: var(--fs-secondary);
.tuf-badge::before { content: ''; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.tuf-badge.success { background: var(--tuf-success-bg); color: var(--tuf-success-text); }
.tuf-badge.warning { background: var(--tuf-warning-bg); color: var(--tuf-warning-text); }
.tuf-badge.danger { background: var(--tuf-danger-bg); color: var(--tuf-danger-text); }
.tuf-badge.neutral { background: var(--tuf-neutral-bg); color: var(--tuf-muted); }

/* Full-screen stages (presenter + participant) */
.stage { min-height: 100vh; background: linear-gradient(160deg, var(--tuf-navy) 0%, var(--tuf-navy-2) 100%); color: #fff; display: flex; flex-direction: column; }
.stage-top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: rgba(0,0,0,.2); }
.stage-top .brand { font-weight: 800; color: var(--tuf-orange); }
.stage-body { flex: 1; padding: 1.5rem 2rem; display: flex; flex-direction: column; animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Presenter (1920x1080) */
.presenter .stage-top { font-size: 2rem; }
.presenter .q-meta { font-size: 2rem; color: #b8c8ee; }
.presenter .q-text { font-size: 4rem; font-weight: 800; line-height: 1.15; margin: 1rem 0 1.5rem; }
.presenter .q-image { max-height: 340px; max-width: 100%; border-radius: 1rem; align-self: center; margin-bottom: 1rem; }
.presenter .answers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.presenter .answer { font-size: 3rem; font-weight: 700; padding: 1.5rem 2rem; border-radius: 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.presenter .timer { font-size: 5rem; font-weight: 900; color: var(--tuf-orange); min-width: 6rem; text-align: right; }
.presenter .controls { padding: 1rem 2rem; display: flex; gap: 1rem; background: rgba(0,0,0,.25); }
.presenter .controls button { font-size: 1.6rem; padding: .8rem 2rem; }
.presenter .big { font-size: 4rem; font-weight: 800; }
.presenter .code { font-size: 6rem; font-weight: 900; color: var(--tuf-orange); letter-spacing: .2em; }
.presenter .score-row { font-size: 2.6rem; }
.qr { background: #fff; padding: 1rem; border-radius: 1rem; width: 360px; }
.qr svg { width: 100%; height: auto; display: block; }

.answer .letter { background: rgba(255,255,255,.25); border-radius: .75rem; width: 3.5rem; height: 3.5rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ans-0 { background: var(--a-red); } .ans-1 { background: var(--a-blue); } .ans-2 { background: var(--a-yellow); } .ans-3 { background: var(--a-green); }
.answer.dim { opacity: .3; }
.answer.correct { outline: 8px solid #fff; box-shadow: 0 0 40px rgba(255,255,255,.6); }

.score-list { width: 100%; }
.score-row { display: flex; justify-content: space-between; padding: .5rem 1rem; border-radius: .75rem; margin-bottom: .4rem; background: rgba(255,255,255,.1); }
.score-row.me { background: var(--tuf-orange); }
.score-row .rank { width: 3rem; opacity: .8; }
.score-row .name { flex: 1; }
.score-row .pts { font-weight: 800; }

/* Participant (mobile) */
.mobile .stage-body { padding: 1rem; max-width: 600px; margin: 0 auto; width: 100%; }
.mobile .q-text { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.mobile .q-image { max-width: 100%; max-height: min(28vh, 220px); object-fit: contain; border-radius: .75rem; margin-bottom: 1rem; align-self: center; }
.media-preview { display: flex; flex-wrap: wrap; gap: var(--sp-sm); margin-top: var(--sp-sm); }
.media-preview figure { margin: 0; max-width: 220px; }
.media-preview img { max-width: 100%; max-height: 140px; border-radius: var(--tuf-radius); border: 1px solid var(--tuf-border); object-fit: contain; }
.mobile .answer-btn { display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 4.5rem; border: 0; border-radius: 1rem; color: #fff; font-size: 1.3rem; font-weight: 700; padding: .75rem 1rem; margin-bottom: .8rem; text-align: left; }
.mobile .answer-btn:disabled { opacity: .45; }
.mobile .answer-btn.chosen { opacity: 1; outline: 5px solid #fff; }
.mobile .answer-btn.correct { opacity: 1; outline: 5px solid #5dff9f; }
.mobile .status { font-size: 1.6rem; font-weight: 800; text-align: center; margin: 1rem 0; }
.mobile .timer { font-size: 2.5rem; font-weight: 900; color: var(--tuf-orange); text-align: center; }
.mobile input, .join-form input { font-size: 1.2rem; padding: .8rem 1rem; border-radius: .75rem; border: 0; width: 100%; margin-bottom: .75rem; color: #000; }
.mobile .tuf-card { color: var(--tuf-navy); }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.home-grid a { text-decoration: none; }
.badge-tuf { background: var(--tuf-orange); color: #fff; border-radius: 1rem; padding: .15rem .6rem; font-size: .8rem; }

/* ===== Presenter redesign (1920x1080 TV) ===== */
.presenter { background: radial-gradient(ellipse at 50% 0%, #1b428f 0%, var(--tuf-navy-2) 35%, #07142f 100%); }
.presenter .stage-top { font-size: 1.5rem; padding: .7rem 2.5rem; background: rgba(0,0,0,.3); border-bottom: 3px solid var(--tuf-orange); }
.presenter .stage-top .brand { font-size: 1.8rem; letter-spacing: .03em; }
.presenter .stage-body { padding: 2rem 4rem; justify-content: center; }
.presenter .q-head { display: flex; justify-content: space-between; align-items: center; }
.presenter .q-meta { font-size: 2rem; color: #c9d6f5; }
.presenter .q-meta .pill { background: var(--tuf-orange); color: #fff; border-radius: 2rem; padding: .15rem 1.2rem; margin-right: 1rem; font-weight: 700; }
.presenter .dim-text { opacity: .6; }
.presenter .timer-box { text-align: center; min-width: 200px; background: rgba(0,0,0,.35); border: 4px solid rgba(255,255,255,.2); border-radius: 1.5rem; padding: .4rem 1.5rem; }
.presenter .timer-box.live { border-color: var(--tuf-orange); box-shadow: 0 0 30px rgba(255,122,0,.4); }
.presenter .timer { font-size: 6rem; line-height: 1; font-weight: 900; color: var(--tuf-orange); min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.presenter .timer-sub { font-size: 1.3rem; color: #c9d6f5; }
.presenter .q-text { font-size: 4.6rem; line-height: 1.12; font-weight: 800; margin: 1.5rem 0 2rem; text-wrap: balance; }
.presenter .q-image { max-height: 300px; max-width: 100%; object-fit: contain; }
.presenter .answers { gap: 1.5rem; }
.presenter .answer { font-size: 3.2rem; min-height: 150px; padding: 1.25rem 2rem; box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: opacity .4s, transform .4s; }
.presenter .answer .letter { width: 4.5rem; height: 4.5rem; font-size: 2.8rem; font-weight: 900; }
.presenter .answer.correct { transform: scale(1.03); }
.presenter .answer.dim { opacity: .25; }
.presenter .big { font-size: 4.5rem; font-weight: 800; }
.presenter .title-center { text-align: center; margin-bottom: 1.5rem; }
.presenter .finale-title { color: var(--tuf-orange); font-size: 6rem; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 0 40px rgba(255,122,0,.5); }
.presenter .score-row { font-size: 2.6rem; padding: .7rem 1.5rem; }
.presenter .score-list { max-width: 1100px; margin: 0 auto; }

/* Controls: small and secondary */
.presenter .controls { padding: .5rem 2.5rem; justify-content: flex-end; gap: .6rem; background: rgba(0,0,0,.35); }
.presenter .controls .ctl { font-size: 1rem; padding: .4rem 1rem; border-radius: .6rem; background: transparent; color: #c9d6f5; border: 1px solid rgba(255,255,255,.3); }
.presenter .controls .ctl:hover:not(:disabled) { background: rgba(255,255,255,.12); color: #fff; }
.presenter .controls .ctl:disabled { opacity: .3; }
.presenter .controls .ctl-main { border-color: var(--tuf-orange); color: var(--tuf-orange); font-weight: 700; }
.presenter .controls .ctl-main:hover:not(:disabled) { background: var(--tuf-orange); }

/* Podium */
.podium-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; animation: fadein .8s ease; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1.5rem; width: 100%; max-width: 1500px; }
.podium-place { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.podium-medal { font-size: 4rem; }
.podium-name { font-size: 3rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-sub { font-size: 1.4rem; color: #c9d6f5; }
.podium-score { font-size: 3.2rem; font-weight: 900; color: var(--tuf-orange); }
.podium-score small { font-size: 1.4rem; }
.podium-block { width: 100%; margin-top: .5rem; border-radius: 1rem 1rem 0 0; display: flex; justify-content: center; align-items: flex-start; font-size: 5rem; font-weight: 900; padding-top: .5rem; background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.08)); }
.place-1 .podium-name { font-size: 4.2rem; color: #ffd24a; text-shadow: 0 0 30px rgba(255,210,74,.5); }
.place-1 .podium-medal { font-size: 6rem; animation: bob 2s ease-in-out infinite; }
.place-1 .podium-score { font-size: 4.5rem; }
.place-1 .podium-block { height: 300px; background: linear-gradient(180deg, var(--tuf-orange), #b34f00); box-shadow: 0 0 60px rgba(255,122,0,.45); }
.place-2 .podium-block { height: 210px; }
.place-3 .podium-block { height: 150px; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.podium-rest { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem 2rem; width: 100%; max-width: 1200px; }
.rest-row { display: flex; gap: 1rem; font-size: 1.6rem; padding: .25rem 1rem; background: rgba(255,255,255,.08); border-radius: .5rem; }
.rest-rank { width: 2.5rem; opacity: .6; }
.rest-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-pts { font-weight: 800; color: var(--tuf-orange); }
.podium-empty { font-size: 3rem; opacity: .7; }

@media (max-width: 1280px) {
    .presenter .q-text { font-size: 2.6rem; }
    .presenter .answers { grid-template-columns: 1fr; }
    .presenter .answer { font-size: 1.8rem; min-height: 0; }
    .presenter .stage-body { padding: 1rem; }
    .presenter .timer { font-size: 3.5rem; }
    .podium-name { font-size: 1.6rem; } .place-1 .podium-name { font-size: 2rem; }
    .podium-rest { grid-template-columns: 1fr; }
}

/* ===== UI refinement: TV focus + phone simplification ===== */
.presenter .stage-body { padding: 1.5rem 4rem; }
.presenter .q-text { font-size: 4.6rem; line-height: 1.1; margin: 1.2rem 0 1.5rem; }
.presenter .answer { font-size: 3.4rem; min-height: 160px; }
.presenter .controls { opacity: .6; transition: opacity .3s; }
.presenter .controls:hover { opacity: 1; }
.presenter .score-row { font-size: 3rem; }
.presenter .score-row .pts { color: var(--tuf-orange); }
.presenter .score-row:first-of-type { background: linear-gradient(90deg, var(--tuf-orange), #b34f00); }
.presenter .score-row:first-of-type .pts { color: #fff; }
.presenter .finale-title { font-size: 5rem; margin-bottom: .5rem; }
.presenter .rest-row { font-size: 2rem; }
.mobile .stage-top { padding: .6rem 1rem; font-size: 1rem; gap: .5rem; }
.mobile .stage-top .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile .my-score { font-weight: 800; color: var(--tuf-orange); white-space: nowrap; font-size: 1.15rem; }
.mobile .q-meta { opacity: .85; font-size: .95rem; }
.mobile .answer-btn { min-height: 4.5rem; font-size: 1.2rem; }
.mobile .status.wait { font-size: 1.2rem; font-weight: 600; opacity: .85; }
.mobile .result { text-align: center; font-size: 1.9rem; font-weight: 800; border-radius: 1rem; padding: 1rem; margin: 1rem 0; }
.mobile .result.good { background: #137a43; }
.mobile .result.bad { background: #a51d2d; }
.mobile .result.none { background: rgba(255,255,255,.15); }
.mobile .rank-card { text-align: center; background: rgba(255,255,255,.1); border: 3px solid var(--tuf-orange); border-radius: 1.5rem; padding: 1.5rem 1rem; margin: 1.5rem 0; }
.mobile .rank-big { font-size: 5rem; font-weight: 900; line-height: 1; color: var(--tuf-orange); }
.mobile .rank-sub { font-size: 1.8rem; font-weight: 700; }
@media (max-width: 380px) { .mobile .q-text { font-size: 1.3rem; } .mobile .answer-btn { font-size: 1.05rem; } .mobile .rank-big { font-size: 4rem; } }

/* Blazor unhandled-error banner: hidden until Blazor shows it */
#blazor-error-ui { color-scheme: light only; background: lightyellow; color: #000; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* Connection indicator: driven by html[data-conn] set from ReconnectModal.razor.js */
.conn { display: inline-flex; align-items: center; gap: .4em; margin-left: .75em; font-size: .6em; font-weight: 600; opacity: .85; white-space: nowrap; vertical-align: middle; }
.conn-dot { width: .8em; height: .8em; border-radius: 50%; background: #2ecc71; display: inline-block; }
.conn-text::after { content: 'Live'; }
html[data-conn='connecting'] .conn-dot, html[data-conn='reconnecting'] .conn-dot { background: #ff9f1a; animation: conn-pulse 1s ease-in-out infinite; }
html[data-conn='disconnected'] .conn-dot { background: #ff4d4f; }
html[data-conn='connecting'] .conn-text::after { content: 'Verbinden...'; }
html[data-conn='reconnecting'] .conn-text::after { content: 'Opnieuw verbinden...'; }
html[data-conn='disconnected'] .conn-text::after { content: 'Verbinding verbroken'; }
.conn.compact { font-size: .8em; }
html:not([data-conn='connecting']):not([data-conn='reconnecting']):not([data-conn='disconnected']) .conn.compact .conn-text { display: none; }
@keyframes conn-pulse { 50% { opacity: .35; } }

/* Presenter header: never clip, wrap groups instead of truncating */
.presenter .stage-top { flex-wrap: wrap; gap: .25rem 2rem; }
.presenter .stage-top > span { white-space: nowrap; }
/* Finished: fit the podium in 1080p */
.presenter.state-finished .stage-body { padding-top: 1rem; padding-bottom: 1rem; }
.presenter .finale-title { font-size: 4.5rem; margin-bottom: 0; }
.place-1 .podium-medal { font-size: 5rem; }
.place-1 .podium-block { height: 240px; }
.place-2 .podium-block { height: 170px; }
.place-3 .podium-block { height: 120px; }

/* Presenter start + a11y */
.stage-link { color: var(--tuf-orange); font-size: 2rem; }
.stage-nav { display: flex; gap: .25rem; font-size: 1rem; flex-wrap: wrap; }
.stage-nav a { color: #fff; text-decoration: none; padding: .6rem 1rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--tuf-radius); font-weight: 600; }
.stage-nav a:hover { background: rgba(255,255,255,.12); color: var(--tuf-orange); }
.presenter-start .stage-top { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; font-size: 1.1rem; padding: .5rem 1.5rem; }
.presenter-start-brand { display: inline-flex; align-items: center; gap: .75rem; font-weight: 600; }
.presenter-start .stage-body { padding: 2rem 1rem; justify-content: center; align-items: center; }
.presenter-card { width: 100%; max-width: 720px; background: var(--tuf-surface); color: var(--tuf-text); border-radius: var(--tuf-radius-lg); box-shadow: var(--tuf-shadow); padding: 2rem; }
.presenter-start-title { font-size: 1.75rem; font-weight: 800; color: var(--tuf-primary); margin: 0 0 1.25rem; }
.presenter-form { font-size: 1rem; }
.presenter-form label { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--tuf-primary); }
.presenter-form .form-select { font-size: 1.1rem; min-height: 3rem; border-radius: var(--tuf-radius); border-color: var(--tuf-border); }
.presenter-form .form-select:focus { border-color: var(--tuf-accent); box-shadow: 0 0 0 .25rem var(--tuf-focus-ring-soft); }
.presenter-form .btn-tuf { font-size: 1.2rem; width: 100%; min-height: 3.25rem; }
.presenter-card .tuf-error { margin-top: 1rem; }
@media (max-width: 600px) { .presenter-card { padding: 1.25rem; } .presenter-start .stage-top { padding: .5rem 1rem; } }
.tuf-header a:focus-visible, .tuf-subnav a:focus-visible, .stage-nav a:focus-visible, .btn-tuf:focus-visible { outline: 3px solid var(--tuf-orange); outline-offset: 2px; }

/* Focus op donkere podia */
:root { --tuf-focus: var(--tuf-orange); --tuf-link: var(--tuf-navy-3); }
.stage input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mobile .answer-btn, .btn-tuf, .btn-tuf-outline, .btn-tuf-danger, .btn-tuf-ghost { touch-action: manipulation; }
.join-submit { width: 100%; font-size: 1.4rem; min-height: 3.5rem; }
.tuf-content a:not([class]):focus-visible,
.tuf-card .tuf-error:first-child, .tuf-card .tuf-ok:first-child { margin-top: 0; }
@media (max-width: 700px) {
    main.tuf-content { padding: var(--sp-md); }
    .tuf-page-actions, .tuf-page-actions > * { width: 100%; }
    .admin-table.stack td.actions .btn-group-tuf { display: flex; width: 100%; }
    .admin-table.stack td.actions .btn-group-tuf > * { flex: 1 1 auto; }
    .btn-group-tuf .btn-tuf-danger { margin-left: 0; }
}
.mobile .answer-btn .letter { font-size: 1.6rem; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.btn-tuf, .tuf-header a, .tuf-subnav a { min-height: 44px; }

/* Question image + fallback */
.q-image { display: block; max-width: 100%; height: auto; object-fit: contain; }
.q-image-missing { align-self: center; margin-bottom: 1rem; padding: .5rem 1.25rem; border: 2px dashed rgba(255,255,255,.5); border-radius: var(--tuf-radius); color: #c9d6f5; font-size: 1.1rem; }
.q-image-missing[hidden] { display: none; }
.presenter .q-image { max-height: min(300px, 32vh); }

/* Presenter: status, progress and controls */.presenter .controls { opacity: 1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; padding: .75rem 2.5rem; border-top: 3px solid var(--tuf-orange); position: sticky; bottom: 0; }
.presenter .ctl-status { display: flex; flex-direction: column; font-size: 1.3rem; color: #c9d6f5; }
.presenter .ctl-state { font-weight: 700; color: #fff; }
.presenter .ctl-actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.presenter .controls .ctl { min-height: 56px; border-radius: var(--tuf-radius); border: 2px solid rgba(255,255,255,.6); background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.presenter .controls .ctl:hover:not(:disabled) { background: rgba(255,255,255,.15); }
.presenter .controls .ctl-main { background: var(--tuf-orange); border-color: var(--tuf-orange); color: #fff; }
.presenter .controls .ctl-main:hover:not(:disabled) { background: #e56e00; }
.presenter .controls .ctl-end { background: #a51d2d; border-color: #a51d2d; }
.presenter .controls .ctl:disabled { opacity: .5; cursor: progress; }
.presenter .controls .ctl:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.progress-strip { height: 6px; background: rgba(255,255,255,.15); }
.progress-strip span { display: block; height: 100%; background: var(--tuf-orange); transition: width .4s; }
@media (max-width: 700px) {
    .presenter .controls { padding: .75rem 1rem; }
    .presenter .ctl-actions, .presenter .ctl-actions .ctl { width: 100%; }
    .presenter .stage-top { font-size: 1.1rem; padding: .6rem 1rem; }
    .presenter .stage-top > span { white-space: normal; }
    .presenter .q-head { flex-wrap: wrap; gap: .75rem; }
    .presenter .q-text { font-size: 1.9rem; }
    .presenter .answer { font-size: 1.4rem; padding: .75rem 1rem; }
    .presenter .answer .letter { width: 2.5rem; height: 2.5rem; font-size: 1.5rem; }
    .presenter .timer { font-size: 3rem; }
    .presenter .big { font-size: 2.2rem; }
    .presenter .code { font-size: 3rem; }
}
@media (min-width: 2200px) { .presenter .q-text { font-size: 6rem; } .presenter .answer { font-size: 4.2rem; } .presenter .timer { font-size: 8rem; } }

/* ===== Visual polish: presenter hierarchy, player cards, podium ===== */
.presenter { min-height: 100dvh; }
.presenter .stage-body { justify-content: flex-start; gap: .5rem; }
.presenter .q-text { text-align: center; font-size: clamp(1.6rem, min(4.2vw, 6vh), 4.6rem); margin: .5rem auto .75rem; max-width: min(100%, 32ch); }
.presenter .q-text.q-short { font-size: clamp(2rem, min(5.6vw, 8vh), 6rem); }
.presenter .q-text.q-long { font-size: clamp(1.3rem, min(2.6vw, 4vh), 3.2rem); max-width: 100%; text-align: left; }
.presenter .q-image { display: block; margin: 0 auto .75rem; max-width: 100%; max-height: clamp(140px, 26vh, 520px); width: auto; height: auto; object-fit: contain; border-radius: 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.presenter .q-image-missing { margin: 0 auto 1rem; }
.presenter .answers { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 1rem; }
.presenter .answer { min-height: clamp(72px, 11vh, 190px); font-size: clamp(1.1rem, min(2.2vw, 3.2vh), 3.2rem); padding: .75rem 1.25rem; line-height: 1.15; overflow-wrap: anywhere; box-sizing: border-box; }
.presenter .answer .letter { width: 3rem; height: 3rem; font-size: 1.8rem; }
.presenter .answer > span:last-child { flex: 1; min-width: 0; }
.presenter .stage-body { padding-bottom: 1rem; }
.presenter .answer.correct { outline: 6px solid #fff; transform: none; }
@media (max-width: 1280px) { .presenter .answers { grid-template-columns: 1fr; grid-auto-rows: auto; } .presenter .q-text, .presenter .q-text.q-short, .presenter .q-text.q-long { text-align: left; max-width: 100%; } }
@media (min-width: 2200px) { .presenter .q-image { max-height: 40vh; } .presenter .q-text.q-long { font-size: 4.4rem; } }

.mobile { min-height: 100dvh; }
.mobile .answer-btn { position: relative; min-height: 4.5rem; border: 3px solid transparent; box-shadow: 0 3px 10px rgba(0,0,0,.3); overflow-wrap: anywhere; }
.mobile .answer-btn .letter { background: rgba(0,0,0,.25); border-radius: .6rem; width: 2.6rem; height: 2.6rem; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 900; }
.mobile .answer-btn .ans-text { flex: 1; min-width: 0; }
.mobile .answer-btn .ans-mark { font-size: .85rem; font-weight: 800; background: #fff; color: var(--tuf-navy); border-radius: 2rem; padding: .15rem .6rem; white-space: nowrap; }
.mobile .answer-btn:not(:disabled):active { transform: scale(.98); }
.mobile .answer-btn:focus-visible { outline: 4px solid #fff; outline-offset: 2px; }
.mobile .answer-btn:disabled:not(.chosen):not(.correct) { opacity: .4; }
.mobile .answer-btn.chosen { border-color: #fff; opacity: 1; outline: none; box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 3px 10px rgba(0,0,0,.3); }
.mobile .answer-btn.correct { border-color: #5dff9f; outline: none; }
.mobile .q-text { text-wrap: balance; overflow-wrap: anywhere; }
.mobile .q-image { display: block; margin: 0 auto 1rem; }

.podium-place.place-1 .podium-block { background: linear-gradient(180deg, #ffd24a, var(--tuf-orange)); color: var(--tuf-navy); }
.podium-place.place-2 .podium-block { background: linear-gradient(180deg, #e3e8f2, #8d9ab5); color: var(--tuf-navy); }
.podium-place.place-3 .podium-block { background: linear-gradient(180deg, #e0a36b, #8a5326); color: #fff; }
.podium-name { overflow-wrap: anywhere; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
.rest-row { align-items: center; }
.rest-rank { font-variant-numeric: tabular-nums; text-align: right; }
.score-row .rank { font-variant-numeric: tabular-nums; }
.score-row .name { min-width: 0; overflow-wrap: anywhere; }
.score-row:nth-child(-n+3) .rank { font-weight: 900; opacity: 1; }
@media (max-width: 700px) { .podium { gap: .5rem; } .place-1 .podium-medal, .podium-medal { font-size: 2.6rem; } .podium-score { font-size: 1.6rem; } .place-1 .podium-score { font-size: 2rem; } .podium-block { font-size: 2.4rem; } }
.podium-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rest-row { min-width: 0; }
.rest-name { min-width: 0; }
@media (max-width: 1280px) { .podium-rest { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .podium-name, .place-1 .podium-name { font-size: 1rem; } .podium-sub { font-size: .8rem; overflow-wrap: anywhere; } .podium-wrap { width: 100%; } }

