@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg:         #090b0f;
  --bg2:        #0f1218;
  --card:       #161b26;
  --card2:      #1c2232;
  --border:     #232b3a;
  --gold:       #f0b900;
  --gold2:      #ffd340;
  --red:        #e63946;
  --green:      #2ecc71;
  --blue:       #4a9eff;
  --primary:    #4a9eff;
  --purple:     #9b59b6;
  --accent:     #9b59b6;
  --danger:     #e63946;
  --txt:        #dde4f0;
  --txt1:       #dde4f0;
  --txt2:       #8494aa;
  --txt3:       #4f5e73;
  --surface:    #161b26;
  --surface2:   #1c2232;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { background: var(--bg); color: var(--txt); font-family: 'Inter', sans-serif; font-size: 15px; line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold2); }
img { max-width: 100%; height: auto; }

h1,h2,h3,h4,h5 { font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: .5px; }
h1 { font-size: 2.4rem; } h2 { font-size: 1.8rem; } h3 { font-size: 1.4rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ─── NAVBAR ─── */
.navbar {
  background: rgba(9,11,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 0 24px;
}
.navbar-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.navbar-brand-row { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-width: 0; }
.nav-logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-logo-icon { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nav-logo-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(240,185,0,.35)); }
.nav-logo-text { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--txt); }
.nav-logo-text span { color: var(--gold); }
.nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex: 1 1 auto; }
.nav-links a { color: var(--txt2); padding: 8px 12px; border-radius: 8px; font-size: .9rem; font-weight: 600; line-height: 1; transition: all .2s; white-space: nowrap; flex: 0 0 auto; }
.nav-links a:hover, .nav-links a.active { color: var(--txt); background: var(--card); }
.nav-admin-btn { background: var(--gold); color: #000 !important; border-radius: 8px; padding: 8px 16px !important; font-weight: 700 !important; }
.nav-admin-btn:hover { background: var(--gold2) !important; color: #000 !important; }
.nav-search { display: inline-flex; align-items: center; margin-left: 6px; flex: 0 1 180px; min-width: 120px; }
.nav-search-input { width: 100%; min-width: 120px; padding: 7px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface2); color: var(--txt); font-size: .85rem; outline: none; }
.nav-search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,185,0,.1); }

