/* ============================================================
   MAHENDRA CTF CLUB — main stylesheet
   Theme: dark / ember-crimson / gold, JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root{
  --bg:            #08090a;
  --bg-card:       #0d1210;
  --bg-card-alt:   #0e0f0f;
  --border:        #2a1414;
  --border-soft:   #1c1c1c;
  --red:           #e0342d;
  --red-bright:    #ff4136;
  --red-dark:      #7f1d1d;
  --gold:          #f4b400;
  --ember:         #ff7a1a;
  --text:          #eaeaea;
  --text-dim:      #9aa39d;
  --text-faint:    #626b66;
  --green-ok:      #4ade80;
  --font: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 4px;
}

*{ box-sizing:border-box; margin:0; padding:0; }

html{ scroll-behavior:smooth; }

body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  line-height:1.6;
  min-height:100vh;
}

a{ color:inherit; text-decoration:none; }
ul{ list-style:none; }
img{ max-width:100%; display:block; }
button, input, select, textarea{ font-family:inherit; }

.container{ max-width:1400px; margin:0 auto; padding:0 32px; }

/* ---------- top info strip (college header) ---------- */
.college-strip{
  background:#000;
  border-bottom:2px solid var(--red-dark);
  padding:14px 32px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:24px;
  text-align:center;
  flex-wrap:wrap;
}
.college-strip img{ height:56px; width:56px; border-radius:50%; }
.college-strip h1{ font-size:20px; letter-spacing:1px; color:#fff; }
.college-strip p{ font-size:11px; color:var(--text-dim); }

/* ---------- navbar ---------- */
.navbar{
  position:sticky; top:0; z-index:100;
  background:rgba(8,9,10,0.97);
  border-bottom:1px solid var(--red-dark);
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 32px;
  backdrop-filter:blur(6px);
}
.nav-left{ display:flex; align-items:center; gap:14px; }
.nav-toggle{
  width:38px; height:38px; border:1px solid var(--red-dark);
  background:transparent; color:var(--red); border-radius:var(--radius);
  cursor:pointer; font-size:16px; display:none; align-items:center; justify-content:center;
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:1px; font-size:15px; color:#fff; }
.brand img{ width:34px; height:34px; border-radius:50%; border:1px solid var(--red-dark); }
.nav-links{ display:flex; align-items:center; gap:4px; }
.nav-links a{
  padding:8px 14px; font-size:13px; color:var(--text-dim); border:1px solid transparent;
  border-radius:var(--radius); white-space:nowrap;
}
.nav-links a:hover{ color:var(--text); }
.nav-links a.active{ color:var(--red); border-color:var(--red-dark); background:rgba(224,52,45,0.06); }

.nav-right{ display:flex; align-items:center; gap:10px; }
.chip{
  display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-dim);
  border:1px solid var(--border-soft); padding:6px 12px; border-radius:20px;
}
.xp-tag{ color:var(--red); font-weight:700; font-size:13px; }
.auth-btn{
  border:1px solid var(--border-soft); padding:8px 14px; border-radius:var(--radius);
  font-size:12px; color:var(--text-dim);
}
.auth-btn.primary{ background:var(--red); border-color:var(--red); color:#fff; font-weight:700; }
.profile-avatar{
  width:38px; height:38px; border-radius:var(--radius); background:var(--red);
  color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center;
  cursor:pointer; font-size:13px; border:1px solid var(--red-bright);
}

/* mobile nav drawer */
@media (max-width: 980px){
  .nav-toggle{ display:flex; }
  .nav-links{
    position:fixed; top:0; left:0; height:100vh; width:250px; background:#050505;
    border-right:1px solid var(--red-dark); flex-direction:column; align-items:flex-start;
    padding:90px 20px 20px; transform:translateX(-100%); transition:transform .25s ease; z-index:99;
  }
  .nav-links.open{ transform:translateX(0); }
  .nav-links a{ width:100%; padding:12px 10px; }
  .college-strip{ padding:10px 12px; }
  .college-strip h1{ font-size:14px; }
  .college-strip p{ font-size:9px; }
}

/* ---------- hero ---------- */
.hero{ padding:70px 32px 40px; text-align:center; }
.hero-logos{ display:flex; align-items:center; justify-content:center; gap:20px; margin-bottom:20px; flex-wrap:wrap; }
.hero-logos img{ width:56px; height:56px; border-radius:50%; }
.hero-logos .sep{ width:1px; height:30px; background:var(--border-soft); }
.eyebrow{ color:var(--red); font-size:12px; letter-spacing:2px; margin-bottom:10px; }
.eyebrow span{ color:var(--text-faint); }
.hero h2{ font-size:44px; font-weight:800; color:#fff; letter-spacing:1px; margin-bottom:18px; }
.hero h2 .accent{ color:var(--red); }
.hero p.lead{ max-width:680px; margin:0 auto 30px; color:var(--text-dim); font-size:15px; }
.hero-ctas{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:8px; padding:12px 22px; border-radius:var(--radius);
  font-size:13px; font-weight:700; cursor:pointer; border:1px solid var(--border-soft); transition:all .15s ease;
}
.btn-primary{ background:var(--red); border-color:var(--red); color:#fff; }
.btn-primary:hover{ background:var(--red-bright); }
.btn-outline{ background:transparent; border-color:var(--border-soft); color:var(--text); }
.btn-outline:hover{ border-color:var(--red-dark); color:var(--red); }
.btn-block{ width:100%; justify-content:center; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ---------- stat grid ---------- */
.stat-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:50px 0;
}
.stat-grid.stat-grid-3{ grid-template-columns:repeat(3,1fr); }
.stat-box{
  background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius);
  padding:22px; border-top:2px solid var(--red-dark);
}
.stat-box .num{ font-size:28px; font-weight:800; color:#fff; }
.stat-box .num.red{ color:var(--red); }
.stat-box .lbl{ font-size:11px; color:var(--text-faint); letter-spacing:1px; margin-top:4px; }
@media (max-width:800px){ .stat-grid{ grid-template-columns:repeat(2,1fr);} .stat-grid.stat-grid-3{ grid-template-columns:repeat(2,1fr); } }

hr.rule{ border:none; border-top:1px solid var(--border-soft); margin:40px 0; }

/* ---------- section heading ---------- */
.section-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; }
.section-head h3{ font-size:20px; color:#fff; }
.section-head h3 .slash{ color:var(--red); }
.section-head a.view-all{ font-size:12px; color:var(--text-dim); }
.section-head a.view-all:hover{ color:var(--red); }

/* ---------- generic panel/card ---------- */
.panel{
  background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius); padding:26px;
}
.panel h4{ color:var(--red); font-size:13px; letter-spacing:1px; margin-bottom:14px; }
.panel h4 .slash{ margin-right:4px; }
.panel li{ position:relative; padding-left:18px; margin-bottom:10px; color:var(--text-dim); font-size:14px; }
.panel li::before{ content:"•"; color:var(--red); position:absolute; left:0; }

.two-col{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:900px){ .two-col{ grid-template-columns:1fr; } }

/* ---------- upcoming banner ---------- */
.upcoming-banner{
  border:1px solid var(--red-dark); border-radius:var(--radius); padding:22px 26px;
  display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
  background:linear-gradient(180deg, rgba(224,52,45,0.05), transparent);
}
.upcoming-banner .tag{ color:var(--red); font-size:11px; letter-spacing:1px; margin-bottom:6px; }
.upcoming-banner h4{ color:#fff; font-size:18px; margin-bottom:4px; }
.upcoming-banner p{ color:var(--text-dim); font-size:13px; margin-bottom:14px; }
.upcoming-banner .banner-poster{
  flex:0 0 auto; width:120px; height:120px; border-radius:var(--radius); overflow:hidden;
  border:1px solid var(--red-dark); display:block;
}
.upcoming-banner .banner-poster img{ width:100%; height:100%; object-fit:cover; display:block; }
.upcoming-banner .banner-body{ flex:1 1 auto; min-width:220px; }
.upcoming-banner .banner-body .btn{ display:inline-block; }
@media (max-width:600px){
  .upcoming-banner{ flex-direction:column; align-items:flex-start; }
  .upcoming-banner .banner-poster{ width:100%; height:180px; }
}

/* ---------- event cards ---------- */
.event-grid{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media (max-width:900px){ .event-grid{ grid-template-columns:1fr; } }
.event-card{
  border:1px solid var(--border-soft); border-radius:var(--radius); padding:22px; background:var(--bg-card-alt);
}
.event-card .date{ font-size:11px; color:var(--text-faint); }
.event-card .tag{
  float:right; border:1px solid var(--red-dark); color:var(--red); font-size:11px; padding:3px 10px; border-radius:14px;
}
.event-card h5{ font-size:16px; color:#fff; margin:10px 0 12px; clear:both; }
.event-card .poster{
  border-radius:var(--radius); overflow:hidden; margin-bottom:14px; position:relative; cursor:pointer;
  border:1px solid var(--border-soft);
}
.event-card .poster img{ width:100%; }
.event-card .poster .tap{
  position:absolute; bottom:8px; right:8px; background:#000; color:var(--text-dim); font-size:11px;
  padding:5px 10px; border-radius:14px; display:flex; align-items:center; gap:5px;
}
.event-card p.desc{ color:var(--text-dim); font-size:13px; margin-bottom:12px; }
.event-card .meta{ border-top:1px solid var(--border-soft); padding-top:12px; font-size:12px; color:var(--text-dim); }
.event-card .meta .participants{ color:var(--red); font-weight:700; }
.event-card .meta .coord{ margin-top:6px; color:var(--red-bright); opacity:.9; }

/* ---------- footer ---------- */
footer{ border-top:1px solid var(--border-soft); padding:40px 32px; margin-top:60px; text-align:center; }
footer .flogos{ display:flex; align-items:center; justify-content:center; gap:16px; margin-bottom:16px; }
footer .flogos img{ width:34px; height:34px; border-radius:50%; }
footer .flogos .sep{ width:1px; height:20px; background:var(--border-soft); }
footer p{ font-size:12px; color:var(--text-faint); max-width:800px; margin:0 auto; }
footer .copy{ margin-top:10px; font-size:11px; }

/* ---------- social links (footer) ---------- */
.social-links{ display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:20px; }
.social-links a{
  width:38px; height:38px; border:1px solid var(--red-dark);
  background:transparent; color:var(--red); border-radius:var(--radius);
  display:flex; align-items:center; justify-content:center;
  transition:background 0.15s, color 0.15s;
}
.social-links a:hover{ background:var(--red); color:#fff; }
.social-links a svg{ width:18px; height:18px; fill:currentColor; }

/* ---------- clickable credit / author links ---------- */
.desc a, .chall-credit a{ color:var(--red); text-decoration:underline; }
.desc a:hover, .chall-credit a:hover{ color:var(--red-bright); }
.chall-credit{ display:inline-block; font-size:12px; color:var(--text-faint); }

/* ---------- hall of fame name links ---------- */
.frame-card h5 a{ color:inherit; text-decoration:none; }
.frame-card h5 a:hover{ color:var(--red); text-decoration:underline; }

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
.auth-wrap{ min-height:calc(100vh - 200px); display:flex; align-items:center; justify-content:center; padding:60px 20px; }
.auth-box{
  width:100%; max-width:420px; background:var(--bg-card); border:1px solid var(--border-soft);
  border-top:2px solid var(--red); border-radius:var(--radius); padding:36px;
}
.auth-box .eyebrow{ text-align:left; }
.auth-box h2{ font-size:24px; color:#fff; margin-bottom:6px; }
.auth-box p.sub{ color:var(--text-dim); font-size:13px; margin-bottom:26px; }
.field{ margin-bottom:18px; }
.field label{ display:block; font-size:11px; color:var(--text-dim); letter-spacing:1px; margin-bottom:6px; }
.field input{
  width:100%; background:#000; border:1px solid var(--border-soft); color:var(--text);
  padding:12px 14px; border-radius:var(--radius); font-size:14px; outline:none;
}
.field input:focus{ border-color:var(--red-dark); }
.form-msg{ font-size:12px; margin-bottom:14px; min-height:16px; }
.form-msg.error{ color:var(--red-bright); }
.form-msg.ok{ color:var(--green-ok); }
.auth-box .switch{ text-align:center; margin-top:20px; font-size:13px; color:var(--text-dim); }
.auth-box .switch a{ color:var(--red); font-weight:700; }

/* ============================================================
   CHALLENGES — container / box style like a real CTF platform
   ============================================================ */
.filter-bar{ display:flex; gap:10px; margin-bottom:24px; flex-wrap:wrap; }
.filter-chip{
  border:1px solid var(--border-soft); padding:7px 14px; border-radius:16px; font-size:12px; color:var(--text-dim); cursor:pointer;
}
.filter-chip.active{ border-color:var(--red); color:var(--red); }

.challenge-grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:18px;
}
.challenge-grid.grouped{ display:block; }
.category-group{ margin-bottom:32px; }
.category-group-head{
  display:flex; align-items:center; gap:10px; margin-bottom:16px;
  padding-bottom:8px; border-bottom:1px solid var(--border-soft);
}
.category-group-head .dot{ width:8px; height:8px; border-radius:50%; background:var(--red); flex:0 0 auto; }
.category-group-head h4{ font-size:15px; letter-spacing:1px; color:#fff; text-transform:uppercase; }
.category-group-head .count{ font-size:11px; color:var(--text-faint); margin-left:auto; }
.category-group .challenge-grid{ margin-bottom:0; }
.chall-box{
  background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius);
  padding:20px; cursor:pointer; position:relative; transition:border-color .15s ease, transform .1s ease;
  border-top:3px solid var(--border-soft);
}
.chall-box:hover{ border-color:var(--red-dark); transform:translateY(-2px); }
.chall-box.solved{ border-top-color:var(--green-ok); }
.chall-box .cat{ font-size:10px; letter-spacing:1px; color:var(--text-faint); }
.chall-box h5{ font-size:16px; color:#fff; margin:10px 0 14px; min-height:40px; }
.chall-box .row{ display:flex; align-items:center; justify-content:space-between; }
.diff{ font-size:11px; padding:3px 9px; border-radius:10px; font-weight:700; }
.diff.easy{ background:rgba(74,222,128,0.12); color:var(--green-ok); }
.diff.medium{ background:rgba(244,180,0,0.12); color:var(--gold); }
.diff.hard{ background:rgba(224,52,45,0.15); color:var(--red-bright); }
.pts{ color:var(--red); font-weight:800; font-size:14px; }
.chall-box .solves{ font-size:11px; color:var(--text-faint); margin-top:10px; }
.chall-box .solved-badge{
  position:absolute; top:12px; right:12px; color:var(--green-ok); font-size:16px;
}

/* modal */
.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,0.75); z-index:200; display:none;
  align-items:center; justify-content:center; padding:20px; backdrop-filter:blur(3px);
}
.modal-overlay.open{ display:flex; }
.modal-box{
  width:100%; max-width:560px; max-height:88vh; overflow-y:auto; background:var(--bg-card);
  border:1px solid var(--red-dark); border-radius:var(--radius); padding:30px; position:relative;
}
.modal-close{
  position:absolute; top:16px; right:18px; background:none; border:none; color:var(--text-dim);
  font-size:20px; cursor:pointer;
}
.modal-box .cat{ font-size:11px; color:var(--text-faint); letter-spacing:1px; }
.modal-box h3{ font-size:22px; color:#fff; margin:8px 0 14px; }
.modal-box .meta-row{ display:flex; gap:10px; margin-bottom:18px; align-items:center; }
.modal-box p.desc{ color:var(--text-dim); font-size:14px; margin-bottom:18px; line-height:1.7; }
.file-link{
  display:flex; align-items:center; gap:10px; border:1px solid var(--border-soft); border-radius:var(--radius);
  padding:12px 14px; margin-bottom:18px; font-size:13px; color:var(--text); background:#000;
}
.file-link:hover{ border-color:var(--red-dark); color:var(--red); }
.hint-toggle{ font-size:12px; color:var(--gold); cursor:pointer; margin-bottom:10px; display:inline-block; }
.hint-box{ display:none; background:#000; border:1px dashed var(--border-soft); padding:12px 14px; border-radius:var(--radius); font-size:13px; color:var(--text-dim); margin-bottom:18px; }
.hint-box.open{ display:block; }
.flag-form{ display:flex; gap:10px; margin-top:6px; }
.flag-form input{
  flex:1; background:#000; border:1px solid var(--border-soft); color:var(--text); padding:12px 14px;
  border-radius:var(--radius); font-size:13px; outline:none;
}
.flag-form input:focus{ border-color:var(--red); }
.chall-msg{ font-size:12px; margin-top:10px; min-height:16px; }
.chall-msg.error{ color:var(--red-bright); }
.chall-msg.ok{ color:var(--green-ok); }

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leader-table{ width:100%; border-collapse:collapse; background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; }
.leader-table th{ text-align:left; font-size:11px; letter-spacing:1px; color:var(--text-faint); padding:16px 20px; border-bottom:1px solid var(--border-soft); }
.leader-table td{ padding:16px 20px; border-bottom:1px solid var(--border-soft); font-size:14px; }
.leader-table tr:last-child td{ border-bottom:none; }
.leader-table tr.me{ background:rgba(224,52,45,0.06); }
.rank-num{ font-weight:800; color:var(--text-dim); }
.rank-num.gold{ color:var(--gold); }
.rank-num.silver{ color:#c9c9c9; }
.rank-num.bronze{ color:#c98a4b; }
.op-tag{ display:inline-block; border:1px solid var(--red-dark); color:var(--red); font-size:10px; font-weight:800; padding:2px 6px; border-radius:3px; margin-right:8px; }
.score-cell{ color:var(--red); font-weight:800; }
.badge-icon{ font-size:16px; margin-right:4px; }
.empty-row td{ text-align:center; color:var(--text-faint); padding:40px; }

/* ============================================================
   HALL OF FRAME
   ============================================================ */
.frame-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
@media (max-width:900px){ .frame-grid{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:520px){ .frame-grid{ grid-template-columns:1fr;} }
.frame-card{ background:var(--bg-card); border:1px solid var(--border-soft); border-radius:var(--radius); padding:26px; text-align:center; }
.frame-card .avatar{
  width:96px; height:96px; border-radius:50%; margin:0 auto 16px; border:2px solid var(--red);
  overflow:hidden; box-shadow:0 0 14px rgba(224,52,45,0.35);
}
.frame-card .avatar img{ width:100%; height:100%; object-fit:cover; }
.frame-card h5{ color:#fff; font-size:16px; margin-bottom:4px; }
.frame-card .role{ color:var(--red); font-size:12px; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-hero{ display:flex; align-items:center; gap:22px; margin-bottom:36px; flex-wrap:wrap; }
.profile-hero .avatar-lg{
  width:88px; height:88px; border-radius:var(--radius); background:var(--red); color:#fff;
  font-weight:800; font-size:28px; display:flex; align-items:center; justify-content:center; border:1px solid var(--red-bright);
}
.profile-hero h2{ font-size:26px; color:#fff; }
.profile-hero .rank-line{ color:var(--text-dim); font-size:13px; margin-top:6px; }
.profile-hero .rank-line b{ color:var(--red); }

.profile-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:40px; }
@media (max-width:800px){ .profile-stats{ grid-template-columns:repeat(2,1fr);} }

.solved-list .item{
  display:flex; align-items:center; justify-content:space-between; padding:14px 18px;
  border:1px solid var(--border-soft); border-radius:var(--radius); margin-bottom:10px; background:var(--bg-card);
}
.solved-list .item .name{ color:#fff; font-size:14px; }
.solved-list .item .cat{ color:var(--text-faint); font-size:11px; margin-top:3px; }
.solved-list .item .pts{ color:var(--green-ok); font-weight:800; }

.streak-strip{ display:flex; gap:6px; margin-top:10px; flex-wrap:wrap; }
.streak-day{ width:26px; height:26px; border-radius:4px; background:#151515; border:1px solid var(--border-soft); }
.streak-day.hit{ background:var(--red); border-color:var(--red-bright); }

.badge-row{ display:flex; gap:14px; flex-wrap:wrap; }
.badge-pill{ border:1px solid var(--border-soft); border-radius:20px; padding:8px 16px; font-size:12px; color:var(--text-dim); display:flex; gap:6px; align-items:center; }

.loading-note, .empty-note{ color:var(--text-faint); font-size:13px; padding:20px 0; }

/* utility */
.mt-40{ margin-top:40px; } .mb-20{ margin-bottom:20px; }
.center{ text-align:center; }
.page-title{ padding:36px 0 10px; }
.page-title h2{ font-size:22px; color:#fff; }
.page-title .slash{ color:var(--red); }
main{ min-height: 60vh; }
