:root {
  --bg: #020b0c;
  --panel: rgba(0, 25, 28, 0.72);
  --cyan: #00f5ff;
  --green: #00ff9a;
  --muted: #7debf0;
  --warning: #ff4d4d;
  --text: #d8ffff;
}

html, body { margin: 0; padding: 0; background: var(--bg); }
* { box-sizing: border-box; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--green); }

/* --- keyframes --- */
@keyframes floatBot { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulseGlow { 0%,100% { filter: drop-shadow(0 0 12px rgba(0,245,255,.35)); } 50% { filter: drop-shadow(0 0 30px rgba(0,245,255,.6)); } }
@keyframes thruster { 0%,100% { opacity: .45; transform: translateX(-50%) scale(1); } 50% { opacity: .85; transform: translateX(-50%) scale(1.12); } }
@keyframes scanMove { from { transform: translateY(0); } to { transform: translateY(40px); } }
@keyframes gridDrift { 0% { transform: translate3d(0,0,0); opacity: .18; } 50% { opacity: .34; } 100% { transform: translate3d(0,44px,0); opacity: .18; } }
@keyframes statusBlink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes piPulse { 0%,100% { box-shadow: 0 0 16px rgba(0,245,255,.45); } 50% { box-shadow: 0 0 34px rgba(0,245,255,.9); } }
@keyframes hudSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes blinkDot { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes piScan { 0% { top: -30%; opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes panelReveal {
  from { opacity: 0; transform: translateY(12px); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glitch {
  0%, 92%, 100% { text-shadow: 0 0 18px rgba(0,245,255,.45); transform: translateX(0); }
  93% { text-shadow: -3px 0 rgba(255,77,77,.7), 3px 0 rgba(0,255,154,.7), 0 0 18px rgba(0,245,255,.45); transform: translateX(1px); }
  95% { text-shadow: 4px 0 rgba(0,245,255,.6), -4px 0 rgba(255,77,77,.5), 0 0 18px rgba(0,245,255,.45); transform: translateX(-2px); }
  97% { text-shadow: 0 0 18px rgba(0,245,255,.45); transform: translateX(0); }
}

/* --- status bar segmenty --- */
.bars i { display: block; width: 4px; height: 17px; background: var(--green); animation: statusBlink 1.8s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: .12s; }
.bars i:nth-child(3) { animation-delay: .24s; }
.bars i:nth-child(4) { animation-delay: .36s; }
.bars i:nth-child(5) { animation-delay: .48s; background: var(--cyan); }
.bars i:nth-child(6) { animation-delay: .6s; background: var(--cyan); }
.bars i:nth-child(7) { animation-delay: .72s; background: var(--cyan); }

/* --- moduly --- */
.module { opacity: .78; transition: transform .25s ease, opacity .25s ease; cursor: default; }
.module:hover { transform: translateY(-5px); opacity: 1; }

/* --- π tlačítko --- */
.pi-tooltip {
  padding: 4px 8px; background: rgba(0,25,28,.9); border: 1px solid rgba(0,245,255,.35);
  font-size: 9px; letter-spacing: .24em; color: var(--cyan); white-space: nowrap;
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.pi-dock:hover .pi-tooltip { opacity: 1; }

.pi-button {
  position: relative; width: clamp(26px, 2.4vw, 34px); height: clamp(26px, 2.4vw, 34px); padding: 0;
  border: 1px solid rgba(0,245,255,.4); border-radius: 50%; background: rgba(0,25,28,.6);
  cursor: pointer; display: grid; place-items: center; overflow: hidden; opacity: .8;
  transition: opacity .3s ease, transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.pi-button:hover, .pi-button:focus-visible {
  opacity: 1; transform: scale(1.12); border-color: rgba(0,245,255,.6);
  box-shadow: 0 0 22px rgba(0,245,255,.6); animation: piPulse 3s ease-in-out infinite;
}
.pi-ring { position: absolute; inset: 8%; border: 1px dashed rgba(0,245,255,.3); border-radius: 50%; }
.pi-button:hover .pi-ring { animation: hudSpin 6s linear infinite; }
.pi-scan {
  position: absolute; left: 0; right: 0; height: 34%; opacity: 0;
  background: linear-gradient(to bottom, rgba(0,245,255,0), rgba(0,245,255,.25), rgba(0,245,255,0));
}
.pi-button:hover .pi-scan { opacity: 1; animation: piScan 2.4s ease-in-out infinite; }

/* --- π overlay --- */
.pi-overlay {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: radial-gradient(circle at 70% 30%, rgba(0,245,255,.08), transparent 35%), rgba(0,8,10,.94);
  color: var(--text); font-family: 'IBM Plex Mono', 'Share Tech Mono', monospace;
  animation: toastIn .3s ease-out both;
}
.pi-overlay[hidden] { display: none; }
.pi-matrix { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; }
.pi-scanlines {
  position: absolute; inset: -40px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.03) 0px, rgba(255,255,255,.03) 1px, transparent 2px, transparent 5px);
  animation: scanMove 12s linear infinite;
}
.pi-backdrop { position: absolute; inset: 0; }

.pi-access-panel {
  position: absolute; right: clamp(16px, 8vw, 120px); top: 50%; transform: translateY(-50%);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: clamp(16px, 2.4vw, 26px); background: rgba(0,20,24,.88); border: 1px solid rgba(0,245,255,.65);
  box-shadow: 0 0 32px rgba(0,245,255,.16), inset 0 0 24px rgba(0,245,255,.06);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  display: flex; flex-direction: column; gap: 16px;
}
.pi-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(0,245,255,.25);
  font-size: 11px; letter-spacing: .28em; color: var(--cyan);
}
.pi-close {
  width: 28px; height: 28px; border: 1px solid rgba(0,245,255,.45); background: transparent;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.pi-close:hover { color: var(--cyan); border-color: var(--cyan); }

.pi-terminal-output { min-height: 132px; font-size: clamp(10px, 1.1vw, 12px); line-height: 1.9; color: var(--green); }
.pi-caret { display: inline-block; width: 8px; height: 13px; background: var(--green); vertical-align: -2px; animation: blinkDot 1s steps(1, end) infinite; }

.pi-password-form { display: flex; flex-direction: column; gap: 10px; animation: panelReveal .5s ease-out both; }
.pi-password-form[hidden] { display: none; }
.pi-password-form label { font-size: 10px; letter-spacing: .24em; color: var(--muted); }
.pi-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pi-row input {
  flex: 1 1 180px; min-width: 0; padding: 11px 12px; background: rgba(0,8,10,.8);
  border: 1px solid rgba(0,245,255,.55); box-shadow: 0 0 14px rgba(0,245,255,.18);
  color: var(--cyan); caret-color: var(--cyan); font-family: inherit; font-size: 13px; letter-spacing: .2em; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.pi-row input:focus { border-color: var(--cyan); box-shadow: 0 0 22px rgba(0,245,255,.4); }
.pi-row input.is-error { border-color: var(--warning); box-shadow: 0 0 18px rgba(255,77,77,.45); }
.pi-row button {
  padding: 11px 18px; background: rgba(0,245,255,.1); border: 1px solid var(--cyan); color: var(--cyan);
  font-family: inherit; font-size: 11px; letter-spacing: .24em; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pi-row button:hover { background: var(--cyan); color: #02181a; }

.pi-message { min-height: 34px; }
.pi-message .title { font-size: 11px; letter-spacing: .22em; color: var(--green); }
.pi-message.is-error .title { color: var(--warning); }
.pi-message .text { margin-top: 4px; font-size: 11px; line-height: 1.6; color: #a9f4f8; }
.pi-footer { display: flex; align-items: center; justify-content: space-between; font-size: 9px; letter-spacing: .2em; color: rgba(125,235,240,.55); }

@media (max-width: 768px) {
  .pi-dock { right: 14px; bottom: 16px; }
  .pi-access-panel { right: 16px; left: 16px; width: auto; }
}

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