/* ─── HERO ─── */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 24px;
  background: linear-gradient(135deg, #0a0e17 0%, #0f1520 50%, #0a0c10 100%);
  text-align: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(240,185,0,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: rgba(240,185,0,.12); border: 1px solid rgba(240,185,0,.3); color: var(--gold); font-size: .78rem; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; padding: 6px 16px; border-radius: 100px; margin-bottom: 20px; }
.hero h1 { font-size: 3.8rem; background: linear-gradient(135deg, #fff 0%, var(--gold) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 16px; }
.hero p { font-size: 1.1rem; color: var(--txt2); max-width: 560px; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 11px 24px; border-radius: var(--radius); font-size: .92rem; font-weight: 600; border: none; cursor: pointer; transition: all .2s; text-decoration: none; white-space: nowrap; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover { background: var(--gold2); color: #000; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(240,185,0,.35); }
.btn-outline { background: transparent; color: var(--txt); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(240,185,0,.06); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-green { background: var(--green); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.inline-form { display: inline; }
.admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-actions .btn, .admin-actions button { white-space: nowrap; }
.admin-actions .form-control { width: auto; }
.admin-actions input[type="file"].form-control { min-width: 180px; }

/* ─── CARDS ─── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: rgba(240,185,0,.2); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }

/* ─── STATS GRID ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 40px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; position: relative; overflow: hidden; transition: all .25s; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gold); border-radius: 3px 3px 0 0; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(240,185,0,.25); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.stat-card .label { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--txt2); margin-bottom: 8px; }
.stat-card .value { font-family: 'Rajdhani',sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-card .sub { font-size: .8rem; color: var(--txt3); margin-top: 4px; }
.stat-card.red::before { background: var(--red); }
.stat-card.red .value { color: var(--red); }
.stat-card.green::before { background: var(--green); }
.stat-card.green .value { color: var(--green); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.blue .value { color: var(--blue); }

/* ─── TABLES ─── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap { overflow-x: auto; max-width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
thead { background: var(--bg2); }
thead th { padding: 13px 16px; text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--txt2); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid rgba(35,43,58,.6); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody td { padding: 12px 16px; font-size: .9rem; white-space: nowrap; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: .95rem; }
.rank-1 { background: linear-gradient(135deg,#f0b900,#ffd340); color:#000; }
.rank-2 { background: linear-gradient(135deg,#9e9e9e,#cfcfcf); color:#000; }
.rank-3 { background: linear-gradient(135deg,#cd7f32,#e8a95e); color:#000; }
.rank-n { background: var(--bg2); color: var(--txt2); }

/* ─── BADGES ─── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.badge-gold { background: rgba(240,185,0,.15); color: var(--gold); border: 1px solid rgba(240,185,0,.25); }
.badge-red { background: rgba(230,57,70,.15); color: var(--red); border: 1px solid rgba(230,57,70,.25); }
.badge-green { background: rgba(46,204,113,.15); color: var(--green); border: 1px solid rgba(46,204,113,.25); }
.badge-blue { background: rgba(74,158,255,.15); color: var(--blue); border: 1px solid rgba(74,158,255,.25); }
.badge-gray { background: rgba(100,116,139,.15); color: var(--txt2); border: 1px solid var(--border); }

/* ─── EVENT CARDS ─── */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 20px; }
.event-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: all .25s; position: relative; overflow: hidden; }
.event-card::after { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; background: radial-gradient(circle, rgba(240,185,0,.06) 0%, transparent 70%); }
.event-card:hover { transform: translateY(-4px); border-color: rgba(240,185,0,.3); box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.event-card-type { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--txt2); margin-bottom: 8px; }
.event-card-name { font-family: 'Rajdhani',sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; color: var(--txt); }
.event-card-meta { display: flex; gap: 16px; font-size: .82rem; color: var(--txt2); margin-bottom: 16px; }
.event-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }

/* ─── MATCH CARDS ─── */
.match-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; transition: all .2s; gap: 16px; }
.match-card:hover { border-color: rgba(240,185,0,.2); background: var(--card2); }
.match-map-icon { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--bg2), var(--border)); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.match-info { flex: 1; min-width: 0; }
.match-title { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1rem; }
.match-meta { font-size: .78rem; color: var(--txt2); margin-top: 2px; }
.match-stats { display: flex; gap: 16px; font-size: .82rem; }
.match-stat { display: flex; flex-direction: column; align-items: center; }
.match-stat .ms-val { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1.1rem; color:var(--txt); }
.match-stat .ms-label { font-size:.68rem; color:var(--txt3); text-transform:uppercase; letter-spacing:.8px; }

/* ─── SECTIONS ─── */
.section { padding: 48px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-family: 'Rajdhani',sans-serif; font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; display: block; width: 4px; height: 22px; background: var(--gold); border-radius: 2px; }

/* ─── TABS ─── */
.tabs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; width: fit-content; -webkit-overflow-scrolling: touch; }
.tab-btn { padding: 9px 20px; border-radius: 7px; border: none; background: transparent; color: var(--txt2); font-size: .88rem; font-weight: 600; cursor: pointer; transition: all .2s; font-family: 'Inter',sans-serif; }
.tab-btn.active { background: var(--card); color: var(--txt); }
.tab-btn:hover:not(.active) { color: var(--txt); }

/* ─── FORMS ─── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--txt2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .8px; }
.form-control { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--txt); border-radius: var(--radius); padding: 11px 14px; font-size: .92rem; font-family: 'Inter',sans-serif; transition: border-color .2s, box-shadow .2s; }
.form-control-sm { padding: 7px 10px; font-size: .82rem; }
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,185,0,.1); }
.form-control::placeholder { color: var(--txt3); }
select.form-control option { background: var(--card2); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-help { margin-top: 6px; font-size: .75rem; color: var(--txt3); }
.text-muted { color: var(--txt2); }
.text-subtle { color: var(--txt3); }
.text-gold { color: var(--gold); }
.empty-state { text-align: center; color: var(--txt2); padding: 30px; }
.empty-card { text-align: center; color: var(--txt2); padding: 60px; }
.admin-grid-2 { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
.admin-card-narrow { max-width: 700px; }
.card-spaced { margin-bottom: 20px; }
.compact-grid-2 { display: grid; grid-template-columns: minmax(150px,1fr) minmax(150px,1fr); gap: 8px; min-width: 340px; }
.table-date { color: var(--txt2); }
.mini-meta { font-size: .75rem; color: var(--txt3); margin-top: 3px; }
.table-wrap-spaced { margin-top: 14px; margin-bottom: 14px; }
.admin-team-list { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.roster-add-btn { margin-top: 8px; }
.event-roster-mobile-list { margin: 14px 0; }
.event-roster-card .mobile-stat-head { margin-bottom: 10px; }
.section-copy { color: var(--txt2); font-size: .88rem; margin-bottom: 16px; }
.danger-box { background: rgba(255,59,48,.05); border: 1px solid rgba(255,59,48,.2); padding: 16px; border-radius: 8px; }
.danger-label { color: var(--red); display: flex; align-items: center; gap: 8px; }
.admin-page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-page-title-block .admin-page-title { margin-bottom: 8px; }
.admin-inline-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.admin-list-row:last-child { border-bottom: 0; }
.admin-list-title { font-weight: 600; }
.admin-list-meta { font-size: .78rem; color: var(--txt2); }
.admin-mobile-list { display: none; }
.admin-mobile-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.admin-mobile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-mobile-title { color: var(--txt); font-weight: 800; overflow-wrap: anywhere; }
.admin-mobile-meta { color: var(--txt3); font-size: .76rem; margin-top: 2px; overflow-wrap: anywhere; }
.admin-mobile-desc { color: var(--txt2); font-size: .82rem; line-height: 1.5; margin-top: 10px; overflow-wrap: anywhere; }
.admin-mobile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.admin-mobile-stats div { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.05); border-radius: 8px; padding: 8px; min-width: 0; }
.admin-mobile-stats span { display: block; color: var(--txt3); font-size: .64rem; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.admin-mobile-stats strong { display: block; color: var(--txt); font-family: 'Rajdhani', sans-serif; font-size: 1rem; overflow-wrap: anywhere; }
.admin-mobile-actions { margin-top: 12px; width: 100%; }
.admin-mobile-form, .admin-mobile-upload { display: grid; gap: 8px; margin-top: 12px; }
.media-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.note-text { font-size: .78rem; color: var(--txt3); line-height: 1.7; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--txt2); font-weight: 600; }
.spaced-form { margin-bottom: 18px; }
.quick-panel { margin-top: 24px; padding: 20px; background: rgba(240,185,0,.06); border: 1px solid rgba(240,185,0,.15); border-radius: var(--radius); }
.quick-panel-title { color: var(--gold); font-weight: 700; }
.quick-panel-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.link-muted { color: var(--txt2); }
.link-subtle { color: var(--txt3); font-size: .82rem; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-shell { width: 100%; max-width: 420px; padding: 24px; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-logo { width: 78px; height: 78px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.auth-logo-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 14px rgba(240,185,0,.42)); }
.auth-title { font-size: 1.6rem; margin-bottom: 4px; }
.auth-subtitle { color: var(--txt2); font-size: .9rem; }
.auth-footer { text-align: center; margin-top: 20px; }
.auth-submit { margin-top: 8px; }
.auth-card-led { position: relative; isolation: isolate; overflow: hidden; background: transparent; border-color: transparent; box-shadow: 0 0 28px rgba(240,185,0,.08), var(--shadow); }
.auth-card-led::before { content: ''; position: absolute; inset: -60%; z-index: -2; background: conic-gradient(from 0deg, transparent 0deg, transparent 80deg, rgba(240,185,0,.15) 108deg, var(--gold) 128deg, #4a9eff 148deg, rgba(74,158,255,.18) 168deg, transparent 210deg, transparent 360deg); animation: ledBorderSpin 3.2s linear infinite; }
.auth-card-led::after { content: ''; position: absolute; inset: 1px; z-index: -1; background: var(--card); border-radius: calc(var(--radius-lg) - 1px); }

/* ─── ALERTS ─── */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: .9rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.25); color: var(--green); }
.alert-danger  { background: rgba(230,57,70,.1);  border: 1px solid rgba(230,57,70,.25);  color: var(--red); }
.alert-info    { background: rgba(74,158,255,.1); border: 1px solid rgba(74,158,255,.25); color: var(--blue); }

