*{box-sizing:border-box} [hidden]{display:none!important}
:root{color-scheme:dark;--purple:#4F15E0;--blue:#1566E0;--bg:#0d0b17;--panel:#171329;--line:#332950;--ink:#f5f2ff;--soft:#bdb2dd;--accent:#ae96ff;font-family:system-ui,sans-serif;color:var(--ink);background:var(--bg)}
body{margin:0} .brand{font-weight:850;letter-spacing:.13em;white-space:nowrap}.brand b{color:#b69fff}.mark{display:inline-grid;place-items:center;background:linear-gradient(135deg,var(--purple),var(--blue));border-radius:.35em;width:1.7em;height:1.7em;margin-right:.45em;color:white}
#tv{width:min(100vw,177.7778vh);height:min(100vh,56.25vw);position:absolute;inset:0;margin:auto;padding:2.4% 3%;font-size:min(1.64vw,2.92vh);display:grid;grid-template-rows:auto 1fr auto;gap:1em;background:radial-gradient(ellipse at 16% 0%,#271452,transparent 65%),#100d1e}
.tv-head,.ticker{display:flex;align-items:center;gap:1em}.tv-head{justify-content:space-between}.status{color:var(--soft);font-size:.82em}.tv-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:.85em;min-height:0}.media,.round,.ticker{border:1px solid #514274;border-radius:.65em;overflow:hidden}.media{position:relative;background:#140e28;display:flex;flex-direction:column;justify-content:center;text-align:center}#creative{height:100%;min-height:0;display:grid;place-items:center;background:radial-gradient(ellipse at 80% 0%,#1566e0 0%,transparent 65%),linear-gradient(145deg,#170b34 18%,#4f15e0 70%,#1e0e53)}#creative.text-ad{padding:8%;font-size:2.58em;font-weight:850;line-height:1.02;overflow-wrap:anywhere}#creative img,#creative iframe,#creative video{width:100%;height:100%;min-height:0;border:0;object-fit:contain;background:#100d1e}#ad-caption:empty{display:none}#ad-caption{background:#19122a;padding:.35em;font-size:.76em}
.round{background:#19132c;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:5%;text-align:center;gap:.45em}.round h2{font-size:1.18em;line-height:1.1;margin:0;overflow-wrap:anywhere}.label{font-weight:780;letter-spacing:.12em;color:#c3afff;font-size:.66em}.clock{font-variant-numeric:tabular-nums;font-weight:850;line-height:1}.round .clock{font-size:5.35em;letter-spacing:-.065em;white-space:nowrap}.track{width:80%;height:.24em;background:#403358;border-radius:100px;overflow:hidden}.track div{height:100%;background:linear-gradient(90deg,#8d55ff,#4099ff)}.ticker{padding:.58em 2%;background:#201638;min-height:2.5em}.tv-notices{display:flex;gap:.65em}.tv-notices .ticker:first-child{flex:1;min-width:0}.ticker strong{font-size:.86em;overflow-wrap:anywhere}.ticker .label{flex:none}#fullscreen{position:absolute;right:.2em;bottom:.1em;padding:.2em .4em;opacity:.4;font-size:.65em}
#admin{max-width:1050px;margin:auto;padding:clamp(16px,4vw,46px)}.admin-head{display:flex;justify-content:space-between;align-items:center;gap:1em;flex-wrap:wrap}.admin-head a{color:#cfbfff}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:clamp(16px,3vw,28px)}.wide{grid-column:1/-1}.panel h2{margin:0 0 1rem;font-size:1.2rem}.panel h2 output{color:#d6c7ff;float:right}.panel label{display:grid;gap:6px;color:#ddd4f7;font-size:.95rem;margin-bottom:12px}input,select,button{font:inherit;border-radius:8px}input,select{width:100%;padding:.58em .65em;border:1px solid #5e4e80;background:#100c20;color:var(--ink)}button{cursor:pointer;border:1px solid #6d45df;background:#4F15E0;color:white;padding:.55em .72em;font-weight:650}button:focus-visible,a:focus-visible{outline:3px solid #74afff;outline-offset:3px}button:disabled{cursor:wait;opacity:.55}.actions{display:flex;flex-wrap:wrap;gap:8px}.timer-actions,#logout{margin-top:14px}#logout,[data-action="pause"],#clear,#restart-ads,#ads-list button{background:#231938;border-color:#644d91}.ad-fields{display:grid;grid-template-columns:1.4fr 1fr 1.5fr .65fr;gap:10px}#ads-list{padding-left:1.5rem}#ads-list li{margin:8px 0;overflow-wrap:anywhere}#ads-list button{margin-left:8px;font-size:.88em}#login{max-width:430px}
.customer{background:#102847;border-color:#4d98ee;color:#e6f2ff;gap:.65em;max-width:57%}
.customer .label{color:#a8d6ff}
.customer strong{font-size:1.38em;font-variant-numeric:tabular-nums;line-height:1;min-width:0}
.panel .customer-heading{margin-top:1.4rem}
#warning-form fieldset{min-width:0;margin:1rem 0 0;padding:.75rem;border:1px solid var(--line);border-radius:8px}
.warning-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.75rem}
.warning-fields input[type=color]{height:2.5rem;padding:.22rem}
.ad-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px}
#ads-list .ad-actions button{margin-left:0}
#clear-customer{background:#231938;border-color:#644d91}
#tv-rounds{display:grid;grid-auto-rows:minmax(0,1fr);gap:.45em;min-height:0}
.round-count{min-width:0;width:100%;display:grid;justify-items:center;gap:.2em}
.round-identity{display:flex;flex-direction:column;align-items:center;text-align:center;justify-content:center;gap:.4em;min-width:0;max-width:100%}
.game-name{display:block;color:#d8ccff;font-size:.78em;overflow-wrap:anywhere}
.game-logo{display:block;width:min(100%,8em);height:2.6em;object-fit:contain}
#tv-rounds[data-count="1"] .round-identity{width:100%}
#tv-rounds[data-count="1"] .game-logo{width:min(90%,17em);height:6.5em}
.round.overtime{border-color:#f9bf5d;background:#2b1e29}
.round.overtime .phase{color:#ffcb76}
.round .phase{letter-spacing:.03em;overflow-wrap:anywhere}
#tv-rounds:not([data-count="1"]) .round{flex-direction:row;justify-content:space-between;text-align:left;padding:.32em .55em;gap:.35em}
#tv-rounds:not([data-count="1"]) .round-identity{flex:1;justify-content:center}.round .game-logo{flex-shrink:0}#tv-rounds:not([data-count="1"]) .game-logo{height:1.8em}
#tv-rounds:not([data-count="1"]) .round h2{font-size:.8em}
#tv-rounds:not([data-count="1"]) .round-count{width:64%;text-align:center;gap:.12em}
#tv-rounds:not([data-count="1"]) .clock{font-size:2.75em}
#tv-rounds:not([data-count="1"]) .round-count .label{font-size:.52em}
#game-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:1rem}
.game-card{min-width:0;padding:1rem;background:#100c20;border:1px solid #493867;border-radius:12px}
.game-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.6rem}
.game-card h3{margin:0;overflow-wrap:anywhere}
.card-clock{font-size:1.5rem}
.card-phase{margin:.35rem 0 .85rem}
.game-card form{margin-top:.9rem}
.game-card fieldset{min-width:0;margin:0;padding:.7rem;border:1px solid var(--line);border-radius:8px}
.form-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.65rem}
.form-fields input[type=color]{height:2.5rem;padding:.22rem}
.add-game{margin-top:1rem;display:flex;align-items:end;gap:.7rem;flex-wrap:wrap}
.add-game label{margin:0;flex:1 1 190px;max-width:360px}
#notice-history{list-style:none;padding:0;margin:0;display:grid;gap:.65rem}
#notice-history li{padding:.65rem;border:1px solid var(--line);border-radius:8px;overflow-wrap:anywhere}
#notice-history .actions{margin-top:.5rem}
.notice-state{display:inline-block;margin-left:.55rem;color:var(--soft);font-size:.85rem}
.notice-state[data-active=true]{color:#91e8be}
#tv #customer{position:absolute;z-index:2;inset:0;margin:auto;width:max-content;max-width:85%;height:max-content;padding:1em 2em;display:flex;flex-direction:column;align-items:center;text-align:center;box-shadow:0 .65em 2em #000c;border:2px solid #6cafff;pointer-events:none}
#tv #customer strong{font-size:3em}
#tv #customer .label{font-size:.85em}
.tv-grid.no-rounds{grid-template-columns:minmax(0,1fr)}
#tv-rounds[data-count="0"]{display:none}

@media(max-width:680px){.control-grid,.ad-fields{grid-template-columns:1fr}.wide{grid-column:auto}}
