/* ==========================================================================
   Titan Clash — Lobi (profil · mod seçimi · Savaş Bileti)
   Arkada bulanıklaştırılmış canlı savaş haritası, önde buzlu cam paneller.
   Koyu / açık tema: #lobby[data-theme].
   ========================================================================== */

#lobby {
  --hub-panel:   rgba(10, 22, 40, 0.62);
  --hub-panel-2: rgba(14, 28, 50, 0.78);
  --hub-shadow:  0 24px 60px -28px rgba(0, 0, 0, 0.7);
  --gold:        #FFC24B;
  --green:       #3DDC84;
}
#lobby[data-theme="light"] {
  --ocean:   #E7EDF5;
  --ink:     #0B1626;
  --muted:   #5A687C;
  --line:    rgba(11, 22, 38, 0.10);
  --line-2:  rgba(11, 22, 38, 0.18);
  --hub-panel:   rgba(255, 255, 255, 0.70);
  --hub-panel-2: rgba(255, 255, 255, 0.88);
  --hub-shadow:  0 24px 50px -30px rgba(20, 40, 70, 0.45);
  --gold:        #B27400;
  --green:       #0F9F57;
  background: radial-gradient(120% 90% at 50% 40%, #F4F7FB 0%, #E3EAF3 60%, #D6DFEA 100%);
}

/* Arka plan: canlı harita, hafif bulanık */
#hero-map { filter: blur(1.6px) saturate(1.05); transform: scale(1.02); }
#lobby .lb-shade {
  background:
    radial-gradient(70% 60% at 50% 45%, rgba(5, 12, 24, 0.15), rgba(5, 12, 24, 0.7) 100%),
    linear-gradient(180deg, rgba(5, 12, 24, 0.55) 0%, rgba(5, 12, 24, 0) 16%);
}
#lobby[data-theme="light"] .lb-shade {
  background: radial-gradient(80% 70% at 50% 45%, rgba(240, 245, 251, 0.45), rgba(232, 239, 247, 0.85) 100%);
}
#lobby[data-theme="light"] .lb-pass { color: #A86A00 !important; }
#lobby[data-theme="light"] .lb-link:hover { background: rgba(11, 22, 38, 0.06); }
#lobby[data-theme="light"] .lb-dialog { background: #FFFFFF; }
#lobby[data-theme="light"] .lb-wallet-menu { background: #FFFFFF; }
#lobby[data-theme="light"] .lb-ca { background: var(--hub-panel); }
#lobby[data-theme="light"] .lb-ca-copy { background: rgba(11, 22, 38, 0.08); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tema düğmesi */
.lb-theme {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--hub-panel);
  color: var(--muted); cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lb-theme:hover { color: var(--ink); }
.lb-theme .i-sun { display: none; }
#lobby[data-theme="light"] .lb-theme .i-sun { display: block; }
#lobby[data-theme="light"] .lb-theme .i-moon { display: none; }

/* ── Yerleşim ───────────────────────────────────────────────────────────── */
.hub {
  position: absolute; z-index: 2;
  top: 84px; bottom: 0; left: 0; right: 0;
  display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 18px; padding: 0 var(--gutter) 20px;
}
.hub-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 2px; }
.hub-col::-webkit-scrollbar { display: none; }

