:root {
  --bg: #12100e;
  --bg-2: #1a1613;
  --surface: #201b16;
  --surface-2: #29221b;
  --paper: #e9dfc8;
  --paper-2: #ddd0b3;
  --ink: #17120c;
  --border: #3a3025;
  --text: #efe6d4;
  --muted: #a2937a;
  --faint: #6b5f4c;
  --red: #e5342a;
  --red-deep: #b3241c;
  --amber: #e0a53c;
  --gold: #e8b447;
  --silver: #cdd2d8;
  --bronze: #d0894f;
  --radius: 6px;
  --radius-lg: 10px;
  --maxw: 1080px;
  --ease: cubic-bezier(.16,1,.3,1);
}
* , *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: Oswald, system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  font-weight: 400;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
h1,h2,h3 { line-height: 1; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.right { text-align: right; }

/* grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .nav, .footer, .admin-panel, .tape, .modal { position: relative; z-index: 2; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 4px;
  font-family: 'Anton', sans-serif; font-size: 1.25rem; letter-spacing: 1px;
  color: var(--paper); background: var(--red);
  border: 2px solid var(--paper); box-shadow: 3px 3px 0 rgba(0,0,0,.4);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: 'Special Elite', monospace; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.brand-name strong { font-family: 'Anton', sans-serif; font-size: 1.15rem; letter-spacing: .02em; color: var(--text); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; transition: color .2s; }
.nav-links a:hover { color: var(--red); }
.nav-cta {
  padding: .5rem 1.1rem; border-radius: 3px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em; font-family: Oswald, sans-serif; font-size: .9rem;
  transition: all .2s;
}
.nav-cta:hover { border-color: var(--red); color: var(--red); }

/* POLICE TAPE */
.tape { overflow: hidden; white-space: nowrap; border-block: 2px solid rgba(0,0,0,.5); }
.tape span {
  display: inline-block; padding: .35rem 0; font-family: 'Anton', sans-serif;
  text-transform: uppercase; letter-spacing: .25em; font-size: .85rem;
  animation: slide 40s linear infinite; will-change: transform;
}
.tape-red { background: var(--red); }
.tape-red span { color: #1a0605; }
.tape-yellow { background: var(--amber); }
.tape-yellow span { color: #241a04; }
@keyframes slide { to { transform: translateX(-50%); } }

/* HERO */
.hero { padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 5vw, 3.5rem); }
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.hero-poster {
  position: relative; background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 8px 8px 0 rgba(0,0,0,.45);
  padding: clamp(1.6rem, 4vw, 2.6rem); text-align: center; overflow: hidden;
  background-image: radial-gradient(circle at 50% 0, rgba(0,0,0,.06), transparent 60%);
}
.poster-top { display: block; font-family: 'Special Elite', monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .2em; color: var(--red-deep); }
.hero-poster h1 {
  font-family: 'Anton', sans-serif; font-size: clamp(3.4rem, 15vw, 9rem);
  letter-spacing: .02em; margin: .3rem 0; color: var(--ink);
  text-shadow: 2px 2px 0 var(--red);
}
.poster-sub { display: block; font-family: 'Special Elite', monospace; font-size: clamp(.9rem, 2.5vw, 1.15rem); color: var(--ink); }
.poster-sub strong { color: var(--red-deep); }
.stamp {
  position: absolute; top: 1rem; right: .5rem; rotate: 12deg;
  font-family: 'Anton', sans-serif; text-transform: uppercase; letter-spacing: .05em; line-height: .95;
  font-size: clamp(.75rem, 2vw, 1rem); color: var(--red); border: 3px double var(--red);
  padding: .3rem .6rem; opacity: .82; text-align: center;
}
.lead { max-width: 620px; margin: 1.6rem 0 0; color: var(--muted); font-size: clamp(1.02rem, 2.2vw, 1.18rem); }

.search { display: flex; gap: .6rem; margin: 1.8rem 0 0; max-width: 500px; }
.search input { flex: 1; }
input {
  width: 100%; padding: .8rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit;
}
input::placeholder { color: var(--faint); }
input:focus { outline: 2px solid color-mix(in srgb, var(--red) 40%, transparent); border-color: var(--red); }
.search-result {
  margin-top: 1rem; max-width: 500px; padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--red);
  display: flex; align-items: center; gap: 1rem;
}
.search-result img { width: 46px; height: 46px; border-radius: 4px; border: 1px solid var(--border); }
.search-result .sr-pts { margin-left: auto; font-family: 'Anton', sans-serif; font-size: 1.9rem; color: var(--red); }

.hero-live { display: flex; align-items: center; gap: .6rem; margin-top: 1.6rem; color: var(--muted); font-size: .95rem; font-family: 'Special Elite', monospace; }
.hero-live strong { color: var(--text); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--red); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3.5); opacity: 0; } }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .78rem 1.3rem; border-radius: var(--radius); font-weight: 700; font-size: .92rem; cursor: pointer; border: 1px solid transparent; transition: all .2s var(--ease); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; font-family: Oswald, sans-serif; }
.btn-primary { background: var(--red); color: var(--paper); box-shadow: 3px 3px 0 rgba(0,0,0,.4); }
.btn-primary:hover { background: var(--red-deep); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: .4rem .6rem; font-size: .82rem; box-shadow: none; letter-spacing: .02em; }
.btn-danger { background: color-mix(in srgb, var(--red) 18%, var(--surface)); color: #ff8f84; border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 30%, var(--surface)); }

/* SECTIONS */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2.5rem); }
.section-head { max-width: 640px; margin-bottom: 2rem; }
.eyebrow {
  display: inline-block; color: var(--paper); background: var(--red);
  font-family: 'Special Elite', monospace; font-weight: 400; text-transform: uppercase; letter-spacing: .12em;
  font-size: .72rem; margin-bottom: .8rem; padding: .25rem .7rem; rotate: -1deg;
}
.section h2 { font-family: 'Anton', sans-serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; }
.section-sub { color: var(--muted); margin-top: .8rem; }

