/* HOLLYHOP - retro ovladaci panel v modernim provedeni
 *
 * Pevne ramecky, zkosene rohy (vlevo nahore a vpravo dole), barvy z loga.
 * Pismo: sablonove na kratke titulky, uzke bezpatkove na nadpisy,
 * citelne Barlow na text.
 */

:root {
  --bg: #121316;
  --panel: #1b1d21;
  --panel-2: #23262b;
  --well: #0e0f11;
  --line: #3a3e45;
  --line-strong: #565b64;
  --text: #ecebe6;
  --muted: #9a9ea6;

  --orange: #ee983a;
  --orange-deep: #c9761f;
  --red: #c3392b;
  --red-deep: #6a1717;
  --green: #3fae49;
  --green-deep: #24702b;
  --steel: #d5d5ce;

  --cut: 12px;
  --gap: 16px;

  --font-stencil: "Saira Stencil One", "Barlow Condensed", Impact, sans-serif;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* jemna mrizka jako na prednim panelu - jedina ozdoba */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(1200px 600px at 50% -10%, #1c1e23, var(--bg));
}

[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.stencil { font-family: var(--font-stencil); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; }
.head { font-family: var(--font-head); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- panel se zkosenymi rohy a pevnym rameckem ----------
 * Ramecek je pozadi samotneho prvku, vnitrek je ::before o 2 px mensi
 * se stejnym orezem - klasicky border by se v rozich useknul.
 */
.panel {
  --bd: var(--line);
  --fill: var(--panel);
  position: relative;
  isolation: isolate;
  background: var(--bd);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.panel::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  background: var(--fill);
  clip-path: polygon(calc(var(--cut) - 1px) 0, 100% 0, 100% calc(100% - var(--cut) + 1px), calc(100% - var(--cut) + 1px) 100%, 0 100%, 0 calc(var(--cut) - 1px));
}

/* ---------- logo ---------- */

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img.box { width: 44px; height: 44px; display: block; }
.brand img.word { height: 28px; width: auto; display: block; }

/* ---------- tlacitka jako hardwarove klavesy ---------- */

.btn {
  --k: var(--panel-2);
  --k-deep: #0b0c0e;
  --k-text: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 2px solid #050506;
  background: var(--k);
  color: var(--k-text);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: inset 0 -4px 0 var(--k-deep), inset 0 2px 0 rgba(255,255,255,.18);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--k-deep), inset 0 2px 0 rgba(255,255,255,.12); }
.btn:disabled { filter: grayscale(.5) brightness(.8); cursor: progress; }
.btn-go { --k: var(--green); --k-deep: var(--green-deep); --k-text: #06140a; }
.btn-stop { --k: var(--red); --k-deep: var(--red-deep); --k-text: #fff; }
.btn-accent { --k: var(--orange); --k-deep: var(--orange-deep); --k-text: #1a1206; }
.btn-ghost { --k: var(--panel-2); --k-deep: #0b0c0e; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- formulare ---------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .control { position: relative; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 2px solid var(--line);
  background: var(--well);
  color: var(--text);
  font-size: 16px;
  outline: none;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  transition: border-color .15s;
}
.field input:focus { border-color: var(--orange); }
.field.invalid input { border-color: var(--red); }
.field.invalid label { color: #ff8a7d; }
.field .toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: 8px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
}
.field .toggle-pass:hover { color: var(--orange); }

/* ukazatel sily hesla jako sloupec LED */
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: -4px 0 14px; }
.meter i { height: 6px; background: var(--well); border: 1px solid var(--line); transition: background .2s, border-color .2s; }
.meter i.on { background: var(--c); border-color: var(--c); box-shadow: 0 0 8px var(--c); }

/* ---------- LED ---------- */

.led {
  --c: var(--line-strong);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 -1px 2px rgba(0,0,0,.5);
  flex: none;
  transition: background .2s, box-shadow .2s;
}
.led.on { box-shadow: 0 0 10px var(--c), inset 0 1px 1px rgba(255,255,255,.4); }
.led.orange { --c: var(--orange); }
.led.green { --c: var(--green); }
.led.red { --c: var(--red); }

/* ---------- avatar (kulaty) ---------- */

.avatar {
  --size: 44px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  padding: 0;
  border: 2px solid var(--orange);
  background: var(--a, var(--orange));
  color: #15100a;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: calc(var(--size) * .4);
  letter-spacing: .02em;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* ---------- hlasky ---------- */

.toasts { position: fixed; z-index: 100; left: 50%; top: 16px; transform: translateX(-50%); display: grid; gap: 8px; width: min(calc(100% - 32px), 420px); }
.toast {
  --bd: var(--line-strong);
  --fill: #202328;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  animation: toast-in .25s ease;
}
.toast.err { --bd: var(--red); }
.toast.ok { --bd: var(--green); }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- orezavac fotky ---------- */

.cropper-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 6, 8, .78);
  animation: fade .15s ease;
}
.cropper { --fill: var(--panel); width: min(100%, 400px); padding: 22px; text-align: center; animation: rise .25s ease; }
.cropper h3 { margin: 0; font-family: var(--font-stencil); font-weight: 400; font-size: 24px; color: var(--orange); }
.cropper p { margin: 4px 0 16px; color: var(--muted); font-size: 14px; }
.crop-stage {
  --s: min(72vw, 300px);
  width: var(--s);
  height: var(--s);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--well);
  border: 2px solid var(--line);
  touch-action: none;
  cursor: grab;
  outline: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { border-color: var(--orange); }
.crop-stage canvas.src { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.crop-stage .mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(8, 8, 10, .68);
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}
.crop-stage .grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .2s;
  background:
    linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(238,152,58,.5) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(238,152,58,.5) 0 calc(66.66% + .5px), transparent 0),
    linear-gradient(0deg, transparent calc(33.33% - .5px), rgba(238,152,58,.5) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(238,152,58,.5) 0 calc(66.66% + .5px), transparent 0);
}
.crop-stage.dragging .grid { opacity: 1; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 18px 2px 6px; color: var(--muted); font-family: var(--font-head); font-weight: 700; }
.crop-zoom input[type=range] { flex: 1; accent-color: var(--orange); height: 28px; }
.crop-actions { display: flex; gap: 10px; margin-top: 14px; }
.crop-actions .btn { flex: 1; }
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
