/* Vzhled podle přehrávače Superbox 85: hnědozlatý rám, zlatá tlačítka, fialové kanály. */
:root {
  --bg: #170d05;
  --frame: #3a2210;
  --panel-top: #4c2c12;
  --panel-bottom: #2a1708;
  --gold: #e0ab45;
  --gold-light: #ffd86b;
  --edge: #6b4318;
  --text: #f6e8c8;
  --muted: #d8c39a;
  --dark: #2a1606;
  --glow: #7dff7a;
  --well: #160c04;
  --lilac-top: #ece6ff;
  --lilac-bottom: #b8a8f0;
  --lilac-edge: #5a4aa8;
  --lilac-text: #1d1440;
  font-size: 20px;
  color-scheme: dark;
}
:root[data-size="-1"] { font-size: 17px; }
:root[data-size="1"] { font-size: 23px; }
:root[data-size="2"] { font-size: 27px; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #2c1a0c, var(--bg) 70%) fixed;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
}
a { color: var(--gold-light); }
h2 { font-size: 1.15rem; margin: 0 0 .6em; color: var(--gold-light); }
small { color: var(--muted); }
.center { text-align: center; }
:focus-visible { outline: 4px solid #4cc3ff; outline-offset: 2px; }

/* Horní lišta */
.strip {
  max-width: 1280px; margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
}
.me { font-weight: 700; display: inline-flex; align-items: center; gap: .4em; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tools form { margin: 0; }

/* Rám a panely */
.box {
  max-width: 1280px; margin: 0 auto 24px; padding: 12px;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 12px;
  background: var(--frame); border: 3px solid var(--gold); border-radius: 22px;
  box-shadow: 0 0 0 3px #1c0f05, 0 10px 40px rgba(0, 0, 0, .6);
}
.box.single { grid-template-columns: 1fr; max-width: 900px; }
.panel {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: linear-gradient(var(--panel-top), var(--panel-bottom));
  border: 2px solid var(--gold); border-radius: 16px;
  box-shadow: inset 0 0 0 2px var(--edge), 0 0 18px rgba(255, 190, 80, .18);
}
/* Řada žároviček kolem panelu */
.panel::before {
  content: ""; position: absolute; inset: 5px; border-radius: 12px; pointer-events: none;
  border: 3px dotted rgba(255, 216, 107, .5);
}
.marquee, .side-title {
  margin: 0; text-align: center; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-light); text-shadow: 0 0 10px rgba(255, 200, 80, .7), 0 2px 0 #000;
}
.marquee { font-size: 1.5rem; padding: 4px 0 10px; border-bottom: 2px solid var(--edge); }
.side-title { font-size: 1.15rem; }

/* Obrazovka */
.screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
  background: #000; border: 3px solid #120a03; border-radius: 10px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .9);
}
.box:not(.single) .screen { aspect-ratio: auto; height: clamp(220px, 44vh, 560px); }
.screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.screen iframe { width: 100%; height: 100%; border: 0; display: block; }
.screen.idle { display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--gold-light); font-size: 1.1rem; text-align: center; padding: 16px; }
.note-icon { font-size: 4rem; line-height: 1; color: var(--gold-light); text-shadow: 0 0 18px rgba(255, 200, 80, .6); }
.screen:not(.idle) > .note-icon { position: absolute; inset: 0; display: grid; place-items: center; }
.screen-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; background: rgba(0, 0, 0, .65); text-align: center; }
.screen:fullscreen { border: 0; border-radius: 0; }

.status { background: var(--well); border: 2px solid var(--edge); border-radius: 10px; padding: 10px 14px; text-align: center; }
.status p { margin: 0; }
.glow { color: var(--glow); font-weight: 800; font-size: 1.15rem; text-shadow: 0 0 8px rgba(60, 255, 60, .55); }
.said { margin-top: .3em !important; font-style: italic; font-size: 1.05rem; }