/* PODIUM — mugshots */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: end; }
.pod {
  position: relative; background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.4);
  padding: 1.2rem 1rem 1.3rem; text-align: center;
}
.pod-banner {
  font-family: 'Anton', sans-serif; text-transform: uppercase; letter-spacing: .05em;
  background: var(--ink); color: var(--paper); font-size: .82rem; padding: .3rem; margin: -1.2rem -1rem 1rem; letter-spacing: .08em;
}
.pod-1 .pod-banner { background: var(--red); }
.mug {
  width: 120px; height: 120px; margin: 0 auto; position: relative; padding: 6px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 23px, rgba(0,0,0,.18) 23px 24px),
    var(--paper-2);
  border: 1px solid var(--ink);
}
.mug img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.pod-1 { transform: translateY(-16px); border-color: var(--red); }
.pname { font-family: 'Anton', sans-serif; font-size: 1.3rem; text-transform: uppercase; margin-top: .7rem; word-break: break-word; letter-spacing: .01em; }
.case { font-family: 'Special Elite', monospace; font-size: .72rem; color: var(--red-deep); letter-spacing: .1em; }
.ppts { font-family: 'Anton', sans-serif; font-size: 2.1rem; color: var(--red); line-height: 1; margin-top: .4rem; }
.ppts span { font-family: 'Special Elite', monospace; font-size: .7rem; color: var(--ink); display: block; letter-spacing: .1em; }

/* TABLE — dossier */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); box-shadow: 6px 6px 0 rgba(0,0,0,.4); background: var(--paper); }
.rank-table { width: 100%; border-collapse: collapse; min-width: 480px; color: var(--ink); }
.rank-table th { text-align: left; padding: .9rem 1.2rem; font-family: 'Special Elite', monospace; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--paper); background: var(--ink); }
.rank-table th.right { text-align: right; }
.rank-table td { padding: .75rem 1.2rem; border-bottom: 1px solid rgba(23,18,12,.15); vertical-align: middle; }
.rank-table tbody tr:nth-child(even) { background: rgba(23,18,12,.045); }
.rank-table tbody tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover { background: color-mix(in srgb, var(--red) 10%, transparent); }
.rk { font-family: 'Anton', sans-serif; font-size: 1.35rem; color: var(--muted); width: 46px; color: var(--red-deep); }
.rk-1, .rk-2, .rk-3 { color: var(--red); }
.player { display: flex; align-items: center; gap: .75rem; }
.player img { width: 36px; height: 36px; border-radius: 3px; flex: 0 0 auto; border: 1px solid var(--ink); filter: grayscale(1) contrast(1.05); background: var(--paper-2); }
.player strong { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 1.05rem; letter-spacing: .01em; }
.pts { font-family: 'Anton', sans-serif; font-size: 1.5rem; color: var(--red-deep); }
.tw { color: var(--faint); font-size: .9rem; font-family: 'Special Elite', monospace; }
.admin-table, .admin-table .rank-table { }