/* ─── WWCD ─── */
.wwcd-badge { display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, rgba(240,185,0,.2), rgba(255,211,64,.1)); border: 1px solid rgba(240,185,0,.35); color: var(--gold); padding: 3px 10px; border-radius: 100px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }

/* ─── PLAYER NAME ─── */
.player-name { font-weight: 600; color: var(--txt); }
.player-name a { color: var(--txt); }
.player-name a:hover { color: var(--gold); }
.squad-tag { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--gold); background: rgba(240,185,0,.1); border: 1px solid rgba(240,185,0,.2); border-radius: 4px; padding: 1px 6px; margin-left: 5px; }
.squad-identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.squad-identity-text { min-width: 0; }
.squad-logo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; object-fit: cover; background: var(--bg2); border: 1px solid var(--border); color: var(--gold); font-family: 'Rajdhani',sans-serif; font-size: .72rem; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.squad-logo-sm { width: 22px; height: 22px; border-radius: 6px; font-size: .62rem; }
.squad-logo-md { width: 36px; height: 36px; border-radius: 8px; font-size: .8rem; }
.squad-logo-lg { width: 64px; height: 64px; border-radius: 12px; font-size: 1.1rem; }
.squad-logo-placeholder { background: linear-gradient(135deg, rgba(240,185,0,.16), rgba(74,158,255,.1)); }

/* ─── KILL / DAMAGE ─── */
.kill-count { font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--red); }
.damage-count { font-family: 'Rajdhani',sans-serif; font-weight: 600; color: var(--txt); }
.hs-count { color: var(--gold); font-size: .85rem; }

/* ─── GRENADE ICON ─── */
.nade-stat { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--txt2); }
.nade-stat .val { color: var(--txt); font-weight: 600; }

/* ─── FOOTER ─── */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 28px 24px; text-align: center; color: var(--txt3); font-size: .82rem; margin-top: 60px; }
footer span { color: var(--gold); }

