/* ==================== THEME VARIABLES ==================== */
:root{
  /* Light Theme (default) */
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel2: #f8fbff;
  --stroke: rgba(15,23,42,.06);
  --text: rgba(15,23,42,.95);
  --muted: rgba(15,23,42,.45);
  --danger: rgba(220,60,76,1);
  --ok: rgba(34,197,94,1);
  --warn: rgba(245,158,11,1);
  --brand: rgba(37,99,235,1);
  --accent: rgba(124,58,237,1);
  --radius: 12px;
  
  /* Theme-specific */
  --header-bg: rgba(15,23,42,0.92);
  --header-text: rgba(255,255,255,0.96);
  --loader-bg: rgba(255,255,255,0.86);
  --loader-border: rgba(15,23,42,.06);
  --loader-inner-bg: #fff;
  --body-gradient: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  --input-bg: #fff;
  --input-border: rgba(15,23,42,.08);
  --btn-ghost-hover: rgba(15,23,42,.04);
  --card-shadow: 0 4px 24px rgba(15,23,42,.06);
}

/* Dark Theme */
[data-theme="dark"]{
  --bg: #0f172a;
  --panel: #1e293b;
  --panel2: #1a2332;
  --stroke: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.5);
  --danger: rgba(248,113,113,1);
  --ok: rgba(74,222,128,1);
  --warn: rgba(251,191,36,1);
  --brand: rgba(96,165,250,1);
  --accent: rgba(167,139,250,1);
  
  /* Theme-specific overrides */
  --header-bg: rgba(15,23,42,0.98);
  --header-text: rgba(255,255,255,0.96);
  --loader-bg: rgba(15,23,42,0.92);
  --loader-border: rgba(255,255,255,.08);
  --loader-inner-bg: #1e293b;
  --body-gradient: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --input-bg: #1e293b;
  --input-border: rgba(255,255,255,.12);
  --btn-ghost-hover: rgba(255,255,255,.08);
  --card-shadow: 0 4px 24px rgba(0,0,0,.3);
}

/* Dark theme element overrides */
[data-theme="dark"] .podiumSlot.tall{
  background: linear-gradient(180deg, rgba(251,191,36,0.15) 0%, var(--panel) 100%);
}
[data-theme="dark"] .podiumSlot.mid{
  background: linear-gradient(180deg, rgba(156,163,175,0.15) 0%, var(--panel) 100%);
}
[data-theme="dark"] .podiumSlot.short{
  background: linear-gradient(180deg, rgba(217,119,6,0.15) 0%, var(--panel) 100%);
}
[data-theme="dark"] .leaderboardCard{
  background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, var(--panel) 50%, rgba(74,222,128,0.08) 100%);
}
[data-theme="dark"] .authInput::placeholder{
  color: var(--muted);
}
[data-theme="dark"] .donut::after{
  color: var(--text);
}

/* Global loader (logo altında) */
.globalLoader{
  position: sticky;
  top: 0;
  z-index: 999;
  display: none;
  justify-content: center;
  padding: 10px 12px;
  background: var(--loader-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--loader-border);
}

.globalLoader.show{
  display: flex;
}

.globalLoaderInner{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--loader-inner-bg);
  border: 1px solid var(--input-border);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
}

.spinner{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid var(--stroke);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin{
  to { transform: rotate(360deg); }
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--body-gradient);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Smooth image appearance (reduces harsh pop-in on slow connections) */
img.imgSmooth{
  opacity: 0;
  transition: opacity 180ms ease;
}
img.imgSmooth.loaded{
  opacity: 1;
}

a{ color:inherit; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 16px;
  min-height: 64px;
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(124,58,237,0.35);
  box-shadow: 0 10px 30px rgba(15,23,42,0.14);
  isolation: isolate;
}

.topLogoBtn{
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255,255,255,0.96);
}

.topLogoBtn::before,
.topLogoBtn::after{
  content: "";
  display: block;
  height: 2px;
  width: clamp(64px, 12vw, 220px);
  background: var(--accent);
  opacity: 0.55;
  border-radius: 999px;
}

.topLogo{
  position: static;
  transform: none;
  height: 56px;
  width: auto;
  display:block;
  filter: drop-shadow(0 6px 14px rgba(15,23,42,0.08));
  object-fit: contain;
  mix-blend-mode: normal;
}

/* Modal popup (friend requests / invites) */
.modalBackdrop{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(8px);
}

.modalCard{
  width: min(560px, 92vw);
  max-height: min(74vh, 720px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(124,58,237,0.22);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15,23,42,0.22);
}

.modalHead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid var(--stroke);
}


.modalBody{ padding: 12px 14px 14px 14px; }

.modalSection + .modalSection{ margin-top: 14px; }
.modalSectionTitle{ font-weight: 900; margin-bottom: 8px; }

/* disable decorative pseudo element */
.topbar::before{ display:none; }

