*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #07040A;
  --surface: #0D080E;
  --panel:   #130C10;
  --border:  #241018;
  --accent:  #D4001C;
  --glow:    #FF1030;
  --home:    #FFFFFF;
  --away:    #A8A0B0;
  --text:    #F0ECF4;
  --muted:   #503848;
  --dim:     #1E0E18;
}

/* ── NHL LED BOARD THEME ─────────────────────────────────────────── */
[data-theme="nhl"] {
  --bg:      #000000;
  --surface: #0B0800;
  --panel:   #130E00;
  --border:  #2E2400;
  --accent:  #FF6600;
  --glow:    #FF8C00;
  --home:    #FFFFFF;
  --away:    #FFD060;
  --text:    #FFF8E0;
  --muted:   #665500;
  --dim:     #1A1200;
}
/* ── NEUTRAL / LED BOARD THEME ───────────────────────────────────── */
[data-theme="neutral"] {
  --bg:      #000000;
  --surface: #070707;
  --panel:   #0A0A0A;
  --border:  #1C1C1C;
  --accent:  #00CC00;
  --glow:    #00EE00;
  --home:    #FF3300;
  --away:    #FF3300;
  --text:    #FFB800;
  --muted:   #664400;
  --dim:     #0A0800;
}

body {
  font-family: 'Work Sans', 'Arial Narrow', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  width: 100vw; height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 160% 100% at 50% 50%, #1A0814 0%, var(--bg) 65%),
    radial-gradient(ellipse 40% 80% at 0% 50%, rgba(212,0,28,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 80% at 100% 50%, rgba(212,0,28,0.06) 0%, transparent 70%);
}
[data-theme="nhl"] body {
  background: #000;
  background-image: radial-gradient(ellipse 180% 100% at 50% 50%, #1A1000 0%, #000 65%);
  font-family: 'Orbitron', 'Work Sans', monospace;
}
[data-theme="neutral"] body {
  background: #000;
  background-image: radial-gradient(circle, rgba(255,200,50,0.04) 1px, transparent 1px);
  background-size: 5px 5px;
  font-family: 'Share Tech Mono', 'Orbitron', monospace;
}
/* NHL scanlines overlay */
[data-theme="nhl"] body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px
  );
}

/* ── TOP STRIPE ───────────────────────────────────────────────── */
.stripe {
  height: 4px;
  flex-shrink: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent) 10%,
    var(--glow) 40%,
    var(--glow) 60%,
    var(--accent) 90%,
    transparent 100%);
}

/* ── TEAM HEADER ──────────────────────────────────────────────── */
.header {
  flex-shrink: 0;
  height: 30vh;
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4vw;
  gap: 16px;
}

.team-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.8vh, 10px);
}
.team-info.away { align-items: center; }

.team-name {
  font-size: clamp(1.7rem, min(4.8vw, 6.6vh), 6.6rem);
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  max-width: 44vw;
  text-align: center;
  margin-top: 20px;
}

.logo-box {
  flex-shrink: 0;
  width: clamp(180px, 30vh, 330px);
  height: clamp(180px, 30vh, 330px);
  display: flex; align-items: center; justify-content: center;
  margin-top: clamp(4px, 0.8vh, 10px);
}
.logo-box img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 2px 14px rgba(255,255,255,0.15));
  -webkit-mask-image: radial-gradient(circle, black 40%, rgba(0,0,0,0.5) 58%, transparent 68%);
  mask-image:         radial-gradient(circle, black 40%, rgba(0,0,0,0.5) 58%, transparent 68%);
}
.logo-placeholder {
  width: 100%; height: 100%;
  background: var(--panel);
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(2.5rem, 8vh, 6rem);
}

/* ── CENTER (period) ──────────────────────────────────────────── */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  text-align: center;
  gap: 6px;
}

.period-badge {
  font-size: clamp(2.2rem, min(5.4vw, 6.6vh), 4.8rem);
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
}

