/* Pub Kviz — pub-tabla: zelena čoja, ćilibar, neonski znak */
:root {
  --felt: #0e2620;
  --felt-2: #123329;
  --felt-3: #1a4234;
  --ink: #f2ead6;
  --ink-dim: #a9b8ad;
  --line: rgba(242, 234, 214, .14);
  --amber: #f4a81d;
  --amber-glow: #ffcf5a;
  --rose: #ff5d73;
  --ok: #5fd4a0;
  --display: Rockwell, "Roboto Slab", "Cooper Black", Georgia, serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.55 var(--body);
  background: var(--felt);
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0 0 .4em; letter-spacing: .005em; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: var(--amber-glow); }
.ic { flex: none; }
.muted { color: var(--ink-dim); }
.lead { color: var(--ink-dim); max-width: 60ch; }
:focus-visible { outline: 2px solid var(--amber-glow); outline-offset: 2px; }

/* Čoja: tekstura + vinjeta */
.felt {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(244, 168, 29, .10), transparent 55%),
    radial-gradient(90% 80% at 50% 110%, rgba(0, 0, 0, .55), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(var(--felt-2), var(--felt));
}

/* Neonski znak */
.sign {
  display: inline-flex; align-items: center; gap: 14px; padding: 12px 26px;
  border: 2px solid var(--amber); border-radius: 999px; color: var(--amber-glow);
  font-family: var(--display); font-size: 1.7rem; font-weight: 700; letter-spacing: .04em;
  box-shadow: 0 0 14px rgba(244, 168, 29, .55), inset 0 0 14px rgba(244, 168, 29, .25);
  text-shadow: 0 0 8px rgba(255, 207, 90, .9), 0 0 22px rgba(244, 168, 29, .7);
  animation: neon-on 1.6s steps(1, end) both;
}
.sign .ic { filter: drop-shadow(0 0 6px rgba(255, 207, 90, .9)); }
@keyframes neon-on {
  0%   { opacity: .08; box-shadow: none; text-shadow: none; }
  8%   { opacity: .9; }
  11%  { opacity: .1; }
  20%  { opacity: 1; }
  24%  { opacity: .2; }
  32%  { opacity: 1; }
  38%  { opacity: .45; }
  46%, 100% { opacity: 1; }
}

/* Dugmad */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: rgba(242, 234, 214, .07); color: var(--ink); font: 600 .95rem var(--body);
  text-decoration: none; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { background: rgba(242, 234, 214, .13); border-color: rgba(242, 234, 214, .3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, var(--amber-glow), var(--amber)); color: #2a1a00; border-color: transparent;
  box-shadow: 0 6px 20px -6px rgba(244, 168, 29, .7), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { box-shadow: 0 10px 28px -6px rgba(244, 168, 29, .9), inset 0 1px 0 rgba(255, 255, 255, .5); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--ink-dim); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(242, 234, 214, .1); color: var(--ink); }
.icon-btn.danger:hover { background: rgba(255, 93, 115, .16); color: var(--rose); }

/* Forme */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; position: relative; }
.field > span { font-size: .85rem; color: var(--ink-dim); font-weight: 600; }
.field small { color: var(--ink-dim); font-size: .8rem; }
input, select {
  width: 100%; padding: 12px 14px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: rgba(7, 20, 16, .55); color: var(--ink); font: 1rem var(--body);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(244, 168, 29, .22); }
select option { background: var(--felt-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--amber); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }
.meter { display: block; height: 4px; border-radius: 4px; background: rgba(242, 234, 214, .1); overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; background: var(--rose); transition: width .3s var(--ease), background .3s; }

/* Paneli */
.panel {
  background: linear-gradient(180deg, rgba(242, 234, 214, .075), rgba(242, 234, 214, .035));
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(6px);
}
.panel.flush { padding: 6px; }
.panel.narrow { max-width: 640px; }
.panel.empty { text-align: center; }
.center { text-align: center; }
.notice { padding: 12px 14px; border-radius: var(--r-s); background: rgba(95, 212, 160, .12); border: 1px solid rgba(95, 212, 160, .35); }
.notice.bad { background: rgba(255, 93, 115, .12); border-color: rgba(255, 93, 115, .4); }

