/* Voxel World Cup — broadcast chrome */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #10141f; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; color: #e8ecf2; z-index: 5; }
#ui button, #ui .bug { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- scorebug ---------- */
.bug {
  position: absolute; top: 14px; left: 14px; cursor: pointer; user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
}
.bug-main {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #1a2233 0%, #121826 100%);
  border-left: 4px solid #c60b1e; border-right: 4px solid #75aadb;
  padding: 8px 14px; font-weight: 800; font-size: 17px; letter-spacing: .5px;
}
.bug-score { font-family: 'Courier New', monospace; font-size: 19px; color: #ffd23e; padding: 0 4px; }
.bug-sub {
  display: flex; justify-content: space-between; background: #0c111d;
  padding: 3px 12px; font-size: 11px; letter-spacing: 1.5px; color: #9fd8ff;
}
.bug.flash .bug-main { animation: bugflash .9s ease; }
@keyframes bugflash { 0%,40% { background: #2a5a2a; } 100% { } }
.live-dot { width: 8px; height: 8px; background: #ff3b3b; border-radius: 50%; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.flag { display: inline-flex; flex-direction: column; gap: 1px; margin: 0 4px; vertical-align: middle; }
.flag i { width: 14px; height: 4px; display: block; }

/* ---------- team sheets ---------- */
.sheets {
  position: absolute; top: 76px; left: 14px; display: flex; gap: 8px;
  background: rgba(10,14,24,.92); padding: 10px; border: 1px solid #2a3550;
  max-height: 72vh; overflow: auto; z-index: 8;
}
.sheet { min-width: 168px; padding: 0 8px; }
.sheet h4 { font-size: 12px; letter-spacing: 1px; padding: 4px 0 8px; border-bottom: 2px solid #333; margin-bottom: 4px; }
.sheet.esp h4 { border-color: #c60b1e; } .sheet.arg h4 { border-color: #75aadb; }
.sheet h4 em { float: right; color: #8a94a6; font-style: normal; font-size: 10px; }
.plyr { font-size: 11.5px; padding: 2.5px 2px; color: #dfe6f2; display: flex; gap: 6px; align-items: baseline; }
.plyr .num { color: #ffd23e; font-family: monospace; width: 18px; }
.plyr i { margin-left: auto; color: #6a7488; font-size: 9.5px; font-style: normal; }
.plyr.sub { color: #9aa4b2; }
.subhead { font-size: 9px; letter-spacing: 2px; color: #6a7488; margin: 8px 0 3px; }
.sheets-close { position: sticky; top: 0; margin-left: auto; cursor: pointer; color: #8a94a6; padding: 2px 6px; }

/* ---------- feed ---------- */
.feed {
  position: absolute; top: 14px; right: 14px; width: 290px;
  display: flex; flex-direction: column; gap: 4px;
}
.feed-title { font-size: 10px; letter-spacing: 3px; color: #8a94a6; text-align: right; padding-right: 4px; }
.ev {
  display: flex; gap: 8px; align-items: center; background: rgba(10,14,24,.82);
  border-right: 3px solid #333; padding: 6px 8px; font-size: 12px; line-height: 1.3;
  animation: evin .3s ease; backdrop-filter: blur(3px);
}
.ev.esp { border-right-color: #c60b1e; }
.ev.arg { border-right-color: #75aadb; }
.ev-ic {
  flex: 0 0 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900; color: #0c111d; font-family: monospace;
}
@keyframes evin { from { transform: translateX(30px); opacity: 0; } }

/* ---------- timeline ---------- */
.timeline {
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  width: min(640px, 72vw); height: 10px; background: rgba(10,14,24,.8);
  border: 1px solid #2a3550;
}
.tl-fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #35507a, #4d76b8); }
.tl-half { position: absolute; left: 47%; top: -2px; bottom: -2px; width: 2px; background: #ffd23e; }
.tl-label { position: absolute; top: -15px; left: 0; font-size: 9px; letter-spacing: 2px; color: #8a94a6; }
.tl-mark {
  position: absolute; top: -4px; width: 10px; height: 16px; border: none; cursor: pointer;
  transform: translateX(-50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.tl-mark.goal.esp { background: #c60b1e; } .tl-mark.goal.arg { background: #75aadb; }
.tl-mark.card { background: #ffd23e; } .tl-mark.penalty { background: #ff6bd6; }
.tl-mark:hover { transform: translateX(-50%) scale(1.5); }

/* ---------- control bar ---------- */
.bar {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: rgba(10,14,24,.88); border: 1px solid #2a3550; padding: 8px 14px;
  backdrop-filter: blur(6px); max-width: 96vw;
}
.bar-group { display: flex; gap: 5px; align-items: center; }
.bar-label { font-size: 9px; letter-spacing: 2px; color: #6a7488; margin-right: 2px; }
.btn {
  background: #1c2740; color: #dfe6f2; border: 1px solid #33405e;
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 7px 11px;
  cursor: pointer; transition: background .15s, transform .1s;
}
.btn:hover { background: #2a3a5e; }
.btn:active { transform: scale(.96); }
.btn.on { background: #35507a; border-color: #5f7fae; color: #fff; }
.btn.start {
  font-size: 16px; padding: 13px 34px; background: #c60b1e; border-color: #ff5a4e;
  letter-spacing: 1px; font-weight: 800;
}
.btn.start:hover { background: #e02535; }

/* ---------- banners / overlays ---------- */
.banner {
  position: absolute; top: 22vh; left: 0; right: 0; display: flex; justify-content: center;
  pointer-events: none; animation: bin .45s ease;
}
.banner > div { display: inline-block; }
.b-tag {
  background: #ffd23e; color: #10141f; font-weight: 900; font-size: 30px;
  padding: 10px 18px; letter-spacing: 3px;
}
.b-text {
  background: rgba(10,14,24,.92); padding: 10px 20px; font-size: 20px; font-weight: 700;
  max-width: 60vw; display: flex; align-items: center;
}
.banner.arg .b-tag { background: #75aadb; }
@keyframes bin { from { transform: translateY(-30px); opacity: 0; } }
.banner.hidden { display: none !important; }

.ceremony {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8,10,18,.45); pointer-events: none; animation: evin .4s ease;
}
.cer-card {
  background: rgba(10,14,24,.94); border: 1px solid #2a3550; border-top: 4px solid #ffd23e;
  padding: 26px 44px; text-align: center; min-width: 320px;
}
.cer-title { font-size: 30px; font-weight: 900; letter-spacing: 5px; }
.cer-score { font-size: 44px; font-weight: 900; font-family: 'Courier New', monospace; color: #ffd23e; margin: 10px 0 4px; }
.cer-sub { color: #9aa4b2; font-size: 13px; margin-bottom: 14px; }
.cer-stats { margin: 0 auto; border-collapse: collapse; font-size: 12.5px; }
.cer-stats th, .cer-stats td { padding: 3px 14px; text-align: center; color: #c6cfdd; }
.cer-stats th { color: #8a94a6; font-size: 10px; letter-spacing: 1px; }
.cer-stats td:first-child, .cer-stats th:first-child { text-align: left; color: #8a94a6; }

.replaybug {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; background: rgba(10,14,24,.9);
  border: 1px solid #ffd23e; padding: 7px 12px;
}
.rp-tag { background: #ffd23e; color: #10141f; font-weight: 900; font-size: 11px; padding: 3px 8px; letter-spacing: 1px; }
.rp-label { font-size: 12px; color: #dfe6f2; }
.rp-skip { padding: 4px 8px; font-size: 11px; }
.rp-bar { position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: #222; }
.rp-bar i { display: block; height: 100%; width: 0; background: #ffd23e; }

.chip.paused {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(10,14,24,.9); border: 1px solid #5f7fae; padding: 8px 18px;
  font-weight: 800; letter-spacing: 2px; font-size: 14px;
}
.skip { position: absolute; top: 64px; right: 16px; }

/* ---------- help & intro ---------- */
.help, .intro {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(6,8,14,.78); z-index: 20; pointer-events: auto;
}
.help-card, .intro-card {
  background: rgba(10,14,24,.96); border: 1px solid #2a3550; padding: 30px 40px;
  text-align: center; max-width: min(560px, 92vw);
}
.help-card h3 { letter-spacing: 2px; margin-bottom: 16px; color: #ffd23e; }
.help-card table { margin: 0 auto 14px; border-collapse: collapse; font-size: 13.5px; }
.help-card td { padding: 5px 12px; text-align: left; }
.help-card td:first-child { color: #9fd8ff; font-family: monospace; font-weight: 700; white-space: nowrap; }
.help-card p { color: #8a94a6; font-size: 12px; margin-bottom: 14px; }

.intro { background: radial-gradient(ellipse at center, rgba(10,16,32,.55) 0%, rgba(6,8,14,.92) 100%); }
.intro-card { border-top: 5px solid #c60b1e; border-bottom: 5px solid #75aadb; }
.intro-live { font-size: 11px; letter-spacing: 3px; color: #9aa4b2; margin-bottom: 18px; }
.intro-card h1 {
  font-size: clamp(38px, 7vw, 62px); font-weight: 900; letter-spacing: 6px; line-height: 1.02;
  background: linear-gradient(180deg, #fff 30%, #9fd8ff); -webkit-background-clip: text;
  background-clip: text; color: transparent; margin-bottom: 20px;
}
.intro-tie { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 26px; }
.intro-team { font-size: 18px; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; }
.intro-vs { color: #ffd23e; font-weight: 900; font-size: 14px; }
.intro-hint { margin-top: 18px; font-size: 11px; color: #6a7488; letter-spacing: .5px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .feed { width: 44vw; top: auto; bottom: 118px; right: 8px; max-height: 30vh; overflow: hidden; }
  .feed .ev:nth-child(n+7) { display: none; }
  .bug-main { font-size: 14px; padding: 6px 10px; }
  .bar { bottom: 8px; gap: 8px; padding: 6px 8px; width: 96vw; }
  .btn { padding: 9px 10px; font-size: 12px; }
  .bar-label { display: none; }
  .timeline { bottom: 108px; width: 88vw; }
  .sheets { max-width: 92vw; }
  .b-text { font-size: 14px; }
  .b-tag { font-size: 20px; }
}
@media (max-height: 500px) {
  .feed { display: none; }
  .timeline { bottom: 58px; }
}