.hub-card {
  position: relative; display: block; width: 100%; padding: 16px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--hub-panel); color: var(--ink);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--hub-shadow);
}
.hub-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hub-k { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hub-muted { font-size: 0.84rem; line-height: 1.45; color: var(--muted); margin: 0 0 12px; }
.hub-link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.hub-link:hover { text-decoration: underline; }

/* ── Sol: profil ────────────────────────────────────────────────────────── */
.hub-me { display: flex; align-items: center; gap: 14px; }
.hub-avatar {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center;
  border-radius: 20px; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #000));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 10px 26px -10px var(--accent);
}
.hub-avatar span { font-family: var(--condensed); font-weight: 900; font-size: 1.7rem; letter-spacing: 0.02em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }
.hub-id { display: grid; gap: 2px; min-width: 0; }
.hub-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-title .is-none { color: var(--muted); font-weight: 500; letter-spacing: 0; }
#lobby .hub-name #player-name {
  width: 100%; height: auto; padding: 2px 0 4px; border: 0; border-bottom: 1px solid transparent; border-radius: 0;
  background: none; color: var(--ink); font: 700 1.35rem var(--body); outline: none;
}
#lobby .hub-name #player-name:focus { border-bottom-color: var(--accent); background: none; }
.hub-colors { display: grid; gap: 10px; margin-top: 16px; }
.hub-colors .color-palette { gap: 8px; }
.hub-colors .color-btn { width: 26px; height: 26px; }
.hub-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 0; }
.hub-stats div { padding: 8px 6px; border-radius: 12px; background: var(--hub-panel-2); border: 1px solid var(--line); text-align: center; }
.hub-stats dt { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hub-stats dd { margin: 2px 0 0; font-family: var(--condensed); font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; }

/* Cüzdan */
.hub-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--muted); }
.hub-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #8C99AE; }
.hub-dot.is-on { color: var(--green); }
.hub-dot.is-on::before { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.hub-btn {
  width: 100%; height: 42px; border: 0; border-radius: 12px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.hub-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.hub-btn.is-phantom { background: linear-gradient(135deg, #AB9FF2, #7C6CF0); color: #120B33; }
.hub-addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--hub-panel-2); border: 1px solid var(--line); }
.hub-addr code { font: 600 0.92rem var(--body); font-variant-numeric: tabular-nums; }
.hub-addr button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: 0.76rem; font-weight: 600; cursor: pointer; }
.hub-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.hub-bal div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--hub-panel-2); }
.hub-bal span { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hub-bal b { font-family: var(--condensed); font-weight: 800; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.hub-left .lb-ca { width: 100%; justify-content: space-between; height: 46px; background: var(--hub-panel); }
.hub-left .lb-ca-addr { max-width: 14ch; }

/* ── Orta: modlar ───────────────────────────────────────────────────────── */
.hub-center { gap: 12px; }
/* Düğmenin ışıltısı sütunun kenarında kesilip köşeli görünmesin: ışıltıya yer aç (genişlik değişmez) */
@media (min-width: 1181px) { .hub-center { padding: 2px 16px 28px; margin: 0 -14px -26px; } }
.hub-modes {
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent);
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 6px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; flex: none; outline: none;
}
.hub-mode {
  --mc: #3DF5FF;
  position: relative; flex: 1 0 172px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; text-align: left;
  border: 1px solid var(--line-2); border-radius: 18px; background: var(--hub-panel); color: var(--ink);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  cursor: pointer; overflow: hidden; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.hub-mode::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--mc) 28%, transparent), transparent 60%);
}
.hub-mode:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--mc) 55%, transparent); }
.hub-mode.is-on { border-color: var(--mc); box-shadow: 0 0 0 1px var(--mc), 0 18px 40px -20px var(--mc); }
.hub-mode.is-on::before, .hub-mode:hover::before { opacity: 1; }
.hub-mode-art { width: 40px; height: 40px; color: var(--mc); }
.hub-mode-art svg { width: 100%; height: 100%; }
.hub-mode-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mc); }
#lobby[data-theme="light"] .hub-mode-k, #lobby[data-theme="light"] .hub-mode-art { filter: brightness(0.7) saturate(1.3); }
.hub-mode b { font-family: var(--condensed); font-weight: 900; font-size: 1.45rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; }
.hub-mode-d { font-size: 0.78rem; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hub-mode-facts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
.hub-mode-facts i { font-style: normal; font-size: 0.66rem; font-weight: 600; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.hub-live {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--mc) 16%, transparent);
  font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink);
}
.hub-live i { width: 6px; height: 6px; border-radius: 50%; background: #FF4D5E; animation: hub-blink 1.2s ease-in-out infinite; }
.hub-live em { font-style: normal; }
@keyframes hub-blink { 50% { opacity: 0.25; } }

/* Seçili mod detayı */
.hub-detail {
  --mc: #3DF5FF;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; flex: 1 0 auto; min-height: 250px;
  padding: 14px; border: 1px solid var(--line-2); border-radius: 20px;
  background: var(--hub-panel); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--hub-shadow);
}
.hub-preview { position: relative; margin: 0; border-radius: 14px; overflow: hidden; min-height: 180px; background: #0B1B30; }
.hub-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; animation: hub-in 0.5s ease; }
@keyframes hub-in { from { opacity: 0; transform: scale(1.03); } }
.hub-preview figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 40px 16px 14px;
  background: linear-gradient(0deg, rgba(4, 10, 20, 0.92), rgba(4, 10, 20, 0)); color: #EAF0F7;
}
.hub-preview figcaption span { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mc); }
.hub-preview figcaption b { font-family: var(--condensed); font-weight: 900; font-size: 1.8rem; line-height: 1; text-transform: uppercase; }
.hub-preview figcaption em { font-style: normal; font-size: 0.8rem; color: #B9C4D3; }
.hub-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hub-info-head h2 { margin: 2px 0 0; font-family: var(--condensed); font-weight: 900; font-size: 2rem; line-height: 0.95; text-transform: uppercase; }
.hub-info-head .hub-mode-k { color: var(--mc); }

.hub-cd { display: flex; align-items: center; gap: 14px; }
.hub-cd svg { width: 84px; height: 84px; flex: none; transform: rotate(-90deg); }
.hub-cd circle { fill: none; stroke-width: 8; }
.hub-cd .t { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.hub-cd .p { stroke: var(--mc); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; filter: drop-shadow(0 0 6px var(--mc)); }
.hub-cd span { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hub-cd b { font-family: var(--condensed); font-weight: 900; font-size: 3.2rem; line-height: 0.95; font-variant-numeric: tabular-nums; }
.hub-room-note { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--muted); }
.hub-room-note b { color: var(--green); }
.hub-rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hub-room { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--hub-panel-2); text-align: left; cursor: pointer; }
.hub-room b { font-family: var(--condensed); font-weight: 800; font-size: 1.05rem; text-transform: uppercase; }
.hub-room span { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-room.is-on { border-color: var(--mc); box-shadow: 0 0 0 1px var(--mc); }
.hub-test { margin: 0; font-size: 0.74rem; color: var(--muted); }
.hub-test b { color: var(--gold); }
.hub-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.hub-kv div { padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--hub-panel-2); }
.hub-kv dt { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hub-kv dd { margin: 3px 0 0; font-family: var(--condensed); font-weight: 800; font-size: 1.25rem; }
.hub-reroll { align-self: flex-start; height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.hub-reroll:hover { border-color: var(--mc); }

/* Büyük aksiyon düğmesi */
#lobby #btn-start.hub-cta {
  --mc: #3DF5FF;
  position: relative; flex: none; width: 100%; height: 76px; padding: 0; margin: 0; overflow: hidden;
  border: 0; border-radius: 20px; cursor: pointer;
  background: linear-gradient(120deg, color-mix(in srgb, var(--mc) 70%, #fff), var(--mc) 45%, color-mix(in srgb, var(--mc) 70%, #000));
  color: #04121A; font-family: var(--condensed); font-weight: 900; font-size: 2rem; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mc) 60%, #fff), 0 10px 26px -14px var(--mc), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: hub-glow 2.4s ease-in-out infinite;
  transition: transform 0.15s, filter 0.15s;
}
#lobby #btn-start.hub-cta::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-100%); animation: hub-sheen 3.2s ease-in-out infinite;
}
#lobby #btn-start.hub-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
#lobby #btn-start.hub-cta:active { transform: scale(0.99); }
#lobby #btn-start.hub-cta.is-joined {
  background: color-mix(in srgb, var(--mc) 14%, var(--hub-panel-2)); color: var(--ink);
  box-shadow: 0 0 0 2px var(--mc), 0 10px 26px -14px var(--mc);
}
#lobby #btn-start.hub-cta.is-joined::after { display: none; }
@keyframes hub-glow { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--mc) 60%, #fff), 0 12px 32px -14px var(--mc), inset 0 1px 0 rgba(255, 255, 255, 0.5); } }
@keyframes hub-sheen { 55%, 100% { transform: translateX(100%); } }
.hub-cta-note { margin: -4px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ── Sağ: Savaş Bileti, kuşanma, liderlik ───────────────────────────────── */
#lobby .hub-bp { display: grid; gap: 8px; cursor: pointer; border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%), var(--hub-panel); transition: transform 0.15s; }
#lobby .hub-bp:hover { transform: translateY(-2px); }
.hub-bp-top { display: flex; align-items: center; justify-content: space-between; }
.hub-tier { font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.hub-tier.is-premium, .hub-tier.is-standard { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.hub-bp-lvl b { font-family: var(--condensed); font-weight: 900; font-size: 2.1rem; line-height: 1; color: var(--gold); }
.hub-bp-lvl span { margin-left: 4px; font-family: var(--condensed); font-weight: 700; font-size: 1.1rem; color: var(--muted); }
.hub-bp-bar { display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.hub-bp-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22C7E0, #3DF5FF); box-shadow: 0 0 10px rgba(61, 245, 255, 0.6); }
.hub-bp-xp { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hub-bp .bp-dot { top: 12px; right: auto; left: 128px; }

.hub-loadout ul, .hub-board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hub-slot { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; border-radius: 12px; background: var(--hub-panel-2); border: 1px solid var(--line); }
.hub-slot-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(4, 10, 20, 0.55); overflow: hidden; }
.hub-slot-ic .bp-ic { min-height: 0; transform: scale(0.72); }
.hub-slot-ic.is-free .bp-ic { filter: grayscale(1); opacity: 0.75; }
.hub-slot-ic .ic-none { width: 22px; height: 22px; }
.hub-slot-t { display: grid; min-width: 0; flex: 1; }
.hub-slot-t span { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.hub-slot-t b { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-slot-nav { display: flex; gap: 4px; }
.hub-slot-nav button { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 8px; background: none; font-size: 1.05rem; line-height: 1; cursor: pointer; }
.hub-slot-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.hub-slot-nav button:disabled { opacity: 0.35; cursor: default; }

.hub-board li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--hub-panel-2); font-size: 0.86rem; }
.hub-board li.is-me { box-shadow: inset 0 0 0 1px var(--accent); }
.hub-rank { width: 20px; font-family: var(--condensed); font-weight: 900; font-size: 1.1rem; color: var(--muted); }
.hub-board li:first-child .hub-rank { color: var(--gold); }
.hub-lname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hub-lname em { font-style: normal; font-weight: 400; color: var(--muted); }
.hub-board b { font-family: var(--condensed); font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.hub-foot { margin: 10px 0 0; font-size: 0.7rem; color: var(--muted); }

/* ── Dar ekranlar ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .hub { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); grid-template-rows: auto auto; overflow-y: auto; }
  .hub-right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .hub-col { overflow: visible; }
  .hub-detail { min-height: 260px; }
}
@media (max-width: 820px) {
  #lobby { overflow-y: auto; }
  #lobby .lb-top { position: relative; grid-template-columns: 1fr auto; }
  #lobby .lb-nav { display: none; }
  .hub { position: relative; top: 0; grid-template-columns: 1fr; padding: 0 16px 24px; overflow: visible; }
  .hub-right { grid-template-columns: 1fr; }
  .hub-detail { grid-template-columns: 1fr; }
  .hub-preview { min-height: 200px; }
  .hub-center { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  #lobby #btn-start.hub-cta, #lobby #btn-start.hub-cta::after, .hub-live i { animation: none; }
}
