* {
  box-sizing: border-box;
}

:root {
  --bg: #0a0d0d;
  --window: rgba(5, 7, 9, 0.92);
  --panel: rgba(15, 19, 20, 0.95);
  --panel-2: rgba(22, 27, 28, 0.97);
  --line: #303a3a;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f2f0e8;
  --soft: #d9d5ca;
  --muted: #aaa498;
  --dim: #777267;
  --gold: #d6b25d;
  --red: #d56464;
  --green: #8fc985;
  --blue: #82adc5;
  --font: Tahoma, Verdana, Arial, sans-serif;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  background: var(--bg);
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(rgba(8, 10, 10, 0.74), rgba(4, 5, 6, 0.94)),
    url("../InteractiveMap/map.jpg") center / cover fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.48), transparent 28%, rgba(0, 0, 0, 0.38)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 5px);
  opacity: 0.82;
}

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

a:hover {
  color: #ffffff;
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

button,
.open-video {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(214, 178, 93, 0.35);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(38, 36, 27, 0.96), rgba(13, 13, 10, 0.98));
  color: #f3d47b;
  font-weight: 800;
  cursor: pointer;
  text-shadow: 0 1px 0 #000;
}

button:hover,
.open-video:hover {
  border-color: rgba(214, 178, 93, 0.7);
  color: #fff1bd;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(214, 178, 93, 0.86);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid rgba(214, 178, 93, 0.23);
  background: rgba(11, 13, 13, 0.96);
  backdrop-filter: blur(10px);
}

.topbar,
.shell {
  padding-inline: max(12px, calc((100vw - 1180px) / 2));
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 178, 93, 0.62);
  border-radius: 4px;
  background: #0c0e0d;
  color: var(--gold);
  font-weight: 900;
}

.brand strong,
.brand em {
  display: block;
  font-style: normal;
}

.brand strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.1;
}

.brand em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav {
  display: flex;
  gap: 7px;
}

.nav a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: #191c1b;
  color: var(--soft);
  font-weight: 800;
}

.nav a:hover {
  border-color: rgba(214, 178, 93, 0.52);
  background: #202420;
  text-decoration: none;
}

.shell {
  padding-top: 14px;
  padding-bottom: 28px;
}

.hero {
  min-height: 142px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 16px;
  border: 1px solid rgba(214, 178, 93, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(13, 16, 15, 0.96), rgba(13, 16, 15, 0.76)),
    url("../InteractiveMap/map.jpg") center 42% / cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.label {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(214, 178, 93, 0.38);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.24);
  color: #f0d99c;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.hero p {
  margin-top: 8px;
  color: var(--soft);
  font-size: 14px;
}

.summary {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(8, 10, 10, 0.86);
  overflow: hidden;
}

.summary div {
  min-height: 64px;
  display: grid;
  align-content: center;
  padding: 8px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.summary div:last-child {
  border-right: 0;
}

.summary strong {
  color: #ffffff;
  font-size: 19px;
  line-height: 1;
}

.summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 70%),
    var(--panel);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(120px, 160px) minmax(150px, 190px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 10px;
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #354141;
  border-radius: 3px;
  background: rgba(5, 7, 8, 0.9);
  color: #ffffff;
  padding: 0 9px;
}

input::placeholder {
  color: #837e73;
}

.status-line {
  min-height: 29px;
  display: flex;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  margin-top: 10px;
  padding: 18px;
}

.empty-state h2 {
  color: #ffffff;
  font-size: 17px;
}

.empty-state p {
  margin-top: 6px;
  color: var(--soft);
  line-height: 1.5;
}

code {
  color: #f3d47b;
  font-family: Consolas, "Courier New", monospace;
}

.video-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.video-card {
  display: grid;
  grid-template-columns: 186px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 70%),
    var(--panel);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 104px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: #090b0b;
}

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

.play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(213, 100, 100, 0.5);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.74);
  color: #ffd1d1;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.video-main {
  min-width: 0;
  display: grid;
  align-content: start;
}

.video-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.channel {
  color: #f0d99c;
  font-weight: 900;
}

.type-badge {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(213, 100, 100, 0.48);
  border-radius: 3px;
  background: rgba(75, 16, 16, 0.24);
  color: #ffd1d1;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.type-badge.video {
  border-color: rgba(130, 173, 197, 0.5);
  background: rgba(25, 56, 73, 0.24);
  color: #d8edf7;
}

.video-main h2 {
  margin-top: 5px;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.25;
}

.description {
  display: -webkit-box;
  margin-top: 5px;
  color: var(--soft);
  line-height: 1.45;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.copy-id,
.copy-command {
  border-color: rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(31, 37, 38, 0.96), rgba(9, 11, 12, 0.98));
  color: var(--soft);
}

.is-hidden {
  display: none;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  #refreshButton {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .topbar,
  .shell {
    padding-inline: 10px;
  }

  .summary,
  .controls {
    grid-template-columns: 1fr;
  }

  .summary div {
    min-height: 48px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .summary div:last-child {
    border-bottom: 0;
  }

  .video-card {
    grid-template-columns: 1fr;
  }

  .thumb {
    min-height: 0;
  }

  .video-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
