/* Komponenty kapitoly 10 (sál a terminál), převzato z ~/projects/ibm3270/prototyp/css/style.css */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.tab, .btn {
  font: 600 15px/1 "Plex Sans", sans-serif;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  padding: 10px 14px; border-radius: 3px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.btn:hover, .tab:hover { background: #e9e5d8; }
.tab[aria-selected="true"]:hover { background: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }

.note {
  font-size: 14px; color: var(--ink-soft); border-left: 3px solid var(--red);
  padding: 4px 0 4px 10px; margin: 12px 0; max-width: 820px;
}

/* ---------- úkoly ---------- */
.stage[hidden] { display: none !important; }
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; margin-bottom: 40px; }
@media (max-width: 900px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.stage > div, .terminal, .crt { min-width: 0; }
.tasks h2 { font-size: 22px; margin: 0 0 6px; }
.tasks { background: #fffdf6; border: 1px solid var(--rule); padding: 14px 16px; position: sticky; top: 12px; }
.tasks ol { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.tasks li { margin: 6px 0; color: var(--ink-soft); }
.tasks li.now { color: var(--ink); font-weight: 600; }
.tasks li.done { color: #6c8a74; text-decoration: line-through; }
.tasks .explain { font-size: 14px; color: var(--ink); background: var(--bar); padding: 8px 10px; margin-top: 12px; min-height: 3em; }

/* ---------- SÁL ---------- */
.room {
  background: linear-gradient(#cfd3cc, #b9bfb7 62%, var(--floor) 62%);
  border: 1px solid #8e948c; padding: 14px; position: relative; overflow: hidden;
  transition: filter .8s;
}
.room.off { filter: brightness(.45) saturate(.6); }
.room::after { /* dlaždice dvojité podlahy */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background-image: linear-gradient(90deg, rgba(0,0,0,.12) 1px, transparent 1px), linear-gradient(rgba(0,0,0,.12) 1px, transparent 1px);
  background-size: 48px 24px; pointer-events: none;
}
.room > * { position: relative; z-index: 1; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.label { font: 500 11px/1.2 "Plex Mono", monospace; color: #fff; letter-spacing: .05em; }

/* páskové jednotky */
.tapes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.drive {
  background: linear-gradient(90deg, var(--cabinet), var(--cabinet-hi) 50%, var(--cabinet));
  border-radius: 3px 3px 0 0; padding: 6px 5px 8px; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 190px;
}
.drive:focus-visible, .drive.target { border-color: #ffd34d; }
.drive .window {
  width: 100%; aspect-ratio: 1 / 1.25; background: #1b232c; border-radius: 2px;
  display: grid; grid-template-rows: 1fr 1fr; place-items: center; padding: 4px;
  box-shadow: inset 0 0 0 2px #0f151b;
}
.reel { width: 78%; aspect-ratio: 1; border-radius: 50%; position: relative; }
.reel.empty { border: 2px dashed #3f4a55; }
.reel.full {
  background: radial-gradient(circle, #ddd 0 11%, #333 12% 16%, #5a4a3a 17% 60%, #cfd4d8 61% 100%);
}
.reel.full::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 20deg, rgba(0,0,0,.35) 20deg 32deg, transparent 32deg 120deg, rgba(0,0,0,.35) 120deg 132deg, transparent 132deg 240deg, rgba(0,0,0,.35) 240deg 252deg, transparent 252deg);
}
.drive.running .reel.full { animation: spin 1.1s linear infinite; }
.drive.running .reel.full.b { animation-duration: .8s; animation-direction: reverse; }
.drive.running.seek .reel.full { animation-duration: .25s; }
@keyframes spin { to { transform: rotate(360deg); } }
.drive .vol { font: 500 11px "Plex Mono", monospace; color: #ffe9a8; min-height: 1.2em; }
.drive .lamp { width: 8px; height: 8px; border-radius: 50%; background: #3b2b2b; }
.drive.running .lamp { background: #ff5a3c; box-shadow: 0 0 6px #ff5a3c; }

/* disky, procesor, tiskárna */
.floorline { display: grid; grid-template-columns: 1.1fr 1.3fr 1.4fr; gap: 12px; margin-top: 14px; align-items: end; }
@media (max-width: 700px) { .floorline { grid-template-columns: 1fr 1fr; } .floorline .printer { grid-column: span 2; } .tapes { grid-template-columns: repeat(3, 1fr); } }
.cpu {
  background: linear-gradient(90deg, #2f3e4f, #4d6177 50%, #2f3e4f); padding: 10px; border-radius: 3px 3px 0 0; min-height: 150px;
  display: flex; flex-direction: column; gap: 8px;
}
.cpu .panel { background: #20282f; padding: 8px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.cpu .panel i { height: 7px; border-radius: 50%; background: #3a2a22; }
.cpu .panel i.on { background: #ffb347; box-shadow: 0 0 4px #ffb347; }
.load {
  align-self: flex-start; font: 700 13px "Plex Mono", monospace; color: #fff; background: #f2efe6; color: var(--ink);
  border: 3px solid #fff; outline: 3px solid var(--red); padding: 8px 12px; cursor: pointer; border-radius: 2px;
}
.load:disabled { outline-color: #777; cursor: default; opacity: .7; }
.disks { display: flex; gap: 6px; align-items: flex-end; }
.disk {
  flex: 1; background: linear-gradient(#56687c, #3a4a5c); border-radius: 3px 3px 0 0; position: relative;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 6px;
}
.disk::before { content: ""; width: 70%; height: 10px; border-radius: 50%; background: #9aa6b3; box-shadow: 0 2px 0 #2a3440; }
.disk.spin::after { content: ""; position: absolute; top: 4px; left: 20%; width: 60%; height: 14px; border-radius: 50%; border-top: 2px solid rgba(255,255,255,.6); animation: spin 0.4s linear infinite; }
.memory { background: #20282f; padding: 6px; }
.memory .bar { display: flex; height: 16px; gap: 2px; }
.memory .part { flex: 1; background: #2e3b47; position: relative; overflow: hidden; }
.memory .part .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #4fb06a; transition: width .6s; }
.memory .part.over .fill { background: var(--red); }
.memory .names { display: flex; gap: 2px; }
.memory .names span { flex: 1; font: 500 10px "Plex Mono", monospace; color: #cfd8e0; text-align: center; }

.printer { background: linear-gradient(#cfc8b6, #b1a992); border-radius: 4px 4px 0 0; padding: 8px; min-height: 120px; }
.printer .out {
  background: repeating-linear-gradient(to bottom, #e3f0de 0 36px, #fbfbf6 36px 72px);
  font: 9px/12px "Plex Mono", monospace; color: #333; height: 236px; overflow: hidden; padding: 4px 6px;
  white-space: pre; border-left: 6px dotted #bbb; border-right: 6px dotted #bbb; position: relative;
}
.printer .out .scroll { position: absolute; left: 6px; right: 6px; bottom: 4px; }

/* konzole — psací stroj */
.consolebox { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; margin-top: 14px; }
@media (max-width: 700px) { .consolebox { grid-template-columns: 1fr; } }
.typewriter { background: var(--beige); padding: 10px; border-radius: 4px; box-shadow: inset 0 -6px 0 var(--beige-dark); }
.sheet {
  background: #fbf9f2; height: 220px; overflow: hidden; position: relative;
  font: 14px/19px "Plex Mono", monospace; color: #22262a; padding: 0 10px;
  box-shadow: inset 0 12px 10px -8px rgba(0,0,0,.15);
}
.sheet .lines { position: absolute; left: 10px; right: 10px; bottom: 8px; white-space: pre-wrap; word-break: break-all; }
.sheet .caret { display: inline-block; width: 8px; height: 2px; background: #22262a; vertical-align: baseline; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.intray { background: #fffdf6; border: 1px solid var(--rule); padding: 10px; }
.intray h3 { margin: 0 0 6px; font-size: 14px; }
.ticket {
  display: block; width: 100%; text-align: left; margin: 6px 0; padding: 8px; cursor: pointer;
  background: #fff; border: 1px solid #bdb6a2; box-shadow: 2px 2px 0 #d9d2bf; font: 13px/1.35 "Plex Sans", sans-serif; color: var(--ink);
}
.ticket b { font-family: "Plex Mono", monospace; }
.ticket:disabled { opacity: .45; cursor: default; box-shadow: none; }
.rack { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rack button {
  width: 64px; aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 3px solid transparent;
  background: radial-gradient(circle, #ddd 0 10%, #333 11% 15%, #5a4a3a 16% 58%, #cfd4d8 59%);
  display: grid; place-items: end center; padding-bottom: 2px;
}
.rack button span { font: 600 10px "Plex Mono", monospace; background: #fff6c8; padding: 0 3px; }
.rack button[aria-pressed="true"] { border-color: #ffd34d; box-shadow: 0 0 0 3px var(--ink); }
.rack button:disabled { visibility: hidden; }
.rackwrap { margin-top: 12px; background: #fffdf6; border: 1px solid var(--rule); padding: 10px; }
.rackwrap h3 { margin: 0; font-size: 14px; }

.programmer {
  position: absolute; right: 14px; top: 14px; max-width: 330px; background: #fffdf6; border: 2px solid var(--ink);
  padding: 10px 12px; font-size: 14px; box-shadow: 4px 4px 0 rgba(0,0,0,.25); z-index: 5; display: none;
}
.programmer.show { display: block; animation: pop .3s ease-out; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- TERMINÁL ---------- */
.terminal {
  background: linear-gradient(#e2dccd, #c9c1ad); border-radius: 18px 18px 8px 8px; padding: 22px 22px 34px;
  box-shadow: 0 8px 0 #9d9480, 0 20px 30px rgba(0,0,0,.25); position: relative;
}
.terminal .badge { position: absolute; bottom: 9px; left: 26px; font: 700 12px "Plex Mono", monospace; color: #6d6552; letter-spacing: .1em; }
.crt {
  background: radial-gradient(ellipse at center, #07170c 0%, var(--glass) 70%, #000 100%);
  border-radius: 14px / 18px; padding: 3.2% 3.6%; position: relative; overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,.9), inset 0 0 0 6px #1a1a17;
  cursor: text; outline: none;
}
.crt:focus-visible { box-shadow: inset 0 0 40px rgba(0,0,0,.9), inset 0 0 0 6px #1a1a17, 0 0 0 3px #ffd34d; }
.crt::before { /* řádkování */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.28) 0 1px, transparent 1px 3px);
}
.crt::after { /* odlesk skla */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 30% 10%, rgba(255,255,255,.07), transparent 45%);
}
.screen {
  font-family: "IBM3270", monospace; color: var(--phosphor); white-space: pre; position: relative; z-index: 1;
  font-size: var(--cell, 14px); line-height: 1.18; letter-spacing: 0;
  text-shadow: 0 0 2px rgba(51,255,102,.9), 0 0 7px rgba(51,255,102,.35);
}
.screen .hi { color: var(--phosphor-hi); text-shadow: 0 0 3px rgba(184,255,208,.95), 0 0 9px rgba(51,255,102,.5); }
.screen .cur { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.screen.blinkoff .cur { text-decoration: none; }
.screen .oia { color: var(--phosphor-dim); }
.screen .oiarow { display: block; border-top: 1px solid rgba(51,255,102,.35); margin-top: 2px; }
.crt.flash { animation: flash .12s; }
@keyframes flash { 50% { filter: brightness(1.8); } }
.crt.off .screen { opacity: 0; }

.keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.keys button {
  font: 600 13px "Plex Mono", monospace; background: #efeadf; border: 1px solid #8f8672; border-bottom-width: 4px;
  padding: 9px 10px; border-radius: 4px; cursor: pointer; color: #2a2a26; min-width: 44px;
}
.keys button:active { border-bottom-width: 1px; transform: translateY(3px); }
.keys .enter { background: #d9d2bf; margin-left: auto; }
.keys .reset { color: var(--red); }
.hiddeninput { position: absolute; opacity: 0; width: 1px; height: 1px; left: -100px; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* mobil: úkoly nad scénou, aktuální rada přilepená dole na obrazovce */
@media (max-width: 900px) {
  .tasks { order: -1; position: static; }
  .tasks ol { font-size: 14px; }
  /* na dlouhé stránce jen když je kapitola se sálem na obrazovce */
  .tasks .explain { min-height: 0; }
  .in-konzole .tasks .explain {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; min-height: 0;
    padding: 10px 16px 14px; border-top: 2px solid var(--ink); box-shadow: 0 -6px 16px rgba(0,0,0,.15);
  }
}
