:root {
  /* Very transparent glass */
  --glass: rgba(0, 0, 0, 0.18);
  --glass-2: rgba(0, 0, 0, 0.14);
  --glass-3: rgba(0, 0, 0, 0.22);
  --text: #f4f6ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;

  /* Normal brightness background */
  background: url("background.png") center / cover no-repeat fixed;
  background-color: #0b0e14;

  padding: 88px 24px 24px;
}

/* No dark overlay */
body::before { content: none; }

/* Top horizontal header */
.top-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.top-menu summary {
  display: none;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--glass-3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  font-weight: 700;
}

.top-menu summary::-webkit-details-marker {
  display: none;
}

.top-menu-list {
  width: 100%;
  background: var(--glass-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  padding: 10px 16px;
}

.top-menu-mainrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.top-menu-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.top-menu-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.top-menu-links a {
  display: inline-block;
  padding: 8px 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
}

.top-menu-links a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.top-menu-submenu {
  position: relative;
  padding-bottom: 6px;
}

.top-menu-submenu-list {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(11, 14, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  gap: 2px;
}

.top-menu-submenu-list a {
  display: block;
}

.top-menu-submenu:hover .top-menu-submenu-list,
.top-menu-submenu:focus-within .top-menu-submenu-list {
  display: grid;
}

.top-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-drag-handle {
  flex: 0 0 auto;
  width: 24px;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  opacity: 0.75;
}

.top-menu-item.dragging {
  opacity: 0.55;
}

.top-menu-item a {
  flex: 1 1 auto;
}

.top-menu-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.menu-private-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 6px;
  opacity: 0.8;
}

.top-menu-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-menu-edit-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-weight: 700;
}

.top-menu-edit-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

.top-menu-user {
  font-size: 0.82rem;
  line-height: 1.3;
  color: rgba(244, 246, 255, 0.85);
  margin: 0;
  word-break: break-all;
}

.top-menu-auth-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: #0f1320;
  background: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 700;
}

.top-menu-auth-btn:hover {
  background: #ffffff;
}

.menu-editor {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: none;
  gap: 8px;
}

.top-menu .menu-drag-handle,
.top-menu .top-menu-item-actions {
  display: none;
}

body.admin-menu-editing .top-menu-links[data-admin-sortable="1"] {
  display: grid;
  gap: 6px;
  justify-content: stretch;
  width: min(760px, 100%);
}

body.admin-menu-editing .top-menu-item {
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

body.admin-menu-editing .top-menu .menu-drag-handle {
  display: block;
}

body.admin-menu-editing .top-menu .top-menu-item-actions {
  display: flex;
}

body.admin-menu-editing .menu-editor {
  display: grid;
}

@media (max-width: 820px) {
  body {
    padding: 24px;
  }

  .top-menu {
    top: 16px;
    right: 16px;
    left: auto;
  }

  .top-menu summary {
    display: block;
  }

  .top-menu[open] summary {
    margin-bottom: 8px;
  }

  .top-menu-list {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 88px);
    border-radius: 10px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px;
  }

  .top-menu-mainrow {
    display: grid;
    gap: 8px;
  }

  .top-menu-right {
    display: grid;
    gap: 8px;
  }

  body.admin-menu-editing .top-menu-links[data-admin-sortable="1"] {
    width: 100%;
  }

  .top-menu-links {
    display: grid;
    gap: 4px;
    justify-content: stretch;
  }

  .top-menu-links a {
    display: block;
    padding: 10px 12px;
  }

  .top-menu-submenu-list {
    position: static;
    margin-top: 4px;
    min-width: 0;
  }

  .top-menu-auth {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: block;
  }

  .top-menu-auth-btn {
    display: block;
    width: 100%;
  }

  .top-menu:not([open]) .top-menu-list {
    display: none;
  }
}

.menu-editor h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.menu-flash {
  margin: 0;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.82rem;
}

.menu-flash.ok {
  background: rgba(96, 221, 164, 0.2);
  border: 1px solid rgba(96, 221, 164, 0.45);
}

.menu-flash.error {
  background: rgba(255, 122, 122, 0.2);
  border: 1px solid rgba(255, 122, 122, 0.5);
}

.menu-editor-row,
.menu-editor-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.menu-editor-add {
  justify-content: flex-end;
}

.menu-item-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.menu-item-meta strong {
  font-size: 0.9rem;
  line-height: 1.15;
}

.menu-item-url {
  font-size: 0.74rem;
  opacity: 0.86;
  word-break: break-all;
}

.menu-toggle-form,
.menu-edit-form,
.menu-delete-form {
  display: flex;
  align-items: center;
}

.menu-editor-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.top-menu-item button,
.menu-editor-row button,
.menu-editor-add button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.top-menu-item button:hover,
.menu-editor-row button:hover,
.menu-editor-add button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.top-menu-item button.danger,
.menu-editor-row button.danger {
  background: rgba(196, 61, 61, 0.28);
  border-color: rgba(255, 158, 158, 0.4);
}

.top-menu-item button.danger:hover,
.menu-editor-row button.danger:hover {
  background: rgba(196, 61, 61, 0.4);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.24);
  transition: 0.2s;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  top: 2px;
  background-color: #f7fbff;
  transition: 0.2s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: rgba(96, 221, 164, 0.45);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* Page stack */
.page {
  z-index: 1;
  display: grid;
  gap: 16px;
  justify-items: center;
}

/* ===== Header Card ===== */
.header-card {
  width: min(520px, 92vw);
  padding: 14px 18px;
  border-radius: 14px;

  background: var(--glass-3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  text-align: center;
}

.header-card h3 {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.4px;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  text-shadow: 0 4px 14px rgba(0,0,0,0.7);
}

/* ===== Main Container (HUG CONTENT) ===== */
.hero {
  padding: 24px;
  border-radius: 18px;

  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.35);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  width: fit-content;
  max-width: 100%;

  display: grid;
  justify-items: center;
}

/* Grid that holds the posters */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* On medium screens, use two columns */
@media (max-width: 1240px) {
  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* On narrow screens, stack vertically */
@media (max-width: 820px) {
  .poster-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Poster Link/Card ===== */
.card-link {
  text-decoration: none;
}

.promo-card {
  position: relative;

  /* Poster size */
  width: min(360px, 85vw);
  height: min(640px, 75vh);

  border-radius: 22px;
  overflow: hidden;

  box-shadow: 0 25px 70px rgba(0,0,0,0.85);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.promo-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 35px 90px rgba(0,0,0,0.95);
}

/* Image stays fully opaque */
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer badge */
.footer {
  z-index: 1;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  display: grid;
  place-items: center;
}

.footer small {
  padding: 8px 12px;
  border-radius: 999px;

  background: var(--glass-2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(244, 246, 255, 0.9);

  backdrop-filter: blur(6px);
}
