@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/orbitron-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Share Tech Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/share-tech-mono-latin.woff2") format("woff2");
}

:root {
  /* Theme: High-Energy Electric (charcoal black + electric lime) */
  --bg: #121417;
  --panel: #1e2227;
  --panel-2: #272c33;
  --text: #ffffff;
  --muted: #9aa3ad;
  --accent: #a3ff12;
  --on-accent: #101307;
  --danger: #ff4d4d;
  --ok: #3ddc84;
  --border: #363c45;
  --radius: 10px;
  --font-display: "Orbitron", "Arial Black", sans-serif;
  --font-body: "Share Tech Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .brand {
  font-family: var(--font-display);
  letter-spacing: .5px;
}

button, input, select, textarea {
  font-family: inherit;
}

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

/* Offline toast */
.toast {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: #f59e0b;
  color: #1f1300;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  max-width: 92vw;
  text-align: center;
  transition: transform .25s ease;
}

.toast.show { transform: translate(-50%, 0); }

.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer a { color: var(--accent); text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 14px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-size: clamp(15px, 2.5vw, 20px); font-weight: 700; letter-spacing: .3px; }
.brand span { color: var(--accent); }

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
}
.topbar nav a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: clamp(13px, 1.6vw, 15px);
}
.topbar nav a:hover { color: var(--text); }

.topbar nav a.nav-login {
  background: var(--accent);
  color: var(--on-accent);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.topbar nav a.nav-login:hover { color: var(--on-accent); filter: brightness(1.1); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px clamp(12px, 3vw, 32px) 60px;
  width: 100%;
}

.date-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.pill:hover { color: var(--text); border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }

.page-title { font-size: 20px; font-weight: 600; margin: 6px 0 18px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(10px, 1.5vw, 18px);
}

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}

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

.tile-images { display: grid; grid-template-columns: 1fr; }
.tile-images.has-result { grid-template-columns: 1fr 1fr; }

.tile-figure { margin: 0; position: relative; }
.tile-figure img { width: 100%; height: clamp(200px, 22vw, 320px); object-fit: contain; background: #000; display: block; }

.tile-figure figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 70px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty h1 { color: var(--text); }

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

/* Ad slots (Adsterra banners — in-flow only, never over screenshots, never modal ads) */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: clamp(26px, 4vw, 44px) auto;
  max-width: 760px;
  width: 100%;
}

.ad-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}

.ad-frame {
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Disclaimer / prose pages */
.prose {
  max-width: 760px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 34px;
}

.prose h1 { margin-top: 0; font-size: 26px; }
.prose h2 { font-size: 17px; margin: 26px 0 8px; color: var(--accent); }
.prose p { line-height: 1.65; color: var(--text); font-size: 15px; }
.prose .lead { font-size: 16px; color: var(--muted); }
.prose .note { color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 26px; }

/* Lightbox — z-index above any floating ad so screenshots always stay clear */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, .96);
  z-index: 2147483000;
  flex-direction: column;
}

.lightbox.open { display: flex; }

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 60px 20px 44px;
  overflow: auto;
}

.lb-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 48%;
  cursor: zoom-in;
}

.lb-item img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 6px;
  background: #000;
}

.lb-item figcaption { color: var(--muted); font-size: 13px; }

.lightbox.zoomed .lb-item { display: none; }
.lightbox.zoomed .lb-item.zoomed { display: flex; max-width: 100%; cursor: zoom-out; }
.lightbox.zoomed .lb-item.zoomed img { max-height: 86vh; max-width: 96vw; }

.lightbox-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* Auth */
.auth-card {
  max-width: 380px;
  margin: 60px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
}

.auth-card h1 { margin: 0 0 20px; font-size: 22px; }

/* The card's primary action spans the whole form so it reads as a proper
   sign-in button instead of a default, content-sized browser button. */
.auth-card .btn { width: 100%; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

input:focus, select:focus { outline: none; border-color: var(--accent); }

.btn {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: 13px; margin-top: 0; }

.error {
  background: rgba(239, 68, 68, .12);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.note { color: var(--muted); font-size: 14px; margin-top: 14px; }

/* Dashboard */
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.dash-head h1 { margin: 0; font-size: 24px; }
.dash-head .btn { margin-top: 0; }

.dash-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.backfill-calendar { margin-top: 10px; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 10px 0;
}

.flash.success { background: rgba(34, 197, 94, .12); border: 1px solid var(--ok); color: #86efac; }
.flash.error { background: rgba(239, 68, 68, .12); border: 1px solid var(--danger); color: #fca5a5; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.dash-grid .panel { margin-bottom: 0; }
.panel h2 { margin: 0 0 6px; font-size: 16px; }

.preview-wrap {
  margin-top: 10px;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-wrap img { max-width: 100%; max-height: 220px; display: none; }
.preview-wrap img.visible { display: block; }

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 14px;
  margin-top: 14px;
}

.manage-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.manage-item img { width: 100%; height: 150px; object-fit: contain; background: #000; }

.manage-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  font-size: 13px;
}

.manage-meta .muted, .muted { color: var(--muted); font-size: 12px; }
.manage-item form { padding: 0 12px 12px; }

/* Calendar date picker — sits directly beside the Latest pill, never detaches */
.calendar {
  position: relative;
}

.calendar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.calendar-toggle .cal-icon { flex: none; }

.calendar-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 288px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

.calendar-pop.align-right { left: auto; right: 0; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .5px;
}

.cal-nav {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { opacity: .3; cursor: default; }

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0;
}

.cal-day,
.cal-pad {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 13px;
  position: relative;
}

.cal-pad { visibility: hidden; }

.cal-day.disabled {
  color: var(--muted);
  opacity: .3;
}

.cal-day.has {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.cal-day.has:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.cal-day.available::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day.available:hover::after { background: var(--on-accent); }

.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }

.cal-day.selected,
.cal-day.selected.has {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.cal-day.selected::after,
.cal-day.selected.available::after { background: var(--on-accent); }

.cal-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* --- Small screens (phones) --- */
@media (max-width: 640px) {
  .tile-images.has-result { grid-template-columns: 1fr; }
  .lightbox-stage { flex-direction: column; padding-top: 54px; }
  .lb-item { max-width: 94%; }
  .lb-item img { max-height: 58vh; }
  .topbar { padding: 12px 14px; }
  .date-bar { gap: 6px; }
  .pill { padding: 6px 11px; font-size: 12px; }
  .page-title { font-size: 17px; margin-bottom: 14px; }
  .prose { padding: 22px 18px; }
  .prose h1 { font-size: 21px; }
  .auth-card { margin: 30px auto; padding: 24px 20px; }
  .empty { padding: 46px 14px; }
  .panel { padding: 16px; }
  .dash-head h1 { font-size: 19px; }
  .toast { font-size: 13px; padding: 9px 12px; }
  .lightbox-hint { font-size: 11px; }
  .calendar-pop { padding: 12px; width: 270px; }
  .cal-weekdays span, .cal-day { font-size: 12px; }
  .ad-slot { margin: 22px auto; }
  .ad-frame { min-height: 60px; }
}

/* --- Tablets and small laptops --- */
@media (min-width: 641px) and (max-width: 1024px) {
  .tile-figure img { height: clamp(200px, 30vw, 280px); }
}

/* --- Large desktop screens --- */
@media (min-width: 1440px) {
  .container { max-width: 1440px; }
  .page-title { font-size: 24px; }
}

@media (min-width: 1920px) {
  .container { max-width: 1600px; }
}
