/* ============================================================
   Tushar Tournament — NEW UI v6
   White + Blue (light) | Midnight blue (dark) | Hamburger nav
   ============================================================ */

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

:root{
  --bg:#eef5ff;
  --bg-glow-1:#dbe8ff;
  --bg-glow-2:rgba(30,94,255,.10);
  --surface:#ffffff;
  --surface-2:#f6faff;
  --text:#0a1733;
  --muted:#5a6c8c;
  --border:#d6e3f8;

  --primary:#1e5eff;
  --primary-2:#4d8bff;
  --primary-glow:rgba(30,94,255,.35);
  --primary-soft:rgba(30,94,255,.08);

  --danger:#e11d48;
  --success:#10b981;
  --err:#b91c1c;
  --ok:#047857;

  --shadow-sm:0 2px 12px -4px rgba(20,60,150,.14);
  --shadow-md:0 10px 34px -14px rgba(20,60,150,.28);
  --shadow-lg:0 26px 60px -24px rgba(30,94,255,.40);

  --radius:20px;
  --radius-sm:12px;
  color-scheme:light;
}

:root[data-theme="dark"]{
  --bg:#050a18;
  --bg-glow-1:#0a1738;
  --bg-glow-2:rgba(77,139,255,.14);
  --surface:#0d1530;
  --surface-2:#0a1024;
  --text:#e6eeff;
  --muted:#7d8fb5;
  --border:#1b2846;

  --primary:#4d8bff;
  --primary-2:#7ba9ff;
  --primary-glow:rgba(77,139,255,.55);
  --primary-soft:rgba(77,139,255,.14);

  --err:#ff9ea8;
  --ok:#6ee7a8;

  --shadow-sm:0 2px 12px -4px rgba(0,0,0,.7);
  --shadow-md:0 10px 34px -14px rgba(0,0,0,.85);
  --shadow-lg:0 26px 70px -24px rgba(77,139,255,.40);

  color-scheme:dark;
}

/* alternate accent themes */
body.theme-red{
  --primary:#dc2626;--primary-2:#f87171;
  --primary-glow:rgba(220,38,38,.38);
  --primary-soft:rgba(220,38,38,.10);
  --shadow-lg:0 26px 60px -24px rgba(220,38,38,.4);
}
body.theme-purple{
  --primary:#7c3aed;--primary-2:#a855f7;
  --primary-glow:rgba(124,58,237,.38);
  --primary-soft:rgba(124,58,237,.10);
  --shadow-lg:0 26px 60px -24px rgba(124,58,237,.4);
}

/* ================= BASE ================= */
body{
  font-family:'Inter','Segoe UI',system-ui,-apple-system,Roboto,sans-serif;
  background:
    radial-gradient(circle at 0% 0%, var(--bg-glow-1) 0%, transparent 55%),
    radial-gradient(circle at 100% 100%, var(--bg-glow-2) 0%, transparent 55%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  transition:background .35s ease,color .35s ease;
}

/* ================= HEADER ================= */
header{
  position:sticky;top:12px;z-index:100;
  margin:12px 16px 0;
  padding:10px 14px;
  display:flex;align-items:center;gap:10px;
  background:color-mix(in srgb,var(--surface) 88%, transparent);
  backdrop-filter:blur(18px) saturate(180%);
  -webkit-backdrop-filter:blur(18px) saturate(180%);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-md);
  transition:background .35s, border-color .35s;
}
header strong{
  flex:1;
  font-size:1.05rem;font-weight:800;letter-spacing:-.3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  background:linear-gradient(135deg,var(--primary) 0%, var(--primary-2) 100%);
  -webkit-background-clip:text;background-clip:text;
  color:transparent;
}

/* -------- theme toggle button -------- */
.theme-toggle{
  background:var(--surface-2);
  border:1.5px solid var(--border);
  color:var(--text);
  width:44px;height:44px;padding:0;
  border-radius:12px;
  font-size:1.1rem;line-height:1;
  box-shadow:none;
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
  transition:all .2s;
}
.theme-toggle:hover{
  background:var(--primary-soft);
  border-color:var(--primary);
  transform:none;filter:none;box-shadow:none;
}

/* -------- hamburger (3 lines) button -------- */
.hamburger{
  width:44px;height:44px;padding:0;
  display:inline-flex;flex-direction:column;
  align-items:center;justify-content:center;
  gap:5px;
  background:var(--surface-2);
  border:1.5px solid var(--border);
  border-radius:12px;
  cursor:pointer;
  color:var(--text);
  box-shadow:none;
  transition:all .2s;
}
.hamburger span{
  display:block;
  width:20px;height:2.5px;
  background:currentColor;
  border-radius:2px;
  transform-origin:center;
  transition:transform .3s ease, opacity .3s ease;
}
.hamburger:hover{
  border-color:var(--primary);
  background:var(--primary-soft);
  transform:none;filter:none;box-shadow:none;
}
/* animated X when open */
.hamburger.open span:nth-child(1){transform:translateY(7.5px) rotate(45deg)}
.hamburger.open span:nth-child(2){opacity:0}
.hamburger.open span:nth-child(3){transform:translateY(-7.5px) rotate(-45deg)}

