/* DOMOV — AMOLED černá + oranžová (sourodé se SPYGLASSem). Tokeny na jednom místě, nikde zadrátované hexy. */
:root {
  --bg: #000000; --surface: #0c0c0e; --surface-2: #141417; --line: #232327;
  --text: #f2f2f3; --muted: #8b8b93; --accent: #ff7a1a; --accent-soft: rgba(255,122,26,.14);
  --ok: #35c46a; --warn: #ffb020; --bad: #ff4d4f;
  --radius: 14px; --gap: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { min-height: 100%; padding: env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 78px); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
header h1 { font-size: 19px; margin: 0; letter-spacing: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.stamp { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; }
.err { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.dlazdice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 6px; min-height: 120px; cursor: pointer; user-select: none; }
.dlazdice:active { border-color: var(--muted); }
.dlazdice.zap { border-color: var(--accent); background: var(--accent-soft); }
.dlazdice.off { opacity: .55; }
.dlazdice .nazev { font-weight: 650; line-height: 1.25; }
.dlazdice .mistnost { color: var(--muted); font-size: 12px; }
.dlazdice .stav { margin-top: auto; font-size: 13px; font-weight: 600; }
.dlazdice.zap .stav { color: var(--accent); }
.dlazdice .ikona { line-height: 1; color: var(--muted); }
.dlazdice.zap .ikona { color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: var(--gap); }
.row { display: flex; align-items: center; gap: 8px; } .row.between { justify-content: space-between; }
.nazev { font-weight: 650; }
button, .btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 14px; font: inherit; cursor: pointer; }
button:active { border-color: var(--accent); }
button.akcent { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 650; }
button.maly { padding: 5px 10px; font-size: 13px; }
button.nebezpeci { color: var(--bad); }
input, select { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font: inherit; max-width: 100%; }
input[type=range] { padding: 0; width: 100%; accent-color: var(--accent); }
input[type=number] { width: 90px; }
label.pole, div.pole { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
label.pole:first-of-type, div.pole:first-of-type { border-top: 0; }
.prep { position: relative; width: 44px; height: 26px; flex: none; }
.prep input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.prep i { position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; transition: .15s; }
.prep i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .15s; }
.prep input:checked + i { background: var(--accent-soft); border-color: var(--accent); }
.prep input:checked + i::after { left: 20px; background: var(--accent); }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 14px 4px; color: var(--muted); }
nav.tabs button.on { color: var(--accent); font-weight: 650; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: flex-end; justify-content: center; z-index: 40; }
.modal .list { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; width: 100%; max-width: 720px;
  max-height: 85vh; overflow-y: auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.denik div { padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.denik .cas { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 12px; z-index: 50; max-width: 90vw; }
.toast.chyba { border-color: var(--bad); color: var(--bad); }

.login { max-width: 320px; margin: 22vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.login input, .login button { width: 100%; }

/* --- Widgety na Domů --- */
.wgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); grid-auto-flow: dense; }
@media (min-width: 640px) { .wgrid { grid-template-columns: repeat(4, 1fr); } }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; display: flex; flex-direction: column; }
.widget.w-S { grid-column: span 1; } .widget.w-M { grid-column: span 2; } .widget.w-L { grid-column: span 2; grid-row: span 2; }
@media (min-width: 640px) { .widget.w-L { grid-column: span 2; grid-row: span 2; } }
.w-hlavicka { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.w-hlavicka .w-titul { font-size: 12px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); font-weight: 600; }
.w-telo { flex: 1; min-width: 0; }
.widget.zap { border-color: var(--accent); background: var(--accent-soft); }

/* --- celoobrazovkový pohled --- */
.pln { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.pln-hlavicka { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pln-telo { flex: 1; overflow-y: auto; padding: 16px; max-width: 900px; width: 100%; margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* --- boční lišta na širokých displejích (tablet na šířku, notebook) --- */
@media (min-width: 900px) {
  body { padding-bottom: 24px; padding-left: 190px; }
  nav.tabs { top: 0; right: auto; width: 190px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 16px 8px; gap: 4px; }
  nav.tabs button { flex: 0; text-align: left; padding: 12px 14px; border-radius: 10px; }
  nav.tabs button.on { background: var(--accent-soft); }
  .wrap { max-width: 1100px; }
}

/* --- Nastavení: rozcestník --- */
.kat { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
.kat:active { border-color: var(--accent); }
.kat .ik { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 18px; flex: none; }
.kat .t { font-weight: 650; } .kat .p { color: var(--muted); font-size: 12.5px; }
.sw-anim-l { animation: swL .22s ease-out; } .sw-anim-r { animation: swR .22s ease-out; }
@keyframes swL { from { opacity: .3; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes swR { from { opacity: .3; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.widget .dlazdice { border: 0; background: none; padding: 0; min-height: 0; flex: 1; }
.widget .dlazdice.zap { border: 0; background: none; }
.w-prazdno { grid-column: 1 / -1; text-align: center; padding: 30px 10px; }
.w-scena { width: 100%; margin-bottom: 8px; }
.widget .dlazdice .nazev, .widget .dlazdice .mistnost { display: none; }   /* název je už v hlavičce widgetu */
.widget .dlazdice .stav { font-size: 15px; }

/* --- karta „právě hraje" (jako ve Filmech: fanart, titulek, konec, délka, kolekce) --- */
.karta { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2) center/cover no-repeat; min-height: 150px; border: 1px solid var(--line); }
.karta::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.92) 8%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.15)); }
.karta > .ob { position: relative; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; gap: 4px; }
.karta .tit { font-size: 20px; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 6px #000; }
.karta .meta { color: #d6d6da; font-size: 13px; }
.karta .popis { color: #bdbdc4; font-size: 12.5px; max-height: 3.9em; overflow: hidden; }
.karta .pruh { height: 5px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.karta .pruh i { display: block; height: 100%; background: var(--accent); }
.karta .cas { display: flex; justify-content: space-between; font-size: 12px; color: #d6d6da; font-variant-numeric: tabular-nums; }
.karta .stitek { align-self: flex-start; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); border-radius: 99px; padding: 1px 9px; font-size: 11px; }
.d-karta .karta { height: 100%; border-radius: 0; border: 0; min-height: 0; }
.d-karta .karta > .ob { height: 100%; min-height: 0; }
