:root{
  --bg: #0b1220;
  --card: #111b2e;
  --text: #e7eefc;
  --muted: #a9b6d6;
  --xp: #00e5ff;
  --accent: #7c3aed;
  --accent2: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --blue: #3b82f6;
  --shadow: 0 20px 45px rgba(0,0,0,.35);
  --radius: 18px;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 15% 10%, rgba(124,58,237,.25), transparent 60%),
              radial-gradient(1000px 550px at 80% 30%, rgba(0,229,255,.18), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: inherit; text-decoration: none; }
.container{ max-width: 1100px; margin: 0 auto; padding: 24px; }

.topbar{
  position: sticky; top:0; z-index: 10;
  display:flex; align-items:center; justify-content: center; gap: 12px;
  padding: 14px 20px;
  background: rgba(9, 14, 26, .7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-wrap: wrap;
}

@media (min-width: 641px){
  .topbar{
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .brand{
    justify-self: start;
  }
  .nav{
    justify-self: center;
  }
  .account{
    justify-self: end;
  }
}

@media (max-width: 640px){
  .topbar{
    padding: 10px 12px;
    gap: 8px;
  }
  .brand{
    order: 1;
    width: 100%;
    justify-content: center;
  }
  .nav{
    order: 2;
    width: 100%;
    gap: 10px;
    justify-content: center;
  }
  .nav a{
    font-size: 12px;
  }
  .account{
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }
}

.brand{ display:flex; align-items:center; gap:10px; font-weight:700; flex-shrink: 0; }
.brand__logo{
  width: 38px; height: 38px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, var(--xp), var(--accent));
  border-radius: 12px;
  box-shadow: var(--shadow);
  color:#00131a;
  font-weight:800;
  letter-spacing: .5px;
}
.brand__text{ font-size: 18px; letter-spacing:.2px; }
.brand__text-short{ display: none; }
.brand__text-long{ display: inline; }

@media (max-width: 640px){
  .brand__text-long{ display: none; }
  .brand__text-short{ display: inline; }
}

.nav{ display:flex; gap: 16px; align-items: center; }
.nav a{ 
  color: var(--muted); 
  font-weight:600; 
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.nav a:hover{ 
  color: var(--text); 
  background: rgba(255,255,255,.05);
}

.account{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill{
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
.pill--warning{ border-color: rgba(245,158,11,.35); }

.btn{
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(0,229,255,.25), rgba(124,58,237,.25));
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}
.btn:hover{ filter: brightness(1.08); }
.btn--ghost{
  background: rgba(255,255,255,.04);
  box-shadow:none;
}
.btn--danger{
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.35);
  box-shadow:none;
}
.btn--xl{ padding: 14px 18px; border-radius: 16px; font-size: 15px; }

.hero{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 18px;
  margin-top: 14px;
}
.hero__copy h1{ font-size: 44px; margin: 0 0 10px 0; }
.lead{ font-size: 17px; color: var(--muted); line-height:1.6; }
.cta-row{ display:flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.inline{ display:inline; }

.card{
  background: rgba(17,27,46,.78);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card__title{ font-weight:800; margin-bottom: 10px; }
.rank-list{ margin:0; padding-left: 18px; color: var(--muted); }
.rank-interactive{ list-style: none; padding: 0 !important; margin: 0 !important; }
.badge{
  display:inline-block;
  min-width: 56px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,.14);
  border: 1px solid rgba(34,197,94,.25);
  color: var(--text);
  font-size: 12px;
  margin-right: 8px;
  text-align:center;
}

.filters{ margin-top: 28px; }
.filters h2{ margin: 0 0 10px 0; }
.filter-row{ display:flex; gap: 12px; align-items:end; flex-wrap: wrap; }
label{ display:flex; flex-direction:column; gap: 6px; font-weight: 700; color: var(--muted); }
.input, select, textarea{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 12px;
  outline: none;
}

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.game-card{
  display:block;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px;
  transition: transform .15s ease;
}
.game-card:hover{ transform: translateY(-2px); border-color: rgba(0,229,255,.22); }
.game-card__meta{ display:flex; gap: 8px; flex-wrap: wrap; }
.game-card__title{ font-weight: 800; margin-top: 10px; }
.chip{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,229,255,.12);
  border: 1px solid rgba(0,229,255,.22);
  color: var(--text);
  font-size: 12px;
}
.chip--blue{ background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
.chip--purple{ background: rgba(124,58,237,.12); border-color: rgba(124,58,237,.25); }

.section{ margin-top: 30px; }
.muted{ color: var(--muted); }
.small{ font-size: 13px; }

.auth{ max-width: 520px; margin: 20px auto; }
.form{ display:flex; flex-direction:column; gap: 12px; }
.checkbox{ flex-direction: row; align-items:center; gap: 10px; }

.panel .grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.mt{ margin-top: 14px; }

.toast-area{
  display:flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 16px 0;
  position: relative;
  z-index: 3001; /* Modal üzerinde görünsün */
}
.toast{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
}
.toast--success{ border-color: rgba(34,197,94,.35); }
.toast--danger{ border-color: rgba(239,68,68,.35); }
.toast--warning{ border-color: rgba(245,158,11,.35); }
.toast--info{ border-color: rgba(59,130,246,.35); }

.footer{ margin-top: 34px; border-top: 1px solid rgba(255,255,255,.06); }
.footer__inner{ display:flex; justify-content:space-between; gap: 10px; padding: 18px 24px; }

.table{ width:100%; border-collapse: collapse; }
.table th, .table td{ padding: 10px; border-bottom: 1px solid rgba(255,255,255,.08); text-align:left; }
.table th{ color: var(--muted); font-size: 13px; }

@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel .grid-2{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
  .hero__copy h1{ font-size: 34px; }
}
/* HUD (sağ üst rütbe/XP paneli) */
.hud{ display:flex; align-items:center; gap:10px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 640px){
  .hud{ 
    width: 100%;
    justify-content: center;
    gap: 4px; 
  }
}
.hud-box{
  display:flex; align-items:center; gap:10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}

@media (max-width: 640px){
  .hud-box{
    padding: 8px 10px;
    gap: 8px;
  }
}
.hud-icon{
  width: 36px; height:36px;
  display:grid; place-items:center;
  border-radius: 12px;
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.25);
}

@media (max-width: 640px){
  .hud-icon{
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}
.hud-rank{ display:flex; flex-direction:column; line-height:1.05; }
.hud-rank-top{ font-weight:900; font-size:12px; }
.hud-rank-bottom{ font-weight:800; font-size:12px; color: var(--muted); }

@media (max-width: 640px){
  .hud-rank-top{ font-size: 11px; }
  .hud-rank-bottom{ font-size: 11px; }
}

.hud-box-user{ gap:12px; }
.hud-user{ display:flex; flex-direction:column; line-height:1.05; }
.hud-user-mode{ font-size:10px; font-weight:800; color: var(--muted); letter-spacing:.3px; }
.hud-user-name{ font-size:12px; font-weight:900; color: var(--accent2); }

@media (max-width: 640px){
  .hud-user-mode{ font-size: 9px; letter-spacing: 0px; }
  .hud-user-name{ font-size: 11px; }
  .hud-box-user{ gap: 10px; }
}

.icon-btn{
  width: 38px; height: 38px;
  display:grid; place-items:center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  flex-shrink: 0;
}

@media (max-width: 640px){
  .icon-btn{
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}
.icon-btn:hover{ filter: brightness(1.08); }
.icon-btn--danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
}

/* Login ekranı */
.auth-page{
  min-height: calc(100vh - 90px);
  display:grid;
  place-items:center;
  padding: 28px 16px;
}
.auth-card{
  width: min(520px, 100%);
  padding: 26px;
  border-radius: 22px;
  background: rgba(17,27,46,.78);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: var(--shadow);
  position: relative;
}
.auth-card:before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: 24px;
  background: linear-gradient(90deg, rgba(0,229,255,.55), rgba(124,58,237,.55), rgba(34,197,94,.45));
  z-index:-1;
  filter: blur(.2px);
}
.auth-head{ text-align:center; margin-bottom: 14px; }
.auth-title{ font-weight: 900; font-size: 28px; }
.auth-sub{ color: var(--muted); font-weight: 700; margin-top: 4px; }

.auth-actions{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.auth-btn-primary{ border-radius: 16px; }
.auth-btn-secondary{ border-radius: 16px; text-align:center; }

.auth-divider{
  display:flex; align-items:center; gap: 10px;
  margin: 14px 0 10px 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.auth-divider:before, .auth-divider:after{
  content:"";
  height:1px;
  flex:1;
  background: rgba(255,255,255,.10);
}
.auth-btn-guest{
  width: 100%;
  text-align:center;
  border-radius: 16px;
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.28);
}

/* Misafir karşılama */
.welcome{
  min-height: calc(100vh - 90px);
  display:grid;
  place-items:center;
  padding: 28px 16px;
}
.welcome-card{
  width: min(680px, 100%);
  text-align:center;
  padding: 44px 22px;
  border-radius: 26px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
}
.welcome-rocket{ font-size: 64px; margin-bottom: 8px; }
.welcome-headline{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.welcome-title{ 
  font-weight: 900; 
  font-size: 44px; 
  letter-spacing: .8px; 
}
.welcome-sub{ 
  font-weight: 900; 
  font-size: 48px;
  color: #14b8a6; /* Fallback color for accessibility */
  background: linear-gradient(135deg, #10b981, #14b8a6, #22c55e, #84fab0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: welcomePulse 2s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}
@keyframes welcomePulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2); }
}
.welcome-note{ 
  margin-top: 10px; 
  margin-bottom: 20px;
  color: var(--warn); 
  font-weight: 800; 
}

.btn--green{
  background: rgba(34,197,94,.16);
  border-color: rgba(34,197,94,.30);
}
