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

body {
  background: #12161c;
  color: #e8edf3;
  font: 14px/1.5 "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 18px;
  min-height: 100vh;
}

#wrap {
  width: min(960px, 100%);
}

/* ---------- HUD ---------- */

#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1b222c;
  border: 1px solid #2b3542;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 14px;
}

.score {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
}

.score #score {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.team { font-size: 13px; letter-spacing: .08em; }
.team.home { color: #5fb3ff; }
.team.away { color: #ff7a6b; }

#clock {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: #9fb0c3;
}

#hud-right { display: flex; gap: 8px; }

button {
  background: #2b3542;
  color: #e8edf3;
  border: 1px solid #3a4757;
  border-radius: 6px;
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: #364355; }
button:active { transform: translateY(1px); }

/* ---------- Boisko ---------- */

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #131820;
  border: 1px solid #2b3542;
  cursor: crosshair;
}

/* ---------- Panel ---------- */

#panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1px;
  background: #2b3542;
  border: 1px solid #2b3542;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.stats { background: #1b222c; padding: 12px 14px; }

.stats h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #7e8fa3;
  margin-bottom: 10px;
  font-weight: 600;
}
.stats h3 small { text-transform: none; letter-spacing: 0; color: #5d6b7d; }

.bar { margin-bottom: 7px; }
.bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #b7c4d3;
  margin-bottom: 3px;
}
.bar-top b { color: #e8edf3; font-variant-numeric: tabular-nums; }
.bar-track { height: 5px; background: #2b3542; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: #5fb3ff; border-radius: 3px; }

.keys { list-style: none; font-size: 12.5px; color: #9fb0c3; }
.keys li { padding: 2px 0; }
.keys b { color: #e8edf3; font-weight: 600; }
.keys li.sep { color: #ffd166; padding-top: 5px; font-size: 11.5px; }
.keys li.sep i { color: #b08d3a; }
.keys i { color: #6b7a8d; font-style: normal; }

#mystats { font-size: 13px; }
.row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid #232c38;
  color: #9fb0c3;
}
.row:last-child { border-bottom: none; }
.row b { color: #e8edf3; font-variant-numeric: tabular-nums; }
.row.hl b { color: #ffd166; }

/* ---------- Overlay ---------- */

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 17, .82);
  display: flex;
  align-items: center;
  justify-content: center;
}
#overlay.hidden { display: none; }

#overlay-box {
  background: #1b222c;
  border: 1px solid #3a4757;
  border-radius: 10px;
  padding: 26px 30px;
  min-width: 340px;
  text-align: center;
}
#overlay-box h2 { font-size: 22px; margin-bottom: 14px; }
#ov-body { margin-bottom: 18px; }
#ov-body .row { text-align: left; }
#ov-btn { padding: 9px 20px; background: #2f6fb5; border-color: #3d84d1; }
#ov-btn:hover { background: #3a80cc; }

@media (max-width: 780px) {
  body { padding: 8px; }
  #panel { grid-template-columns: 1fr; }
}

/* Podgląd oprawy v2: ta sama gra i układ kontrolek, nowa hierarchia obrazu. */
body.oprawa-v2 {
  background: radial-gradient(ellipse at 50% 0%, #1b3435 0%, #0c171c 65%);
  color: #f0f5f0;
}
body.oprawa-v2 #hud {
  flex-wrap: wrap;
  gap: 9px 16px;
  background: linear-gradient(125deg, #1d3034, #101c27 68%);
  border-color: #395250;
  border-top: 3px solid #5dd4ac;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
body.oprawa-v2 .score { gap: 10px; }
body.oprawa-v2 .score #score {
  color: #f8faf3;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: .015em;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .34);
}
body.oprawa-v2 .team {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
body.oprawa-v2 .team.home { color: #8bd4c4; background: #173b3b; }
body.oprawa-v2 .team.away { color: #f4a27e; background: #422d2c; }
body.oprawa-v2 #clock { color: #e2eadf; font-weight: 700; }
body.oprawa-v2 #hud-right { flex-wrap: wrap; justify-content: flex-end; }
body.oprawa-v2 canvas { background: #102d25; border-color: #395250; }
body.oprawa-v2 #panel {
  gap: 8px;
  padding: 8px;
  background: #111f27;
  border-color: #395250;
}
body.oprawa-v2 .stats {
  background: linear-gradient(160deg, #1d2c34, #18232e);
  border: 1px solid #30434b;
  border-radius: 7px;
}
body.oprawa-v2 .stats h3 { color: #94b5ad; }
body.oprawa-v2 .row { border-color: #30434b; }
body.oprawa-v2 .bar-top b { color: #f3f9f2; }
body.oprawa-v2 .bar-fill { background: #5dd4ac; }
body.oprawa-v2 .bar-track { background: #263940; }
body.oprawa-v2 button { background: #294549; border-color: #3c6865; font-weight: 600; }
body.oprawa-v2 button:hover { background: #35605e; }
body.oprawa-v2 button:focus-visible { outline: 2px solid #5dd4ac; outline-offset: 2px; }