/* Auth / installer */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.wizard { width: 100%; max-width: 640px; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 26px; gap: 8px; }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: .85rem; padding-bottom: 10px; border-bottom: 2px solid var(--line); transition: color .3s, border-color .3s; }
.steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-size: .78rem; }
.steps li.done { color: var(--ok); border-color: var(--ok); }
.steps li.on { color: var(--amber-glow); border-color: var(--amber); }
.steps li.on b { background: var(--amber); color: #2a1a00; border-color: var(--amber); }
.step { animation: step-in .45s var(--ease); }
.step[hidden] { display: none; }
@keyframes step-in { from { opacity: 0; transform: translateX(18px); } }
.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-s); background: rgba(7, 20, 16, .45); }
.checks li span { flex: 1; }
.checks li em { font-style: normal; color: var(--ink-dim); font-size: .85rem; }
.checks .ok .ic { color: var(--ok); }
.checks .bad .ic { color: var(--rose); }
.checks .warn .ic { color: var(--amber); }

/* Admin raspored */
.admin-body { display: grid; grid-template-columns: 264px 1fr; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px;
  background: rgba(5, 16, 13, .55); border-right: 1px solid var(--line); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--amber-glow); font: 700 1.25rem var(--display); padding: 6px 10px 22px; text-shadow: 0 0 12px rgba(244, 168, 29, .5); }
.sign-mark { display: inline-grid; place-items: center; }
.nav { display: grid; gap: 2px; align-content: start; flex: 1; overflow: auto; }
.nav a, .nav .soon { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: .95rem; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(242, 234, 214, .08); color: var(--ink); }
.nav a.on { background: rgba(244, 168, 29, .14); color: var(--amber-glow); }
.nav a.on::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.nav .soon { opacity: .5; cursor: default; }
.nav .soon em { margin-left: auto; font-style: normal; font-size: .7rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 99px; }
.side-foot { display: flex; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.me:hover, .me.on { background: rgba(242, 234, 214, .08); }
.me-text { display: grid; min-width: 0; line-height: 1.2; }
.me-text b, .me-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--ink-dim); }
.coaster {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  font: 700 .85rem var(--display); color: #2a1a00;
  background: radial-gradient(circle at 30% 25%, var(--amber-glow), var(--amber) 70%);
  box-shadow: 0 0 0 3px rgba(244, 168, 29, .25), 0 4px 10px rgba(0, 0, 0, .4);
}
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 22px 36px 0; }
.topbar h1 { margin: 0; font-size: 1.5rem; }
.menu-btn { display: none; }
.content { padding: 22px 36px 60px; display: grid; gap: 22px; max-width: 1100px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lead { margin: 0; }

/* Dashboard */
.hero { padding: 8px 0 4px; }
.display { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 0 0 8px; }
.scoreboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.score {
  display: grid; gap: 2px; padding: 20px; border-radius: var(--r-m); position: relative; overflow: hidden;
  background: #081a15; border: 1px solid var(--line); box-shadow: inset 0 0 0 4px #0b231c, inset 0 0 0 5px var(--line);
}
.score .count { font: 700 2.6rem/1 var(--display); color: var(--amber-glow); text-shadow: 0 0 14px rgba(244, 168, 29, .5); font-variant-numeric: tabular-nums; }
.score small { color: var(--ink-dim); }
.score-ic { position: absolute; right: 16px; top: 16px; color: rgba(242, 234, 214, .25); }
.road { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.road li { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); }
.road li.done { color: var(--ok); }

/* Tabela korisnika */
.table { display: grid; }
.row { display: grid; grid-template-columns: 40px 1fr auto 150px auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-s); transition: background .15s; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: rgba(242, 234, 214, .05); }
.row.off { opacity: .5; }
.who { display: grid; min-width: 0; line-height: 1.25; }
.who small { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { padding: 3px 12px; border-radius: 99px; font-size: .8rem; font-weight: 700; border: 1px solid var(--line); }
.tag.role-superadmin { color: var(--amber-glow); border-color: var(--amber); background: rgba(244, 168, 29, .12); }
.tag.role-voditelj { color: var(--ok); border-color: rgba(95, 212, 160, .5); }
.tag.role-urednik { color: #9ec9ff; border-color: rgba(158, 201, 255, .5); }
.row-actions { display: flex; gap: 2px; }
.row-actions form { margin: 0; }
.seen { font-size: .85rem; }

/* Toast */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 14px 16px; border-radius: var(--r-m);
  background: #08150f; border: 1px solid var(--line); border-left: 4px solid var(--amber); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .7);
  animation: toast-in .45s var(--ease); transition: opacity .3s, transform .3s;
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--rose); }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* Modal potvrde */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); animation: fade .2s; padding: 16px; }
.modal .panel { max-width: 420px; background: #0b231c; animation: pop .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }

.scrim { display: none; }

@media (max-width: 900px) {
  .admin-body { display: block; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); background: #07170f; }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .55); }
  .menu-btn { display: inline-grid; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .row { grid-template-columns: 40px 1fr auto; }
  .row .seen, .row .tag { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
