:root {
  --bg: #0b1622;
  --surface: #132437;
  --surface-2: #1b3049;
  --line: #24405f;
  --text: #eaf1f8;
  --muted: #9db2c8;
  --accent: #2f8fd6;
  --danger: #ff8080;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- Login */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  gap: 16px;
}

.card h1 { margin: 0; font-size: 1.4rem; }
.hint { margin: -8px 0 4px; color: var(--muted); font-size: .9rem; }
.error {
  margin: 0;
  color: var(--danger);
  background: rgba(255, 128, 128, .1);
  border: 1px solid rgba(255, 128, 128, .3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .9rem;
}

label { display: grid; gap: 6px; font-size: .85rem; color: var(--muted); }

input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  padding: 11px 12px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button[type="submit"] {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px;
}

button[type="submit"]:hover { filter: brightness(1.08); }

/* --------------------------------------------------------------- Layout */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; letter-spacing: .01em; }

.bar form { margin: 0; }

.link {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  padding: 4px;
}

.link:hover { color: var(--text); text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

/* --------------------------------------------------------------- Kacheln */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition: transform .15s ease, border-color .15s ease;
}

.tile:hover { transform: translateY(-3px); border-color: var(--accent); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(11, 22, 34, .62);
  border: 2px solid rgba(255, 255, 255, .85);
}

.play::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(3px);
}

.tile:hover .play { background: var(--accent); }

.meta { padding: 14px 16px 18px; }
.meta h2 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.meta p { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }

.empty { color: var(--muted); }
.empty code { background: var(--surface); padding: 2px 6px; border-radius: 5px; }

/* ---------------------------------------------------------------- Player */

.back { color: var(--muted); font-size: .9rem; }
.back:hover { color: var(--text); }
.player-title { margin: 12px 0 4px; font-size: 1.35rem; }
.player-desc { margin: 0 0 16px; color: var(--muted); }

video {
  width: 100%;
  margin-top: 12px;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

@media (max-width: 600px) {
  .wrap { padding: 20px 14px 48px; }
  .bar { padding: 12px 14px; }
  .grid { gap: 16px; }
}
