/* Velín — iPad 11" na šířku (1180 × 820 bodů). Brand Neužitečných: Chakra Petch, Michroma jen na logo,
   magenta #e700ff jako jediná hlasitá věc, hazard žlutá #ffe000 pro odpočty a vítěze. Nic pod 15 px. */

@font-face {
  font-family: 'Chakra Petch';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/chakra-petch-400-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/chakra-petch-400-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/chakra-petch-500-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/chakra-petch-500-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/chakra-petch-600-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/chakra-petch-600-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/chakra-petch-700-latin.woff2) format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/chakra-petch-700-latin-ext.woff2) format('woff2');
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Michroma';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/michroma-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'Michroma';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/michroma-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02AF;
}

:root {
  color-scheme: dark;
  --bg: #0d0a15;
  --bar: #110d1b;
  --tile: #1a1626;
  --cell: #221d31;
  --hover: #2a2438;
  --line: rgba(122, 113, 145, 0.32);
  --line2: rgba(122, 113, 145, 0.22);
  --text: #e8e4f0;
  --dim: #a49cb8;
  --mute: #6a6185;
  --brand: #e700ff;
  --accent: #0096ff;
  --hazard: #ffe000;
  --ok: #3ddc84;
  --bad: #ff5a6a;
  --warn: #ff9f1a;
  --pink: #ff7ac8;
  --red: #ff5a6a;
  --yellow: #ffd23f;
  --blue: #4dc3ff;
  --purple: #b77dff;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}
body {
  font-family: 'Chakra Petch', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
button {
  font: inherit;
  color: inherit;
}

.app {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  overflow: hidden;
}

/* ---------- horní lišta ---------- */
.top {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.logo {
  width: 92px;
  flex: none;
  text-align: center;
  font-family: Michroma, sans-serif;
  font-size: 14px;
  color: var(--brand);
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px rgba(231, 0, 255, 0.55);
}
.clock {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: none;
}
.nowbox {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 18px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}
.nowbox .ell {
  min-width: 0;
}
.k {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid rgba(122, 113, 145, 0.45);
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex: none;
}
.spacer {
  flex: 1;
  min-width: 0;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  flex: none;
  display: inline-block;
}

/* ---------- boční lišta ---------- */
.rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: var(--bar);
  border-right: 1px solid var(--line);
}
.rail button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  font-size: 15px;
  font-weight: 600;
  position: relative;
  cursor: pointer;
}
.rail button.on {
  background: var(--hover);
  color: #fff;
}
.rail svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail button.on svg {
  stroke: var(--brand);
  filter: drop-shadow(0 0 6px rgba(231, 0, 255, 0.6));
}
.badge {
  position: absolute;
  top: 7px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 11px;
  background: var(--warn);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge.bad {
  background: var(--bad);
}

/* ---------- obsah ---------- */
.screen {
  display: grid;
  gap: 10px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.tile {
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.tile:active {
  background: var(--hover);
}
.tile.off {
  opacity: 0.55;
}
.th {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  min-width: 0;
}
.th > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.th .r {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  flex: none;
}
.row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.sb {
  justify-content: space-between;
}
.ell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.nw {
  white-space: nowrap;
}
.dim {
  color: var(--dim);
}
.mute {
  color: var(--mute);
}
.up {
  color: var(--ok);
}
.down {
  color: var(--bad);
}
.warn {
  color: var(--warn);
}
.haz {
  color: var(--hazard);
}
.brand {
  color: var(--brand);
}
.b {
  font-weight: 700;
}
.s15 {
  font-size: 15px;
}
.s16 {
  font-size: 16px;
}
.s17 {
  font-size: 17px;
}
.s18 {
  font-size: 18px;
}
.s20 {
  font-size: 20px;
}
.big {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.huge {
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
}
.ln {
  border-bottom: 1px solid var(--line2);
}
.grow {
  flex: 1;
  min-width: 0;
}
.mt-auto {
  margin-top: auto;
}
.tag {
  flex: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--bg);
  background: var(--dim);
}
.empty {
  color: var(--mute);
  font-size: 16px;
}
.err {
  color: var(--bad);
  font-size: 15px;
}
.stale-note {
  position: absolute;
  top: 9px;
  right: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--warn);
}

.bar {
  height: 10px;
  background: var(--hover);
  border-radius: 5px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
}
.prog {
  height: 8px;
  background: var(--hover);
  border-radius: 4px;
  overflow: hidden;
}
.prog > i {
  display: block;
  height: 100%;
  background: var(--hazard);
}

.pc {
  background: var(--cell);
  border-radius: 4px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pc.dead {
  opacity: 0.42;
}
.ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.tr {
  display: grid;
  gap: 8px;
  align-items: center;
  font-size: 17px;
}
.tr.h {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
.rt {
  text-align: right;
}

.spark {
  display: block;
}
.hours {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 1px solid rgba(122, 113, 145, 0.4);
}
.hours .gl {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(122, 113, 145, 0.2);
}
.hours .col {
  flex: 1;
  height: 100%;
  position: relative;
}
.hours .prev {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #3a3350;
  border-radius: 2px 2px 0 0;
}
.hours .now {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  background: var(--hazard);
  border-radius: 2px 2px 0 0;
}
.hlabels {
  display: grid;
  gap: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
}

.ph {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 4px;
  background: var(--hover) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mute);
}

/* ---------- detail přes celou obrazovku ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}
.sheet.open {
  display: flex;
}
.sheet-head {
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px 0 20px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.sheet-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
}
.sheet-close {
  width: 120px;
  height: 48px;
  border-radius: 4px;
  border: 1px solid rgba(122, 113, 145, 0.5);
  background: var(--tile);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.sheet-body .tile {
  cursor: default;
}
.sheet-body .tile:active {
  background: var(--tile);
}
.cols2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cols4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.cols5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}
.tbl th {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line2);
  vertical-align: baseline;
}
.tbl td.rt,
.tbl th.rt {
  text-align: right;
}
.tbl tr.dead td {
  opacity: 0.45;
}

/* ---------- přihlášení ---------- */
.login {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login form {
  width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.login h1 {
  margin: 0;
  font-family: Michroma, sans-serif;
  font-size: 26px;
  color: var(--brand);
  text-shadow: 0 0 12px rgba(231, 0, 255, 0.5);
}
.login label {
  font-size: 16px;
  color: var(--dim);
}
.login input {
  height: 52px;
  font: inherit;
  font-size: 20px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid rgba(122, 113, 145, 0.5);
  background: var(--bg);
  color: var(--text);
}
.login input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.login .go {
  height: 52px;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: #000;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(231, 0, 255, 0.45);
  cursor: pointer;
}
.login .msg {
  color: var(--bad);
  font-size: 16px;
  min-height: 20px;
}