/* -------- dropdown navigation -------- */
#mainNav{
  display:none;
  position:absolute;
  top:calc(100% + 8px);
  left:0;right:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  padding:10px;
  flex-direction:column;
  gap:4px;
  box-shadow:var(--shadow-lg);
  max-height:70vh;
  overflow-y:auto;
  animation:menuFade .22s ease-out;
}
#mainNav.open{display:flex}
@keyframes menuFade{
  from{opacity:0;transform:translateY(-8px)}
  to{opacity:1;transform:translateY(0)}
}
#mainNav a{
  display:block;width:100%;
  padding:13px 16px;
  border-radius:12px;
  color:var(--muted);
  text-decoration:none;
  font-size:.95rem;font-weight:600;
  transition:all .2s;
}
#mainNav a:hover{
  background:var(--primary-soft);
  color:var(--primary);
  text-decoration:none;
}
#mainNav a.active{
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;
  box-shadow:0 6px 16px -6px var(--primary-glow);
}
#mainNav form{margin:6px 0 0}
#mainNav form button{
  width:100%;justify-content:center;
  padding:13px 16px;font-size:.95rem;
}

/* ================= LAYOUT ================= */
.wrap{max-width:1080px;margin:0 auto;padding:30px 20px 80px}

h1{font-size:2rem;font-weight:800;letter-spacing:-.03em;line-height:1.2;margin:0 0 20px}
h2{font-size:1.5rem;font-weight:700;letter-spacing:-.02em;margin:28px 0 16px}
h3{font-size:1.05rem;font-weight:700;margin:0 0 10px}
p{margin:6px 0}
a{color:var(--primary);text-decoration:none;transition:color .2s}
a:hover{text-decoration:underline}

/* ================= CARDS ================= */
.card{
  position:relative;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:var(--shadow-sm);
  transition:transform .3s cubic-bezier(.2,.8,.2,1),
             box-shadow .3s, border-color .3s, background .35s;
  overflow:hidden;
}
.card::before{
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
  background:linear-gradient(90deg,var(--primary),var(--primary-2));
  opacity:0;transition:opacity .3s;
}
.card:hover{
  transform:translateY(-4px);
  box-shadow:var(--shadow-lg);
  border-color:color-mix(in srgb,var(--primary) 28%, var(--border));
}
.card:hover::before{opacity:1}

/* ================= GRID ================= */
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}
.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}

/* ================= BUTTONS ================= */
button,.button{
  font-family:inherit;font-size:.94rem;font-weight:700;letter-spacing:.2px;
  border:0;border-radius:12px;padding:12px 22px;cursor:pointer;
  color:#fff;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  box-shadow:0 8px 20px -8px var(--primary-glow);
  transition:transform .18s,box-shadow .22s,filter .2s,background .3s;
  text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  line-height:1;
}
button:hover,.button:hover{
  transform:translateY(-2px);
  filter:brightness(1.06);
  box-shadow:0 14px 28px -8px var(--primary-glow);
  text-decoration:none;
}
button:active,.button:active{transform:translateY(0)}

button.secondary,.button.secondary{
  background:transparent;
  color:var(--primary);
  border:2px solid color-mix(in srgb,var(--primary) 45%,var(--border));
  box-shadow:none;
}
button.secondary:hover,.button.secondary:hover{
  background:var(--primary-soft);
  filter:none;
}

button.danger{
  background:linear-gradient(135deg,var(--danger),#ff5d7a);
  color:#fff;
  box-shadow:0 8px 20px -8px rgba(225,29,72,.5);
}

.card .button{margin:6px 8px 6px 0}

button:focus-visible,.button:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
}

/* ================= FORMS ================= */
label{
  display:block;font-size:.85rem;font-weight:600;color:var(--muted);
  margin-bottom:14px;letter-spacing:.1px;
}
input,select,textarea{
  width:100%;font-family:inherit;font-size:.95rem;color:var(--text);
  background:var(--surface-2);
  border:1.5px solid var(--border);
  border-radius:12px;
  padding:12px 14px;margin-top:6px;outline:none;
  transition:border-color .2s,box-shadow .2s,background .35s,color .35s;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primary-soft);
  background:var(--surface);
}
input[type=checkbox],input[type=radio]{
  width:auto;margin:0 8px 0 0;
  accent-color:var(--primary);vertical-align:middle;
}