/* ── MAIN SCORE AREA ──────────────────────────────────────────── */
.score-area {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 3vw;
  gap: clamp(8px, 2vw, 28px);
  min-height: 0;
}

.score-side {
  display: flex;
  align-items: center;
  min-height: 0;
}
.score-side.home { justify-content: flex-end; }
.score-side.away { justify-content: flex-start; }

.score-num {
  font-size: clamp(7rem, min(36vw, 50vh), 99rem);
  font-weight: 900;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
  letter-spacing: -8px;
  transition: transform 0.15s ease;
}
.score-num.home {
  color: var(--home);
  text-shadow:
    0 0 80px rgba(255,255,255,0.20),
    0 0 160px rgba(212,0,28,0.10);
}
.score-num.away {
  color: var(--away);
  text-shadow: 0 0 80px rgba(168,160,176,0.16);
}
.score-num.bump { transform: scale(1.07); }

/* ── CENTER CLOCK ─────────────────────────────────────────────── */
.clock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 10px 0;
}
.clock-wrap::before,
.clock-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--dim) 25%,
    var(--dim) 75%,
    transparent 100%);
}
.clock-wrap::before { left:  -clamp(8px, 2vw, 28px); }
.clock-wrap::after  { right: -clamp(8px, 2vw, 28px); }

.clock {
  font-size: clamp(2rem, min(6.5vw, 8vh), 6.5rem);
  font-weight: 900;
  letter-spacing: 6px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1;
  transition: color 0.4s, text-shadow 0.4s;
  white-space: nowrap;
}
.clock.running {
  color: #27D872;
  text-shadow: 0 0 30px rgba(39,216,114,0.55), 0 0 70px rgba(39,216,114,0.22);
}
.clock.warning {
  color: #FFBF00;
  text-shadow: 0 0 30px rgba(255,191,0,0.60), 0 0 70px rgba(255,191,0,0.22);
}
.clock.ended {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(200,0,26,0.65), 0 0 70px rgba(200,0,26,0.28);
  animation: blink .9s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .32; } }

.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #27D872;
  box-shadow: 0 0 8px #27D872, 0 0 18px rgba(39,216,114,0.5);
  opacity: 0;
  transition: opacity .3s;
}
.live-dot.on { opacity: 1; }

/* ── DIVIDER ──────────────────────────────────────────────────── */
.divider {
  flex-shrink: 0;
  height: 1px;
  margin: 0 5vw;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--dim) 20%,
    var(--border) 50%,
    var(--dim) 80%,
    transparent 100%);
}

/* ── PENALTY BAR ──────────────────────────────────────────────── */
.pen-bar {
  flex-shrink: 0;
  background: var(--surface);
  height: 21vh;
  min-height: 115px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  padding: 0 3vw;
  gap: 0;
  overflow: hidden;
}
.pen-center-div {
  width: 1px;
  height: 60%;
  background: var(--border);
  align-self: center;
  justify-self: center;
}
.pen-side {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 24px);
  height: 100%;
  padding: 10px clamp(8px, 1.5vw, 20px);
  overflow: hidden;
}
/* Chipy rastú OD VONKAJŠIEHO OKRAJA smerom k centru — nikdy sa neodrežú */
.pen-side.home { justify-content: flex-start; }
.pen-side.away { justify-content: flex-end; }
.pen-empty {
  font-size: clamp(0.65rem, 1.3vh, 1rem);
  letter-spacing: 5px;
  color: var(--dim);
  text-transform: uppercase;
}

/* ── PENALTY CHIP ─────────────────────────────────────────────── */
.pen-chip-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.pen-chip-wrap.has-delayed::before {
  content: '';
  display: block;
  width: clamp(10px, 1.6vh, 16px);
  height: clamp(10px, 1.6vh, 16px);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow), 0 0 22px rgba(255,16,48,0.5);
  animation: pulse-dot 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.75); }
}

