/* NOČNÍ SMĚNA – vzhled. Menu je rack: každá hra je zařízení v něm. */

:root {
  --bg: #06080a; --ink: #0b0e12; --steel: #1a1f25; --steel2: #252c34; --edge: #39424d;
  --text: #e8ebe6; --dim: #8a96a2;
  --amber: #ffb224; --green: #3ddc84; --red: #ff4a3a; --blue: #3aa0ff; --oled: #d6ecff;
  --f-display: 'Krona One', 'Arial Black', sans-serif;
  --f-ui: 'Archivo', system-ui, sans-serif;
  --f-dot: 'Doto', ui-monospace, monospace;
  --u: clamp(44px, calc((100dvh - 104px) / 16), 60px);
  --ear: 30px;
  --hud-h: 56px;
  --screw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8.6' r='6.4' fill='%23000' fill-opacity='.55'/%3E%3Ccircle cx='8' cy='8' r='6.2' fill='%239aa3ab'/%3E%3Ccircle cx='8' cy='7.4' r='5' fill='%23c3cad0'/%3E%3Cpath d='M4.8 8h6.4M8 4.8v6.4' stroke='%233a424a' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; }

.silk {
  font-stretch: 75%; font-weight: 700; font-size: 10.5px; letter-spacing: .13em;
  text-transform: uppercase; margin: 0; opacity: .72; white-space: nowrap;
}

/* ---------- serverovna ---------- */
.hub {
  position: fixed; inset: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center;
  padding: 34px 7px calc(10px + env(safe-area-inset-bottom));
  transition: transform .42s cubic-bezier(.6, 0, .9, .4), opacity .36s, filter .36s;
}
.hub.leaving { transform: scale(1.5); opacity: 0; filter: blur(6px); pointer-events: none; }
body.booting .hub { opacity: 0; }

.room { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.room .glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 46% at 50% -6%, rgba(96, 150, 190, .26), transparent 70%),
    radial-gradient(46% 30% at 50% 108%, rgba(58, 160, 255, .13), transparent 70%),
    linear-gradient(#090c10, #050608);
}
/* sousední racky za perforovanými dveřmi */
.neighbor {
  position: absolute; top: 46px; bottom: -20px; width: calc(50vw - 560px); min-width: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 1.1px, rgba(4, 6, 8, .93) 1.6px) 0 0 / 7px 7px,
    linear-gradient(90deg, #0f1318, #171c22 50%, #0d1115);
  border: 1px solid #1b2128; opacity: .9;
}
.neighbor--l { left: -12px; border-radius: 0 4px 0 0; }
.neighbor--r { right: -12px; border-radius: 4px 0 0 0; }
.neighbor b {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 9px 3px var(--c); filter: blur(1.4px);
  animation: bokeh var(--d) steps(1) infinite; animation-delay: var(--o);
}
@keyframes bokeh { 0%, 100% { opacity: .85; } 50% { opacity: .12; } 62% { opacity: .7; } 70% { opacity: .1; } }

/* žlutý žlab na optiku nad racky */
.raceway {
  position: absolute; top: 0; left: 0; right: 0; height: 24px;
  background:
    repeating-linear-gradient(90deg, transparent 0 218px, rgba(0, 0, 0, .28) 218px 220px),
    linear-gradient(#ffd83a, #f0bd00 46%, #c89600 54%, #a87c00);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .7), inset 0 -3px 0 rgba(0, 0, 0, .22);
}
.raceway i {
  position: absolute; top: 20px; left: calc(50% - 150px); width: 44px; height: 30px;
  background: linear-gradient(90deg, #b48600, #f3c40a 40%, #c89600); border-radius: 0 0 9px 9px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .6);
}
.raceway i + i { left: calc(50% + 108px); }

/* ---------- rack ---------- */
.rack {
  position: relative; z-index: 1; width: min(1020px, 100%);
  padding: 0 11px; border-radius: 5px;
  background:
    linear-gradient(90deg, #0a0d10, #20262d 5px, #14181d 11px, #14181d calc(100% - 11px), #20262d calc(100% - 5px), #0a0d10);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .75), 0 0 0 1px #000;
}
.rack-cap {
  height: 20px; margin: 0 -11px; padding: 0 16px; border-radius: 5px 5px 0 0;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(#2a323b, #171c21); border-bottom: 1px solid #000;
  font-stretch: 75%; font-weight: 700; font-size: 9.5px; letter-spacing: .2em; color: #76828e;
}
.rack-body { position: relative; background: #050607; padding: 2px 0; }
.rack-feet { height: 13px; margin: 0 -11px; background: linear-gradient(#1c2228, #0c0f12); border-radius: 0 0 4px 4px; position: relative; }
.rack-feet i { position: absolute; bottom: -7px; left: 26px; width: 44px; height: 7px; background: #0b0d10; border-radius: 0 0 3px 3px; }
.rack-feet i + i { left: auto; right: 26px; }
.hub-foot { position: relative; z-index: 1; margin: 16px 0 4px; font-size: 11.5px; color: #55606b; text-align: center; font-stretch: 85%; letter-spacing: .03em; }

/* ---------- jednotka v racku ---------- */
.unit {
  --chassis: #1b2026; --chassis2: #12161a; --on: var(--text); --earc: #1b2026;
  position: relative; display: block; width: 100%; height: calc(var(--u) * var(--n, 2));
  margin: 0; padding: 0; border: 0; background: none; color: var(--on); text-align: left;
  animation: powerOn .7s both; animation-delay: calc(var(--i) * 95ms + 180ms);
}
@keyframes powerOn {
  0% { filter: brightness(.16) saturate(.2); }
  55% { filter: brightness(1.5) saturate(1.1); }
  100% { filter: none; }
}
.unit::before, .unit::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; width: var(--ear);
  background:
    var(--screw) center 7px / 13px 13px no-repeat,
    var(--screw) center calc(100% - 7px) / 13px 13px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, .1), transparent 30%, rgba(0, 0, 0, .25)), var(--earc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.unit::before { left: 0; border-radius: 3px 0 0 3px; }
.unit::after { right: 0; border-radius: 0 3px 3px 0; }
.unit .face {
  position: absolute; inset: 1px var(--ear);
  display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); padding: 0 clamp(10px, 1.8vw, 20px);
  background: linear-gradient(var(--chassis), var(--chassis2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), inset 0 -2px 2px rgba(0, 0, 0, .4), inset 1px 0 0 rgba(0, 0, 0, .3), inset -1px 0 0 rgba(0, 0, 0, .3);
  overflow: hidden;
}

/* LED */
.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #20252a; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6); vertical-align: middle; }
.led.g { background: var(--green); box-shadow: 0 0 7px 1px var(--green); }
.led.r { background: var(--red); box-shadow: 0 0 7px 1px var(--red); }
.led.a { background: var(--amber); box-shadow: 0 0 7px 1px var(--amber); }
.blink { animation: blink .34s steps(1) infinite; }
.blink-slow { animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: .15; } }

/* maticový displej */
.dm {
  position: relative; background: #0d0902; border-radius: 3px; color: var(--amber);
  font-family: var(--f-dot); font-weight: 900; letter-spacing: .02em;
  text-shadow: 0 0 9px rgba(255, 178, 36, .65);
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 8px #000, 0 1px 0 rgba(255, 255, 255, .09);
}
.dm::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, transparent .9px, rgba(13, 9, 2, .5) 1.3px) 0 0 / 3px 3px,
    linear-gradient(rgba(255, 255, 255, .06), transparent 40%);
}
.dm-l { display: block; font-family: var(--f-ui); font-stretch: 75%; font-weight: 700; font-size: 8.5px; letter-spacing: .16em; color: rgba(255, 178, 36, .55); text-shadow: none; }

/* --- značka --- */
.u-brand { --chassis: #15191e; --chassis2: #0c0f12; --earc: #15191e; }
.brand { flex: 1; min-width: 0; }
.brand h1 {
  margin: 0; font-family: var(--f-display); font-weight: 400; line-height: 1;
  font-size: clamp(20px, calc(var(--u) * .62), 38px); letter-spacing: .03em;
  color: #f1f3ee; text-shadow: 0 -1px 0 rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .13);
  white-space: nowrap;
}
.brand .silk { margin-top: 7px; color: var(--amber); opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.leds-row { display: flex; flex-direction: column; gap: 5px; font-stretch: 75%; font-weight: 700; font-size: 9px; letter-spacing: .14em; color: #7c8792; }
.leds-row span { display: flex; align-items: center; gap: 6px; }
.clock { padding: 6px 12px 7px; flex: none; }
.clock output { display: flex; align-items: center; font-size: clamp(20px, calc(var(--u) * .5), 30px); line-height: 1; }
.clock output i { width: .34em; height: .62em; background: radial-gradient(circle, currentColor 58%, transparent 62%) center top / .17em .17em no-repeat, radial-gradient(circle, currentColor 58%, transparent 62%) center bottom / .17em .17em no-repeat; animation: blink 1s steps(1) infinite; }

/* --- směna --- */
.u-shift { --chassis: #2a3138; --chassis2: #1c2228; --earc: #262c33; }
.u-shift .face { align-items: stretch; padding-top: calc(var(--u) * .28); padding-bottom: calc(var(--u) * .28); }
.marquee { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--u) * .2) 14px; overflow: hidden; }
.dm-row { display: flex; justify-content: space-between; gap: 12px; font-size: clamp(15px, calc(var(--u) * .4), 24px); line-height: 1; white-space: nowrap; }
.dm-row span:last-child { opacity: .7; }
.dm-ticker { overflow: hidden; white-space: nowrap; font-size: clamp(20px, calc(var(--u) * .62), 36px); line-height: 1.05; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.dm-ticker > div { display: inline-block; padding-left: 100%; animation: ticker 46s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }
.shift-ctl { flex: none; width: clamp(128px, 24%, 230px); display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.shift-ctl .silk { text-align: center; white-space: normal; line-height: 1.5; font-size: 9px; }
.bigkey {
  position: relative; flex: 1; min-height: 0; padding: 5px; border: 0; border-radius: 9px;
  background: linear-gradient(#0a0c0e, #23292f); box-shadow: inset 0 2px 5px #000, 0 1px 0 rgba(255, 255, 255, .12);
}
.bigkey-cap {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%; border-radius: 6px; color: #04220f;
  background: radial-gradient(120% 90% at 50% 0%, #b9ffd6, #3ddc84 46%, #17a257);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -5px 0 rgba(0, 0, 0, .25), 0 0 22px rgba(61, 220, 132, .5);
  transition: transform .08s, box-shadow .2s, filter .2s; animation: keyPulse 2.2s ease-in-out infinite;
}
.bigkey-cap b { font-family: var(--f-display); font-weight: 400; font-size: clamp(11px, 1.55vw, 17px); letter-spacing: .04em; }
.bigkey-cap small { font-stretch: 75%; font-weight: 800; font-size: 10px; letter-spacing: .22em; opacity: .75; }
@keyframes keyPulse { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -5px 0 rgba(0, 0, 0, .25), 0 0 40px rgba(61, 220, 132, .85); } }
.bigkey:hover .bigkey-cap { filter: brightness(1.12); }
.bigkey:active .bigkey-cap { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 16px rgba(61, 220, 132, .6); }

/* --- herní jednotky --- */
.u-game { cursor: pointer; transition: transform .16s cubic-bezier(.2, .8, .3, 1.3), filter .16s; z-index: 1; }
.u-game:hover, .u-game:focus-visible { transform: scale(1.012); z-index: 4; filter: brightness(1.1) drop-shadow(0 8px 16px rgba(0, 0, 0, .7)); outline: 0; }
.u-game:active { transform: scale(.995); }
.plate { flex: none; width: clamp(150px, 26%, 250px); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.model { font-family: var(--f-display); font-size: clamp(15px, calc(var(--u) * .37), 21px); line-height: 1; letter-spacing: .03em; white-space: nowrap; }
.hw { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; height: 100%; }
.readout { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lcd {
  display: flex; align-items: baseline; gap: 8px; padding: 4px 9px 5px; border-radius: 3px;
  background: #05080b; box-shadow: inset 0 0 0 1px #000, inset 0 2px 6px #000, 0 1px 0 rgba(255, 255, 255, .14);
  color: var(--oled); font-family: var(--f-dot); font-weight: 900; font-size: 19px; line-height: 1; text-shadow: 0 0 8px rgba(160, 210, 255, .6);
}
.lcd small { font-family: var(--f-ui); font-stretch: 75%; font-weight: 700; font-size: 8.5px; letter-spacing: .15em; opacity: .55; text-shadow: none; }
.stars { display: flex; gap: 5px; }
.stars i {
  width: 15px; height: 15px; background: var(--staroff, rgba(0, 0, 0, .34));
  clip-path: polygon(50% 0, 62% 35%, 98% 36%, 69% 58%, 80% 94%, 50% 72%, 20% 94%, 31% 58%, 2% 36%, 38% 35%);
}
.stars i.on { background: var(--amber); }
.stars:has(i.on) { filter: drop-shadow(0 0 5px rgba(255, 178, 36, .8)); }
.go {
  flex: none; width: calc(var(--u) * .92); height: calc(var(--u) * .92); max-width: 52px; max-height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #3b444e, #14181c 70%);
  box-shadow: inset 0 0 0 2px #0a0c0e, inset 0 0 0 3px rgba(255, 255, 255, .12), 0 2px 4px rgba(0, 0, 0, .6);
  position: relative; transition: box-shadow .2s, background .2s;
}
.go::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 34%; height: 40%; translate: 12% 0;
  background: #7f8a95; clip-path: polygon(0 0, 100% 50%, 0 100%); transition: background .2s;
}
.u-game:hover .go, .u-game:focus-visible .go {
  background: radial-gradient(circle at 50% 35%, #baffd8, #2fcf78 60%, #138c49);
  box-shadow: inset 0 0 0 2px #0a0c0e, inset 0 0 0 3px rgba(255, 255, 255, .3), 0 0 22px rgba(61, 220, 132, .8);
}
.u-game:hover .go::after, .u-game:focus-visible .go::after { background: #04220f; }

/* optická vana: 12 adaptérů SC/APC s krytkami v barvách vláken */
.u-splice { --chassis: #cdd1cc; --chassis2: #a9aeaa; --on: #1b2024; --earc: #b9beb9; }
.hw-odf { gap: clamp(2px, .5vw, 6px); }
.sc {
  position: relative; flex: none; width: clamp(11px, 1.7vw, 19px); height: 62%; max-height: 62px; border-radius: 2px;
  background: linear-gradient(90deg, #0f7f41, #2bc473 45%, #108444);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .38), 0 1px 2px rgba(0, 0, 0, .4);
}
.sc::before { content: ""; position: absolute; left: 18%; right: 18%; top: 20%; height: 46%; border-radius: 2px 2px 3px 3px; background: linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 40%, rgba(255, 255, 255, .25) 60%, rgba(0, 0, 0, .2)), var(--c); box-shadow: 0 1px 1px rgba(0, 0, 0, .5); }
.sc::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 10%; height: 2px; background: rgba(0, 0, 0, .35); }

/* firewall: červená krabice s porty */
.u-firewall { --chassis: #d2412f; --chassis2: #a32a1e; --on: #fff4ee; --earc: #b83424; }
.u-firewall .face::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(0, 0, 0, .1) 5px 6px); pointer-events: none; }
.hw-ports { gap: clamp(3px, .6vw, 7px); }
.rj {
  position: relative; flex: none; width: clamp(16px, 2.3vw, 26px); height: clamp(15px, 2.1vw, 23px); border-radius: 2px;
  background: linear-gradient(#000, #15181b); box-shadow: inset 0 0 0 1px #000, 0 0 0 2px #c9cfd4, 0 1px 0 2px rgba(0, 0, 0, .4);
}
.rj::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 28%; background: repeating-linear-gradient(90deg, #c9a54a 0 1px, transparent 1px 2.5px); opacity: .8; }
.rj i { position: absolute; top: -8px; width: 5px; height: 3px; border-radius: 1px; background: var(--green); box-shadow: 0 0 5px var(--green); animation: blink var(--d, .5s) steps(1) infinite; animation-delay: var(--o, 0s); }
.rj i:first-child { left: 1px; }
.rj i:last-child { right: 1px; background: var(--amber); box-shadow: 0 0 5px var(--amber); }

/* patch panel */
.u-cables { --chassis: #1d2126; --chassis2: #0f1215; --earc: #1a1e22; --staroff: rgba(255, 255, 255, .13); z-index: 2; }
.hw-patch { display: grid; grid-template-columns: repeat(12, auto); grid-auto-rows: min-content; align-content: center; justify-content: center; gap: clamp(4px, .5vw, 6px) clamp(3px, .55vw, 7px); }
.ks { width: clamp(12px, 1.75vw, 20px); height: clamp(10px, 1.45vw, 16px); border-radius: 1.5px; background: #000; box-shadow: 0 0 0 1.5px #5d6771, inset 0 -3px 0 #23282d; }
.ks.used { background: var(--c); box-shadow: 0 0 0 1.5px #5d6771, inset 0 0 0 2px rgba(0, 0, 0, .35); }
.drape { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; filter: drop-shadow(0 5px 3px rgba(0, 0, 0, .55)); }
.drape path { fill: none; stroke-linecap: round; }

/* mikrovlnný spoj – vnitřní jednotka */
.u-antenna { --chassis: #ece8dc; --chassis2: #cfcabb; --on: #1d2a38; --earc: #ddd8ca; }
.u-antenna .face::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: #2b7fd6; }
.bar { display: flex; gap: 3px; align-items: flex-end; padding: 6px 8px; background: #0b0e11; border-radius: 3px; box-shadow: inset 0 2px 5px #000; }
.bar i { width: clamp(4px, .7vw, 7px); height: calc(8px + var(--k) * 2.2px); border-radius: 1px; background: #1c2126; transition: background .12s, box-shadow .12s; }
.bar i.on { background: var(--c); box-shadow: 0 0 6px var(--c); }
.coax { width: 22px; height: 22px; border-radius: 50%; flex: none; background: radial-gradient(circle, #1a1a1a 22%, #f3d27a 24% 34%, #7a5c12 36% 44%, #e9c661 46% 62%, #8d6c18 64%); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

/* ústředna */
.u-helpdesk { --chassis: #d3c5a3; --chassis2: #b4a583; --on: #2b2417; --earc: #c3b592; }
.hw-pbx { gap: clamp(3px, .6vw, 7px); }
.lk { flex: none; width: clamp(14px, 2.1vw, 24px); height: clamp(12px, 1.7vw, 18px); border-radius: 2px; background: linear-gradient(#efe6cf, #c9bb97); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 2px 0 #8a7c5c, 0 3px 3px rgba(0, 0, 0, .35); position: relative; }
.lk::after { content: ""; position: absolute; top: 3px; left: 50%; width: 5px; height: 3px; margin-left: -2.5px; border-radius: 1px; background: #5a4a2c; }
.lk.ring::after { background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink .5s steps(1) infinite; animation-delay: var(--o, 0s); }
.lk.busy::after { background: var(--green); box-shadow: 0 0 6px var(--green); }
.grille { flex: none; width: clamp(26px, 4vw, 44px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #3a3222 1.1px, transparent 1.5px) 0 0 / 5px 5px; margin-left: 8px; opacity: .8; }

/* PDU */
.u-pdu { --chassis: #1b1f24; --chassis2: #101316; --earc: #181c20; }
.u-pdu .face { gap: 14px; }
.hw-sockets { justify-content: flex-start; gap: 7px; }
.c13 { flex: none; width: 28px; height: 62%; max-height: 22px; border-radius: 3px 3px 6px 6px; background: #050607; box-shadow: 0 0 0 1px #343b43; position: relative; }
.c13::after { content: ""; position: absolute; inset: 30% 5px; background: linear-gradient(90deg, #2f363d 0 4px, transparent 4px 7px, #2f363d 7px 11px, transparent 11px 14px, #2f363d 14px 18px); }
.rocker { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: none; }
.rocker input { position: absolute; opacity: 0; pointer-events: none; }
.rocker-sw { width: 36px; height: 21px; border-radius: 3px; background: linear-gradient(90deg, #4a0d08 50%, #7a1810 50%); box-shadow: 0 0 0 2px #000, 0 0 0 3px #3a424a; position: relative; transition: background .12s, box-shadow .12s; }
.rocker-sw::after { content: "O  I"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: rgba(255, 255, 255, .5); letter-spacing: .3em; padding-left: 3px; white-space: pre; }
.rocker input:checked + .rocker-sw { background: linear-gradient(90deg, #ff5a45 50%, #c22a1a 50%); box-shadow: 0 0 0 2px #000, 0 0 0 3px #3a424a, 0 0 16px rgba(255, 74, 58, .7); }
.rocker input:focus-visible + .rocker-sw { outline: 2px solid var(--amber); outline-offset: 4px; }
.minikey { flex: none; height: 24px; padding: 0 11px; border: 0; border-radius: 3px; background: linear-gradient(#3a424b, #262c33); box-shadow: 0 2px 0 #0a0c0e, inset 0 1px 0 rgba(255, 255, 255, .16); font-stretch: 75%; font-weight: 700; font-size: 10.5px; letter-spacing: .14em; color: #c9d1d8; }
.minikey:active { transform: translateY(2px); box-shadow: 0 0 0 #0a0c0e; }
.pdu-name { flex: none; }

/* ---------- hra ---------- */
.play { position: fixed; inset: 0; background: #05070a; animation: playIn .4s both; }
@keyframes playIn { from { opacity: 0; transform: scale(.94); } }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.game-root { position: absolute; inset: var(--hud-h) 0 0 0; pointer-events: none; }
.game-root > * { pointer-events: auto; }

.hud {
  position: absolute; top: 0; left: 0; right: 0; height: var(--hud-h); z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 8px; padding-top: env(safe-area-inset-top);
  background: linear-gradient(#262d34, #14181c); border-bottom: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 20px rgba(0, 0, 0, .5);
}
.hud-x { flex: none; width: 38px; height: 38px; border: 0; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(#39414a, #252b32); box-shadow: 0 2px 0 #090b0d, inset 0 1px 0 rgba(255, 255, 255, .15); color: #b9c2ca; }
.hud-x:active { transform: translateY(2px); box-shadow: none; }
.hud-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.hud-title b { font-family: var(--f-display); font-weight: 400; font-size: 15px; line-height: 1.3; margin-top: -3px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-title span { font-stretch: 75%; font-weight: 700; font-size: 10px; letter-spacing: .16em; color: var(--amber); opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-extra { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; font-stretch: 80%; font-weight: 700; font-size: 13px; letter-spacing: .06em; color: #c9d1d8; display: flex; align-items: center; gap: 6px; }
.hud-lcd {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px;
  height: 40px; padding: 0 10px; min-width: 62px; border-radius: 4px; background: #0d0902;
  box-shadow: inset 0 0 0 1px #000, inset 0 2px 7px #000, 0 1px 0 rgba(255, 255, 255, .1);
}
.hud-lcd small { font-stretch: 75%; font-weight: 700; font-size: 8px; letter-spacing: .18em; color: rgba(255, 178, 36, .55); }
.hud-lcd output { font-family: var(--f-dot); font-weight: 900; font-size: 23px; line-height: .9; color: var(--amber); text-shadow: 0 0 9px rgba(255, 178, 36, .6); }
.hud-score { min-width: 96px; }
.hud-time.low output { color: var(--red); text-shadow: 0 0 10px rgba(255, 74, 58, .8); animation: blink .5s steps(1) infinite; }
.hud-score.bump output { animation: bump .22s; }
@keyframes bump { 40% { transform: scale(1.22); filter: brightness(1.5); } }
.hud-lcd output { display: block; transform-origin: right center; }

/* ---------- karty přes hru ---------- */
.overlay { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 12px; background: rgba(4, 6, 8, .74); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); overflow: auto; }
.overlay:empty { display: none; }
.overlay.clear { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.card {
  position: relative; width: min(540px, 100%); padding: 30px 30px 26px; border-radius: 8px;
  background:
    var(--screw) 9px 9px / 13px 13px no-repeat, var(--screw) calc(100% - 9px) 9px / 13px 13px no-repeat,
    var(--screw) 9px calc(100% - 9px) / 13px 13px no-repeat, var(--screw) calc(100% - 9px) calc(100% - 9px) / 13px 13px no-repeat,
    linear-gradient(#2a3139, #171b20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 30px 80px rgba(0, 0, 0, .8), 0 0 0 1px #000;
  animation: cardIn .38s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(.96); } }
.kicker { display: flex; align-items: center; gap: 9px; font-stretch: 75%; font-weight: 800; font-size: 12px; letter-spacing: .2em; color: var(--amber); }
.card h2 { margin: 10px 0 8px; font-family: var(--f-display); font-weight: 400; font-size: clamp(25px, 6.4vw, 36px); line-height: 1.05; letter-spacing: .02em; }
.card .lead { margin: 0 0 16px; font-size: 17px; line-height: 1.42; color: #c5ccd3; }
.how { margin: 0 0 22px; padding: 14px 16px; list-style: none; border-radius: 5px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6); display: grid; gap: 9px; }
.how li { position: relative; padding-left: 20px; font-size: 15.5px; line-height: 1.36; }
.how li::before { content: ""; position: absolute; left: 0; top: .42em; width: 8px; height: 8px; background: var(--amber); box-shadow: 0 0 8px rgba(255, 178, 36, .7); }
.how b { color: #fff; font-weight: 700; }
kbd { display: inline-block; padding: 1px 6px 2px; border-radius: 3px; background: #0c0f12; box-shadow: 0 1.5px 0 #000, inset 0 0 0 1px #3c454e; font: 700 .78em var(--f-ui); font-stretch: 80%; letter-spacing: .06em; color: #d5dce2; white-space: nowrap; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-foot .best { font-family: var(--f-dot); font-weight: 900; font-size: 18px; color: var(--amber); opacity: .8; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 22px; border: 0; border-radius: 7px;
  font-family: var(--f-display); font-size: 14px; letter-spacing: .05em; white-space: nowrap;
  background: linear-gradient(#3b434c, #272d34); color: #e6eaee;
  box-shadow: 0 4px 0 #0a0c0e, inset 0 1px 0 rgba(255, 255, 255, .16); transition: transform .07s, box-shadow .07s, filter .15s;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 #0a0c0e, inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn.primary { background: linear-gradient(#ffd27a, #ffb224 55%, #e09000); color: #2a1a00; box-shadow: 0 4px 0 #7a4d00, inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 26px rgba(255, 178, 36, .35); }
.btn.primary:active { box-shadow: 0 0 0 #7a4d00, inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn kbd { background: rgba(0, 0, 0, .18); box-shadow: none; color: inherit; opacity: .7; }
.btn.small { min-height: 42px; padding: 0 15px; font-size: 12px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btns .btn { flex: 1 1 auto; }

.count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.count b { font-family: var(--f-display); font-weight: 400; font-size: clamp(56px, 17vw, 150px); color: #fff; text-shadow: 0 0 50px rgba(255, 178, 36, .9), 0 6px 0 rgba(0, 0, 0, .5); animation: countPop .5s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes countPop { from { transform: scale(2.4); opacity: 0; } 70% { opacity: 1; } }

/* výsledek */
.res-score { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 12px 18px 14px; margin: 14px 0 14px; }
.res-score output { font-size: clamp(46px, 13vw, 74px); line-height: .82; }
.res-score .rec { font-family: var(--f-ui); font-stretch: 75%; font-weight: 800; font-size: 11px; letter-spacing: .16em; text-shadow: none; padding: 4px 8px; border-radius: 3px; background: var(--amber); color: #2a1a00; animation: blink .7s steps(1) 4; }
.bigstars { display: flex; gap: 10px; margin: 0 0 14px; }
.bigstars i { width: 44px; height: 44px; background: rgba(0, 0, 0, .45); clip-path: polygon(50% 0, 62% 35%, 98% 36%, 69% 58%, 80% 94%, 50% 72%, 20% 94%, 31% 58%, 2% 36%, 38% 35%); }
.bigstars i.on { background: linear-gradient(#ffe7a8, #ffb224 60%, #e08a00); animation: starIn .45s cubic-bezier(.2, .9, .3, 1.6) both; }
.bigstars-wrap { filter: drop-shadow(0 0 12px rgba(255, 178, 36, .6)); }
@keyframes starIn { from { transform: scale(2.6) rotate(-40deg); opacity: 0; } }
.facts { display: grid; grid-template-columns: 1fr auto; gap: 5px 16px; margin: 0 0 14px; font-size: 15px; }
.facts dt { color: #9aa5b0; }
.facts dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.remark { margin: 0 0 20px; padding-left: 14px; border-left: 3px solid var(--amber); font-size: 16.5px; line-height: 1.4; color: #dfe4e8; font-style: italic; }

/* ---------- protokol o směně (traktorový papír) ---------- */
.report {
  position: fixed; inset: 0; z-index: 20; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 10px calc(26px + env(safe-area-inset-bottom));
  background: radial-gradient(70% 50% at 50% 0%, rgba(96, 150, 190, .2), transparent 70%), #06080a;
}
.printer { position: sticky; top: 0; z-index: 3; width: min(640px, 100%); height: 46px; flex: none; border-radius: 0 0 8px 8px; background: linear-gradient(#2c343c, #171b20); box-shadow: 0 10px 24px rgba(0, 0, 0, .7), inset 0 -1px 0 rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.printer::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 5px; background: #000; border-radius: 3px 3px 0 0; }
.paper-wrap { position: relative; width: min(560px, 100%); margin-top: -18px; container-type: inline-size; }
.paper-wrap canvas { display: block; width: 100%; height: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .7); }
.paper-clip { overflow: hidden; }
.stamp {
  position: absolute; right: 9.5%; top: 80.5%; padding: 1.4cqw 2.6cqw 1.6cqw; border: .7cqw double #c81e1e; border-radius: 1.2cqw; color: #c81e1e;
  font-family: var(--f-display); font-size: 2.9cqw; line-height: 1.25; text-align: center; letter-spacing: .03em; white-space: nowrap;
  transform: rotate(-11deg); mix-blend-mode: multiply; opacity: 0;
}
.stamp small { display: block; font-family: var(--f-ui); font-stretch: 75%; font-weight: 800; font-size: 1.8cqw; letter-spacing: .2em; margin-bottom: .4cqw; }
.stamp.hit { animation: stampIn .28s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes stampIn { from { transform: rotate(-11deg) scale(3.2); opacity: 0; } to { transform: rotate(-11deg) scale(1); opacity: .88; } }
.report-actions { width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; opacity: 0; transition: opacity .4s; }
.report-actions.show { opacity: 1; }
.report-actions p { margin: 0; text-align: center; color: #8a96a2; font-size: 14px; }

/* ---------- žebříček ---------- */
.board { border-radius: 8px; padding: 14px 14px 12px; background: linear-gradient(#232a31, #151a1e); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px #000; }
.board header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--amber); }
.board-join { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.board-join > div { flex: 1 1 100%; display: flex; flex-direction: column; gap: 3px; }
.board-join .btn { flex: 1; }
.board-join b { font-size: 19px; font-weight: 800; font-stretch: 88%; }
.board-list { list-style: none; margin: 0; padding: 6px; border-radius: 4px; background: #0d0902; box-shadow: inset 0 0 0 1px #000, inset 0 2px 8px #000; display: grid; gap: 1px; max-height: min(46vh, 420px); overflow: auto; }
.board-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; padding: 5px 8px; border-radius: 3px; }
.board-list li b { font-family: var(--f-dot); font-weight: 900; font-size: 17px; color: rgba(255, 178, 36, .6); text-align: right; }
.board-list li span { font-weight: 600; font-stretch: 92%; color: #e9dcc0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-list li i { font-family: var(--f-dot); font-style: normal; font-weight: 900; font-size: 18px; color: var(--amber); text-shadow: 0 0 8px rgba(255, 178, 36, .5); }
.board-list li.me { background: rgba(255, 178, 36, .17); }
.board-list li.me span { color: #fff; font-weight: 800; }
.board-list li.empty { display: block; color: #9a8a62; text-align: center; padding: 14px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- modál a toast ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 12px; background: rgba(4, 6, 8, .8); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); overflow: auto; }
.modal p { margin: 0 0 12px; color: #c5ccd3; font-size: 15.5px; line-height: 1.45; }
.modal .ranks { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14.5px; }
.modal .ranks li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 10px; background: rgba(0, 0, 0, .28); border-radius: 3px; }
.modal .ranks span { font-family: var(--f-dot); font-weight: 900; color: var(--amber); }
.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 40; translate: -50% 30px; opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 6px; background: #f1f3ee; color: #111; font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  transition: translate .25s, opacity .25s; max-width: calc(100% - 24px); text-align: center;
}
.toast.show { translate: -50% 0; opacity: 1; }

/* ---------- úzké displeje ---------- */
@media (max-width: 760px) {
  :root { --ear: 15px; --u: clamp(46px, calc((100dvh - 96px) / 16), 58px); --hud-h: 52px; }
  .hub { padding-top: 30px; }
  .rack { padding: 0 6px; }
  .rack-cap, .rack-feet { margin: 0 -6px; }
  .unit::before, .unit::after { background-size: 9px 9px, 9px 9px, auto, auto; }
  .neighbor { display: none; }
  .clock { display: none; }
  .brand h1 { font-size: clamp(20px, 6.6vw, 30px); }
  .brand .silk { font-size: 8.5px; letter-spacing: .08em; }
  .dm-row .date { display: none; }
  .dm-row { font-size: 14px; }
  .u-pdu .face { gap: 8px; padding: 0 8px; }
  .u-pdu .pdu-name { display: none; }
  .u-pdu .rocker { margin-right: auto; }
  .minikey { padding: 0 8px; font-size: 10px; letter-spacing: .1em; }
  .plate { width: auto; flex: 1; }
  .hw { display: none; }
  .u-cables .hw, .u-pdu .hw { display: none; }
  .lcd { font-size: 17px; padding: 3px 7px 4px; }
  .shift-ctl .silk { display: none; }
  .shift-ctl { width: 118px; }
  .marquee { padding: 8px 10px; }
  .card { padding: 24px 20px 20px; }
  .hud-title b { font-size: 12.5px; }
  .hud-lcd { padding: 0 8px; min-width: 52px; }
  .hud-score { min-width: 84px; }
  .hud-lcd output { font-size: 21px; }
  .hub-foot { font-size: 10.5px; }
}
@media (max-width: 400px) {
  .model { font-size: 14px; }
  .u-game .silk { font-size: 8.5px; letter-spacing: .07em; }
  .go { display: none; }
}
@media (hover: none) { .btn kbd { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .unit, .card, .play { animation: none; }
  .dm-ticker > div { animation-duration: 120s; }
}