/* Tlačítka */
.key {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 12px 14px 8px; font: inherit; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer;
  color: var(--dark); border: 2px solid #7a4d12; border-radius: 12px;
  background: linear-gradient(#fff3b8, #f3cf63 45%, #d39f36);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), 0 3px 0 #4d2e0a;
}
.key::before { content: ""; position: absolute; top: 4px; left: 32%; right: 32%; height: 4px; border-radius: 4px; background: rgba(0, 0, 0, .18); }
.key.lit::before { background: var(--glow); box-shadow: 0 0 8px var(--glow), 0 0 14px #3cff3c; }
.key.lit { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .75), 0 3px 0 #4d2e0a, 0 0 14px rgba(60, 255, 60, .55); }
.key:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 1px 0 #4d2e0a; }
.key:disabled { opacity: .4; cursor: default; transform: none; }
.key.yellow { background: linear-gradient(#fffbd0, #fbe86a 45%, #e8c42e); }
.key.green { background: linear-gradient(#ecffe6, #a9ec9c 45%, #62c457); border-color: #2f6d27; }
.key.grey { background: linear-gradient(#f4f4f4, #c9c9c9 45%, #9a9a9a); border-color: #555; }
.key.small { min-height: 44px; padding: 10px 12px 6px; font-size: .8rem; }
.key.small::before { display: none; }
.key.big { min-height: 84px; font-size: 1.15rem; }
.key b { background: rgba(255, 255, 255, .7); border-radius: 99px; padding: 0 .5em; }
.key.wide { width: 100%; }
.key small { color: inherit; font-weight: 600; font-size: .7em; }

.controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.controls.two { grid-template-columns: 1fr 2fr; }
.controls form { margin: 0; display: grid; }
.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.keys .key { min-height: 72px; font-size: 1.3rem; padding-top: 12px; }
.keys .key span { font-size: .62rem; line-height: 1.15; }

/* Kanály */
.side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crumbs { margin: 0; padding: 6px 12px; background: var(--well); border-radius: 8px; font-size: .85rem; }
.list-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 8px; flex: 1; min-height: 0; }
.list {
  display: grid; align-content: start; gap: 10px; overflow-y: auto; padding: 4px 6px 4px 2px;
  max-height: calc(100vh - 290px); min-height: 300px; scroll-behavior: smooth;
}
.arrows { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; max-height: calc(100vh - 290px); }
.arrow { font-size: 1.6rem; padding: 0; }
.item {
  display: block; padding: 10px 12px; text-decoration: none; color: var(--lilac-text);
  background: linear-gradient(var(--lilac-top), var(--lilac-bottom));
  border: 2px solid var(--lilac-edge); border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 3px 0 #2c2160;
}
.item b { font-size: 1.02rem; overflow-wrap: anywhere; }
.item small { display: block; color: #3b2f73; margin-top: 2px; }
.item.on {
  background: linear-gradient(#fff6c6, #f6d870 45%, #dcae46); border-color: #7a4d12;
  box-shadow: 0 0 0 3px var(--glow), 0 0 18px rgba(60, 255, 60, .6);
}
.item.on small { color: #5a3b0c; }
.item.comment p { margin: .3em 0; white-space: pre-line; }
.item.comment form { margin: 0; }
.badge {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: 2px;
  background: linear-gradient(#ffab4d, #e5630f); color: #fff; font-size: .62rem; font-weight: 900; letter-spacing: .05em;
}
.empty-note { text-align: center; padding: 20px 8px; margin: 0; }
.empty-note .key { margin-top: 10px; }

/* Formuláře */
.form { display: grid; gap: 12px; }
.form.narrow, .pin-form { max-width: 400px; margin: 0 auto; width: 100%; }
.pin-form { display: grid; gap: 12px; }
label { font-weight: 700; }
input, textarea {
  font: inherit; width: 100%; padding: .55em .7em; color: #1d1206;
  background: #fffaf0; border: 2px solid var(--gold); border-radius: 10px;
}
.write { display: grid; gap: 8px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.step {
  display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-right: .3em; border-radius: 50%;
  background: var(--gold-light); color: var(--dark); font-size: .85em;
}
.key .step { background: #fff; color: #2f6d27; }
.help { background: var(--well); border-radius: 10px; padding: 10px 14px; margin: 0; }
.error { margin: 0; padding: .5em .8em; border-radius: 10px; font-weight: 700; background: #4a1010; color: #ffd6cf; border: 2px solid #d04a3a; }
.ok-msg { margin: 0; padding: .5em .8em; border-radius: 10px; font-weight: 700; background: #12391a; color: #c9ffc0; border: 2px solid #4fae4a; }
.check { display: flex; gap: .5em; align-items: center; }
.check input { width: 1.4em; height: 1.4em; flex: none; }
.preview .item { display: grid; gap: 8px; }
.preview img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.pin { text-align: center; font-size: 2rem; letter-spacing: .4em; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad .key { min-height: 74px; font-size: 1.6rem; }
.keypad:not([hidden]) ~ .submit { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2.1em; height: 2.1em; border-radius: 50%;
  background: #fff3d6; border: 2px solid var(--gold); font-size: 1.15rem;
}
.avatar.sm { width: 1.6em; height: 1.6em; font-size: .95rem; }
.avatar.xl { width: 2.8em; height: 2.8em; font-size: 2.2rem; }
.avatars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatars legend { font-weight: 700; margin-bottom: 8px; }
.avatars label input { position: absolute; opacity: 0; }
.avatars label span {
  display: grid; place-items: center; width: 2.3em; height: 2.3em; font-size: 1.35rem; cursor: pointer;
  background: #fff3d6; border: 2px solid var(--edge); border-radius: 12px;
}
.avatars input:checked + span { border: 4px solid var(--glow); box-shadow: 0 0 12px rgba(60, 255, 60, .6); }
.avatars input:focus-visible + span { outline: 4px solid #4cc3ff; }

/* Přihlášení */
.guest-form { display: grid; margin: 0; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.key.person { min-height: 160px; gap: 8px; font-size: 1.1rem; padding-top: 16px; }

/* Správa */
.sub { background: rgba(0, 0, 0, .25); border: 1px solid var(--edge); border-radius: 12px; padding: 14px; }
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--edge); }
.user-list strong { margin-right: auto; }
.inline { display: flex; gap: 6px; margin: 0; }
.inline input { width: 7.5em; padding: .3em .5em; }

/* Spodní lišta na mobilu */
.bottombar { display: none; }

@media (max-width: 860px) {
  :root { font-size: 18px; }
  .box { grid-template-columns: 1fr; padding: 8px; border-radius: 16px; }
  .box:not(.single) .screen { aspect-ratio: 16 / 9; height: auto; }
  .box.has-bar { margin-bottom: 104px; }
  .list { max-height: none; min-height: 0; overflow: visible; }
  .list-wrap { grid-template-columns: 1fr; }
  .arrows, .side-nav { display: none; }
  .bottombar {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--frame); border-top: 3px solid var(--gold);
  }
  .bottombar.two { grid-template-columns: repeat(2, 1fr); }
  .keys { gap: 6px; }
  .keys .key { padding-left: 4px; padding-right: 4px; }
  .key.big { min-height: 72px; font-size: 1rem; }
}
@media (max-width: 480px) {
  .keys .key span { font-size: .55rem; }
  .controls { gap: 6px; }
  .key.person { min-height: 140px; }
  .people { grid-template-columns: repeat(2, 1fr); }
}