/* ─── ADMIN SIDEBAR ─── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--bg2); border-right: 1px solid var(--border); padding: 24px 16px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-mobile-bar { display: block; }
.admin-menu-toggle { display: none; }
.admin-nav { display: block; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-family: 'Rajdhani',sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--gold); padding: 8px 10px 24px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.sidebar-logo-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(240,185,0,.35)); }
.sidebar-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--txt3); padding: 10px 10px 6px; font-weight: 600; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--txt2); font-size: .88rem; font-weight: 500; transition: all .2s; margin-bottom: 2px; }
.sidebar a:hover, .sidebar a.active { background: var(--card); color: var(--txt); }
.sidebar a.active { color: var(--gold); }
.sidebar .sidebar-site-link { justify-content: center; background: rgba(240,185,0,.1); border: 1px solid rgba(240,185,0,.22); color: var(--gold); font-weight: 700; margin-bottom: 14px; }
.sidebar .sidebar-site-link:hover { background: rgba(240,185,0,.18); color: var(--gold); }
.admin-content { flex: 1; padding: 32px; overflow-x: auto; }
.admin-page-title { font-family: 'Rajdhani',sans-serif; font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.admin-page-sub { color: var(--txt2); font-size: .9rem; margin-bottom: 28px; }

/* ─── MATCH ID INPUT ─── */
.match-id-input-group { display: flex; gap: 12px; }
.match-id-input-group .form-control { font-family: 'Rajdhani',sans-serif; font-size: 1.1rem; letter-spacing: 1px; }
.lookup-result-row { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border); transition:background .15s; gap:12px; }
.lookup-result-row:hover { background:rgba(255,255,255,.03); }
.lookup-result-row:last-child { border-bottom:none; }
.match-badge-custom { display:inline-block; background:rgba(240,185,0,.15); color:var(--gold); border:1px solid rgba(240,185,0,.25); font-size:.68rem; font-weight:700; padding:2px 8px; border-radius:100px; text-transform:uppercase; letter-spacing:.5px; }
.match-badge-normal { display:inline-block; background:rgba(100,116,139,.1); color:var(--txt3); border:1px solid var(--border); font-size:.68rem; font-weight:700; padding:2px 8px; border-radius:100px; text-transform:uppercase; }
.use-id-btn { background:var(--gold); color:#000; border:none; padding:7px 14px; border-radius:8px; font-size:.82rem; font-weight:700; cursor:pointer; white-space:nowrap; transition:background .2s; }
.use-id-btn:hover { background:var(--gold2); }
#lookup-panel { display:none; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; margin-top:16px; }
#lookup-results { max-height:420px; overflow-y:auto; }
.spinner { display:inline-block; width:18px; height:18px; border:2px solid var(--border); border-top-color:var(--gold); border-radius:50%; animation:spin .7s linear infinite; vertical-align:middle; margin-right:8px; }
.import-report { max-width:1000px; margin-bottom:22px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--card); overflow:hidden; }
.import-report-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border-bottom:1px solid var(--border); }
.import-report-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; padding:14px 18px; border-bottom:1px solid var(--border); }
.import-metric { background:rgba(255,255,255,.03); border:1px solid var(--border); border-radius:8px; padding:10px 12px; min-width:0; }
.import-metric-value { font-size:1.2rem; font-weight:800; color:var(--txt); }
.import-metric-label { font-size:.72rem; color:var(--txt3); text-transform:uppercase; letter-spacing:.04em; margin-top:2px; overflow-wrap:anywhere; }
.import-item { padding:14px 18px; border-bottom:1px solid var(--border); }
.import-item:last-child { border-bottom:none; }
.import-item-top { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:8px; }
.import-match-id { font-family:monospace; font-size:.72rem; color:var(--txt3); overflow-wrap:anywhere; }
.import-status { display:inline-flex; align-items:center; border-radius:999px; padding:3px 9px; font-size:.68rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; border:1px solid var(--border); white-space:nowrap; }
.import-status.imported { color:#41d67a; background:rgba(65,214,122,.1); border-color:rgba(65,214,122,.25); }
.import-status.skipped { color:var(--txt2); background:rgba(148,163,184,.1); border-color:rgba(148,163,184,.25); }
.import-status.failed { color:#ff6b6b; background:rgba(255,107,107,.1); border-color:rgba(255,107,107,.25); }
.import-status.warning { color:var(--gold); background:rgba(240,185,0,.1); border-color:rgba(240,185,0,.25); }
.import-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.import-chip { border:1px solid var(--border); border-radius:999px; color:var(--txt2); font-size:.72rem; padding:4px 8px; background:rgba(255,255,255,.03); }
.import-warning-list { margin-top:8px; color:var(--txt2); font-size:.78rem; line-height:1.6; }
.import-report-title { font-weight:800; }
.import-report-sub { font-size:.8rem; color:var(--txt2); margin-top:3px; }
.import-item-title { font-weight:800; }
.import-item-message { color:var(--txt2); font-size:.82rem; }
.import-retry { color:var(--gold); font-size:.78rem; margin-top:6px; }
.import-note { color:var(--txt3); font-size:.74rem; margin-top:7px; }
.import-layout { display:grid; grid-template-columns:1fr 1fr; gap:24px; align-items:start; max-width:1000px; }
.lookup-form-row { display:flex; gap:10px; }
.lookup-input { flex:1; }
.lookup-header { padding:12px 16px; background:var(--bg2); border-bottom:1px solid var(--border); font-size:.82rem; color:var(--txt2); }
.mono-field { font-family:monospace; font-size:.88rem; }
.match-id-field { margin-bottom:8px; }
.form-tip { margin-top:6px; font-size:.75rem; color:var(--txt3); }
.info-panel { background:rgba(74,158,255,.07); border:1px solid rgba(74,158,255,.2); border-radius:var(--radius); padding:12px 14px; margin-bottom:16px; font-size:.82rem; color:var(--txt2); }
.lookup-main { font-weight:600; font-size:.9rem; }
.lookup-meta { font-size:.75rem; color:var(--txt2); margin-top:3px; }
.lookup-id { font-size:.7rem; color:var(--txt3); margin-top:2px; font-family:monospace; overflow-wrap:anywhere; }

/* ─── PAGE LAYOUT ─── */
.page-hero { background: linear-gradient(135deg, var(--bg2), var(--bg)); padding: 40px 24px; border-bottom: 1px solid var(--border); }
.page-hero-title { font-size: 2rem; margin-bottom: 8px; }
.page-hero-sub { color: var(--txt2); font-size: .95rem; }
.main-content { padding: 40px 24px; max-width: 1200px; margin: 0 auto; }

/* ─── RESPONSIVE ─── */


/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt3); }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes ledBorderSpin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .4s ease both; }
.fade-in-2 { animation: fadeIn .4s .1s ease both; }
.fade-in-3 { animation: fadeIn .4s .2s ease both; }

/* ─── TEAM CARD (Twire-style match detail) ─── */
.team-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color .2s;
}
.team-card:hover { border-color: rgba(240,185,0,.2); }
.team-card.place-1 { border-color: rgba(240,185,0,.35); background: linear-gradient(90deg, rgba(240,185,0,.06) 0%, var(--card) 40%); }
.team-card.place-2 { border-color: rgba(158,158,158,.35); background: linear-gradient(90deg, rgba(158,158,158,.05) 0%, var(--card) 40%); }
.team-card.place-3 { border-color: rgba(205,127,50,.35); background: linear-gradient(90deg, rgba(205,127,50,.06) 0%, var(--card) 40%); }