/* CARDS — folders */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.card { padding: 1.8rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.folder {
  position: relative; background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(0,0,0,.35); padding-top: 2.4rem;
}
.card-tab {
  position: absolute; top: -2px; left: -2px; background: var(--red); color: var(--paper);
  font-family: 'Anton', sans-serif; font-size: 1rem; padding: .25rem .7rem; letter-spacing: .05em;
}
.folder h3 { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 1.4rem; text-transform: uppercase; margin-bottom: .5rem; }
.folder p { color: #4b3f2f; margin: .4rem 0; font-size: .95rem; }
.folder .muted { color: #6b5b45; }
.cmd { display: inline-block; font-family: 'Special Elite', monospace; background: var(--ink); border: 1px solid var(--ink); color: var(--amber); padding: .5rem .8rem; border-radius: 3px; font-size: .95rem; margin: .3rem 0; }
.folder code { font-family: 'Special Elite', monospace; background: rgba(23,18,12,.1); border: 1px solid rgba(23,18,12,.25); border-radius: 3px; padding: .1rem .4rem; font-size: .85em; color: var(--red-deep); }
code { font-family: 'Special Elite', monospace; color: var(--amber); }

/* FOOTER */
.footer { border-top: 2px solid var(--border); margin-top: 1rem; padding: 2.5rem clamp(1rem, 4vw, 2.5rem); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.tiny { color: var(--faint); font-size: .82rem; margin: 0; font-family: 'Special Elite', monospace; }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.modal-box { position: relative; width: min(410px, 100%); padding: 2rem; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 10px 10px 0 rgba(0,0,0,.5); }
.modal-box h3 { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 1.7rem; text-transform: uppercase; }
.modal-box .muted { color: #6b5b45; }
.modal-x { position: absolute; top: .8rem; right: .8rem; background: none; border: 0; color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.stamp-sm { position: absolute; top: 1rem; right: 2.6rem; font-size: .8rem; }
.stack { display: grid; gap: 1rem; margin-top: 1.2rem; }
.field { display: grid; gap: .4rem; }
label { font-family: 'Special Elite', monospace; font-size: .82rem; font-weight: 400; color: var(--red-deep); text-transform: uppercase; letter-spacing: .05em; }
.modal-box input { background: #fff; border: 1px solid var(--ink); color: var(--ink); }
.modal-box input:focus { outline: 2px solid color-mix(in srgb, var(--red) 40%, transparent); }
.form-error { color: var(--red-deep); font-weight: 600; font-size: .9rem; margin: 0; }

/* ADMIN PANEL */
.admin-panel { border-top: 3px solid var(--red); background: var(--bg-2); }
.admin-inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.admin-head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.admin-add { margin-bottom: 1.5rem; background: var(--surface); border: 1px solid var(--border); }
.admin-add h3 { font-family: 'Anton', sans-serif; font-weight: 400; text-transform: uppercase; font-size: 1.2rem; margin-bottom: 1rem; }
.add-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.add-row input { flex: 1; min-width: 130px; }
.add-row input[type=number] { max-width: 110px; flex: 0 0 auto; }
.admin-table td .adj { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.adj input { width: 66px; padding: .4rem .5rem; text-align: center; background: #fff; border: 1px solid var(--ink); color: var(--ink); }

/* TOAST */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 200; padding: .8rem 1.4rem; background: var(--red); color: var(--paper); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-family: Oswald, sans-serif; transition: all .3s var(--ease); pointer-events: none; border: 2px solid var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--ink); color: #ff8f84; }

@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; }
  .pod-1 { transform: none; order: -1; }
  .admin-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, .tape span { animation: none !important; transition: none !important; } }
