.duel-screen[hidden],.duel-hud[hidden],#duel-host[hidden],#duel-join[hidden],.duel-action[hidden] {display:none;}
.duel-screen {position:fixed;inset:0;z-index:1150;display:grid;place-items:center;padding:18px;background:#261a11d9;backdrop-filter:blur(9px);color:#603d22;}
.duel-panel {width:min(100%,390px);max-height:calc(100svh - 36px);overflow:auto;padding:27px 25px 22px;border:1px solid #ebc78c;border-radius:30px;background:linear-gradient(150deg,#f6dfb7,#d2b58b);box-shadow:inset 0 2px #fff0cf,0 22px 70px #150d0cc2;outline:none;text-align:center;}
.duel-eyebrow {font-size:10px;font-weight:900;letter-spacing:.15em;opacity:.7;margin:0 0 7px;}
.duel-panel h2 {margin:0 0 20px;font-size:29px;letter-spacing:-.03em;}
.duel-tabs {display:flex;gap:6px;padding:5px;background:#5f3b2015;border-radius:17px;margin-bottom:20px;}
.duel-tabs button {flex:1;min-height:44px;padding:8px;border:0;border-radius:12px;background:none;color:#6e4c2f;font:800 13px/1.2 system-ui;cursor:pointer;}
.duel-tabs button[aria-pressed=true] {color:#69340e;background:linear-gradient(#ffe5a1,#ffbc40);box-shadow:0 2px 5px #6a3a242e,inset 0 1px #fff2c9;}
.duel-panel p {font-size:13px;line-height:1.45;margin:12px 0;}
.duel-code {display:block;width:100%;padding:10px 0 10px 12px;border:1px solid #9e754d70;border-radius:18px;background:#63402112;box-shadow:inset 0 3px 8px #68432520;font:900 48px/1.2 ui-monospace,monospace;letter-spacing:12px;color:#683916;}
.duel-panel label {display:block;font-size:14px;font-weight:750;margin:0 0 8px;}
.duel-panel input {display:block;width:100%;min-height:68px;padding:10px 0 10px 10px;border:1px solid #94633580;border-radius:17px;background:#fff4d5;color:#633719;text-align:center;font:900 36px/1.2 ui-monospace,monospace;letter-spacing:10px;}
.duel-panel button {touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
.duel-action {display:block;width:100%;min-height:50px;margin-top:13px;padding:12px;border:1px solid #d68f22;border-radius:16px;color:#66320e;background:linear-gradient(#ffe5a6,#ffbe43);font:850 15px/1.2 system-ui;box-shadow:inset 0 1px #fff2c1,0 3px 7px #7a4a2126;cursor:pointer;}
.duel-panel button:disabled {opacity:.55;cursor:wait;}
.duel-panel :focus-visible {outline:3px solid #954e11;outline-offset:3px;}
.duel-panel .duel-status {min-height:38px;color:#70471f;font-weight:750;margin:17px 0 10px;}
.duel-rules {list-style:none;padding:13px 0;margin:0;border-top:1px solid #996b3c30;border-bottom:1px solid #996b3c30;text-align:left;display:grid;gap:11px;}
.duel-rules li {display:flex;gap:12px;font-size:12px;line-height:1.4;}
.duel-rules b {flex:none;display:grid;place-items:center;width:38px;min-height:35px;border-radius:10px;background:#8a5e3220;font-size:15px;}
.duel-panel .duel-fair {font-size:11px;opacity:.8;}
.duel-back {border:0;background:none;color:#684324;text-decoration:underline;text-underline-offset:3px;font:750 13px system-ui;min-height:44px;cursor:pointer;}

/* Tug-of-war score bar: sits in the gap under the logo, above BEST, never on the board. */
.duel-hud {
  position:absolute;left:7%;right:7%;top:25.2cqw;z-index:4;
  display:flex;flex-direction:column;align-items:center;gap:1.1cqw;
  padding:0;border:0;background:none;color:#fff6d8;
  font:750 clamp(10px,2.7cqw,13px)/1.15 system-ui,sans-serif;
  pointer-events:none;
}
.duel-hud-meta {display:flex;align-items:baseline;justify-content:center;gap:8px;min-height:1.15em;}
#duel-hud-status {color:#efe4c8;font-weight:700;text-shadow:0 1px 4px #0009;opacity:.92;}
#duel-timer {
  font-size:clamp(15px,4.8cqw,20px);font-variant-numeric:tabular-nums;letter-spacing:.04em;
  color:#fff8dc;text-shadow:0 1px 8px #000a,0 0 12px #ffe7a055;
}
#duel-timer.is-urgent {color:#ffb198;text-shadow:0 1px 8px #000a,0 0 10px #ff6a3a66;}
.duel-tug {display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:2.1cqw;width:100%;}
.duel-tug-score {display:flex;flex-direction:column;min-width:9cqw;font-variant-numeric:tabular-nums;text-shadow:0 1px 5px #000c;}
.duel-tug-score small {font-size:clamp(8px,2.15cqw,10px);font-weight:800;letter-spacing:.08em;text-transform:uppercase;opacity:.82;line-height:1;}
.duel-tug-score output {font-size:clamp(14px,4.3cqw,19px);font-weight:850;line-height:1.15;}
.duel-tug-me {align-items:flex-end;color:#9ee7ff;}
.duel-tug-me small {color:#7ed9ff;}
.duel-tug-opp {align-items:flex-start;color:#ffb0bd;}
.duel-tug-opp small {color:#ff8aa0;}
.duel-tug-track {
  --tug:.5;
  container-type:inline-size;
  position:relative;height:5.6cqw;min-height:17px;max-height:24px;
  border-radius:999px;
  background:linear-gradient(180deg,#2a1c12ee,#140e0af0);
  border:1px solid #f8df9b66;
  box-shadow:inset 0 2px 7px #0009,0 2px 10px #0005,0 0 0 1px #0003;
  overflow:visible;
}
.duel-tug-fill {position:absolute;inset:1.5px;border-radius:inherit;overflow:hidden;pointer-events:none;}
.duel-tug-fill::after {
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(180deg,#ffffff55,transparent 42%,#00000033 100%);
}
.duel-tug-blue,.duel-tug-red {display:block;position:absolute;inset:0;width:100%;height:100%;}
.duel-tug-red {
  background:linear-gradient(180deg,#ff8fa4 0%,#ff3d6a 38%,#e0174c 78%,#a00d34 100%);
  box-shadow:inset 0 0 8px #ffd0d855;
}
.duel-tug-blue {
  z-index:1;
  transform:scaleX(var(--tug));transform-origin:left center;
  background:linear-gradient(180deg,#7ae2ff 0%,#1ec4ff 38%,#0090d6 78%,#0069a8 100%);
  box-shadow:inset 0 0 8px #b4f6ff55;
}
.duel-tug-knob {
  position:absolute;top:50%;left:0;z-index:1;
  width:7.6cqw;height:7.6cqw;min-width:18px;min-height:18px;max-width:26px;max-height:26px;
  border-radius:50%;
  transform:translate3d(-50%,-50%,0) translate3d(calc(var(--tug) * 100cqi),0,0);
  background:radial-gradient(circle at 32% 28%,#fff 0%,#fff3cf 34%,#f0c56a 68%,#c8892c 100%);
  border:1px solid #fff6d8dd;
  box-shadow:0 1px 3px #0008,0 0 0 1px #6a421866,0 0 10px #ffe7a055,inset 0 2px 3px #fff9,inset 0 -2px 3px #a86a1840;
  will-change:transform;
}
.duel-tug-track.is-lead .duel-tug-blue {box-shadow:inset 0 0 8px #b4f6ff55,0 0 10px #1ec4ff55;}
.duel-tug-track.is-trail .duel-tug-red {box-shadow:inset 0 0 8px #ffd0d855,0 0 10px #ff3d6a55;}
@media (prefers-reduced-motion:no-preference) {
  .duel-tug-knob {transition:transform .45s cubic-bezier(.22,.7,.25,1);}
  .duel-tug-blue {transition:transform .45s cubic-bezier(.22,.7,.25,1);}
}
@media(max-height:650px){.duel-panel {padding:20px;}.duel-panel h2{margin-bottom:12px;}.duel-code{font-size:38px;}.duel-rules{gap:7px;}}
