/* ============================================================
   TGA Predictions — sistem vizual: noapte de gală gaming
   Graphite + aur, tipografie editorială, lumină cinematică.
   ============================================================ */

:root {
  /* Graphite */
  --g-950: #101114;
  --g-900: #15161a;
  --g-850: #191b20;
  --g-800: #1e2026;
  --g-700: #262931;
  --g-600: #323641;
  --g-500: #454a57;

  /* Aur */
  --gold: #d9b45b;
  --gold-bright: #eccb74;
  --gold-deep: #a8853c;
  --gold-soft: rgba(217, 180, 91, 0.14);
  --gold-line: rgba(217, 180, 91, 0.32);

  /* Cerneală */
  --ink: #edeae2;
  --ink-muted: #a49e93;
  --ink-faint: #757066;

  /* Stări */
  --ok: #93b87c;
  --err: #e08a72;
  --warn: #d9b45b;

  /* Tipografie */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spațiere (scală) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.45);
  --ease: cubic-bezier(.25,.6,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1250px 560px at 82% -12%, rgba(217,180,91,.16), transparent 62%),
    radial-gradient(1400px 520px at 50% 112%, rgba(217,180,91,.22), transparent 60%),
    radial-gradient(760px 430px at 104% 40%, rgba(168,133,60,.11), transparent 60%),
    radial-gradient(1150px 560px at -12% 108%, rgba(217,180,91,.26), transparent 58%),
    linear-gradient(180deg, #14151b 0%, var(--g-950) 45%),
    var(--g-950);
  min-height: 100vh;
}

/* Textură gold-stage subtilă, fixă, pe toate paginile (ComfyUI, vezi assets/comfyui). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/img/texture-gold-stage.webp') center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: .55;
  pointer-events: none;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 var(--s-4); }
a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Navigare ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(16, 17, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(217,180,91,.16);
}
.nav {
  max-width: 1180px; margin: 0 auto; padding: var(--s-3) var(--s-5);
  display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  color: var(--ink); letter-spacing: .02em;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.nav-links { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--ink-muted); font-size: .95rem; font-weight: 500;
  padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--gold-soft); text-decoration: none; }
.nav-links a.active { color: var(--gold-bright); background: var(--gold-soft); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem; color: var(--g-950);
  border: 1px solid rgba(255,255,255,.18); flex: none;
}
.avatar.gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep)); }
.avatar.ember { background: linear-gradient(135deg, #e08a72, #a8543c); }
.avatar.steel { background: linear-gradient(135deg, #9fb4c7, #5d7186); }
.avatar.jade { background: linear-gradient(135deg, #93b87c, #55744a); }
.avatar.rose { background: linear-gradient(135deg, #d9a0b4, #96536b); }
.avatar.violet { background: linear-gradient(135deg, #a99bd1, #6a5c96); }

/* ---------- Structură pagini ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: var(--s-7) var(--s-5) var(--s-9); }
.page-head { margin-bottom: var(--s-6); }
.page-head .kicker {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: var(--s-2);
}
.page-head p.lede { color: var(--ink-muted); max-width: 60ch; margin-top: var(--s-3); }

/* ---------- Butoane ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1c1810;
  box-shadow: 0 4px 18px rgba(217,180,91,.28);
}
.btn-primary:hover { box-shadow: 0 6px 26px rgba(217,180,91,.42); transform: translateY(-1px); }
.btn-ghost { border-color: var(--gold-line); color: var(--gold-bright); background: transparent; }
.btn-ghost:hover { background: var(--gold-soft); }
.btn-quiet { color: var(--ink-muted); background: transparent; border-color: var(--g-600); }
.btn-quiet:hover { color: var(--ink); border-color: var(--g-500); }
.btn-danger { color: var(--err); border-color: rgba(224,138,114,.4); background: transparent; }
.btn-danger:hover { background: rgba(224,138,114,.1); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Carduri și secțiuni ---------- */
.card {
  background: linear-gradient(180deg, var(--g-850), var(--g-900));
  border: 1px solid var(--g-700);
  border-radius: var(--radius);
  padding: var(--s-5);
  box-shadow: var(--shadow-card);
}
.card-gold { border-color: var(--gold-line); }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4);
  margin: var(--s-7) 0 var(--s-4);
}
.section-title h2 { font-size: 1.45rem; }
.section-title .hint { color: var(--ink-faint); font-size: .9rem; }