/* ================= AUTH ================= */
.auth{
  max-width:440px;margin:40px auto;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:34px 28px;
  box-shadow:var(--shadow-lg);
}
.auth h1{text-align:center;margin-bottom:22px;font-size:1.6rem}
.auth button.primary,.auth button{width:100%;margin-top:8px}
.auth p{text-align:center;color:var(--muted);font-size:.9rem;margin-top:14px}

/* ================= ALERTS ================= */
.alert{
  background:color-mix(in srgb,var(--danger) 9%, var(--surface));
  border:1px solid color-mix(in srgb,var(--danger) 40%, var(--border));
  color:var(--err);
  padding:14px 18px;border-radius:14px;margin:0 0 18px;
  font-weight:600;font-size:.92rem;
}
.alert.success{
  background:color-mix(in srgb,var(--success) 10%, var(--surface));
  border-color:color-mix(in srgb,var(--success) 40%, var(--border));
  color:var(--ok);
}

/* ================= BADGE ================= */
.badge{
  display:inline-block;font-size:.74rem;font-weight:700;letter-spacing:.3px;
  padding:4px 11px;border-radius:999px;
  color:var(--primary);
  background:var(--primary-soft);
  border:1px solid color-mix(in srgb,var(--primary) 30%, transparent);
}

/* ================= IMAGES ================= */
img.banner,.banner{
  width:100%;max-height:200px;object-fit:cover;
  border-radius:14px;margin-bottom:16px;display:block;
}

/* ================= MISC ================= */
.muted{color:var(--muted);font-size:.88rem}

/* ================= TABLES ================= */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:.9rem}
th,td{padding:12px 14px;text-align:left;border-bottom:1px solid var(--border)}
th{
  color:var(--muted);font-weight:700;
  font-size:.74rem;text-transform:uppercase;letter-spacing:.6px;
  background:var(--surface-2);
}
tr:last-child td{border-bottom:0}
tbody tr{transition:background-color .15s}
tbody tr:hover{background:var(--primary-soft)}

/* ================= HERO ================= */
.hero{
  position:relative;
  padding:64px 44px;
  border-radius:26px;
  background:linear-gradient(135deg,var(--primary) 0%, var(--primary-2) 100%);
  color:#fff;
  margin-bottom:34px;
  overflow:hidden;
  box-shadow:var(--shadow-lg);
}
.hero::before{
  content:'';position:absolute;top:-40%;right:-15%;
  width:520px;height:520px;
  background:radial-gradient(circle, rgba(255,255,255,.18), transparent 68%);
  border-radius:50%;pointer-events:none;
}
.hero::after{
  content:'';position:absolute;bottom:-45%;left:-10%;
  width:420px;height:420px;
  background:radial-gradient(circle, rgba(0,0,0,.15), transparent 70%);
  border-radius:50%;pointer-events:none;
}
.hero h1{font-size:2.4rem;color:#fff;margin-bottom:14px;position:relative;z-index:1}
.hero p{font-size:1.08rem;opacity:.94;margin-bottom:26px;position:relative;z-index:1;max-width:620px}
.hero .button{
  position:relative;z-index:1;
  background:#fff;color:var(--primary);
  box-shadow:0 10px 26px -10px rgba(0,0,0,.35);
}
.hero .button:hover{
  transform:translateY(-2px);filter:none;
  box-shadow:0 16px 32px -10px rgba(0,0,0,.45);
}
.hero .button.secondary{
  background:transparent;color:#fff;
  border:2px solid rgba(255,255,255,.55);
  box-shadow:none;margin-left:10px;
}
.hero .button.secondary:hover{background:rgba(255,255,255,.15)}
:root[data-theme="dark"] .hero{
  background:linear-gradient(135deg,#16327a 0%, #4d8bff 100%);
  box-shadow:0 30px 90px -30px var(--primary-glow);
}

/* ================= RESPONSIVE ================= */
@media (max-width:720px){
  header{margin:8px 10px 0;padding:9px 12px;border-radius:16px}
  .hamburger,.theme-toggle{width:40px;height:40px}
  .hamburger span{width:18px;height:2.2px}
  #mainNav{top:calc(100% + 6px);left:0;right:0;border-radius:16px}
  .wrap{padding:22px 14px 60px}
  h1{font-size:1.55rem}
  h2{font-size:1.24rem}
  .hero{padding:38px 22px;border-radius:22px}
  .hero h1{font-size:1.7rem}
  .hero p{font-size:1rem}
  .hero .button.secondary{margin-left:0;margin-top:10px}
  .card{padding:18px}
  .auth{margin:20px auto;padding:26px 20px}
}