:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --gold: #d4af37;
  --gold-bright: #f0cb5b;
  --danger: #e5484d;
  --radius: 10px;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--gold); color: #000; padding: .5rem 1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }
.gold { color: var(--gold); }
.muted { color: var(--muted); margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.25rem; border-radius: 6px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; font-size: .95rem;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #0a0a0a; }
.btn-gold:hover:not(:disabled) { background: var(--gold-bright); }
.btn-outline { border-color: var(--gold); color: var(--gold); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--gold); color: #0a0a0a; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 10, 10, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); }
.brand img { border-radius: 8px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.admin-badge {
  font-family: var(--font-display); font-size: .75rem; letter-spacing: .12em;
  color: var(--gold); border: 1px solid var(--gold); padding: .15rem .5rem; border-radius: 4px;
}

/* Hero */
.hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 70% at 75% 50%, rgba(212, 175, 55, .16), transparent 70%),
    linear-gradient(180deg, #0a0a0a, #0f0f0f);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: repeating-linear-gradient(135deg, rgba(212, 175, 55, .06) 0 2px, transparent 2px 22px);
}
.hero-inner {
  position: relative; display: flex; flex-direction: column-reverse; align-items: center;
  gap: 1.5rem; padding-block: 3rem 3.5rem; text-align: center;
}
.hero-logo { width: min(260px, 70vw); height: auto; filter: drop-shadow(0 0 40px rgba(212, 175, 55, .25)); }
.eyebrow {
  margin: 0 0 .5rem; color: var(--gold); font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: .2em; font-size: .85rem; font-weight: 500;
}
.hero-title {
  margin: 0 0 1rem; font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1; letter-spacing: .01em;
}
.hero-lead { margin: 0 auto 1.75rem; max-width: 34rem; color: var(--muted); font-size: 1.1rem; }

@media (min-width: 860px) {
  .hero-inner { flex-direction: row; justify-content: space-between; text-align: left; padding-block: 5rem; }
  .hero-lead { margin-left: 0; }
  .hero-logo { width: 380px; }
}

/* Notice */
.notice {
  margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, .5); background: rgba(212, 175, 55, .08); color: var(--text);
}
.notice code { color: var(--gold-bright); font-size: .9em; }

/* Admin panel */
.admin-panel {
  margin-top: 2rem; padding: 1.25rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--gold); background: linear-gradient(90deg, rgba(212, 175, 55, .12), transparent);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.admin-title { margin: 0; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; font-size: 1.4rem; }

/* Roster */
.roster { padding-block: 3rem 4rem; }
.roster-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: 1.25rem; }
.section-title {
  margin: 0; font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: .04em;
}
.section-title::after { content: ""; display: block; width: 56px; height: 3px; background: var(--gold); margin-top: .4rem; }

.filters { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1.75rem; }
@media (min-width: 860px) { .filters { flex-direction: row; align-items: center; justify-content: space-between; } }
.filters .input { max-width: 320px; }
.role-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; font-size: .875rem; font-weight: 500;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { background: var(--gold); border-color: var(--gold); color: #0a0a0a; }

.input {
  width: 100%; padding: .7rem .85rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
}
.input::placeholder { color: #6b6b6b; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .2); }
textarea.input { resize: vertical; min-height: 6rem; }
input[type="file"].input { padding: .5rem; }

.player-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.player-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.player-card:hover, .player-card:focus-within {
  transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 10px 30px rgba(212, 175, 55, .12);
}
.card-open {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.card-media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 10, 10, .95));
}
.card-number {
  position: absolute; top: .6rem; right: .75rem; z-index: 1;
  font-family: var(--font-display); font-weight: 700; font-size: 2.25rem; line-height: 1;
  color: rgba(240, 203, 91, .9); text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}
.card-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 1rem; }
.card-role {
  display: inline-block; margin-bottom: .35rem; padding: .1rem .5rem; border-radius: 4px;
  background: var(--gold); color: #0a0a0a; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.card-ign { margin: 0; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; text-transform: uppercase; letter-spacing: .03em; color: var(--text); }
.card-real { margin: .15rem 0 0; color: var(--muted); font-size: .875rem; }
.card-admin { display: flex; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--border); }
.card-admin .btn { flex: 1; }

.photo-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #262626, #121212);
}
.photo-fallback img { width: 55%; height: auto; opacity: .25; filter: grayscale(1); object-fit: contain; }

.skeleton { aspect-ratio: 4 / 5; border-radius: var(--radius); background: linear-gradient(90deg, #151515, #1e1e1e, #151515); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.load-more-wrap { display: flex; justify-content: center; margin-top: 2rem; }

/* Dialogs */
.dialog {
  width: min(440px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 0;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.dialog-wide { width: min(820px, calc(100% - 2rem)); }
.dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
.dialog-close {
  position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; border: 1px solid var(--border); background: rgba(10, 10, 10, .7);
  color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.dialog-close:hover { border-color: var(--gold); color: var(--gold); }
.dialog-title { margin: 0 0 .5rem; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; font-size: 1.6rem; }

.form { display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .field-full { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: .35rem; font-size: .875rem; color: var(--muted); }
.form-error { margin: 0; min-height: 1.25rem; color: #ff8a8d; font-size: .9rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.check { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .9rem; }
.check input { accent-color: var(--gold); width: 1rem; height: 1rem; }
.photo-row { display: flex; gap: 1rem; align-items: center; }
.photo-preview { flex: none; width: 88px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview img.is-logo { object-fit: contain; opacity: .25; }
.photo-controls { flex: 1; display: flex; flex-direction: column; gap: .5rem; min-width: 0; }

/* Profile */
.profile { display: grid; grid-template-columns: 1fr; }
@media (min-width: 720px) { .profile { grid-template-columns: 5fr 6fr; } }
.profile-photo { aspect-ratio: 4 / 5; background: var(--surface-2); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-body { padding: 1.75rem; overflow-y: auto; }
.profile-ign { margin: 0; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.05; }
.profile-real { margin: .25rem 0 1.25rem; color: var(--muted); }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.profile-stats div { padding: .65rem .8rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.profile-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.profile-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.2rem; color: var(--gold); }
.mini-title { margin: 0 0 .5rem; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; color: var(--muted); font-weight: 500; }
.hero-tags { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.hero-tags li { padding: .25rem .7rem; border-radius: 999px; border: 1px solid rgba(212, 175, 55, .5); color: var(--gold-bright); font-size: .85rem; }
.profile-bio { margin: 0; color: #d4d4d4; white-space: pre-line; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.5rem; color: var(--muted); font-size: .875rem; }
.footer-inner { display: flex; align-items: center; gap: .75rem; }
.footer-inner p { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50;
  padding: .75rem 1.25rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 2rem);
}
.toast.is-error { border-color: var(--danger); }

@media (max-width: 480px) {
  .brand-name { font-size: 1.1rem; }
  .header-actions .btn { padding: .55rem .8rem; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