/* ---------- Badge / stări ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--gold-line); color: var(--gold-bright);
  background: var(--gold-soft);
}
.badge-neutral { border-color: var(--g-600); color: var(--ink-muted); background: var(--g-800); }
.badge-ok { border-color: rgba(147,184,124,.45); color: var(--ok); background: rgba(147,184,124,.1); }

/* Flash */
.flash {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-4) var(--s-5); border-radius: var(--radius);
  margin-bottom: var(--s-5); border: 1px solid;
  animation: flash-in .25s var(--ease);
}
.flash-success { border-color: rgba(147,184,124,.5); background: rgba(147,184,124,.09); color: #c6ddb4; }
.flash-error { border-color: rgba(224,138,114,.5); background: rgba(224,138,114,.09); color: #ecb9a8; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: 999px; background: var(--g-700); overflow: hidden; }
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  border-radius: 999px; transition: width .4s var(--ease);
}

/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s-5);
  align-items: start;
}

/* ---------- Clasament ---------- */
.leader-table { width: 100%; border-collapse: collapse; }
.leader-table th, .leader-table td {
  text-align: left; padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--g-700);
}
.leader-table th {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-faint); font-weight: 600;
}
.leader-table tr:last-child td { border-bottom: none; }
.leader-table tr.me td { background: var(--gold-soft); }
.rank-num { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); width: 2.5ch; }
.score-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Coperte nominalizări (administrare) ---------- */
.nominee-cover {
  width: 56px; height: 74px; border-radius: 6px; flex: none; object-fit: cover;
  border: 1px solid var(--g-600); background: var(--g-800);
}
.cover-fallback-sm {
  width: 56px; height: 74px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--g-700), var(--g-900));
  border: 1px solid var(--g-600); color: var(--gold); font-family: var(--font-display);
}

.save-status { font-size: .9rem; color: var(--ink-faint); }
.save-status.ok { color: var(--ok); }
.save-status.err { color: var(--err); }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: var(--s-2); }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  font: inherit; color: var(--ink);
  background: var(--g-850); border: 1px solid var(--g-600); border-radius: var(--radius-sm);
  padding: 10px 14px; width: 100%; max-width: 420px;
  transition: border-color .15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.field { margin-bottom: var(--s-4); }
.form-inline { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; }
.auth-brand { text-align: center; margin-bottom: var(--s-5); }
.auth-brand .kicker { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.auth-brand h1 { font-size: 1.7rem; margin-top: var(--s-2); }

/* Tabel administrare */
.admin-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-wrap { overflow-x: auto; }
.table-wrap .admin-table, .table-wrap .leader-table { min-width: 620px; }
.winner-select { max-width: 320px; }
input[type="checkbox"] { accent-color: var(--gold-bright); width: 18px; height: 18px; }
.admin-table th, .admin-table td { padding: var(--s-3); border-bottom: 1px solid var(--g-700); text-align: left; vertical-align: middle; }
.admin-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }
.admin-table code { background: var(--g-800); padding: 2px 8px; border-radius: 6px; font-size: .85rem; color: var(--gold-bright); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s-4); }

/* Statistici distribuție */
.dist-row { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); font-size: .92rem; }
.dist-row .dist-name { width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-row .bar { flex: 1; height: 8px; background: var(--g-700); border-radius: 999px; overflow: hidden; }
.dist-row .bar > span { display: block; height: 100%; background: var(--gold-deep); border-radius: 999px; }
.dist-row .n { width: 3ch; text-align: right; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--g-700); margin-top: var(--s-8);
  color: var(--ink-faint); font-size: .85rem;
}
.site-footer .page { padding-top: var(--s-5); padding-bottom: var(--s-5); display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .nav { padding: var(--s-3) var(--s-4); gap: var(--s-3); }
  .nav-links { order: 3; width: 100%; }
  .page { padding: var(--s-5) var(--s-4) var(--s-8); }
  .winner-select { width: 100%; max-width: none; }
  .form-inline .field { flex: 1 1 100%; }
  .form-inline .btn { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Toolbar /predictions: progres + taburi de grup ---------- */
.vote-toolbar {
  position: sticky; top: var(--s-2); z-index: 40;
  display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5);
  align-items: center; justify-content: space-between;
  margin: var(--s-4) 0;
  padding: var(--s-3) var(--s-4);
  background: rgba(16, 17, 20, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--g-700);
  border-radius: 14px;
}

/* ---------- Mișcare redusă ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
