/* iOS dark mode inspired theme */
:root {
  --bg: #000000;
  --bg-grouped: #1c1c1e;
  --panel: #1c1c1e;
  --panel-hi: #2c2c2e;
  --panel-lo: #1c1c1e;
  --border: rgba(84, 84, 88, 0.45);
  --border-hi: rgba(84, 84, 88, 0.65);
  --chip-bg: rgba(118, 118, 128, 0.24);
  --chip-bg-hi: rgba(118, 118, 128, 0.32);
  --text: #ffffff;
  --muted: rgba(235, 235, 245, 0.6);
  --muted-2: rgba(235, 235, 245, 0.3);
  --primary: #0a84ff;
  --primary-2: #0070e0;
  --primary-glow: rgba(10, 132, 255, 0.35);
  --pos: #30d158;
  --neg: #ff453a;
  --accent: #ff9f0a;
  --yellow: #ffd60a;
  /* Role colors – musí být dobře čitelné na šedém, modrém i tmavém pozadí. */
  --role-forhont: #ffd166;
  --role-vydrazitel: #ff80ab;
  --role-both-grad: linear-gradient(95deg, var(--role-forhont) 0%, var(--role-vydrazitel) 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --gap: 10px;
  --gap-lg: 16px;
  --tap: 44px;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.2);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-thumb: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top, 0) 14px env(safe-area-inset-bottom, 14px);
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

p { margin: 0; }

code {
  background: var(--panel-hi);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
}

/* ---------- Buttons (iOS style) ---------- */
button {
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--chip-bg);
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  min-height: var(--tap);
  cursor: pointer;
  transition: opacity 0.12s, transform 0.08s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
button:active { opacity: 0.6; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

button.primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.01em;
}
button.primary:hover:not(:disabled) { background: var(--primary-2); }
button.primary:disabled { background: var(--chip-bg); color: var(--muted); }

button.ghost {
  background: transparent;
  color: var(--primary);
}

button.big {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

button.small {
  padding: 4px 10px;
  font-size: 14px;
  min-height: 32px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 22px;
  color: var(--primary);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 1;
  font: inherit;
  cursor: pointer;
}
.icon-btn > .ico {
  font-size: 1.4rem;
  line-height: 1;
  display: block;
}
.icon-btn:active:not(:disabled) { opacity: 0.5; }
.icon-btn.invisible { visibility: hidden; }

/* ---------- Inputs (iOS) ---------- */
input[type="text"],
input[type="number"] {
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--chip-bg);
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  width: 100%;
  transition: background 0.12s;
}
input[type="number"] {
  max-width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input:focus {
  outline: none;
  background: var(--chip-bg-hi);
}
input::placeholder { color: var(--muted-2); }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips.wrap-2 > .chip { flex: 1 1 calc(50% - 3px); }
.chips.chips-center { justify-content: center; }
.chips.chips-equal > .chip { flex: 1 1 0; min-width: 0; }

.chip {
  background: var(--chip-bg);
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  min-height: 38px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s, opacity 0.12s;
}
.chip.active {
  background: var(--primary);
  color: #fff;
}
.chip:active:not(:disabled):not(.active) { background: var(--chip-bg-hi); }
.chip[disabled] { opacity: 1; cursor: default; }

/* Chip pro výběr hráče: aktivní stav má jen modrý okraj, výplň zůstává
   šedá – role colors v textu pak zůstávají čitelné. */
.chip.chip-player.active {
  background: var(--chip-bg);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--primary);
}

.chip.lbl {
  flex-direction: column;
  padding: 6px 10px;
  line-height: 1.1;
  min-height: 44px;
  border-radius: var(--radius-sm);
  gap: 2px;
}
.chip.lbl .lbl-main { font-size: 0.85rem; }
.chip.lbl .lbl-sub {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--mono);
}
.chip.lbl.active .lbl-sub { color: rgba(255,255,255,0.75); }

/* Typ hry – krátký název + kurzíva alt name */
.type-chips .chip.lbl { min-height: 54px; justify-content: center; }
.type-chips .lbl-main { font-size: 1rem; font-weight: 600; }
.type-chips .lbl-sub {
  font-family: var(--font);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}
