*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:#14171c;color:#eef1f5;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
canvas{display:block;width:100vw;height:100vh}
.screen{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(10,12,16,.82);backdrop-filter:blur(3px);z-index:10;padding:12px}
.hidden{display:none!important}
.panel{background:linear-gradient(160deg,#232833,#1a1e26);border:1px solid #3a4252;border-radius:18px;padding:22px 26px;max-width:900px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.panel.small{max-width:380px;text-align:center}
.panel.scroll{max-height:92vh;overflow:auto;touch-action:pan-y;user-select:text;-webkit-user-select:text}
.title{font-size:clamp(34px,7vw,64px);font-weight:900;letter-spacing:2px;text-align:center;background:linear-gradient(90deg,#ff7043,#ffd54f,#66bb6a,#29b6f6);-webkit-background-clip:text;background-clip:text;color:transparent;line-height:1.05}
.title .to{font-size:.55em;font-style:italic}
.title.sm{font-size:36px}
.subtitle{text-align:center;color:#b8c2d3;margin-top:4px}
.gameday{text-align:center;margin:10px auto 4px;padding:6px 12px;border-radius:999px;background:#2f3a2a;color:#d4f5b0;font-weight:700;width:max-content;max-width:100%}
.setup h3{margin:16px 0 8px;font-size:15px;color:#9fb0c8;text-transform:uppercase;letter-spacing:1px}
#slots{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px}
.slot{display:flex;align-items:center;gap:8px;background:#151920;border-radius:10px;padding:8px 10px;border-left:6px solid}
.slot b{min-width:56px}
select,button{font:inherit;color:#eef1f5;background:#2c3341;border:1px solid #475166;border-radius:9px;padding:7px 10px}
select{flex:1}
button{cursor:pointer;font-weight:700}
button:hover{background:#384257}
button.big{background:linear-gradient(90deg,#ef6c00,#f9a825);border:none;color:#1a1300;font-size:18px;padding:11px 24px}
.row{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
.row label{display:flex;align-items:center;gap:6px;color:#b8c2d3;flex:1;min-width:200px}
.buttons{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:18px}
.foot{margin-top:14px;text-align:center;font-size:12px;color:#7d889b}
h2{margin:0 0 8px} h4{margin:16px 0 6px;color:#ffd54f}
table{border-collapse:collapse;width:100%;font-size:14px}
td,th{border-bottom:1px solid #353d4c;padding:5px 6px;text-align:left;vertical-align:top}
th{color:#9fb0c8}
td.n,th.n{text-align:right}
.tag{display:inline-block;font-size:11px;font-weight:800;padding:1px 6px;border-radius:6px;margin-right:4px}
.tag.off{background:#1b5e20;color:#c8f7c5}.tag.qna{background:#0d47a1;color:#cfe3ff}.tag.sim{background:#6d4c00;color:#ffe9a8}
.kbd{display:inline-block;background:#0f1217;border:1px solid #475166;border-bottom-width:3px;border-radius:6px;padding:0 6px;font-family:ui-monospace,monospace;font-size:13px}
a{color:#7cc4ff}
.winner{font-size:26px;font-weight:900;text-align:center;margin:4px 0 12px}
ul{margin:4px 0;padding-left:20px} li{margin:3px 0}
#touch{position:fixed;inset:0;pointer-events:none;z-index:5}
#stick{position:absolute;left:24px;bottom:24px;width:150px;height:150px;border-radius:50%;background:rgba(255,255,255,.08);border:2px solid rgba(255,255,255,.25);pointer-events:auto}
#knob{position:absolute;left:50%;top:50%;width:62px;height:62px;margin:-31px 0 0 -31px;border-radius:50%;background:rgba(255,255,255,.35)}
.tbtn{position:absolute;pointer-events:auto;width:92px;height:92px;border-radius:50%;font-size:17px;line-height:1.1;background:rgba(239,108,0,.75);border:2px solid rgba(255,255,255,.4)}
#tAction{right:24px;bottom:110px}
#tAuto{right:124px;bottom:30px;background:rgba(41,182,246,.7)}
.tbtn.tiny{width:48px;height:48px;right:16px;top:16px;font-size:16px;background:rgba(40,40,40,.7)}

/* Team logo on title screen */
#menu .panel{max-height:96vh;overflow:auto;touch-action:pan-y}
.hero{display:flex;align-items:center;justify-content:center;gap:26px}
.hero-text{flex:1 1 auto;min-width:0}
.logo-card{flex:0 0 auto;width:clamp(120px,22vw,200px);background:#fff;border-radius:18px;padding:10px;box-shadow:0 8px 28px rgba(0,0,0,.45),0 0 0 3px #1f47b8;line-height:0}
.logo-card img{width:100%;height:auto;display:block}
.team-name{text-align:center;font-weight:800;letter-spacing:3px;color:#8fb2ff;font-size:clamp(12px,1.6vw,15px);margin-bottom:4px}
.team-name span{color:#cfe0ff;font-style:italic;letter-spacing:1px}
@media (max-width:640px){
  .hero{flex-direction:column;gap:12px}
  .logo-card{width:clamp(110px,38vw,170px);padding:8px;border-radius:14px}
}
@media (max-height:520px) and (orientation:landscape){
  .logo-card{width:96px;padding:6px;border-radius:12px}
}
.foot a.statslink{color:#8fb2ff;font-weight:700;text-decoration:none;border-bottom:1px dotted #8fb2ff}
.foot a.statslink:hover{color:#cfe0ff}

/* Autonomous instructions on the title screen + AUTO button pulse */
.auto-tip{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#15202c;border:1px solid #2a5a7a;color:#d5e6f5;font-size:13.5px;line-height:1.45}
.auto-tip h4{margin:0 0 6px;color:#7fd0ff;font-size:13px;letter-spacing:.8px;text-transform:uppercase}
.auto-tip p{margin:0 0 6px}
.auto-tip ol{margin:4px 0 6px;padding-left:20px}
.auto-tip li{margin:3px 0}
.auto-tip .more{margin:0;color:#8fb0c8;font-size:12px}
#tAuto.ready{box-shadow:0 0 0 4px #ffd54f,0 0 18px rgba(255,213,79,.8);animation:autoPulse 1s ease-in-out infinite}
@keyframes autoPulse{50%{box-shadow:0 0 0 6px #ffd54f,0 0 24px rgba(255,213,79,.95)}}
@media (max-width:640px){
  .auto-tip{font-size:12.5px;padding:10px 12px;margin-top:12px}
  .auto-tip h4{font-size:12px}
}
@media (max-height:520px) and (orientation:landscape){
  .auto-tip ol{display:none}
  .auto-tip .more{display:none}
}