.pen-chip {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 24px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: clamp(8px, 1.2vh, 16px) clamp(12px, 2vw, 28px);
  position: relative;
  overflow: hidden;
  height: clamp(80px, 15vh, 170px);
  max-width: 25vw;
  flex-shrink: 0;
}
.pen-chip::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 7px;
}
.pen-chip.home::before { left: 0; right: auto; background: var(--accent); }
.pen-chip.away::before { right: 0; left: auto; background: var(--away); }

.pen-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pen-label {
  font-size: clamp(0.55rem, 1vh, 0.85rem);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.pen-player {
  font-size: clamp(1.5rem, 3vw, 4rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}
.pen-vr {
  width: 1px;
  height: 65%;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
}
.pen-time {
  font-size: clamp(1.5rem, 2.5vw, 4rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  color: #FFBF00;
  text-shadow: 0 0 28px rgba(255,191,0,0.38);
  line-height: 1;
  white-space: nowrap;
}

/* ── NHL overrides ─────────────────────────────────────────────── */
[data-theme="nhl"] .score-num,
[data-theme="nhl"] .clock,
[data-theme="nhl"] .period-badge { font-family: 'Orbitron', monospace; }
[data-theme="nhl"] .team-name { font-family: 'Oswald', 'Work Sans', sans-serif; letter-spacing: 4px; }
[data-theme="nhl"] .score-num.home { color: #FFFFFF; text-shadow: 0 0 60px rgba(255,140,0,0.35), 0 0 120px rgba(255,140,0,0.15); }
[data-theme="nhl"] .score-num.away { color: var(--away); text-shadow: 0 0 60px rgba(255,208,96,0.25); }
[data-theme="nhl"] .clock.running  { color: #00FF88; text-shadow: 0 0 20px rgba(0,255,136,0.7), 0 0 60px rgba(0,255,136,0.3); }
[data-theme="nhl"] .clock.warning  { color: #FFD700; text-shadow: 0 0 25px rgba(255,215,0,0.7), 0 0 60px rgba(255,215,0,0.3); }

/* ── Neutral / LED overrides ───────────────────────────────────── */
[data-theme="neutral"] .score-num,
[data-theme="neutral"] .clock,
[data-theme="neutral"] .period-badge { font-family: 'Orbitron', monospace; }
[data-theme="neutral"] .score-num.home,
[data-theme="neutral"] .score-num.away { color: #FF3300; text-shadow: 0 0 30px rgba(255,50,0,0.65), 0 0 80px rgba(255,50,0,0.2); }
[data-theme="neutral"] .period-badge   { color: #00CC00; text-shadow: 0 0 18px rgba(0,200,0,0.6); }
[data-theme="neutral"] .team-name      { font-family: 'Oswald', 'Work Sans', sans-serif; color: #FFB800; text-shadow: 0 0 12px rgba(255,180,0,0.25); letter-spacing: 4px; }
[data-theme="neutral"] .clock          { color: #FFFFFF; text-shadow: 0 0 16px rgba(255,255,255,0.3); }
[data-theme="neutral"] .clock.running  { color: #FFFFFF; text-shadow: 0 0 24px rgba(255,255,255,0.55); }
[data-theme="neutral"] .clock.warning  { color: #FFD700; text-shadow: 0 0 24px rgba(255,215,0,0.65); }
[data-theme="neutral"] .clock.ended    { color: #FF3300; text-shadow: 0 0 30px rgba(255,50,0,0.7); }
[data-theme="neutral"] .pen-time       { color: #FFD700; text-shadow: 0 0 14px rgba(255,215,0,0.45); }
[data-theme="neutral"] .pen-chip       { background: #080808; border-color: #1C1C1C; }
[data-theme="neutral"] .stripe         { background: linear-gradient(90deg, transparent 0%, #FF3300 10%, #FFB800 35%, #FFB800 65%, #FF3300 90%, transparent 100%); }
[data-theme="neutral"] .live-dot       { background: #00CC00; box-shadow: 0 0 8px #00CC00, 0 0 18px rgba(0,200,0,0.5); }

/* ── GÓLOVÁ ANIMÁCIA ──────────────────────────────────────────── */
.goal-flash {
  position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: radial-gradient(ellipse at center, rgba(212,0,28,0.55) 0%, transparent 70%);
  opacity: 0;
}
[data-theme="nhl"]     .goal-flash { background: radial-gradient(ellipse at center, rgba(255,102,0,0.55) 0%, transparent 70%); }
[data-theme="neutral"] .goal-flash { background: radial-gradient(ellipse at center, rgba(255,50,0,0.55) 0%, transparent 70%); }
@keyframes goalFlash {
  0%   { opacity: 0; }  10%  { opacity: 1; }  35%  { opacity: 0; }
  50%  { opacity: 0.6; } 70% { opacity: 0; }  85%  { opacity: 0.3; } 100% { opacity: 0; }
}
.goal-flash.active { animation: goalFlash 1.4s ease-out forwards; }

/* ── PREZENTAČNÝ REŽIM ────────────────────────────────────────── */
.pres-screen {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vh, 60px);
  padding: 40px 20px 36vh;
}
.pres-screen.active { display: flex; }
.pres-label {
  font-size: clamp(1.2rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  opacity: 0.75;
}
[data-theme="nhl"] .pres-label,
[data-theme="neutral"] .pres-label { font-family: 'Oswald', sans-serif; }
.pres-clock {
  font-size: clamp(5rem, 20vw, 18rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 6px;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}
[data-theme="nhl"] .pres-clock,
[data-theme="neutral"] .pres-clock { font-family: 'Orbitron', monospace; color: var(--accent); }
.pres-sponsors {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(12px, 2.5vw, 36px);
  padding: clamp(12px, 2.5vh, 28px) clamp(20px, 5vw, 80px);
  background: rgba(255,255,255,0.05);
  height: 33vh;
  box-sizing: border-box;
}
.pres-sponsors:empty { display: none; }
.pres-sponsors img {
  height: 100%;
  max-height: 24vh;
  width: auto;
  max-width: 18vw;
  object-fit: contain;
  filter: brightness(1.05);
}

/* ── PRESTÁVKA ────────────────────────────────────────────────── */
.break-screen {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 5vh, 60px);
  padding: 40px 20px;
}
.break-screen.active { display: flex; }

/* ── CONTROLS ─────────────────────────────────────────────────── */
.ctrl-btn {
  position: fixed;
  font-family: 'Work Sans', sans-serif;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all .2s;
  opacity: .35;
}
.ctrl-btn:hover { opacity: 1; border-color: var(--text); color: var(--text); }
.fs-btn  { bottom: 12px; right: 14px; }
.snd-btn { bottom: 12px; right: 110px; }
.status-dot {
  position: fixed; top: 12px; right: 14px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .3s;
}
.status-dot.show { opacity: 1; }

/* ── RESPONSIVE ───────────────────────────────────────────────────
   ≥ 1921px  → TV      |  1024–1920 → PC (default)
    768–1023 → tablet landscape  |  500–767 → tablet portrait / phone landscape
       ≤ 499 → phone portrait
─────────────────────────────────────────────────────────────────── */
@media (min-width: 1921px) {
  .header   { height: 32vh; }
  /* Logo max 26vh — team-info (meno+logo) sa zmestí do 32vh headera */
  .logo-box { width: clamp(160px, 26vh, 300px); height: clamp(160px, 26vh, 300px); }
  .pen-bar  { height: 20vh; }
  /* Kompaktnejšie chipy — 3 tresty na jednej strane sa musia zmestiť do pen-side */
  .pen-side { gap: clamp(8px, 1vw, 16px); }
  .pen-chip {
    height: clamp(100px, 13vh, 170px);
    padding: clamp(6px, 1vh, 12px) clamp(8px, 1vw, 14px);
    gap: clamp(8px, 1.2vw, 18px);
  }
}
@media (max-width: 1023px) {
  .header    { height: 28vh; min-height: 125px; }
  .logo-box  { width: clamp(110px, 22vh, 220px); height: clamp(110px, 22vh, 220px); }
  .pen-bar   { height: 20vh; min-height: 100px; }
  .pen-chip  { height: clamp(65px, 12vh, 130px); }
  /* 2+ tresty na strane → vertikálne stohuj */
  .pen-side:has(.pen-chip-wrap + .pen-chip-wrap) {
    flex-direction: column; justify-content: center; gap: 5px;
  }
  .pen-side.home:has(.pen-chip-wrap + .pen-chip-wrap) { align-items: flex-end; }
  .pen-side.away:has(.pen-chip-wrap + .pen-chip-wrap) { align-items: flex-start; }
  .pen-side:has(.pen-chip-wrap + .pen-chip-wrap) .pen-chip {
    height: auto; min-height: unset; max-width: none;
  }
}
@media (max-width: 767px) {
  .header    { height: 25vh; min-height: 105px; padding: 0 2vw; gap: 8px; }
  .logo-box  { width: clamp(70px, 19vh, 150px); height: clamp(70px, 19vh, 150px); }
  .team-name { font-size: clamp(1.1rem, 4.8vw, 2.8rem); max-width: 38vw; letter-spacing: 1px; }
  .period-badge { font-size: clamp(1.4rem, 4.5vw, 3rem); letter-spacing: 3px; }
  .score-num    { font-size: clamp(6rem, min(36vw, 52vh), 22rem); letter-spacing: -4px; }
  .clock        { font-size: clamp(1.6rem, 5vw, 4.5rem); letter-spacing: 4px; }
  .pen-bar      { height: 20vh; min-height: 88px; }
  .pen-chip     { height: clamp(52px, 10vh, 110px); padding: clamp(6px, 1vh, 12px) clamp(8px, 1.5vw, 18px); gap: clamp(7px, 1.3vw, 18px); }
  .pen-player   { font-size: clamp(1.5rem, 5.5vh, 5.5vh); }
  .pen-time     { font-size: clamp(1.8rem, 7vh, 7vh); }
  .pen-label    { letter-spacing: 2px; }
  .ctrl-btn     { font-size: 0.68rem; padding: 5px 9px; }
}
@media (max-width: 499px) {
  .header    { height: 22vh; min-height: 90px; padding: 0 1.5vw; gap: 4px; }
  .logo-box  { width: clamp(50px, 14vh, 100px); height: clamp(50px, 14vh, 100px); }
  .team-name {
    font-size: clamp(0.85rem, 3.6vw, 1.5rem);
    max-width: 38vw; letter-spacing: 0;
    white-space: normal; overflow-wrap: break-word; word-break: break-word;
    text-overflow: clip; text-align: center;
  }
  .period-badge { font-size: clamp(1.1rem, 4vw, 2rem); letter-spacing: 1px; }
  .score-area   { padding: 0 1.5vw; gap: 4px; }
  .score-num    { font-size: clamp(7rem, 38vh, 24rem); letter-spacing: -6px; }
  .clock        { font-size: clamp(1.3rem, 4.5vw, 3.2rem); letter-spacing: 3px; }
  .pen-bar      { height: 20vh; min-height: 90px; }
  .pen-side     { flex-direction: column; justify-content: center; gap: 4px; padding: 5px clamp(6px, 1.2vw, 12px); }
  .pen-side.home { align-items: flex-end; }
  .pen-side.away { align-items: flex-start; }
  .pen-chip     { height: auto; min-height: unset; max-width: none; padding: 4px 8px; gap: 6px; border-radius: 6px; width: 100%; }
  .pen-player   { font-size: clamp(1rem, 5vw, 1.5rem); }
  .pen-time     { font-size: clamp(1.1rem, 6.5vw, 2rem); letter-spacing: 1px; }
  .pen-vr       { height: 50%; }
  .pen-label    { letter-spacing: 1px; font-size: 0.5rem; }
  .ctrl-btn     { font-size: 0.6rem; padding: 4px 7px; bottom: 8px; }
  .fs-btn       { right: 9px; }
  .snd-btn      { right: 85px; }
  .pen-chip-wrap.has-delayed::before { width: 9px; height: 9px; }
}
