/* The Dota clock on the web (web SPEC 122.6): the app's screen (MikeyKit/UI/DotaClockBoard.swift), drawn by app.js. */
:root {
  --ink: #16151c;
  --num: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --label: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: #fff; color: var(--ink); overflow: hidden;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overscroll-behavior: none; font-family: var(--label);
}
#probe {
  position: fixed; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#screen { position: fixed; inset: 0; overflow: hidden; background: #fff; }
.layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#icons { position: absolute; left: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#icons .irow { display: flex; align-items: center; justify-content: center; }
#icons .icol { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.icon { position: relative; flex: none; }
.icon .glow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#edge .soft, #edge .band { position: absolute; inset: 0; border-style: solid; border-color: #fff; }
#edge { will-change: opacity; }
#header { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; pointer-events: none; }
#left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#countdown { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; letter-spacing: -0.01em; white-space: nowrap; }
#names { font-weight: 600; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#right { flex: none; display: flex; align-items: center; opacity: 0.7; }
#game { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#paused { fill: currentColor; display: none; }
#paused.on { display: block; }

#hint {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  font: 600 14px var(--label); color: rgba(22, 21, 28, 0.55); pointer-events: none; transition: opacity 0.4s;
}
#hint.gone { opacity: 0; }

#bar {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: min(900px, calc(100vw - 24px)); border-radius: 999px; overflow-x: auto; overflow-y: hidden;
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); scrollbar-width: none; transition: opacity 0.2s, transform 0.2s;
}
#bar::-webkit-scrollbar { display: none; }
#bar[hidden] { display: block; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
#bar .keys { display: flex; gap: 6px; padding: 8px; width: max-content; }
button {
  font: 600 16px var(--label); color: rgba(0, 0, 0, 0.82); border: 0; background: rgba(0, 0, 0, 0.06);
  border-radius: 999px; min-width: 44px; min-height: 40px; padding: 0 12px; cursor: pointer;
  font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
}
button:active { background: rgba(0, 0, 0, 0.12); }
button svg { width: 18px; height: 18px; fill: currentColor; }

#toast {
  position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); font: 600 16px var(--label); color: rgba(0, 0, 0, 0.85); white-space: nowrap;
}
#toast[hidden] { display: none; }
#toast button { min-height: 34px; }

dialog {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; color: var(--ink);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.25); }
.sheet {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; margin: 0 auto;
  background: #f2f2f7; border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  -webkit-user-select: none; user-select: none;
}
.sheet.small { width: min(380px, calc(100vw - 24px)); }
.sheet.small > button { min-height: 50px; width: 100%; background: #fff; }
.sheet .quiet { background: transparent; }
.sheet .strong { background: var(--ink); color: #fff; }
.sheet .title { font: 700 18px var(--label); text-align: center; }
.sheet .top { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -16px; background: #f2f2f7; padding: 4px 0 6px; z-index: 1; }
.sheet .top .title { text-align: left; }
.sheet h2 { font: 600 13px var(--label); text-transform: uppercase; letter-spacing: 0.04em; color: rgba(60, 60, 67, 0.6); margin: 8px 4px 6px; }
.sheet section { display: flex; flex-direction: column; }
.group { background: #fff; border-radius: 12px; overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 14px;
  font: 400 17px var(--label); background: #fff;
}
.group .row + .row { box-shadow: inset 0 1px 0 rgba(60, 60, 67, 0.12); }
.group-after { border-radius: 12px; margin-top: 8px; }
.row select, .time select {
  font: 400 17px var(--label); border: 0; background: rgba(0, 0, 0, 0.06); border-radius: 8px; padding: 6px 10px; color: var(--ink);
}
.foot { font: 400 13px var(--label); color: rgba(60, 60, 67, 0.6); margin: 6px 4px 0; }
.segmented { display: flex; background: rgba(118, 118, 128, 0.12); border-radius: 10px; padding: 2px; }
.segmented button { flex: 1; background: transparent; border-radius: 8px; min-height: 34px; font-size: 15px; }
.segmented button.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.time { display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 28px var(--num); padding: 8px 0; }
.time select { font: 700 26px var(--num); padding: 8px 14px; }
.pair { display: flex; gap: 8px; }
.pair button { flex: 1; min-height: 48px; }
.switch {
  -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 999px; background: rgba(120, 120, 128, 0.16);
  position: relative; flex: none; margin: 0; cursor: pointer; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