.type-chips .chip.lbl.active .lbl-sub { color: rgba(255, 255, 255, 0.7); }

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--chip-bg);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 15px;
  min-height: 38px;
  white-space: pre;
}
/* Jméno hráče s rolí – funguje vnořeně i uvnitř filled chip/tlačítek. */
.pname { font-weight: 600; }
.pname.role-forhont { color: var(--role-forhont); }
.pname.role-vydrazitel { color: var(--role-vydrazitel); }
.pname.role-both {
  background: var(--role-both-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Panel / Field (iOS grouped) ---------- */
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  padding-left: 4px;
}

.row-stack { display: flex; flex-direction: column; gap: 6px; }

.labeled-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--chip-bg);
  border: none;
  border-radius: var(--radius-sm);
  min-height: 52px;
}
.labeled-row .row-label {
  min-width: 60px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.labeled-row .row-label.stacked {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 1px;
}
.row-label .rl-main { color: var(--text); }
.row-label .rl-sub {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}
.labeled-row .row-meta {
  margin-left: 4px;
  font-weight: 400;
  color: var(--muted-2);
}
.labeled-row .chips { flex: 1; justify-content: flex-end; }
.labeled-row input[type="number"] { margin-left: auto; }
.labeled-row .row-info {
  margin-left: auto;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Setup screen ---------- */
.setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 0;
  flex: 1;
  justify-content: center;
}
.setup h1 {
  font-size: 1.8rem;
  text-align: center;
  background: linear-gradient(180deg, #fff, #aab0cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.brand-logo {
  width: 220px;
  height: 220px;
  max-width: 56vw;
  max-height: 56vw;
  object-fit: contain;
}

.header-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.setup-grid { margin: 8px 0; }
.player-slot {
  background: var(--panel);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}
.player-slot input { background: transparent; border-color: transparent; padding: 4px 8px; }

.grid2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
/* CCW pořadí (1→2→3→4 proti směru hodinových ručiček):
   1 4
   2 3
*/
.slot-0 { grid-column: 1; grid-row: 1; }
.slot-1 { grid-column: 1; grid-row: 2; }
.slot-2 { grid-column: 2; grid-row: 2; }
.slot-3 { grid-column: 2; grid-row: 1; }

/* ---------- Main dashboard ---------- */
.main-view { flex: 1; display: flex; flex-direction: column; }

.app-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 10px;
  margin-bottom: 8px;
}
.app-header h1 {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.app-header .spacer { width: 44px; }
.app-header .header-logo + .icon-btn { margin-left: auto; }

.scoreboard { margin-bottom: 12px; }

.player-card {
  padding: 14px 12px;
  background: var(--panel);
  border: none;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
}
.player-card.povinnost {
  background: rgba(255, 159, 10, 0.18);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.player-card.pos { box-shadow: inset 0 0 0 2px var(--pos); }
.player-card.neg { box-shadow: inset 0 0 0 2px var(--neg); }
.player-name {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 15px;
  color: var(--text);
}
.player-total {
  font-size: 22px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.player-card.pos .player-total { color: var(--pos); }
.player-card.neg .player-total { color: var(--neg); }

.player-card.swappable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 120ms ease;
}
.player-card.swappable.dragging {
  cursor: grabbing;
  opacity: 0.85;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 0 0 2px var(--primary);
  transition: none;
}
.player-card.swappable.drop-target {
  box-shadow: inset 0 0 0 2px var(--primary);
  background: rgba(10, 132, 255, 0.14);
}

.badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #000000;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-inline {
  display: inline-flex;
  background: var(--accent);
  color: #000000;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 6px;
}

.actions {
  margin: 12px 0;
  display: flex;
  gap: var(--gap);
}

.history {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 14px;
}
.history h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.history-list .hist-item {
  background: var(--panel);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.hist-num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  color: var(--muted);
}
.hist-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hist-type {
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
}
.hist-forhont {
  font-size: 13px;
  color: var(--accent);
}
.hist-actors {
  font-size: 13px;
  color: var(--muted);
}
.hist-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-template-rows: repeat(2, auto);
  gap: 2px 16px;
}
.hist-cell {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted);
  min-width: 56px;
}
.hist-cell.pos { color: var(--pos); }
.hist-cell.neg { color: var(--neg); }