/* Form inputs */
.input{
  width:100%;
  padding:12px 14px;
  border-radius:10px;
  border:1px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(15,23,42,0.02);
  margin-top:8px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.input::placeholder{
  color: var(--muted);
}

/* Avatar picker */
.avatarRow{ display:flex; gap:8px; flex-wrap:wrap; margin-top:8px }
.avatarGrid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.avatarBtn{
  appearance:none;
  border:1px solid var(--stroke);
  background: var(--panel);
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  font-size:20px;
  transition: all 0.15s ease;
  position: relative;
}
.avatarBtn:hover:not(:disabled){
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}
.avatarBtn.selected{
  border-color: rgba(59,130,246,1);
  border-width: 2px;
  box-shadow: 0 6px 18px rgba(59,130,246,0.18);
  transform:translateY(-2px);
  background: rgba(59,130,246,0.06);
}
.avatarBtn.premium{
  background: linear-gradient(135deg, #fefce8 0%, #fff 100%);
  border-color: #fbbf24;
}
.avatarBtn.premium.selected{
  border-color: #f59e0b;
  box-shadow: 0 6px 18px rgba(245,158,11,0.22);
}
.avatarBtn.locked{
  opacity: 0.7;
  cursor: not-allowed;
  background: var(--bg);
}
.avatarLock{
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 12px;
  background: var(--panel);
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ==================== AUTH PAGE ==================== */
.authPage{
  position: relative;
  min-height: calc(100vh - 200px);
  padding-top: 20px;
}
.authBg{
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.authBgShape{
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
}
.authBgShape.shape1{
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  top: -100px;
  left: -150px;
}
.authBgShape.shape2{
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  bottom: 50px;
  right: -100px;
}
.authBgShape.shape3{
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  top: 40%;
  left: 30%;
}
.authPage .grid{
  position: relative;
  z-index: 1;
}
.authLeft{
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.authRight{
  position: sticky;
  top: 100px;
  align-self: start;
}

/* Auth Card */
.authCard{
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.02),
    0 12px 40px rgba(15,23,42,0.08);
}
.authHeader{
  text-align: center;
  margin-bottom: 24px;
}
.authIcon{
  font-size: 48px;
  margin-bottom: 12px;
  animation: authIconFloat 3s ease-in-out infinite;
}
@keyframes authIconFloat{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}
.authTitle{
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.authSubtitle{
  font-size: 14px;
  color: var(--muted);
}

/* Auth Promo */
.authPromo{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}
.authPromoIcon{
  font-size: 22px;
}

/* Auth Form */
.authForm{
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.authInputGroup{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.authLabel{
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.authInput{
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  transition: all 0.15s ease;
}
.authInput:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}
.authInput::placeholder{
  color: #9ca3af;
}

/* Auth Button */
.authBtn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.authBtn.primary{
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.authBtn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}
.authBtnArrow{
  font-size: 18px;
  transition: transform 0.2s ease;
}
.authBtn:hover .authBtnArrow{
  transform: translateX(4px);
}

.authLinkBtn{
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.authLinkBtn:hover{
  color: var(--brand);
}

/* Auth Avatar Section */
.authAvatarSection{
  margin-top: 4px;
}
.authAvatarHint{
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

/* Auth Error */
.authError{
  padding: 12px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
}

/* Auth Switch */
.authSwitch{
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
  font-size: 14px;
  color: var(--muted);
}
.authSwitchBtn{
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.authSwitchBtn:hover{
  color: #1d4ed8;
}

/* Auth Features Card */
.authFeaturesCard{
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.06);
}
.authFeaturesList{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media(max-width: 600px){
  .authFeaturesList{ grid-template-columns: 1fr; }
}
.authFeature{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--stroke);
}
.authFeatureIcon{
  font-size: 24px;
  flex-shrink: 0;
}
.authFeatureTitle{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 2px;
}
.authFeatureDesc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Presence dot + friend rows */
.statusDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 16px rgba(15,23,42,0.10);
}
.statusDot.online{ background: var(--ok); }
.statusDot.offline{ background: rgba(15,23,42,0.22); }

.friendCardRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--panel2);
}
.friendCardLeft{ display:flex; align-items:center; gap:10px; min-width:0; }
.friendCardRight{ display:flex; align-items:center; gap:10px; justify-content:flex-end; }
.friendAvatar{ font-size: 20px; }
.friendName{
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile section blocks */
.profileBlock{
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel);
}
.profileBlock + .profileBlock{ margin-top: 12px; }
.profileBlockAccent{ background: var(--panel2); }
.profileBlockAccent .avatarBtn{ background: var(--panel2); }

/* Room chat */
.chatCard{ padding: 12px; }
.chatHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.chatTitle{ font-weight: 900; }
.chatList{
  margin-top: 10px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--panel2);
  padding: 10px;
  max-height: 240px;
  overflow: auto;
}
.chatList.muted{ opacity: .55; }
.chatMsg{
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  margin-bottom: 8px;
}
.chatMsg.mine{ border-color: rgba(37,99,235,0.25); }
.chatMeta{ font-size: 12px; opacity: .85; margin-bottom: 4px; }
.chatText{ font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.chatInputRow{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  align-items:center;
}
.chatInputRow .input{ flex:1; margin-top:0; }

/* Sol/sağ butonlar logonun altında kalmasın */
.topbar-left, .topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}
.topbar-right{ justify-content:flex-end; }

/* Header buttons: dark background + white bold text */
.topbarBtn{
  background: rgba(15,23,42,0.86) !important;
  color: rgba(255,255,255,0.96) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15,23,42,0.12);
}
.topbarBtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15,23,42,0.16);
}

/* Header notifications */
.topbarNotifIcons{
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.topbarNotifPanel{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(520px, 92vw);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.12);
  z-index: 200;
}

.topbarNotifSection + .topbarNotifSection{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}

/* Topbar user area (avoid wrapping on mobile) */
.topbarUser{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.topbarUserName{
  font-weight:900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(44vw, 360px);
  color: rgba(255,255,255,0.92);
}

.topbarUserActions{
  display:flex;
  gap:8px;
  flex-wrap: nowrap;
}

@media (max-width: 600px){
  .topbar{ 
    padding: 7px 10px; 
    min-height: 54px;
    position: relative;
  }
  .topLogo{ height: 42px; }
  .topLogoBtn{ gap: 8px; }
  .topLogoBtn::before,
  .topLogoBtn::after{ width: clamp(20px, 6vw, 60px); }
  
  /* Hide left slot and user info on mobile */
  .topbar-left{ display: none !important; }
  .topbarUser{ display: none !important; }
  
  /* Position hamburger absolutely on the right */
  .topbar-right{ 
    position: absolute !important; 
    right: 10px; 
    top: 50%; 
    transform: translateY(-50%);
    z-index: 10;
  }
  
  /* Hamburger menu */
  .hamburgerBtn{
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(15,23,42,0.86);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
  }
  .hamburgerBtn:hover{ background: rgba(15,23,42,0.95); }
  .hamburgerBadge{
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
  }
}

@media (min-width: 601px){
  .hamburgerBtn{ display: none !important; }
}

/* Mobile menu overlay */
.mobileMenuOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.2s ease;
}
.mobileMenuPanel{
  width: min(280px, 80vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--stroke);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideInRight 0.25s ease;
}
@keyframes slideInRight{
  from{ transform: translateX(100%); }
  to{ transform: translateX(0); }
}
.mobileMenuHeader{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke);
  margin-bottom: 8px;
}
.mobileMenuClose{
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}
.mobileMenuItem{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mobileMenuItem:hover{
  background: rgba(124,58,237,0.3);
  border-color: var(--accent);
}
.mobileMenuDivider{
  height: 1px;
  background: var(--stroke);
  margin: 8px 0;
}

/* Theme Toggle Button */
.themeToggle{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.3rem;
  transition: all 0.2s ease;
}
.themeToggle:hover{
  background: var(--btn-ghost-hover);
  transform: scale(1.05);
}

/* Theme toggle button in header */
.themeToggleBtn{
  font-size: 1.2rem;
  padding: 6px 10px;
  border-radius: 8px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.themeToggleBtn:hover{
  transform: scale(1.1);
}

.themeToggleMenuItem{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
}
.themeToggleSwitch{
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.themeToggleSwitch::after{
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .themeToggleSwitch{
  background: var(--accent);
}
[data-theme="dark"] .themeToggleSwitch::after{
  transform: translateX(24px);
}

/* Dark mode profile section improvements */
[data-theme="dark"] .profileBlock {
  background: #1a2332;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .profileBlock .input,
[data-theme="dark"] .profileBlock input {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .profileBlock .input::placeholder,
[data-theme="dark"] .profileBlock input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .profileBlock .input:focus,
[data-theme="dark"] .profileBlock input:focus {
  border-color: rgba(96, 165, 250, 0.5);
  background: #1a2332;
  color: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] .profileBlock .pill {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .profileBlock .h3 {
  color: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] .profileBlock .small {
  color: rgba(255, 255, 255, 0.65);
}

/* Dark mode stats cards and game sections */
[data-theme="dark"] .statCard {
  background: linear-gradient(180deg, #1e293b 0%, #1a2332 100%);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .statCard .statTitle,
[data-theme="dark"] .statCard .statKpi {
  color: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] .statCard .small,
[data-theme="dark"] .statCard .muted {
  color: rgba(255, 255, 255, 0.65);
}
[data-theme="dark"] .donut::before {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .donut::after {
  color: rgba(255, 255, 255, 0.92);
}

/* Dark mode for .roomCard (my games section) */
[data-theme="dark"] .roomCard {
  background: #1a2332;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
}
[data-theme="dark"] .roomCard:hover {
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.05) inset;
}
[data-theme="dark"] .roomCard.lobby {
  background: linear-gradient(180deg, #1e293b 0%, #1a2332 100%);
}
[data-theme="dark"] .roomCard::before {
  opacity: 0.35;
}
[data-theme="dark"] .roomCard .roomTitle {
  color: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] .roomCard .roomMeta {
  color: rgba(255, 255, 255, 0.65);
}
[data-theme="dark"] .roomBadge {
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .roomBadge.lobby {
  background: rgba(96, 165, 250, 0.15);
  color: rgba(147, 197, 253, 0.95);
  border-color: rgba(96, 165, 250, 0.25);
}
[data-theme="dark"] .roomBadge.active {
  background: rgba(251, 146, 60, 0.15);
  color: rgba(254, 215, 170, 0.95);
  border-color: rgba(251, 146, 60, 0.25);
}
[data-theme="dark"] .roomInfoBox {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .infoLabel {
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .infoValue {
  color: rgba(255, 255, 255, 0.96);
}
[data-theme="dark"] .infoValue.timer {
  color: rgba(254, 215, 170, 0.95);
}
[data-theme="dark"] .miniBadge {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .miniBadge.timer {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.25);
  color: rgba(147, 197, 253, 0.95);
}
[data-theme="dark"] .playerChip {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .playerChip .pName {
  color: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] .playerChip .pScore,
[data-theme="dark"] .playerChip .pAvatar {
  color: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .emptyState {
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .emptyTitle {
  color: rgba(255, 255, 255, 0.96);
}

/* Mobile menu notification items */
.mobileMenuNotifItem{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
}
.mobileMenuNotifItem .notifTitle{
  font-size: 0.95rem;
  color: #fff;
}
.mobileMenuNotifItem .notifActions{
  display: flex;
  gap: 8px;
}
.mobileMenuNotifItem .notifActions .btn{
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
}
.mobileMenuNotifHeader{
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobileMenuBadge{
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
}

/* Header slotları pseudo-elementin üstüne çıksın */
.topbar-left, .topbar-right{
  position: relative;
  z-index: 4;
}

/* Logo zaten üstte kalsın */
.topLogo{
  z-index: 3;
}

/* Beyaz panel tıklamayı engellemesin ve arkada kalsın */
.topbar::before{
  z-index: 1;
  pointer-events: none;
}

/* Root */
.appRoot{
  max-width: 1060px;
  margin: 0 auto;
  padding: 10px 12px 0;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

/* Generic components */
.card{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--card-shadow);
}

.card-title{ font-weight:700; font-size:16px; margin-bottom:6px; }

.joinRow{ display:flex; gap:10px; margin-top:12px; align-items:center; }
.joinRow .input{ flex:1; margin-top:0; }

.hint{ margin-top:8px; font-size:12px; opacity:.85; }

.row{ display:flex; gap:10px; flex-wrap:wrap; }
.col{ display:flex; flex-direction:column; gap:10px; }
.spacer{ height:8px; }
.divider{ height:1px; background: var(--stroke); margin: 12px 0; }

/* Home image tiles */
.homeHero{
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 18px 46px rgba(15,23,42,0.16);
}

.homeHero .homeWelcome,
.homeHero .homeAvatarEmoji{
  color: rgba(255,255,255,0.94);
}

.homeHero .homeStatsTitle{
  color: rgba(255,255,255,0.72);
}

.homeHero .homeAvatarCircle{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}

.homeHero .subjectCard{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
}

.homeHero .subjectTitle{
  color: rgba(255,255,255,0.92);
}

.homeHero .homeTile{
  border-color: rgba(124,58,237,0.65);
}

.homeTileGrid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.homeProfileSummary{
  max-width: 520px;
  margin: 0 auto 12px auto;
  text-align: center;
}

.homeAvatarCircle{
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(15,23,42,0.08);
}

.homeAvatarEmoji{
  font-size: 34px;
  line-height: 1;
}

.homeWelcome{
  margin-top: 10px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.homeWelcomeName{
  color: var(--brand);
}

.homeStatsTitle{
  margin-top: 6px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.homeSubjectGrid{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.homeTile{
  appearance: none;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(15,23,42,0.08);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  aspect-ratio: 1 / 1;
}

.homeTileWide{
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.homeTile:hover{
  transform: scale(1.03);
  filter: brightness(1.06) saturate(1.06);
  box-shadow: 0 18px 40px rgba(15,23,42,0.12);
}

.homeTile:active{
  transform: scale(1.01);
}

.homeTileImg{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 520px){
  .homeTileGrid{ gap: 10px; }
}

/* Results: correct/wrong question boxes */
.qBoxGrid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px){
  .qBoxGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.qBox{
  appearance: none;
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  cursor: default;
}

.qBox.clickable{ cursor: pointer; }

.qBoxTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 8px;
}

.qBoxTitle{
  font-weight: 900;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qBoxMeta{
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qBox.correct{
  border-color: rgba(34,197,94,0.55);
  background: rgba(34,197,94,0.08);
}

.qBox.wrong{
  border-color: rgba(220,60,76,0.55);
  background: rgba(220,60,76,0.08);
}

.solutionMedia{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Lobby player slots + invite buttons */
.lobbySlots{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.lobbySlot{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 14px;
  padding: 10px;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}
.lobbySlotEmpty{
  background: var(--panel2);
  color: var(--muted);
}
.lobbySlotPerson{
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.lobbySlotAv{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel2);
  border: 1px solid var(--stroke);
  font-size: 18px;
}
.lobbySlotName{
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inviteMiniBtn{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  color: var(--text);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.inviteMiniBtn:hover{ filter: brightness(1.03); }
.inviteMiniBtn:disabled{ opacity: 0.6; cursor: not-allowed; }
.inviteMiniBtn.sent{
  background: rgba(16,185,129,0.10);
  border-color: rgba(16,185,129,0.35);
  color: rgba(16,185,129,1);
}

@media (max-width: 520px){
  .lobbySlots{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Home actions (Oyun Kur / Oyuna Katıl) */
.homeActions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.homeJoinInline{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
}

/* Premium card (Home + Profile) */
.premiumCard{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel2);
  position: relative;
  overflow: hidden;
}

.premiumCard::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: 6px;
  background: rgba(37,99,235,1);
  opacity: .55;
}

.premiumCard.premium::before{ background: rgba(34,197,94,1); opacity: .6; }
.premiumCard.trial::before{ background: rgba(245,158,11,1); opacity: .6; }

.premiumTop{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-left: 6px;
}

.premiumTitle{
  font-weight: 900;
  letter-spacing: -0.02em;
}

.premiumBadge{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.premiumBullets{
  margin-top: 10px;
  padding-left: 12px;
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.premiumActions{
  margin-top: 12px;
  padding-left: 12px;
}

/* Layout grid */
.grid{ display:grid; gap:14px; }
.grid.cols2{ grid-template-columns: 1.2fr 0.8fr; align-items:start; }
.grid.cols3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px){
  .grid.cols2, .grid.cols3{ grid-template-columns: 1fr; }
}

/* Remove decorative hero tiles completely */
.subject-hero, .heroTile { display: none !important; }

.linkLike{
  border:none;
  background:transparent;
  color: rgba(37,99,235,1);
  font-weight:800;
  cursor:pointer;
  padding:0;
}
.linkLike:hover{ text-decoration: underline; }

/* Footer */
.footer{
  margin-top: auto;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 18px 0 14px;
  background: rgba(15,23,42,0.96);
  border-top: 1px solid rgba(255,255,255,0.10);
}
.footer-inner{
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 12px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.footer-left{ display:flex; flex-direction:column; gap:6px; }
.footer-brand{ font-weight:900; color: rgba(255,255,255,0.92); font-size:14px; }
.footer-note{ color: rgba(255,255,255,0.70); }

.footer-right{ display:flex; align-items:center; }
.footer-social{ display:flex; gap:10px; flex-wrap:wrap; }

.footer-link{ color: rgba(255,255,255,0.78); font-weight:700; text-decoration:none; }
.footer-link:hover{ text-decoration: underline; }

.socialLink{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.86);
  text-decoration:none;
  font-weight:800;
  font-size: 13px;
}
.socialLink:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}
.socialIcon{ width:16px; height:16px; }

/* Ünite listesi stilleri */
.unitAccordion{ margin-top: 10px; display:flex; flex-direction:column; gap:10px; }

.unitDetails{
  border:1px solid var(--stroke);
  border-radius:14px;
  background: var(--panel);
  overflow:hidden;
}

.unitSummary{
  list-style:none;
  cursor:pointer;
  padding:12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.unitSummary::-webkit-details-marker{ display:none; }

.unitSubject{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius:12px;
  background: var(--bg);
  font-weight:900;
}

.unitList{ padding: 0 12px 12px; }

.unitRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 10px;
  border-radius:12px;
  background: var(--panel);
  border:1px solid var(--stroke);
  margin-top:10px;
}
.unitName{ font-weight:800; }
.unitStat{ font-size:13px; }

.unitBar{
  height:10px;
  border-radius:999px;
  background: rgba(15,23,42,.06);
  margin:8px 10px 0;
  overflow:hidden;
}
.unitBarFill{
  height:100%;
  background: rgba(37,99,235,.55);
}

.h1{ font-size:20px; font-weight:800; }
.h2{ font-size:16px; font-weight:800; }
.p{ font-size:14px; color: var(--text); line-height:1.4; }
.small{ font-size:12px; color: var(--muted); }
.muted{ color: var(--muted); }

/* ===== Profile: Stats (donut cards) ===== */
.statsGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px){
  .statsGrid{ grid-template-columns: 1fr; }
}

.statCard{
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(15,23,42,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.statCard:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15,23,42,0.08);
}

.statCardTop{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.statTitle{ font-weight: 900; font-size: 13px; }
.statKpi{ font-weight: 900; font-size: 14px; color: var(--text); }

.donutRow{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 10px;
}

.donut{
  --p: 0;
  --donut-color: var(--brand);
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background:
    conic-gradient(var(--donut-color) calc(var(--p) * 1%), rgba(15,23,42,.08) 0);
  position: relative;
  flex: 0 0 auto;
}

.donut::before{
  content: "";
  position:absolute;
  inset: 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}

.donut::after{
  content: attr(data-label);
  position:absolute;
  inset: 0;
  display:grid;
  place-items:center;
  font-weight: 900;
  font-size: 12px;
  color: var(--text);
}

.donutMeta{ min-width: 0; }

.donutLegend{
  display:flex;
  align-items:center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
  border: 1px solid rgba(15,23,42,.10);
}

.dot.ok{ background: var(--ok); border-color: rgba(34,197,94,.35); }
.dot.bad{ background: var(--danger); border-color: rgba(220,60,76,.35); }
.dot.blue{ background: var(--brand); border-color: rgba(37,99,235,.30); }
.dot.dim{ background: rgba(15,23,42,.18); }

.statMini{
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 14px;
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.statMiniLabel{ font-size: 12px; color: var(--muted); font-weight: 800; }
.statMiniValue{ font-weight: 900; font-size: 16px; }

/* Buttons */
.btn{
  appearance:none;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor:pointer;
  font-weight:700;
  box-shadow: 0 2px 6px rgba(15,23,42,0.04);
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,0.06); }
.btn:disabled{ opacity:.6; cursor:not-allowed; transform:none; box-shadow:none; }

.btn.primary{
  background: linear-gradient(180deg,#3b82f6,#2563eb);
  color: #fff;
  border-color: rgba(37,99,235,.12);
}
.btn.ghost{
  background: transparent;
  border-style: none;
  color: var(--text);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  color: var(--text);
  font-size:13px;
  font-weight:700;
}

/* Leaderboard */
.leaderboardCard{
  border-width: 2px;
  border-color: var(--brand);
  background: linear-gradient(135deg, #fefce8 0%, #fff 50%, #ecfdf5 100%);
}

.leaderboardPanel{
  padding: 16px;
  border-radius: var(--radius);
}

.leaderHeader{
  display: flex;
  align-items: center;
  gap: 12px;
}
.leaderTrophy{
  font-size: 32px;
  filter: drop-shadow(0 2px 6px rgba(234,179,8,0.35));
}

/* Podium layout */
.podiumRow{
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 16px 0 12px 0;
}
.podiumSlot{
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px 10px 10px;
  border-radius: 16px;
  background: var(--panel);
  border: 2px solid var(--stroke);
  min-width: 90px;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.podiumSlot.empty{
  visibility: hidden;
}
.podiumSlot.tall{
  border-color: #fbbf24;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  box-shadow: 0 8px 24px rgba(251,191,36,0.22);
  transform: translateY(-14px);
}
.podiumSlot.mid{
  border-color: #9ca3af;
  background: linear-gradient(180deg, #f9fafb 0%, #fff 100%);
}
.podiumSlot.short{
  border-color: #d97706;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}
.podiumAvatar{
  font-size: 28px;
  margin-bottom: 4px;
}
.podiumAvatar.flame{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245,158,11,0.12);
  box-shadow:
    0 0 0 3px rgba(245,158,11,0.55),
    0 8px 20px rgba(245,158,11,0.18);
  animation: flamePulse 1.6s ease-in-out infinite;
}
.podiumMedal{
  font-size: 22px;
  margin: 2px 0;
}
.podiumName{
  font-weight: 800;
  font-size: 13px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podiumGold{
  font-weight: 900;
  font-size: 14px;
  color: var(--brand);
  margin-top: 2px;
}
.podiumStats{
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* List (4th and beyond) */
.leaderboard{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.leaderItem{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
}
.leaderMeta{
  display: flex;
  align-items: center;
  gap: 10px;
}
.leaderRank{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 11px;
  border: 1px solid var(--stroke);
  background: var(--panel2);
  color: var(--text);
}
.leaderAvatar{
  font-size: 20px;
}
.leaderAvatar.flame{
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245,158,11,0.10);
  box-shadow:
    0 0 0 2px rgba(245,158,11,0.55),
    0 10px 24px rgba(245,158,11,0.18);
  animation: flamePulse 1.6s ease-in-out infinite;
}

@keyframes flamePulse{
  0%,100%{
    box-shadow:
      0 0 0 2px rgba(245,158,11,0.55),
      0 10px 24px rgba(245,158,11,0.18);
  }
  50%{
    box-shadow:
      0 0 0 3px rgba(245,158,11,0.75),
      0 14px 30px rgba(245,158,11,0.26);
  }
}
.leaderName{
  font-weight: 700;
  font-size: 13px;
}
.leaderGold{
  font-weight: 900;
  font-size: 13px;
  color: var(--brand);
}

/* Wheel */
.wheelWrap{
  position:relative;
  width:min(520px, 92vw);
  aspect-ratio: 1 / 1;
  margin: 14px auto 6px auto;
  display:block;
}

.wheelStage{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
}


.spinTransOverlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  pointer-events: none;
}

.spinTransLogo{
  width: 56px;
  height: 56px;
  object-fit: contain;
  animation: spin 1.0s linear infinite;
  mix-blend-mode: multiply;
}

.spinTransBar{
  width: min(260px, 70%);
  height: 10px;
  border-radius: 999px;
  background: var(--stroke);
  overflow: hidden;
}

.spinTransFill{
  height: 100%;
  background: var(--brand);
  transform-origin: left;
  transform: scaleX(0);
  animation: spinFill 0.9s linear forwards;
}

@keyframes spinFill{
  to { transform: scaleX(1); }
}
.wheelRotator{
  position:absolute;
  inset:0;
  transform: rotate(var(--wheel-rot, 0deg));
  transition: transform 2600ms cubic-bezier(.18,.9,.22,1);
  will-change: transform;
}

.wheelSvg{
  width:100%;
  height:100%;
  display:block;
  filter: drop-shadow(0 14px 26px rgba(0,0,0,.16));
}

.wheelPointer{
  position:absolute;
  top:-10px;
  left:50%;
  transform: translateX(-50%);
  width:0;height:0;
  border-left:14px solid transparent;
  border-right:14px solid transparent;
  border-bottom:24px solid #111827;
  z-index: 5;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.25));
}

/* Merkez SPIN butonu */
.wheelCenterBtn{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  z-index: 6;
  width:104px;
  height:104px;
  border-radius:999px;
  border: 1px solid rgba(0,0,0,.08);
  background: white;
  box-shadow: 0 10px 22px rgba(0,0,0,.10);
  font-weight:900;
  letter-spacing:.6px;
  cursor:pointer;
  pointer-events:auto;
}

.wheelCenterBtn:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* Soru kartı */
.qWrap{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.qFrame{
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel);
}

.qImage{
  width:100%;
  height:auto;
  display:block;
  border-radius: 10px;
}

/* Şıklar: sorunun tam altı + harfler beyaz */
.options{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.optBtn{
  appearance:none;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 0;
  font-weight: 800;
  cursor:pointer;
}
.optBtn:hover{ box-shadow: 0 6px 14px rgba(15,23,42,0.04); }

.letterBtn{
  appearance:none;
  border-radius: 12px;
  padding: 14px 0;
  font-weight: 900;
  cursor:pointer;
  min-width:48px;

  background: rgba(15,23,42,0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
}
.letterBtn.ok{
  background: rgba(34,197,94,0.95);
  color:#fff;
  border-color: rgba(34,197,94,1);
}
.letterBtn.bad{
  background: rgba(220,60,76,0.95);
  color:#fff;
  border-color: rgba(220,60,76,1);
}
.letterBtn.pending{
  background: rgba(245,158,11,0.95);
  color:#fff;
  border-color: rgba(245,158,11,1);
}
.letterBtn.dim{
  opacity:0.6;
}

/* Soru görseli ve şık düzeni */
.qDrawWrapper{
  position: relative;
  margin: 0;
}

.qmedia{
  width: 100%;
  height: auto;
  display: block;
  max-height: 62vh;        /* resmi büyütür ama şıkları aşağı gömmez */
  object-fit: contain;     /* don't crop image */
}

/* Çizim katmanı: akışta durmasın, resmin üstüne binsin */
.drawCanvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  pointer-events: none;
}

/* Çizim açıkken canvas tıklama/çizim alsın */
.qDrawWrapper.drawOn .drawCanvas{
  pointer-events: auto;
}

.choicesRow{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

/* Fixed toast to avoid layout shifts when showing notifications */
.toastFixed{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}
.toastBox{
  pointer-events: auto;
  background: rgba(15,23,42,0.94);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.28);
  min-width: 160px;
  max-width: calc(100vw - 40px);
  font-weight: 800;
}

.notifIconBar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notifIconBtn {
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
  line-height: 1;
  font-size: 22px;
  cursor: pointer;
}

.notifIconBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.notifBadge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
/* Compact cards for ongoing games on the home screen */
.ongoingGrid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.ongoingCard{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.ongoingCard .meta{ display:flex; flex-direction:column; gap:4px }
.ongoingCard .meta .title{ font-weight:900 }
.ongoingCard .timer{ font-weight:800; color: var(--muted); }

/* ===== Home: Ongoing Rooms (Professional Cards) ===== */
.ongoingList{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.roomCard{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  padding: 12px;
  box-shadow:
    0 10px 26px rgba(15,23,42,0.06),
    0 1px 0 rgba(255,255,255,0.70) inset;
  transition: all 0.2s ease;
}

.roomCard::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: 5px;
  background: linear-gradient(180deg, rgba(37,99,235,0.85) 0%, rgba(37,99,235,0.25) 100%);
  opacity: 0.22;
}

.roomCard:hover{
  transform: translateY(-2px);
  box-shadow:
    0 16px 40px rgba(15,23,42,0.1),
    0 1px 0 rgba(255,255,255,0.70) inset;
}

.roomCard.lobby{
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.roomCard.active {
  border-left-color: rgba(37, 99, 235, 0.25);
}

.roomTop{
  display:flex;
  align-items: flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.roomLeft{ 
  min-width: 0; 
  flex: 1;
}
.roomTitle{
  font-weight: 900;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--text);
}
.roomMeta{
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.roomBadge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: 0.3px;
}
.roomBadge.lobby {
  background: rgba(59, 130, 246, 0.1);
  color: rgba(37, 99, 235, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.roomBadge.active {
  background: rgba(249, 115, 22, 0.1);
  color: rgba(194, 65, 12, 0.9);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.roomRight{
  display:flex;
  align-items:flex-end;
  flex-direction:column;
  gap:10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.roomActions {
  display: flex;
  gap: 8px;
}

.roomInfoBox {
  display: flex;
  gap: 12px;
  background: rgba(15, 23, 42, 0.03);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.infoItem {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.infoLabel {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.infoValue {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
}

.infoValue.timer {
  font-family: 'Courier New', monospace;
  color: rgba(194, 65, 12, 0.9);
}

.miniBadges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.miniBadge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--stroke);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.miniBadge.timer{
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.14);
}

.btn.compact{
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 900;
}

.emptyState {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.emptyIcon {
  font-size: 48px;
  margin-bottom: 12px;
}

.emptyTitle {
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.roomPlayersRow{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 12px;
}

.playerChip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.70);
  box-shadow: 0 6px 16px rgba(15,23,42,0.05);
}

.playerChip.turn{
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.22);
  box-shadow: 0 10px 18px rgba(34,197,94,0.10);
}

.playerChip .pAvatar{ font-size: 16px; }
.playerChip .pName{
  font-weight: 900;
  font-size: 12px;
  max-width: 140px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playerChip .pScore{
  font-weight: 900;
  font-size: 12px;
  color: var(--muted);
  padding-left: 6px;
  border-left: 1px solid var(--stroke);
}


/* Timer */
.timerRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.timerBar{
  flex:1;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.30);
  overflow:hidden;
}
.timerFill{
  height:100%;
  width:100%;
  background: rgba(120,140,255,.60);
  transform-origin:left;
}

/* Table (rapor) */
.statTable{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
.statTable th,
.statTable td{
  border:1px solid rgba(255,255,255,.12);
  padding:6px 8px;
  font-size:12px;
}
.statTable th{
  background: rgba(255,255,255,.05);
  text-align:left;
}

/* Game over report */
.winnerHero{
  border: 1px solid var(--stroke);
  background:
    radial-gradient(900px 240px at 0% 0%, rgba(37,99,235,0.14) 0%, rgba(37,99,235,0.00) 55%),
    radial-gradient(700px 220px at 100% 0%, rgba(34,197,94,0.10) 0%, rgba(34,197,94,0.00) 60%),
    linear-gradient(180deg, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.70) 100%);
  border-radius: 16px;
  padding: 12px;
}
.winnerTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.winnerLabel{
  font-weight: 900;
  letter-spacing: -0.02em;
}
.winnerBadge{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
}
.winnerName{
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.2;
}
.winnerMeta{ margin-top: 6px; }

.winnerBar{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(15,23,42,0.04);
  overflow:hidden;
}
.winnerFill{
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(34,197,94,1) 0%, rgba(37,99,235,1) 100%);
}

.rankList{
  display:flex;
  flex-direction:column;
  gap: 8px;
  margin-top: 10px;
}
.rankRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.7);
  position: relative;
}
.rankRow.winner{
  border-color: rgba(34,197,94,0.35);
  background:
    radial-gradient(700px 180px at 0% 0%, rgba(34,197,94,0.12) 0%, rgba(34,197,94,0.00) 60%),
    rgba(34,197,94,0.06);
}
.rankLeft{ display:flex; align-items:center; gap: 10px; min-width: 0; }
.rankNo{ font-weight: 900; color: var(--muted); width: 36px; }
.rankName{ min-width: 0; }
.rankRight{ display:flex; gap: 8px; flex-wrap:wrap; justify-content:flex-end; }

.rankBar{
  position:absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  overflow:hidden;
}
.rankFill{
  height:100%;
  width:0;
  background: linear-gradient(90deg, rgba(37,99,235,1) 0%, rgba(245,158,11,1) 55%, rgba(34,197,94,1) 100%);
  opacity: .95;
}

/* Subject comparison (game report) */
.compareTable{
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.compareTable th,
.compareTable td{
  border: 1px solid var(--stroke);
  padding: 10px 10px;
  font-size: 12px;
  vertical-align: top;
}
.compareTable th{
  background: rgba(15,23,42,0.03);
  text-align: left;
  font-weight: 900;
  white-space: nowrap;
}
.compareTable .scPlayer{
  min-width: 150px;
}
.compareTable .scSubject{
  min-width: 160px;
  white-space: nowrap;
}
.scCell{
  background: rgba(255,255,255,0.6);
}
.scCell.best{
  border-color: rgba(34,197,94,0.45);
  background:
    radial-gradient(700px 180px at 0% 0%, rgba(34,197,94,0.14) 0%, rgba(34,197,94,0.00) 60%),
    rgba(34,197,94,0.07);
}
.scPct{ font-weight: 900; }
.scMeta{ font-size: 11px; margin-top: 2px; }
.scBar{
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(15,23,42,0.04);
  overflow: hidden;
}
.scFill{
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(37,99,235,1) 0%, rgba(34,197,94,1) 100%);
}

/* Solutions (post-test) */
.solutionsLock{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel2);
}
.solutionsLockTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.solutionsLockTitle{
  font-weight: 900;
  letter-spacing: -0.02em;
}

.solutionsList{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 10px;
}
.solutionItem{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px;
  background: var(--panel);
}
.solutionHead{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
}
.solutionTitle{
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.reportWrapper{ overflow:auto; }
.reportTable{
  width:100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.reportTable th,
.reportTable td{
  border: 1px solid var(--stroke);
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: top;
}
.reportTable th{
  background: rgba(15,23,42,0.03);
  text-align:left;
  font-weight: 900;
}
.reportTable.small th,
.reportTable.small td{ font-size: 12px; padding: 7px 9px; }
.reportTable tr.winnerRow td{
  background: rgba(34,197,94,0.06);
}

/* Homepage subject hero (background tiles using uploaded images) */
.subject-hero{
  display:block;
  position:relative;
  margin: 18px 0 26px;
  padding: 28px 12px;
  border-radius: 14px;
  overflow:visible;
}

/* Ders avatar grid */
.subjectGrid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:12px;
  margin-top:10px;
}

.subjectCard{
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  overflow:hidden;
}

/* Home subject cards: match renderHome markup */
.subjectCardHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 2px;
}

.subjectTitle{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.1;
}

.subjectPct{
  font-weight: 900;
  font-size: 13px;
  color: var(--brand);
}

.subjectPct.pct-red{ color: var(--danger); }
.subjectPct.pct-orange{ color: var(--warn); }
.subjectPct.pct-green{ color: var(--ok); }
.subjectPct.pct-blue{ color: var(--brand); }

.subjectUnits{
  margin-top: 10px;
}

.subjectUnits > summary{
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg);
}

.subjectUnits > summary::-webkit-details-marker{ display:none; }

.subjectUnits[disabled]{
  opacity: .7;
}

.subjectUnits[disabled] > summary{
  cursor: not-allowed;
}

.subjectCard:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15,23,42,0.06);
}

.subjectCardTop{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.subjectCardIcon{ font-size:22px; }
.subjectCardTitle{ font-weight:900; }

.subjectCardImg{
  width:100%;
  height:110px;
  border-radius:12px;
  object-fit:cover;
  border:1px solid rgba(15,23,42,.06);
  opacity:.92;
}

/* Click-to-select cards (Create view) */
.selectCard{
  cursor: pointer;
  user-select: none;
}

/* Premium locked (blurred) blocks */
.lockedBox{
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}

.lockedInner{
  padding: 12px;
}

.lockedBlur{
  filter: blur(6px);
  opacity: 0.85;
  pointer-events: none;
}

.lockedOverlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  text-align: center;
  background: var(--panel2);
  border-top: 1px solid var(--stroke);
}

.lockedTitle{
  font-weight: 900;
  letter-spacing: -0.02em;
}

.heroTile{
  position:absolute;
  border-radius:12px;
  overflow:hidden;
  border:1px solid transparent;
}
.heroTile img{ width:100%; height:100%; object-fit:cover; display:block; filter:none; opacity:0.18 }
.heroTile.logo img{ opacity:0.14 }

/* Example positions (adjustable) */
.heroTile.lt{ width:360px; height:180px; left:8px; top:8px }
.heroTile.rt{ width:320px; height:200px; right:8px; top:12px }
.heroTile.ml{ width:240px; height:140px; left:36px; bottom:12px }
.heroTile.mr{ width:220px; height:120px; right:36px; bottom:28px }
.heroTile.center{ width:460px; height:220px; left:50%; transform:translateX(-50%); top:36px }
.heroTile.sm{ width:150px; height:86px }

/* hero overlay removed per user request (no slogans/CTAs) */

@media (max-width:880px){
  .heroTile.center{ width:90%; height:160px; left:50%; transform:translateX(-50%); top:12px }
  .topLogo{ height: 62px; }
}

/* Premium Upsell Modal */
.premiumUpsellModal{
  max-width: 420px !important;
  text-align: center;
  padding: 32px 24px !important;
}
.premiumUpsellIcon{
  font-size: 48px;
  margin-bottom: 12px;
}
.premiumUpsellFeatures{
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 0 12px;
}
.premiumUpsellFeature{
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Emoji Chat Bubble */
.emojiChatBubble{
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 22px;
  box-shadow: var(--card-shadow);
  animation: bubblePop 0.3s ease-out;
  z-index: 10;
}
.emojiChatBubble::after{
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff;
}
@keyframes bubblePop{
  0%{ transform: translateX(-50%) scale(0.5); opacity: 0; }
  100%{ transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Emoji Picker Toggle */
.emojiPickerRow{
  display: none;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--panel2);
  border-radius: 12px;
  margin-top: 6px;
}
.emojiPickerRow.open{
  display: flex;
}
.emojiToggleBtn{
  font-size: 18px;
}

/* Seri Loading Transition */
.seriLoadingOverlay{
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}
.seriLoadingOverlay .spinner{
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
}
@keyframes fadeIn{
  0%{ opacity: 0; }
  100%{ opacity: 1; }
}

/* Topbar nav and center */
.topbar-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.topbar-nav{
  display: flex;
  gap: 6px;
}
.topbarNavBtn{
  font-size: 13px;
  padding: 4px 10px;
  background: transparent !important;
  color: rgba(255,255,255,0.95) !important;
  border: none !important;
  font-weight: 700;
  box-shadow: none !important;
}
.topbarNavBtn:hover{
  color: #fff !important;
  text-decoration: underline;
}

/* Profile Subject Grid */
.profileSubjectGrid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* Cookie Consent Banner */
.cookieConsent{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(10px);
  padding: 16px 24px;
  z-index: 1000;
  display: flex;
  justify-content: center;
}
.cookieConsentInner{
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  flex-wrap: wrap;
  justify-content: center;
}
.cookieConsentText{
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
}
.cookieConsentText a{
  color: var(--brand);
  text-decoration: underline;
}

/* About Page */
.aboutContent{
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.aboutSection{
  padding: 20px;
  background: var(--panel2);
  border-radius: 16px;
  border: 1px solid var(--stroke);
}
.aboutIcon{
  font-size: 32px;
  margin-bottom: 10px;
}
.aboutText{
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 10px 0 0 0;
}

/* KVKK Page */
.kvkkContent{
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.kvkkSection{
  padding: 16px 20px;
  background: var(--panel2);
  border-radius: 12px;
  border: 1px solid var(--stroke);
}
.kvkkText{
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin: 8px 0 0 0;
}
.kvkkList{
  margin: 10px 0 0 0;
  padding-left: 24px;
  line-height: 1.8;
  font-size: 14px;
}
.kvkkList li{
  margin-bottom: 4px;
}

/* Footer links */
.footer-links{
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.footerLink{
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}
.footerLink:hover{
  color: var(--text);
}

/* Collapsible Home Stats */
.homeStatsToggle{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 10px;
  transition: background 0.15s;
}
.homeStatsToggle:hover{
  background: rgba(37,99,235,0.05);
}
.homeStatsTitle{
  display: flex;
  align-items: center;
  gap: 6px;
}
.homeStatsArrow{
  font-size: 12px;
  color: var(--muted);
}
.homeSubjectGrid{
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.homeSubjectGrid.open{
  display: flex;
}

/* ==================== RANK SYSTEM ==================== */

.rankBadge{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.rankBadge.IRON{
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  color: #e2e8f0;
  border: 1px solid rgba(74,85,104,0.5);
}
.rankBadge.BRONZE{
  background: linear-gradient(135deg, #cd7f32 0%, #8b5a2b 100%);
  color: #fff;
  border: 1px solid rgba(205,127,50,0.5);
}
.rankBadge.SILVER{
  background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
  color: #1a1a2e;
  border: 1px solid rgba(192,192,192,0.5);
}
.rankBadge.GOLD{
  background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
  color: #1a1a2e;
  border: 1px solid rgba(255,215,0,0.5);
}
.rankBadge.PLATINUM{
  background: linear-gradient(135deg, #00cec9 0%, #0984e3 100%);
  color: #fff;
  border: 1px solid rgba(0,206,201,0.5);
}
.rankBadge.EMERALD{
  background: linear-gradient(135deg, #00b894 0%, #00a86b 100%);
  color: #fff;
  border: 1px solid rgba(0,184,148,0.5);
}
.rankBadge.DIAMOND{
  background: linear-gradient(135deg, #b9f2ff 0%, #74b9ff 100%);
  color: #1a1a2e;
  border: 1px solid rgba(185,242,255,0.5);
}
.rankBadge.MASTER{
  background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
  color: #fff;
  border: 1px solid rgba(155,89,182,0.5);
}
.rankBadge.GRANDMASTER{
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  border: 1px solid rgba(231,76,60,0.5);
}
.rankBadge.CHALLENGER{
  background: linear-gradient(135deg, #f39c12 0%, #e74c3c 50%, #9b59b6 100%);
  color: #fff;
  border: 1px solid rgba(243,156,18,0.5);
  animation: challengerGlow 2s ease-in-out infinite;
}

@keyframes challengerGlow{
  0%, 100%{ box-shadow: 0 0 6px rgba(243,156,18,0.4); }
  50%{ box-shadow: 0 0 12px rgba(243,156,18,0.7); }
}

/* Rank Badge Small (oyun içi) */
.rankBadge.sm{
  padding: 1px 5px;
  font-size: 9px;
  gap: 2px;
}

/* Rank Progress Bar */
.rankProgress{
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.rankProgressBar{
  position: relative;
  height: 8px;
  background: var(--stroke);
  border-radius: 4px;
  overflow: hidden;
}
.rankProgressFill{
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.rankProgressFill.IRON{ background: linear-gradient(90deg, #4a5568, #718096); }
.rankProgressFill.BRONZE{ background: linear-gradient(90deg, #cd7f32, #daa520); }
.rankProgressFill.SILVER{ background: linear-gradient(90deg, #a0aec0, #cbd5e0); }
.rankProgressFill.GOLD{ background: linear-gradient(90deg, #f6e05e, #ffd700); }
.rankProgressFill.PLATINUM{ background: linear-gradient(90deg, #00cec9, #0984e3); }
.rankProgressFill.EMERALD{ background: linear-gradient(90deg, #00b894, #55efc4); }
.rankProgressFill.DIAMOND{ background: linear-gradient(90deg, #74b9ff, #b9f2ff); }
.rankProgressFill.MASTER{ background: linear-gradient(90deg, #9b59b6, #be90d4); }
.rankProgressFill.GRANDMASTER{ background: linear-gradient(90deg, #e74c3c, #f39c12); }
.rankProgressFill.CHALLENGER{ background: linear-gradient(90deg, #f39c12, #e74c3c, #9b59b6); }

.rankProgressLabel{
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* Rank Card */
.rankCard{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--panel2);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.rankCardTop{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rankCardTitle{
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.rankCardLp{
  font-size: 22px;
  font-weight: 900;
  color: var(--brand);
}

/* LP Change Animation */
.lpChange{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  animation: lpPop 0.4s ease;
}
.lpChange.gain{ color: var(--ok); }
.lpChange.lose{ color: var(--danger); }

@keyframes lpPop{
  0%{ transform: scale(0.8); opacity: 0; }
  50%{ transform: scale(1.15); }
  100%{ transform: scale(1); opacity: 1; }
}
/* ==================== SERI PAD (Çalışma Alanı) ==================== */
#seriPadCanvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  min-height: 250px;
  background: white !important;
  border: 2px solid var(--stroke) !important;
  border-radius: 8px !important;
  cursor: crosshair !important;
  touch-action: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#seriPadArea {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

#seriPadArea .btn.sm {
  padding: 6px 12px;
  font-size: 13px;
  min-width: 0;
}