/* Dizajn preuzet sa storefronta HKK Ljubuški (staging, assets/css/main.css) */
:root {
  --bg-void: #070707;
  --bg: #0C0C0C;
  --bg-elevated: #111111;
  --surface: #151515;
  --surface-2: #1B1B1B;
  --surface-3: #222222;
  --surface-card: #131313;
  --field: #0E0E0E;
  --text: #F5F5F5;
  --muted: #9E9E9E;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --gold: #E0C37E;
  --gold-hover: #EBD4A0;
  --gold-pressed: #C9AB6A;
  --gold-muted: rgba(224, 195, 126, 0.12);
  --gold-border: rgba(224, 195, 126, 0.35);
  --gold-glow: rgba(224, 195, 126, 0.28);
  --red: #E02127;
  --blue: #1B4C9C;
  --radius: 2px;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Tomorrow', -apple-system, monospace, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg-void); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: .95rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.04; margin: 0 0 .5rem;
}
.muted { color: var(--muted); }
.kicker {
  font-family: var(--font-display); color: var(--gold); font-weight: 400;
  letter-spacing: .14em; text-transform: uppercase; font-size: .72rem;
}
.kicker::before { content: '[ '; }
.kicker::after { content: ' ]'; }

/* Šahovnica kao na webshopu */
.bg-checkers {
  background-color: #0B0B0B;
  background-image:
    linear-gradient(45deg, #121212 25%, transparent 25%, transparent 75%, #121212 75%),
    linear-gradient(45deg, #121212 25%, transparent 25%, transparent 75%, #121212 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

/* ---------- zaglavlje ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 12, 12, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  width: min(1220px, 100% - 2.5rem); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 0;
}
.header-accent-line { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-border), transparent); opacity: .6; }
.checker-strip { height: 24px; border-bottom: 1px solid var(--border); opacity: .8; }
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; }
.brand:hover { color: inherit; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.wordmark {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1;
}
.brand-sub {
  display: block; margin-top: .3rem; font-weight: 500; font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- gumbi ---------- */

.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .78rem 1.45rem;
  font-family: var(--font-body); font-weight: 700; font-size: .84rem;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: all .22s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--gold); transform: translateY(-2px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #070707; }
.btn.primary::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -120%; width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  transition: transform .55s var(--ease);
}
.btn.primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: #070707; box-shadow: 0 4px 22px -2px var(--gold-glow); }
.btn.primary:hover::before { transform: translateX(400%); }
.btn.primary:active { background: var(--gold-pressed); border-color: var(--gold-pressed); transform: scale(.985); box-shadow: none; }
.btn.outline { background: rgba(255, 255, 255, .02); color: var(--gold); border-color: var(--gold-border); }
.btn.outline:hover { background: var(--gold-muted); border-color: var(--gold); color: var(--gold-hover); }
.btn.danger { background: rgba(224, 33, 39, .15); color: #ff6b6e; border-color: rgba(224, 33, 39, .3); }
.btn.danger:hover { color: #fff; border-color: var(--red); background: rgba(224, 33, 39, .3); }
.btn.small { padding: .45rem .85rem; font-size: .78rem; }

.badge {
  display: inline-flex; align-items: center; padding: .25rem .6rem; border-radius: var(--radius);
  font-family: var(--font-display); font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  background: rgba(224, 195, 126, .08); color: var(--gold); border: 1px solid var(--gold-border);
}

/* ---------- javni prikaz ---------- */

.display {
  width: min(1720px, 100% - 2.5rem); margin-inline: auto;
  display: flex; flex-direction: column;
  padding: clamp(20px, 3vw, 48px) 0;
  gap: clamp(16px, 2vw, 32px);
}
.display-page .brand img { width: clamp(44px, 4vw, 80px); height: auto; }
.display-page .wordmark { font-size: clamp(1.35rem, 2vw, 2.4rem); }
.display-page .brand-sub { font-size: clamp(.68rem, .9vw, 1rem); }
.display-head { text-align: center; }
.display-head .kicker { font-size: clamp(.8rem, 1.3vw, 1.5rem); }
.display h1 { margin: .3em 0 0; font-size: clamp(2.3rem, 4.4vw, 5rem); }
.display .meta { color: var(--muted); font-size: clamp(14px, 1.3vw, 24px); margin-top: .5em; }

.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: clamp(10px, 1.2vw, 20px);
  align-content: start;
}
.prize {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(14px, 1.3vw, 24px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.prize .num {
  width: 2.3em; height: 2.3em;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 800; color: var(--muted);
  font-size: clamp(14px, 1.2vw, 22px);
}
.prize .name { font-weight: 600; font-size: clamp(16px, 1.45vw, 28px); line-height: 1.2; letter-spacing: -.01em; }
.prize .sponsor { color: var(--muted); font-size: clamp(12px, .95vw, 18px); margin-top: 2px; }
.prize .ticket {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; font-size: clamp(22px, 2.3vw, 44px);
  color: var(--surface-3); min-width: 3ch; text-align: right;
}
.prize.won { border-color: var(--gold-border); box-shadow: 0 0 20px -4px rgba(224, 195, 126, .15); }
.prize.won .num { background: var(--gold); border-color: var(--gold); color: #070707; }
.prize.won .ticket { color: var(--gold); }

.empty { text-align: center; color: var(--muted); font-size: clamp(18px, 2vw, 32px); margin: 8vh auto; }

.reveal {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(ellipse at center, rgba(224, 195, 126, .10), transparent 60%),
    rgba(7, 7, 7, .96);
  display: grid; place-items: center; text-align: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.reveal.show { opacity: 1; pointer-events: auto; }
.reveal .kicker { font-size: clamp(16px, 2vw, 36px); }
.reveal .prize-name {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  font-size: clamp(28px, 4.6vw, 84px); line-height: 1.05; margin: .35em 0 .4em;
}
.reveal .big-ticket {
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(80px, 20vw, 360px); color: var(--gold); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 60px var(--gold-glow);
  animation: pop .7s var(--ease);
}
.reveal .hint { color: var(--muted); font-size: clamp(14px, 1.5vw, 26px); margin-top: .8em; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fs-btn {
  position: fixed; right: 12px; bottom: 12px; z-index: 60;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; cursor: pointer; opacity: .5;
  font-family: var(--font-display); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
}
.fs-btn:hover { opacity: 1; color: var(--gold); border-color: var(--gold-border); }
:fullscreen .fs-btn { display: none; }

/* ---------- admin ---------- */

.admin { width: min(960px, 100% - 2rem); margin: 1.5rem auto 3rem; }
.admin header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.admin h2 { font-size: 1.05rem; margin: 0 0 .9rem; }
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 180px; min-width: 0; }
label.field {
  display: flex; flex-direction: column; gap: .35rem;
  font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: uppercase;
}
input, select {
  background: var(--field); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .78rem .95rem; width: 100%; font-size: .92rem;
  text-transform: none; letter-spacing: normal; font-weight: 400;
}
input::placeholder { color: #7C7C7C; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-muted); }

.match-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.match-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: .8rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  transition: border-color .22s var(--ease);
}
.match-list li:hover { border-color: var(--border-strong); }
.match-list li.selected { border-color: var(--gold-border); box-shadow: inset 2px 0 0 var(--gold); }

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

.prize-table { width: 100%; border-collapse: collapse; }
.prize-table td { padding: .6rem .4rem; border-top: 1px solid var(--border); vertical-align: middle; }
.prize-table td.n { width: 2.5em; color: var(--muted); font-family: var(--font-display); font-weight: 700; }
.prize-table td.t { width: 9em; }
.prize-table td.a { width: 1%; white-space: nowrap; text-align: right; }
.prize-table td.a .btn { margin-left: .25rem; }
.prize-table tr.won td.t input {
  border-color: var(--gold-border); color: var(--gold);
  font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums;
}
.prize-table .pname { font-weight: 600; }
.prize-table .psponsor { font-size: .82rem; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200;
  background: var(--bg-elevated); border: 1px solid var(--gold-border); color: var(--text);
  padding: .7rem 1.1rem; border-radius: var(--radius);
  box-shadow: 0 14px 36px -8px rgba(0, 0, 0, .8); max-width: calc(100% - 32px);
}
.toast.error { border-color: rgba(224, 33, 39, .5); color: #ff6b6e; }

.login { width: min(400px, 100% - 2rem); margin: 10vh auto; }
.login form { display: grid; gap: 1rem; }

@media (max-width: 600px) {
  .prize-table tr { display: grid; grid-template-columns: 1fr 8em; border-top: 1px solid var(--border); padding: .4rem 0; }
  .prize-table td { border-top: 0; width: auto !important; }
  .prize-table td.n { display: none; }
  .prize-table td.a { grid-column: 1 / -1; text-align: left; padding-top: 0; }
  .prize-table td.a .btn { margin: 0 .25rem 0 0; }
  .wordmark { font-size: 1.05rem; }
}

/* ---------- podnožje ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
  font-size: .78rem; color: var(--muted);
}
.site-footer a {
  font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); transition: color .22s var(--ease);
}
.site-footer a strong { font-weight: 700; color: var(--text); }
.site-footer a:hover, .site-footer a:hover strong { color: var(--gold); }
/* Podnožje je uvijek na dnu ekrana, i kad je sadržaj kratak */
body { min-height: 100vh; display: flex; flex-direction: column; }
.site-footer { flex-shrink: 0; margin-top: auto; }
/* Na ekranu u dvorani podnožje je stalno vidljivo na dnu, i kad je nagrada puno */
.display-page .display { padding-bottom: 4.5rem; }
.display-page .site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  border-top: 1px solid var(--border);
  padding: .7rem 1rem;
  background: rgba(7, 7, 7, .92); backdrop-filter: blur(8px);
  font-size: clamp(.78rem, .9vw, 1rem);
}
.display-page .fs-btn { bottom: 52px; }