/* ---------- Wizard ---------- */
.wizard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wizard-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 8px;
  min-height: 44px;
}
.wizard-header .wizard-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wizard-header h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.wizard-type {
  display: inline-grid;
  place-items: center end;
  min-width: 64px;
  padding: 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.step-dots {
  display: flex;
  gap: 6px;
}
.step-dots .dot {
  width: 6px;
  height: 6px;
  min-height: 6px;
  padding: 0;
  border-radius: 50%;
  background: rgba(235, 235, 245, 0.18);
  border: none;
  cursor: default;
  transition: background 0.15s;
}
.step-dots .dot.active { background: #fff; }
.step-dots .dot.done {
  background: rgba(235, 235, 245, 0.38);
  cursor: pointer;
}
.step-dots .dot.done:hover { background: rgba(235, 235, 245, 0.6); }

.wizard-content {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wizard-footer {
  padding: 10px 0 6px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 30%);
}

.err-bar {
  background: rgba(239, 68, 68, 0.12);
  color: var(--neg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Hlášky tabs ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 2px;
  background: rgba(118, 118, 128, 0.24);
  border: none;
  border-radius: 9px;
  margin-bottom: 6px;
  align-items: stretch;
}
.tab {
  background: transparent;
  border: none;
  padding: 6px 4px;
  border-radius: 7px;
  min-height: 36px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
  transition: background 0.18s;
}
.tab .tab-name {
  font-weight: 500;
}
.tab .tab-hlaska {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-style: italic;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.tab.active {
  background: #636366;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-thumb);
}
.tab.active .tab-name { font-weight: 600; }
.tab.active .tab-hlaska { color: rgba(255, 255, 255, 0.78); }

.hlasky-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 52px;
  gap: 5px;
}
.hlasky-grid .chip.lbl { min-height: 0; height: 100%; }

/* ---------- Slider ---------- */
.oci-slider { display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 0; }
.oci-readout {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.oci-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  background: var(--chip-bg);
  border: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.oci-team.win {
  background: rgba(48, 209, 88, 0.18);
}
.oci-team .oci-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}
.oci-team .oci-num {
  font-size: 28px;
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 2px;
  letter-spacing: -0.02em;
}
.oci-team.win .oci-num { color: var(--pos); }

.shoz-slider {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px;
  background: var(--chip-bg);
  border: none;
  border-radius: var(--radius-sm);
}
.shoz-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.shoz-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.shoz-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.shoz-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.shoz-max {
  color: var(--muted-2);
  font-size: 0.85rem;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 120, 128, 0.32);
  border: none;
  padding: 0;
  cursor: pointer;
  accent-color: var(--primary);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: var(--shadow-thumb);
  cursor: grab;
}
.slider::-webkit-slider-thumb:active { cursor: grabbing; }
.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: var(--shadow-thumb);
  cursor: grab;
}

/* ---------- Varšava výsledek ---------- */
.varsava-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.varsava-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
  padding: 10px 14px;
  background: var(--chip-bg);
  border: none;
  border-radius: var(--radius-sm);
}
.varsava-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.v-name { font-weight: 500; }
.varsava-num {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: grid;
  place-items: center;
  min-width: 56px;
  color: var(--text);
}

.sum-indicator {
  margin-top: 6px;
  padding: 6px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
}
.sum-indicator.ok { background: rgba(74, 222, 128, 0.12); color: var(--pos); }
.sum-indicator.err { background: rgba(239, 68, 68, 0.12); color: var(--neg); }

/* ---------- Summary ---------- */
.summary { flex: 1; display: flex; flex-direction: column; }
.summary-content { flex: 1; overflow-y: auto; }

.recap {
  background: var(--panel);
  border: none;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.recap h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}
.recap p { color: var(--muted); font-size: 15px; }
.recap strong { color: var(--text); font-weight: 500; }

.teams {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.teams-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.teams-4 { grid-template-columns: repeat(2, 1fr); }

.team-card {
  background: var(--panel);
  border: none;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.team-card.pos { box-shadow: inset 0 0 0 2px var(--pos); }
.team-card.neg { box-shadow: inset 0 0 0 2px var(--neg); }

.team-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.team-title .member-names {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted);
}

.team-card .rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.team-card .rows li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 15px;
  border-bottom: 0.5px solid var(--border);
}
.team-card .rows li:last-child { border-bottom: none; }
.row-label { color: var(--text); }
.row-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.row-value.pos { color: var(--pos); }
.row-value.neg { color: var(--neg); }

.team-sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 0.5px solid var(--border);
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}
.team-sum .player-total {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}

.deltas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.deltas .delta-pill {
  background: var(--panel);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.deltas .delta-pill.pos { box-shadow: inset 0 0 0 2px var(--pos); }
.deltas .delta-pill.neg { box-shadow: inset 0 0 0 2px var(--neg); }
.delta-pill .d-name { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.delta-pill .d-val {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.delta-pill.pos .d-val { color: var(--pos); }
.delta-pill.neg .d-val { color: var(--neg); }

.summary .actions { margin-top: auto; }

/* ---------- iOS-style alert dialog ---------- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 16px;
  animation: dlgFade 0.15s ease-out;
}
@keyframes dlgFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.dialog-card {
  width: 100%;
  max-width: 270px;
  background: rgba(45, 45, 47, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dlgPop 0.18s ease-out;
}
@keyframes dlgPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.dialog-body {
  padding: 18px 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dialog-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.dialog-message {
  font-size: 13px;
  color: rgba(235, 235, 245, 0.78);
  line-height: 1.35;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  padding: 4px 14px 14px;
}
.dialog-actions.stack {
  flex-direction: column;
}
.dialog-btn {
  flex: 1;
  background: var(--chip-bg);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  min-height: 44px;
  min-width: 0;
}
.dialog-btn.confirm {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.dialog-btn.confirm.destructive {
  background: var(--neg);
}

/* ---------- Wide viewport tweaks ---------- */
@media (min-width: 520px) {
  #app { padding: 0 24px; max-width: 560px; }
  .hlasky-grid { grid-template-columns: repeat(4, 1fr); }
}