.team-header {
  display: grid;
  grid-template-columns: 48px 1fr auto auto auto auto auto;
  align-items: center;
  padding: 14px 18px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.team-header:hover { background: rgba(255,255,255,.02); }

.team-place {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  font-family: 'Rajdhani',sans-serif; font-weight: 700; font-size: 1.1rem;
  flex-shrink: 0;
}
.team-place.p1 { background: linear-gradient(135deg,#f0b900,#ffd340); color:#000; }
.team-place.p2 { background: linear-gradient(135deg,#9e9e9e,#cfcfcf); color:#000; }
.team-place.p3 { background: linear-gradient(135deg,#cd7f32,#e8a95e); color:#000; }
.team-place.pn { background: var(--bg2); color: var(--txt2); border: 1px solid var(--border); }

.team-name-col { min-width: 0; }
.team-squad-name { font-family: 'Rajdhani',sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--txt); }
.team-members-preview { font-size: .75rem; color: var(--txt3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.team-stat { text-align: center; min-width: 54px; }
.team-stat .ts-val { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1.15rem; color:var(--txt); }
.team-stat .ts-label { font-size:.65rem; color:var(--txt3); text-transform:uppercase; letter-spacing:.8px; margin-top:1px; }
.team-stat.kills .ts-val { color: var(--red); }
.team-stat.pts .ts-val { color: var(--gold); }

.team-wwcd {
  background: linear-gradient(135deg, rgba(240,185,0,.2), rgba(255,211,64,.1));
  border: 1px solid rgba(240,185,0,.3);
  color: var(--gold);
  font-size:.68rem; font-weight:700; letter-spacing:.8px; text-transform:uppercase;
  padding: 3px 8px; border-radius: 100px;
  white-space: nowrap;
}

.team-chevron {
  color: var(--txt3); font-size: .9rem;
  transition: transform .25s;
  padding: 4px;
}
.team-card.open .team-chevron { transform: rotate(180deg); }

/* ── Player rows inside team ── */
.team-players {
  display: none;
  border-top: 1px solid var(--border);
  background: rgba(15,18,24,.6);
}
.team-card.open .team-players { display: block; }

.player-row {
  display: grid;
  grid-template-columns: 1fr 60px 60px 80px 50px 50px 70px;
  align-items: center;
  padding: 10px 18px 10px 72px; /* indent to align with name col */
  gap: 12px;
  border-bottom: 1px solid rgba(35,43,58,.5);
  transition: background .15s;
}
.player-row:last-child { border-bottom: none; }
.player-row:hover { background: rgba(255,255,255,.025); }
.player-row-header {
  display: grid;
  grid-template-columns: 1fr 60px 60px 80px 50px 50px 70px;
  padding: 7px 18px 7px 72px;
  gap: 12px;
  background: rgba(9,11,15,.4);
  border-bottom: 1px solid var(--border);
}
.player-row-header span { font-size: .65rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--txt3); font-weight: 600; }

.pr-name { font-weight: 600; font-size: .9rem; color: var(--txt); min-width: 0; }
.pr-name a { color: var(--txt); }
.pr-name a:hover { color: var(--gold); }
.pr-kills { font-family:'Rajdhani',sans-serif; font-weight:700; font-size:1rem; color:var(--red); text-align:center; }
.pr-assists { text-align:center; color:var(--txt2); font-size:.88rem; }
.pr-damage { text-align:center; font-family:'Rajdhani',sans-serif; font-weight:600; font-size:.9rem; }
.pr-hs { text-align:center; color:var(--gold); font-size:.85rem; }
.pr-dbno { text-align:center; color:var(--blue); font-size:.85rem; }
.pr-survived { text-align:center; color:var(--txt3); font-size:.82rem; }

/* Kill bar */
.kill-bar-wrap { width:100%; height:4px; background:var(--bg2); border-radius:2px; margin-top:5px; }
.kill-bar { height:4px; border-radius:2px; background:var(--red); }

/* ─── VIEW TOGGLE ─── */
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--txt2); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s; font-family: 'Inter',sans-serif; }
.view-toggle button.active { background: var(--gold); color: #000; border-color: var(--gold); }

/* ─── INDIVIDUAL PLAYER TABLE ─── */
.player-stats-table th:first-child,
.player-stats-table td:first-child { position: sticky; left: 0; background: var(--bg2); z-index: 1; }
.player-stats-table td:first-child { background: var(--card); }
.player-stats-table tbody tr:hover td:first-child { background: rgba(255,255,255,.025) !important; filter: brightness(1.3); }

/* ─── MAP COLORS ─── */
.map-erangel { color: #5dade2; }
.map-miramar { color: #e67e22; }
.map-sanhok   { color: #27ae60; }
.map-vikendi  { color: #85c1e9; }
.map-taego    { color: #a9cce3; }
.map-deston   { color: #76b7c1; }
.map-karakin  { color: #e74c3c; }

/* ─── LIGHT MODE ─── */
body.light-mode {
  --bg:         #f8fafc;
  --bg2:        #ffffff;
  --card:       #ffffff;
  --card2:      #f1f5f9;
  --border:     #e2e8f0;
  --txt:        #0f172a;
  --txt2:       #475569;
  --txt3:       #64748b;
  --shadow:     0 4px 24px rgba(0,0,0,.08);
}
body.light-mode .navbar { background: rgba(255,255,255,.95); }
body.light-mode .hero { background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); }
body.light-mode .hero h1 { background: linear-gradient(135deg, #1e293b 0%, #c89500 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.light-mode tbody tr:hover, body.light-mode .player-row:hover { background: rgba(0,0,0,.03); }
body.light-mode .player-row-header { background: #f8fafc; }
body.light-mode .team-header:hover { background: rgba(0,0,0,.03); }
body.light-mode .team-players { background: #fdfdfd; }
body.light-mode .nav-logo-icon, body.light-mode .nav-admin-btn { color: #fff !important; }

/* Title Guide */
.guide-kicker {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.guide-section {
  margin-bottom: 34px;
}
.guide-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.guide-section-head h2,
.guide-warning h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.65rem;
  margin: 0;
}
.guide-section-head p,
.guide-warning p {
  color: var(--txt2);
  max-width: 620px;
  margin: 0;
  line-height: 1.65;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.guide-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.guide-rule {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.guide-rule-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--txt);
}
.guide-rule-source {
  color: var(--txt3);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 3px;
}
.guide-formula {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  margin: 14px 0 12px;
  padding: 10px 12px;
}
.guide-rule p {
  color: var(--txt2);
  line-height: 1.6;
  margin: 0 0 12px;
}
.guide-note {
  border-top: 1px solid var(--border);
  color: var(--txt3);
  font-size: .82rem;
  line-height: 1.5;
  padding-top: 10px;
}
.guide-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.guide-table {
  width: 100%;
  border-collapse: collapse;
}
.guide-table th,
.guide-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.guide-table th {
  color: var(--txt3);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.guide-table td:first-child {
  color: var(--gold);
  font-weight: 800;
  white-space: nowrap;
}
.guide-table tr:last-child td {
  border-bottom: 0;
}
.guide-warning {
  background: linear-gradient(135deg, rgba(240,185,0,.09), rgba(139,92,246,.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.guide-inline-link {
  color: var(--gold);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}
.guide-inline-link:hover {
  color: var(--gold2);
}

/* Match detail responsive foundation */
.match-actions,
.match-title-row,
.match-highlights,
.match-expand-controls,
.killfeed-filters {
  flex-wrap: wrap;
}
.match-actions .btn,
.match-actions button,
.match-title-row .btn,
.match-expand-controls button {
  min-height: 38px;
}
.match-meta-line {
  overflow-wrap: anywhere;
}
.match-highlight-card {
  min-width: 220px;
}
.team-column-hint {
  color: var(--txt3);
}
.match-table-wrap {
  position: relative;
}
.mobile-stat-list {
  display: none;
}
.mobile-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.mobile-stat-card.is-winner {
  border-color: rgba(240,185,0,.35);
  background: linear-gradient(135deg, rgba(240,185,0,.07), var(--card) 58%);
}
.mobile-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.mobile-stat-title {
  flex: 1;
  min-width: 0;
}
.mobile-stat-title a {
  color: var(--txt);
  display: block;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-stat-title strong {
  color: var(--txt);
  display: block;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-stat-title > span:not(.squad-identity) {
  color: var(--txt3);
  display: block;
  font-size: .75rem;
  margin-top: 2px;
}
.mobile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
.mobile-stat-grid div {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 8px;
  min-width: 0;
  padding: 8px 6px;
  text-align: center;
}
.mobile-stat-grid strong {
  color: var(--txt);
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.mobile-stat-grid span {
  color: var(--txt3);
  display: block;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .7px;
  margin-top: 5px;
  text-transform: uppercase;
}
.mobile-stat-note {
  border-top: 1px solid var(--border);
  color: var(--txt3);
  font-size: .78rem;
  margin-top: 10px;
  padding-top: 9px;
}
.mobile-pill {
  background: rgba(240,185,0,.12);
  border: 1px solid rgba(240,185,0,.25);
  border-radius: 999px;
  color: var(--gold);
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 9px;
}
.event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.event-meta-line {
  overflow-wrap: anywhere;
}
.dropmap-card {
  max-width: 100%;
}
.dropmap-head {
  gap: 10px;
}
.dropmap-stage {
  min-height: 280px;
}
.dropmap-note {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--txt3);
  font-size: .78rem;
  padding: 10px 16px;
  text-align: center;
}
.leaderboard-filters,
.leaderboard-filter-group,
.leaderboard-sort-links {
  min-width: 0;
}
.leaderboard-sort-links {
  flex-wrap: wrap;
}
.hof-grid {
  min-width: 0;
}
.hof-record-card {
  min-width: 0;
}
.hof-record-value {
  overflow-wrap: anywhere;
}
.player-hero-row,
.squad-detail-head {
  min-width: 0;
}
.player-avatar {
  flex: 0 0 auto;
}
.secondary-stats-grid,
.map-stats-grid,
.squad-stats-grid {
  min-width: 0;
}
.player-chart-card {
  overflow: hidden;
}
.player-chart-card canvas {
  width: 100% !important;
}
.squad-detail-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 20px;
}
.squad-detail-hero + .grid,
.squad-tabs,
#tab-roster,
#tab-history,
#tab-damage {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
.btn-back {
  color: var(--txt2);
  font-size: .85rem;
}
.btn-back:hover {
  color: var(--gold);
}


/* -- COMPREHENSIVE RESPONSIVE DESIGN (MOBILE FIXES) -- */
@media (max-width: 768px) {
  /* Navbar */
  .hamburger { display: block !important; }
  .navbar-inner { flex-direction: column; padding: 10px; align-items: flex-start; height: auto; }
  .navbar-brand-row { width: 100%; }
  .nav-links { display: none; flex-direction: column; gap: 8px; width: 100%; align-items: flex-start; justify-content: flex-start; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .nav-links.show { display: flex; }
  .nav-links a { display: inline-block !important; font-size: 1rem; padding: 8px 0; width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .nav-links form, .nav-search { margin-left: 0 !important; width: 100%; max-width: none; flex-basis: auto; margin-top: 10px; margin-bottom: 10px; }
  .nav-links input[type="text"], .nav-search-input { width: 100% !important; max-width: 100%; }

  /* Layout & Containers */
  .container, .main-content { padding-left: 12px; padding-right: 12px; }
  .card { padding: 15px; overflow-x: auto; }
  .card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .card-header .btn,
  .card-header button {
    width: 100%;
    justify-content: center;
  }
  .page-hero { padding: 28px 14px; }
  .main-content { padding-top: 24px; padding-bottom: 28px; }
  .btn { width: auto; min-height: 40px; padding: 9px 13px; font-size: .84rem; white-space: normal; text-align: center; }

  /* Grids & Flex */
  .grid, .admin-grid-2, .admin-grid-equal, .form-row, [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card .label {
    font-size: .68rem;
    margin-bottom: 6px;
  }
  .stat-card .value {
    font-size: 1.85rem;
  }
  [style*="display:flex"], [style*="display: flex"] { flex-wrap: wrap; }

  /* Tables */
  table { min-width: 600px; /* force horizontal scroll on mobile */ }
  .table-wrap { margin-left: -2px; margin-right: -2px; border-radius: 10px; }

  /* Specific Elements */
  .hero-title, .page-hero-title { font-size: 2rem !important; }
  .hero-sub, .page-hero-sub { font-size: 1rem !important; }
  .badge, .role-badge, .tier-badge { font-size: 0.7rem; padding: 2px 6px; }

  /* Leaderboard & Hall of Fame */
  .leaderboard-table th, .leaderboard-table td { padding: 10px 8px; font-size: 0.9rem; }
  .hof-card { grid-template-columns: 1fr; }

  /* Admin Sidebar */
  .admin-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 80;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    display: block;
    overflow: visible;
  }
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sidebar-logo {
    padding: 6px 0;
    margin: 0;
    border-bottom: none;
    white-space: nowrap;
  }
  .admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--txt);
    font-family: 'Inter', sans-serif;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
  }
  .admin-menu-toggle::before {
    content: '';
    width: 14px;
    height: 10px;
    margin-right: 8px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  }
  .admin-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 10px;
  }
  .sidebar.admin-menu-open .admin-nav {
    display: grid;
  }
  .sidebar-label { display: none; }
  .sidebar a {
    width: 100%;
    margin-bottom: 0;
    white-space: nowrap;
    min-height: 40px;
    justify-content: flex-start;
  }
  .sidebar .sidebar-site-link {
    margin-bottom: 0;
    margin-right: 0;
    justify-content: center;
  }
  .admin-content {
    width: 100%;
    min-width: 0;
    padding: 18px 12px;
    overflow-x: hidden;
  }
  .admin-page-title {
    font-size: 1.55rem;
    line-height: 1.05;
  }
  .admin-page-sub {
    margin-bottom: 18px;
    overflow-wrap: anywhere;
  }
  .admin-page-head {
    align-items: stretch;
  }
  .admin-page-head > * {
    min-width: 0;
  }
  .admin-page-head .btn,
  .admin-page-head button {
    flex: 1 1 150px;
    justify-content: center;
  }
  .admin-list-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-list-row .admin-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-list-row .admin-actions .btn,
  .admin-list-row .admin-actions button,
  .admin-list-row .admin-actions a {
    flex: 1 1 130px;
    justify-content: center;
  }
  .admin-card-narrow {
    max-width: none;
  }
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .form-actions .btn,
  .form-actions button {
    width: 100%;
    justify-content: center;
  }
  .media-row {
    align-items: flex-start;
  }
  .admin-mobile-list {
    display: grid;
    gap: 12px;
  }
  .mobile-stat-list {
    display: grid;
    gap: 10px;
  }
  .mobile-hidden-table {
    display: none;
  }
  .admin-mobile-card-head {
    align-items: flex-start;
  }
  .admin-mobile-card-head .badge,
  .admin-mobile-card-head .squad-tag,
  .admin-mobile-card-head .text-subtle {
    flex: 0 0 auto;
  }
  .admin-mobile-actions .inline-form,
  .admin-mobile-actions .btn,
  .admin-mobile-actions button,
  .admin-mobile-actions a {
    flex: 1 1 130px;
    justify-content: center;
  }
  .admin-mobile-upload .btn {
    width: 100%;
  }
  .quick-panel {
    padding: 14px;
  }
  .quick-panel-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-panel-actions .btn {
    width: 100%;
  }
  .import-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: none;
  }
  .import-report {
    max-width: none;
  }
  .import-report-head {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }
  .import-report-head .btn {
    justify-content: center;
  }
  .import-report-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    padding: 12px;
  }
  .import-item {
    padding: 14px;
  }
  .import-item-top {
    flex-direction: column;
    gap: 8px;
  }
  .lookup-form-row {
    flex-direction: column;
  }
  .lookup-form-row .btn,
  .lookup-form-row button {
    width: 100%;
    justify-content: center;
  }
  .lookup-result-row {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }
  .lookup-result-row .use-id-btn {
    width: 100%;
    min-height: 38px;
  }
  #lookup-results {
    max-height: 60vh;
  }
  .mono-field {
    font-size: .78rem;
  }
  .event-team-head {
    align-items: stretch;
  }
  .event-team-head .squad-identity {
    align-items: flex-start;
  }
  .event-team-head .admin-actions {
    width: 100%;
  }
  .event-team-head .admin-actions .inline-form {
    flex: 1 1 130px;
  }
  .event-team-edit-grid,
  .event-roster-add-form,
  .compact-grid-2 {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .event-roster-add-form .form-group {
    margin-bottom: 0;
  }

  /* Tabs */
  .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; font-size: 0.86rem; padding: 8px 12px; flex: 0 0 auto; }
}

@media (max-width: 680px) {
  .match-hero-head,
  .match-title-row,
  .match-actions,
  .match-highlights,
  .event-hero-head,
  .event-title-row,
  .event-actions,
  .match-tabbar,
  .match-expand-controls {
    align-items: stretch !important;
  }
  .match-hero-head,
  .match-title-row,
  .match-actions,
  .match-highlights,
  .event-hero-head,
  .event-title-row,
  .event-actions {
    width: 100%;
  }
  .event-title-row {
    gap: 10px !important;
  }
  .event-title-row .page-hero-title {
    flex: 1 1 220px;
    min-width: 0;
    line-height: 1.08;
  }
  .event-actions .btn,
  .event-actions button {
    flex: 1 1 150px;
  }
  .match-title-row {
    gap: 10px !important;
  }
  .match-title-row .page-hero-title {
    flex: 1 1 220px;
    min-width: 0;
    line-height: 1.08;
  }
  .match-title-row .btn,
  .match-actions .btn,
  .match-actions button {
    flex: 1 1 138px;
  }
  .match-actions {
    margin-top: 4px;
  }
  .match-meta-line {
    margin-top: 12px;
    line-height: 1.75;
  }
  .match-highlight-card {
    width: 100%;
    min-width: 0;
    padding: 12px 14px !important;
  }
  .match-tabbar {
    display: block !important;
  }
  .match-tabbar .tabs {
    margin-bottom: 12px;
  }
  .match-expand-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }
  .match-expand-controls button {
    width: 100%;
  }
  .team-column-hint {
    display: none !important;
  }
  .team-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
    gap: 10px;
  }
  .team-place {
    width: 38px;
    height: 38px;
    font-size: .98rem;
    order: 1;
  }
  .team-name-col {
    flex: 1 1 calc(100% - 82px);
    order: 2;
  }
  .team-chevron {
    order: 3;
    margin-left: auto;
  }
  .team-header > .team-stat {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    order: 4;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 8px;
    padding: 8px 6px;
  }
  .team-wwcd-slot {
    flex: 1 1 100%;
    order: 5;
  }
  .team-wwcd {
    width: 100%;
    justify-content: center;
    padding: 6px 10px;
  }
  .team-members-preview {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .team-players {
    background: rgba(15,18,24,.82);
  }
  .player-row-header {
    display: none;
  }
  .player-row {
    grid-template-columns: repeat(3, minmax(0,1fr));
    padding: 12px;
    gap: 8px;
  }
  .pr-name {
    grid-column: 1 / -1;
    font-size: .95rem;
  }
  .player-row > div:not(.pr-name) {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 8px;
    min-height: 48px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
  }
  .pr-kills::after { content: "Kills"; }
  .pr-assists::after { content: "Ast"; }
  .pr-damage::after { content: "Dmg"; }
  .pr-hs::after { content: "HS"; }
  .pr-dbno::after { content: "DBNO"; }
  .pr-survived::after { content: "Time"; }
  .player-row > div:not(.pr-name)::after {
    margin-top: 4px;
    color: var(--txt3);
    font-family: 'Inter', sans-serif;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
  }
  .player-stats-table th:nth-child(6),
  .player-stats-table td:nth-child(6),
  .player-stats-table th:nth-child(7),
  .player-stats-table td:nth-child(7),
  .player-stats-table th:nth-child(9),
  .player-stats-table td:nth-child(9),
  .player-stats-table th:nth-child(10),
  .player-stats-table td:nth-child(10),
  .player-stats-table th:nth-child(11),
  .player-stats-table td:nth-child(11),
  .player-stats-table th:nth-child(12),
  .player-stats-table td:nth-child(12) {
    display: none;
  }
  .player-stats-table {
    min-width: 480px;
  }
  .mobile-stat-list {
    display: grid;
    gap: 10px;
  }
  .match-mobile-table,
  .mobile-hidden-table {
    display: none;
  }
  .match-card {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }
  .match-map-icon {
    width: 38px;
    height: 38px;
  }
  .match-info {
    flex: 1 1 calc(100% - 54px);
  }
  .match-card > .badge,
  .match-card > span,
  .match-card > div:not(.match-map-icon):not(.match-info) {
    margin-top: 4px;
  }
  .dropmap-head {
    align-items: flex-start !important;
    flex-direction: column;
    padding: 14px !important;
  }
  .dropmap-stage {
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: 78vh;
  }
  .dropmap-stage canvas {
    touch-action: manipulation;
  }
  .leaderboard-filter-card {
    padding: 12px !important;
  }
  .leaderboard-filters {
    align-items: stretch !important;
    flex-direction: column;
    gap: 12px !important;
  }
  .leaderboard-filter-group {
    align-items: stretch !important;
    flex-direction: column;
    gap: 6px !important;
  }
  .leaderboard-filter-group select {
    min-height: 40px;
    width: 100%;
  }
  .leaderboard-sort-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr));
    width: 100%;
  }
  .leaderboard-sort-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    text-align: center;
  }
  .hof-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .hof-record-card {
    padding: 16px !important;
  }
  .hof-record-card .hof-record-value {
    font-size: 2.2rem !important;
  }
  .guide-section {
    margin-bottom: 26px;
  }
  .guide-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .guide-grid,
  .guide-grid-2 {
    grid-template-columns: 1fr;
  }
  .guide-rule {
    padding: 15px;
  }
  .guide-formula {
    font-size: .76rem;
    overflow-wrap: anywhere;
  }
  .guide-table {
    min-width: 720px;
  }
  .player-hero-row,
  .squad-detail-head {
    align-items: flex-start !important;
  }
  .player-hero-row > div:last-child,
  .squad-detail-head > div:last-child {
    flex: 1 1 100%;
    min-width: 0;
  }
  .player-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.1rem !important;
  }
  .secondary-stats-grid,
  .map-stats-grid,
  .squad-stats-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  .player-chart-card {
    padding: 14px !important;
  }
  .player-chart-card > div:first-child {
    align-items: stretch !important;
    flex-direction: column;
  }
  .player-chart-card .chart-toggle-btn {
    flex: 1 1 30%;
  }
  .squad-detail-hero {
    padding: 24px 12px 16px;
  }
  .squad-detail-hero + .grid,
  .squad-tabs,
  #tab-roster,
  #tab-history,
  #tab-damage {
    padding-left: 12px;
    padding-right: 12px;
  }
  .squad-tabs {
    width: auto;
  }
  .squad-mobile-list {
    padding: 12px;
  }
  .killfeed-summary {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
  .killfeed-card > div:first-child {
    align-items: stretch !important;
    flex-direction: column;
  }
  .killfeed-filters {
    margin-left: 0 !important;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .killfeed-filters button {
    flex: 0 0 auto;
  }
  .kf-row {
    display: grid !important;
    grid-template-columns: 54px minmax(0,1fr);
    gap: 8px !important;
    align-items: start !important;
    padding: 12px !important;
  }
  .kf-row > * {
    min-width: 0 !important;
    max-width: none !important;
  }
  .kf-row > div:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .kf-row > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
  }
  .kf-row > div:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }
  .kf-row > a:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: left !important;
    white-space: normal !important;
  }
  .kf-row > div:nth-child(5),
  .kf-row > div:nth-child(6) {
    grid-column: 1 / -1;
    justify-content: flex-start !important;
    text-align: left !important;
  }
}

@media (max-width: 420px) {
  .container,
  .main-content {
    padding-left: 10px;
    padding-right: 10px;
  }
  .page-hero-title {
    font-size: 1.7rem !important;
  }
  .match-title-row .btn,
  .match-actions .btn,
  .match-actions button,
  .event-actions .btn,
  .event-actions button {
    flex-basis: 100%;
  }
  .killfeed-summary {
    grid-template-columns: 1fr !important;
  }
  .import-report-grid {
    grid-template-columns: 1fr;
  }
  .secondary-stats-grid,
  .map-stats-grid,
  .squad-stats-grid {
    grid-template-columns: 1fr !important;
  }
}
