:root {
  --wood: #5a2f12; --wood-dark: #2a1408; --brass: #d9a441; --cream: #fff4d6;
  --green: #35d35f; --orange: #ffa51f; --red: #ff4a3d; --blue: #4aa8ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(ellipse at top, #4a2610, var(--wood-dark) 70%); color: var(--cream);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; overflow: hidden; }
.sprite { position: absolute; }
[hidden] { display: none !important; }

#app { height: 100%; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; padding: 14px; }
#cabinet, #listbox { min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 28px;
  background: linear-gradient(145deg, #7a431a, var(--wood)); border: 6px solid var(--brass);
  box-shadow: inset 0 0 30px #0008, 0 10px 30px #000a; }
.sign { text-align: center; }
.sign h1 { margin: 2px 0; font-size: clamp(22px, 2.7vw, 44px); white-space: nowrap; letter-spacing: .06em; text-transform: uppercase; font-weight: 900;
  background: linear-gradient(#fff6c8, #ffc43a 55%, #e8851a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 10px #ff9a1a) drop-shadow(0 3px 0 #5a2f12); }
.sign .star { color: #ffd34d; -webkit-text-fill-color: #ffd34d; }
.bulbs { height: 10px; background: radial-gradient(circle, #ffe38a 0 4px, #0000 5px) 0 0 / 26px 12px repeat-x; animation: blink 1.6s steps(2) infinite; }
.bulbs:last-child { animation-delay: .8s; }
@keyframes blink { 50% { opacity: .35; } }
.marquee { margin: 0; text-align: center; font-size: clamp(26px, 3.4vw, 46px); letter-spacing: .08em; text-transform: uppercase;
  color: #ffe9a8; text-shadow: 0 0 12px #ffb52e, 0 0 28px #ff8a00; }
#listbox .marquee { font-size: clamp(22px, 2.2vw, 32px); }
.infobar { padding: 8px 14px; border-radius: 14px; background: #1a0b04; border: 3px inset #8a5a2a; text-align: center; }
.status { font-size: clamp(22px, 2.4vw, 32px); min-height: 1.3em; color: #9dff9d; text-shadow: 0 0 8px #3f3; overflow-wrap: anywhere; }
.substatus { min-height: 1.2em; font-size: clamp(16px, 1.6vw, 22px); color: #ffd27a; }
.status.warn { color: #ffd27a; text-shadow: 0 0 8px #fa0; }

/* obrazovka */
#screen-wrap { flex: 1 1 auto; min-height: 200px; position: relative; display: flex; flex-direction: column; background: #000;
  border: 10px solid #111; border-radius: 18px; box-shadow: inset 0 0 40px #000, 0 0 0 4px var(--brass); overflow: hidden; }
#stage { flex: 1 1 auto; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
#stage iframe, #stage video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.idle, .note-screen { text-align: center; color: #ffd27a; text-shadow: 0 0 16px #fa0; padding: 20px; }
.idle span, .note-screen span { display: block; font-size: clamp(64px, 12vw, 160px); line-height: 1; }
.idle p, .note-screen p { margin: 8px 0 0; font-size: clamp(20px, 2.4vw, 34px); }
.note-screen span { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-14px) scale(1.06); } }

/* tlačítka */
.btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: clamp(72px, 11.5vh, 104px);
  padding: 20px 8px 8px; font: inherit; font-size: clamp(20px, 2.2vw, 30px); font-weight: 700; color: #2a1608; cursor: pointer;
  background: linear-gradient(#f4d98a, #c79a3a); border: 0; border-radius: 20px;
  box-shadow: 0 8px 0 #6d4c14, 0 12px 14px #000a, inset 0 2px 0 #fff9; transition: transform .06s, box-shadow .06s, filter .15s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.btn:hover { filter: brightness(1.07); }
.btn:active, .btn.pressed { transform: translateY(7px); box-shadow: 0 1px 0 #6d4c14, 0 3px 6px #000a, inset 0 2px 0 #fff6; }
.btn:focus-visible { outline: 5px solid var(--blue); outline-offset: 3px; }
.btn .ico { width: 36px; height: 36px; fill: currentColor; }
.btn .lbl { line-height: 1.1; text-align: center; }
.btn .lamp { position: absolute; top: 9px; left: 50%; width: 46%; height: 9px; margin-left: -23%; border-radius: 5px; background: #6b5320;
  box-shadow: inset 0 1px 2px #0008; transition: background .15s, box-shadow .15s; }
.btn[data-lit="green"] .lamp { background: var(--green); box-shadow: 0 0 16px 4px var(--green); }
.btn[data-lit="orange"] .lamp { background: var(--orange); box-shadow: 0 0 16px 4px var(--orange); }
.btn[data-lit="red"] .lamp { background: var(--red); box-shadow: 0 0 16px 4px var(--red); }
.btn[data-lit="blue"] .lamp { background: var(--blue); box-shadow: 0 0 16px 4px var(--blue); }
.btn[data-lit] { color: #000; background: linear-gradient(#fff3b0, #ffd34d); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.btn.small { min-height: 84px; padding-top: 18px; font-size: 22px; }
.btn.arrow { flex-direction: row; gap: 14px; min-height: 80px; padding: 16px 8px 8px; }

/* seznam */
#listbox { gap: 12px; }
.list { flex: 1 1 auto; min-height: 0; overflow-y: auto; scroll-snap-type: y proximity; display: flex; flex-direction: column; gap: 12px; padding: 4px;
  scrollbar-width: auto; scrollbar-color: var(--brass) #1a0b04; background: #1a0b04; border-radius: 14px; border: 3px inset #8a5a2a; }
.list::-webkit-scrollbar { width: 22px; }
.list::-webkit-scrollbar-thumb { background: var(--brass); border-radius: 11px; border: 3px solid #1a0b04; }
.item { scroll-snap-align: start; flex: 0 0 auto; padding: 14px; border-radius: 16px; background: #3b1e0c; border: 4px solid #6e4220; }
.item.selected { border-color: var(--blue); box-shadow: 0 0 14px var(--blue); }
.item.playing { border-color: var(--green); box-shadow: 0 0 18px var(--green); background: #1d3a1f; }
.item h3 { margin: 0 0 6px; font-size: clamp(22px, 2.2vw, 30px); color: #ffe9a8; overflow-wrap: anywhere; }
.item p { margin: 0 0 10px; font-size: clamp(18px, 1.8vw, 24px); line-height: 1.3; color: var(--cream); overflow-wrap: anywhere; }
.item .badge { display: inline-block; margin-right: 8px; padding: 2px 10px; border-radius: 10px; font-size: 18px; font-weight: 800; vertical-align: middle;
  background: var(--orange); color: #000; }
.item .btn { width: 100%; min-height: 84px; flex-direction: row; gap: 12px; padding-top: 20px; }
.empty { padding: 24px; font-size: 26px; text-align: center; color: #ffd27a; }

/* celá obrazovka */
.fs-bar { display: none; gap: 14px; padding: 12px; background: #000c; justify-content: center; }
#screen-wrap:fullscreen { border: 0; border-radius: 0; }
#screen-wrap:fullscreen .fs-bar { display: flex; }
#screen-wrap:fullscreen .fs-bar .btn { min-width: 190px; }


/* spí */
.asleep { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px;
  background: #0b0502; }
.asleep h2 { margin: 0; font-size: clamp(36px, 6vw, 80px); color: #ffe9a8; text-shadow: 0 0 20px #ff8a00; text-align: center; }

@media (max-width: 900px) {
  html, body { overflow: auto; }
  #app { grid-template-columns: 1fr; height: auto; }
  #screen-wrap { min-height: 220px; aspect-ratio: 16 / 9; flex: none; }
  .list { max-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) { .note-screen span { animation: none; } .btn { transition: none; } }

/* automat, náhodně, navigace */
.btn.small { min-height: clamp(50px, 8vh, 64px); padding: 16px 6px 6px; font-size: clamp(16px, 1.7vw, 22px); flex-direction: row; gap: 10px; }
.btn.small .ico { width: 26px; height: 26px; }
.navrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn.nav { min-height: clamp(64px, 10vh, 84px); flex-direction: row; gap: 14px; padding-top: 20px; font-size: clamp(22px, 2.4vw, 32px); background: linear-gradient(#a9d8ff, #4f8fd1); color: #04203d;
  box-shadow: 0 8px 0 #1f4a7a, 0 12px 14px #000a, inset 0 2px 0 #fff9; }
.btn.nav:active { box-shadow: 0 1px 0 #1f4a7a, 0 3px 6px #000a; }
.btn.nav[data-lit] { background: linear-gradient(#fff3b0, #ffd34d); color: #000; }
.crumbs { padding: 6px 12px; font-size: clamp(18px, 1.8vw, 24px); color: #ffe9a8; background: #1a0b04; border-radius: 10px; border: 2px inset #8a5a2a; overflow-wrap: anywhere; }
.arrowrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn.arrow { min-height: clamp(56px, 9vh, 70px); padding-top: 18px; }
.item.folder { background: #2b2a45; border-color: #5b5aa0; }
.item.folder h3 { color: #cfd0ff; }
.item.folder .btn { background: linear-gradient(#cfd0ff, #7d7bd6); color: #12113a; box-shadow: 0 8px 0 #3a3880, 0 12px 14px #000a, inset 0 2px 0 #fff9; }
.item .count { font-weight: 400; font-size: .8em; color: #b9baf0; }

/* skrytý zámek správce */
.pinwrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.8); }
.pinbox { background: #1d1a16; border: 3px solid var(--brass); border-radius: 16px; padding: 18px; width: min(320px, 92vw); text-align: center; color: #fff; }
.pin-dots { font-size: 30px; letter-spacing: 6px; min-height: 40px; }
.pin-msg { min-height: 24px; margin-bottom: 8px; color: #ffd37a; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinkey { padding: 14px 0; font: inherit; font-size: 22px; font-weight: 700; color: #fff; background: #3a342b; border: 2px solid var(--brass); border-radius: 10px; cursor: pointer; }
.pinkey:active { background: #5b5040; }

/* výraznější 3D, stisk a svícení */
.btn { box-shadow: 0 12px 0 #5a3d0e, 0 18px 18px #000b, inset 0 3px 0 #fffb, inset 0 -4px 0 #0003; margin-bottom: 4px; }
.btn:active, .btn.pressed { transform: translateY(11px); filter: brightness(.82) saturate(1.1);
  box-shadow: 0 1px 0 #5a3d0e, 0 2px 4px #000c, inset 0 6px 12px #0009, inset 0 0 0 3px #0003; }
.btn .lamp { height: 12px; }
.btn[data-lit] { --glow: var(--green); box-shadow: 0 12px 0 #5a3d0e, 0 18px 18px #000b, inset 0 3px 0 #fffb, 0 0 26px 6px var(--glow), 0 0 60px 10px color-mix(in srgb, var(--glow) 45%, transparent); }
.btn[data-lit="orange"] { --glow: var(--orange); } .btn[data-lit="red"] { --glow: var(--red); } .btn[data-lit="blue"] { --glow: var(--blue); }
.btn[data-lit]:active { box-shadow: 0 1px 0 #5a3d0e, 0 2px 4px #000c, inset 0 6px 12px #0009, 0 0 26px 6px var(--glow); }
.btn[data-lit] .lamp { box-shadow: 0 0 22px 8px var(--glow); }

.copy { position: fixed; left: 0; right: 0; bottom: 1px; text-align: center; font-size: 10px; line-height: 12px; color: #ffe9a8; opacity: .55; pointer-events: none; z-index: 1; }

/* počítač: vlevo okno, popisy, panel jako na mobilu a řada tlačítek; vpravo seznam se svislými šipkami */
.m-panel, .d-row { display: none; }
body:not(.m) .m-panel { display: block; }
body:not(.m) .d-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
body:not(.m) .m-panel { --mh: clamp(92px, 13vh, 116px); padding: 12px 12px 18px; border-radius: 24px; background: linear-gradient(#120804, #2a1408); border: 4px solid var(--brass);
  box-shadow: inset 0 0 18px #000c, 0 0 0 3px #0008, 0 0 18px 2px #ffb52e44; }
body:not(.m) .m-panel .m-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
body:not(.m) .m-panel .btn { height: var(--mh); min-height: 0; font-size: clamp(20px, 2.2vw, 30px); }
.d-row .btn { min-height: clamp(60px, 9vh, 90px); padding: 18px 4px 6px; font-size: clamp(15px, 1.55vw, 22px); }
.d-row .btn .ico { width: 28px; height: 28px; }
.btn.go { background: linear-gradient(#cfe9c9, #7fb878); box-shadow: 0 12px 0 #3e6a39, 0 18px 18px #000b, inset 0 3px 0 #fffb; }
.btn.grey { background: linear-gradient(#cfc8bb, #9b9385); box-shadow: 0 12px 0 #5f594e, 0 18px 18px #000b, inset 0 3px 0 #fffa; }
.btn.pwr { background: linear-gradient(#fff3b0, #ffd34d); color: #d6291d; --glow: var(--green); }
.btn.pwr .lamp { background: var(--green); box-shadow: 0 0 22px 8px var(--green); }
.btn.pwr { box-shadow: 0 12px 0 #5a3d0e, 0 18px 18px #000b, inset 0 3px 0 #fffb, 0 0 26px 6px var(--green), 0 0 60px 10px #35d35f66; }
.btn.go[data-lit], .btn.grey[data-lit] { background: linear-gradient(#fff3b0, #ffd34d); box-shadow: 0 12px 0 #5a3d0e, 0 18px 18px #000b, inset 0 3px 0 #fffb, 0 0 26px 6px var(--glow), 0 0 60px 10px color-mix(in srgb, var(--glow) 45%, transparent); }
.btn.pwr:active, .btn.go:active, .btn.grey:active { transform: translateY(11px); box-shadow: 0 1px 0 #5a3d0e, 0 2px 4px #000c, inset 0 6px 12px #0009; }
.listwrap { flex: 1 1 auto; min-height: 0; display: flex; gap: 12px; }
.listwrap .list { flex: 1 1 auto; min-width: 0; }
.listwrap .arrowrow { display: flex; flex-direction: column; gap: 14px; flex: 0 0 clamp(84px, 8vw, 110px); }
.listwrap .arrowrow .btn.arrow { flex: 1 1 0; min-height: 0; padding: 18px 0 8px; }
.listwrap .arrowrow .btn .ico { width: 56px; height: 56px; }
.listwrap .arrowrow .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 900px) { .listwrap .arrowrow { flex-basis: 80px; } }
body:not(.m) .m-bottom, body:not(.m) .m-flags, body:not(.m) .m-browse, body:not(.m) .m-play, body:not(.m) .m-land { display: none; }
body:not(.m) .m-panel .btn { padding-top: 24px; } body:not(.m) .m-panel .btn .ico { width: 30px; height: 30px; }

/* seznam vpravo: název programu je napsaný přímo na tlačítku */
.item { padding: 8px; }
.item > .btn { width: 100%; min-height: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 26px 18px 14px; text-align: left; }
.item > .btn .ttl { display: block; font-size: clamp(22px, 2.2vw, 32px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.item > .btn .note { display: block; font-size: clamp(16px, 1.5vw, 21px); font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.item > .btn .lbl { font-size: clamp(14px, 1.3vw, 18px); font-weight: 600; opacity: .75; text-align: left; }
.item > .btn .count { font-weight: 500; font-size: .75em; }
.item.folder > .btn { color: #12113a; }
.item > .btn .badge { color: #000; }
.item > .btn .count { color: inherit; opacity: .7; }

/* šipky užší */
.listwrap .arrowrow { flex-basis: clamp(54px, 4.6vw, 66px); }
.listwrap .arrowrow .btn .ico { width: 36px; height: 36px; }

/* vypnuto: aplikace zešedne a zmenší se na lištu dole, Zapnout svítí červeně */
body:not(.m)[data-power="off"] { background: #1c1a18; }
body:not(.m)[data-power="off"] #app { display: block; padding: 0; }
body:not(.m)[data-power="off"] #listbox, body:not(.m)[data-power="off"] #screen-wrap, body:not(.m)[data-power="off"] .sign,
body:not(.m)[data-power="off"] .d-row, body:not(.m)[data-power="off"] .m-panel .btn:not(.pwr), body:not(.m)[data-power="off"] .infobar .substatus { display: none; }
body:not(.m)[data-power="off"] #cabinet { position: fixed; left: 0; right: 0; bottom: 0; flex-direction: row; align-items: center; gap: 18px; padding: 12px 16px;
  border-radius: 22px 22px 0 0; border: 5px solid #6b655c; border-bottom: 0; background: linear-gradient(#4a4540, #2e2a26); box-shadow: 0 -6px 24px #000a; }
body:not(.m)[data-power="off"] .infobar { flex: 1 1 auto; order: 1; background: #181614; border-color: #5a554d; }
body:not(.m)[data-power="off"] .status { font-size: clamp(18px, 1.8vw, 26px); color: #a9a49b; text-shadow: none; }
body:not(.m)[data-power="off"] .m-panel { order: 2; flex: 0 0 min(360px, 40vw); padding: 0; border: 0; background: none; box-shadow: none; }
body:not(.m)[data-power="off"] .m-panel .m-row { grid-template-columns: 1fr; }
body:not(.m)[data-power="off"] .m-panel .btn { --mh: 84px; }
body:not(.m)[data-power="off"] .btn.pwr { --glow: var(--red); background: linear-gradient(#ffd0c8, #ff6a5c); color: #5c0c06; }
body:not(.m)[data-power="off"] .btn.pwr .lamp { background: var(--red); box-shadow: 0 0 22px 8px var(--red); }
body:not(.m)[data-power="off"] .btn.pwr { box-shadow: 0 12px 0 #7a1f17, 0 18px 18px #000b, inset 0 3px 0 #fffb, 0 0 26px 6px var(--red), 0 0 60px 10px #ff4a3d66; }
