* { box-sizing: border-box; }

:root {
  --bg: #0d1014;
  --card: #1a2230;
  --line: #2c394d;
  --text: #e9effa;
  --muted: #9bb0d0;
  --accent: #2a9df4;
  --accent2: #0f7ed1;
}

html, body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(1000px 420px at 10% -10%, #1f2a3b 0%, var(--bg) 60%);
  color: var(--text);
}

.navbar {
  height: 58px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(11, 15, 22, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand { font-weight: 800; letter-spacing: 0.2px; }
.nav-sub { color: var(--muted); font-size: 13px; }
.admin-link { color: var(--muted); text-decoration: none; }

.container { width: min(980px, 95vw); margin: 0 auto; padding: 18px 0 40px; }
.hero { margin: 12px 0 16px; }
.hero h1 { margin: 0; font-size: clamp(26px, 4.2vw, 42px); }
.hero p { color: var(--muted); margin: 8px 0 0; }

.card {
  background: linear-gradient(180deg, rgba(30,40,56,0.42), rgba(24,33,47,0.66));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}

.drop-zone {
  border: 2px dashed #3e526f;
  border-radius: 12px;
  padding: 26px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s ease;
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--accent); background: rgba(42,157,244,0.08); }
.drop-title { font-size: 20px; font-weight: 700; }
.drop-sub { color: var(--muted); margin-top: 6px; font-size: 13px; }

.selected-list { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sel-item { padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #131a24; }
.sel-item img { width: 100%; aspect-ratio: 1.3; object-fit: cover; border-radius: 8px; }
.no-preview {
  width: 100%;
  aspect-ratio: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed #3f5575;
  color: var(--muted);
  font-size: 12px;
}
.sel-name { font-size: 12px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.block { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(10, 14, 20, 0.5); }
.block label { display: block; margin-bottom: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: #182232; border: 1px solid #3b4b62; color: var(--text); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
.chip.active { border-color: var(--accent); background: rgba(42,157,244,0.22); }

.input { width: 100%; background: #0f1622; border: 1px solid #364763; color: var(--text); border-radius: 9px; padding: 9px; }
input[type="color"] {
  width: 100%;
  height: 46px;
  padding: 4px 6px;
  border: 2px solid #364763;
  border-radius: 9px;
  background: #0f1622;
  cursor: pointer;
  display: block;
}
input[type="color"]:hover { border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { margin-top: 6px; color: var(--muted); font-size: 12px; }

.actions { margin-top: 14px; display: flex; justify-content: center; }
.btn { border: none; border-radius: 11px; padding: 12px 20px; font-size: 16px; font-weight: 700; color: white; background: linear-gradient(135deg, var(--accent), var(--accent2)); cursor: pointer; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: linear-gradient(135deg, #1f9f58, #15803d); text-decoration: none; }

.progress-label { font-weight: 600; }
.bar { margin-top: 8px; height: 10px; background: #101723; border-radius: 999px; overflow: hidden; }
#bar-fill { height: 100%; width: 100%; }
#bar-fill.loading {
  background: linear-gradient(90deg, #1d9bf0, #10b981, #1d9bf0);
  background-size: 200% 100%;
  animation: indeterminate 1.2s linear infinite;
}
@keyframes indeterminate { from { background-position: 0 0; } to { background-position: 200% 0; } }
.bar-text { margin-top: 6px; color: var(--muted); }

.results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.results-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.result-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #101722; }
.thumb-wrap { position: relative; overflow: visible; height: 140px; display: flex; align-items: center; justify-content: center; background: #0a0f17; }
.thumb-wrap img { max-width: 100%; max-height: 100%; transition: transform 0.24s ease; transform-origin: center center; cursor: zoom-in; }
@media (hover: hover) and (pointer: fine) {
  .thumb-wrap:hover img { transform: scale(1.7); z-index: 3; position: relative; box-shadow: 0 14px 36px rgba(0,0,0,0.48); }
}
.result-meta { padding: 8px; font-size: 12px; color: var(--muted); }
.result-actions { padding: 0 8px 10px; display: flex; gap: 8px; }
.result-actions a { display: inline-block; font-size: 12px; color: #9bd0ff; text-decoration: none; }
.mini-btn { font-size: 12px; border: 1px solid #4b5f7d; background: #122033; color: #dceafe; border-radius: 8px; padding: 4px 8px; cursor: pointer; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid #2a3b52; font-size: 12px; text-align: left; padding: 8px; white-space: nowrap; }

.viewer { position: fixed; inset: 0; z-index: 30; }
.viewer-bg { position: absolute; inset: 0; background: rgba(3, 8, 14, 0.88); }
.viewer-panel { position: absolute; inset: 8% 5%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.viewer-panel img { max-width: 100%; max-height: 100%; object-fit: contain; transform: scale(1); transition: transform 0.2s ease; }
.viewer-actions { margin-top: 10px; display: flex; gap: 8px; }
.small-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #44607e; color: white; background: rgba(8, 15, 24, 0.8); font-size: 20px; }
.hidden { display: none !important; }

.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 28, 44, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
  z-index: 100;
  font-size: 14px;
  flex-wrap: wrap;
}
.cookie-btn { padding: 8px 20px; font-size: 14px; }

@media (max-width: 780px) { .settings-grid { grid-template-columns: 1fr; } }
