:root {
  --bg: #05060a;
  --ink: #cfe6ea;
  --muted: #7d939c;
  --cyan: #59f2ff;
  --amber: #ffc24d;
  --panel: #0a1018;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(1200px 800px at 50% 40%, #0a1119 0%, #05060a 62%, #000 100%);
  color: var(--ink);
  font-family: "Cascadia Mono", "Consolas", "DejaVu Sans Mono", ui-monospace, monospace;
  overflow: hidden;
}

/* ------------------------------------------------------------ herní plocha */
#stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #000;
  outline: none;
  filter: saturate(1.05) contrast(1.02);
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.55) 100%);
}

#vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
  opacity: 0.25;
}

/* ---------------------------------------------------------------- tlačítka */
#toolbar {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

#toolbar button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(89, 242, 255, 0.25);
  background: rgba(6, 12, 18, 0.72);
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color .15s, background .15s;
}

#toolbar button:hover {
  border-color: var(--cyan);
  background: rgba(89, 242, 255, 0.12);
}

/* -------------------------------------------------------------- startovní overlay */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 9, 0.84);
  backdrop-filter: blur(6px);
  transition: opacity .6s ease;
}

#overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  width: min(760px, 94vw);
  text-align: center;
  animation: rise .7s ease-out both;
}

.frame {
  position: relative;
  padding: 40px 28px 26px;
  border: 1px solid rgba(89, 242, 255, 0.25);
  background: linear-gradient(180deg, rgba(10, 18, 26, 0.94), rgba(6, 9, 14, 0.94));
  box-shadow: 0 0 90px rgba(89, 242, 255, 0.08), inset 0 0 70px rgba(0, 0, 0, 0.65);
}

.frame::before,
.frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--cyan);
  opacity: .8;
}

.frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.frame::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.logo {
  margin: 0;
  font-size: clamp(30px, 6vw, 54px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(89, 242, 255, 0.55), 0 0 2px #fff;
}

.tagline {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

#startBtn,
#reloadBtn {
  display: block;
  margin: 26px auto 6px;
  padding: 14px 40px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--cyan);
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}

#startBtn:disabled {
  opacity: .4;
  cursor: progress;
}

#startBtn:not(:disabled):hover,
#reloadBtn:hover {
  background: var(--cyan);
  color: #031014;
  box-shadow: 0 0 34px rgba(89, 242, 255, 0.45);
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  max-width: 560px;
  margin: 24px auto 0;
  text-align: left;
  font-size: 13px;
  color: #a7bcc4;
}

.controls div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.controls span {
  width: 86px;
  flex: none;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64808a;
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 3px 7px;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
  color: var(--ink);
  background: rgba(89, 242, 255, 0.07);
  border: 1px solid rgba(89, 242, 255, 0.22);
  border-bottom-width: 2px;
  border-radius: 3px;
}

.status {
  min-height: 1.2em;
  margin: 20px 0 0;
  font-size: 12px;
  letter-spacing: .06em;
  color: #5d747d;
}

.hint {
  margin: 16px 0 0;
  font-size: 11px;
  color: #41545c;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .controls { grid-template-columns: 1fr; }
  .frame { padding: 30px 18px 20px; }
}
