/* ==========================================================================
   Titan Clash — Lobi
   Arka plan oyunun kendi haritası; vurgu rengi oyuncunun seçtiği ülke rengi.
   ========================================================================== */

#lobby {
  --ocean:   #071120;
  --ink:     #EAF0F7;
  --muted:   #8C99AE;
  --line:    rgba(234, 240, 247, 0.12);
  --line-2:  rgba(234, 240, 247, 0.22);
  --panel:   rgba(9, 20, 38, 0.66);
  --accent:  #00D0FF;
  --gutter:  clamp(16px, 4vw, 64px);
  --display: 'Big Shoulders Stencil', 'Big Shoulders Stencil Display', 'Big Shoulders', 'Big Shoulders Display', Impact, sans-serif;
  --condensed: 'Big Shoulders', 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body:    'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #0B1A31 0%, var(--ocean) 60%, #050C18 100%);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

#lobby [hidden] { display: none !important; }

#lobby button { font: inherit; color: inherit; }

#lobby :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#hero-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Yazıların okunması için haritayı kenarlarda koyulaştır */
.lb-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 12, 24, 0.55) 0%, rgba(5, 12, 24, 0) 18%),
    linear-gradient(0deg, rgba(5, 12, 24, 0.92) 0%, rgba(5, 12, 24, 0.35) 32%, rgba(5, 12, 24, 0) 55%),
    linear-gradient(90deg, rgba(5, 12, 24, 0.55) 0%, rgba(5, 12, 24, 0) 45%);
}

/* ── Üst çubuk ───────────────────────────────────────────────────────────── */
.lb-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 22px var(--gutter);
  z-index: 3;
}

.lb-mark {
  justify-self: start;
  font-family: var(--condensed);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.lb-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lb-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.lb-link:hover { color: var(--ink); background: rgba(234, 240, 247, 0.06); }
.lb-link-icon { padding: 0 11px; }

.lb-top-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lb-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-online #online-count { color: var(--ink); font-weight: 600; }

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3DDC84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: lb-pulse 2.4s infinite;
}
@keyframes lb-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* Cüzdan */
.lb-wallet-wrap { position: relative; }

.lb-wallet {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(171, 159, 242, 0.08);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.lb-wallet-icon { color: #AB9FF2; flex: none; }
.lb-wallet:hover { border-color: #AB9FF2; background: rgba(171, 159, 242, 0.16); }
.lb-wallet.is-busy { opacity: 0.7; cursor: progress; }
.lb-wallet.is-connected { font-variant-numeric: tabular-nums; }
.lb-wallet.is-connected .lb-wallet-label::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #3DDC84;
  vertical-align: 1px;
}

.lb-wallet-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #0C1A30;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.lb-wallet-menu button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 0.92rem;
  cursor: pointer;
}
.lb-wallet-menu button:hover { background: rgba(234, 240, 247, 0.07); }
#wallet-disconnect { color: #FF7A85; }

/* ── Kahraman başlık ─────────────────────────────────────────────────────── */
.lb-hero {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(96px, 15vh, 150px);
  z-index: 2;
  pointer-events: none;
}

.lb-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(5.5rem, 15.5vw, 17.5rem);
  line-height: 0.8;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-left: -0.04em;
}
.lb-title-line { display: block; overflow: hidden; padding-bottom: 0.02em; }
.lb-title-line > span {
  display: inline-block;
  transform: translateY(102%);
  animation: lb-rise 1.1s cubic-bezier(0.2, 0.75, 0.15, 1) forwards;
  animation-delay: 0.35s;
}
.lb-title-line + .lb-title-line > span {
  animation-delay: 0.5s;
}
@keyframes lb-rise { to { transform: translateY(0); } }

.lb-lede {
  max-width: 34ch;
  margin-top: clamp(16px, 2.4vh, 28px);
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.45;
  color: #C3CCDA;
  opacity: 0;
  animation: lb-fade 0.8s ease forwards;
  animation-delay: 1.1s;
}
@keyframes lb-fade { to { opacity: 1; } }

/* ── Katılım paneli ──────────────────────────────────────────────────────── */
.lb-panel {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(96px, 15vh, 150px);
  z-index: 3;
  width: min(360px, calc(100vw - 2 * var(--gutter)));
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 4px 4px 10px 10px;
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(14px);
  animation: lb-panel-in 0.9s cubic-bezier(0.2, 0.75, 0.15, 1) forwards;
  animation-delay: 0.9s;
  transition: border-top-color 0.3s;
}
@keyframes lb-panel-in { to { opacity: 1; transform: none; } }

.lb-field { display: flex; flex-direction: column; gap: 9px; }
.lb-field-name { font-size: 0.88rem; font-weight: 500; color: var(--muted); }

#player-name {
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(234, 240, 247, 0.04);
  color: var(--ink);
  font-family: var(--condensed);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}
#player-name::placeholder { color: rgba(234, 240, 247, 0.3); }
#player-name:focus { border-color: var(--accent); background: rgba(234, 240, 247, 0.07); }

.color-palette { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.color-btn {
  width: 30px; height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease;
}
.color-btn:hover { transform: scale(1.12); }
.color-btn.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 0 3px var(--ocean), 0 0 0 5px var(--c, var(--accent));
}
.rainbow-btn {
  background: conic-gradient(#ff3b3b, #ffb800, #3ddc84, #00d0ff, #6a5cff, #ff3bd4, #ff3b3b);
}
.rainbow-btn.active { --c: var(--accent); }
#hidden-color-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

#btn-start {
  position: relative;
  height: 58px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-on, #06101E);
  font-family: var(--condensed);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.2s;
}
#btn-start::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}
#btn-start:hover { filter: brightness(1.08); }
#btn-start:hover::after { transform: translateX(100%); }
#btn-start:active { transform: scale(0.985); }

.lb-hint { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: -6px; }

/* ── Alt çubuk: kontrat adresi + canlı akış ──────────────────────────────── */
.lb-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter) 24px;
  pointer-events: none;
}
.lb-bottom > * { pointer-events: auto; }

.lb-ca {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  height: 44px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(7, 17, 32, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.92rem;
}
.lb-ca-sym { font-family: var(--condensed); font-weight: 900; font-size: 1.15rem; letter-spacing: 0.03em; }
.lb-ca-label { color: var(--muted); }
.lb-ca-addr {
  font-family: var(--body);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 26ch;
}
.lb-ca-addr.is-empty { color: var(--muted); font-weight: 500; padding-right: 10px; }

.lb-ca-copy {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(234, 240, 247, 0.1);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.lb-ca-copy:hover { background: rgba(234, 240, 247, 0.18); }
.lb-ca-copy.is-done { background: #3DDC84; color: #06101E; }

.lb-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-height: 70px;
  justify-content: flex-end;
  font-size: 0.86rem;
  color: var(--muted);
}
.lb-feed li {
  display: flex;
  align-items: center;
  gap: 9px;
  animation: lb-feed-in 0.5s ease;
}
.lb-feed li:first-child { color: var(--ink); }
.lb-feed li:nth-child(3) { opacity: 0.5; }
.lb-feed-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(234, 240, 247, 0.35); }
@keyframes lb-feed-in { from { opacity: 0; transform: translateY(6px); } }

/* ── Pencereler ──────────────────────────────────────────────────────────── */
.lb-dialog {
  width: min(520px, calc(100vw - 32px));
  margin: auto;
  padding: 30px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #0C1A30;
  color: var(--ink);
  font-family: var(--body);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}
.lb-dialog::backdrop { background: rgba(3, 8, 16, 0.7); backdrop-filter: blur(4px); }
.lb-dialog[open] { animation: lb-dialog-in 0.25s ease; }
@keyframes lb-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.lb-dialog h2 {
  font-family: var(--condensed);
  font-weight: 900;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 20px;
}

.lb-steps { counter-reset: step; list-style: none; display: grid; gap: 14px; }
.lb-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  line-height: 1.5;
  color: #C3CCDA;
}
.lb-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: var(--condensed);
  font-weight: 900;
  color: var(--accent);
}
.lb-steps strong { color: var(--ink); font-weight: 600; }

.lb-dialog-note { margin-top: 18px; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }

.lb-token-info { display: grid; gap: 14px; }
.lb-token-info dt { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.lb-token-info dd { font-weight: 600; word-break: break-all; }
.lb-token-info code { font-family: var(--body); font-variant-numeric: tabular-nums; }

.lb-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.lb-dialog-actions .lb-ca-copy { height: 42px; padding: 0 18px; }
.lb-dialog-buy {
  display: inline-flex; align-items: center;
  height: 42px; padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on, #06101E);
  font-weight: 700;
  text-decoration: none;
}
.lb-dialog-close {
  height: 42px;
  margin-left: auto;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}
.lb-dialog-close:hover { border-color: var(--ink); }
#dlg-how .lb-dialog-close { margin-top: 22px; }

/* ── Mobil ───────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #lobby { overflow-y: auto; }
  .lb-top { grid-template-columns: 1fr auto; }
  .lb-nav { display: none; }
  .lb-online { display: none; }
  .lb-hero { position: relative; left: auto; bottom: auto; padding: 120px var(--gutter) 0; }
  .lb-title { font-size: clamp(5rem, 26vw, 9rem); }
  .lb-panel { position: relative; right: auto; bottom: auto; width: auto; margin: 28px var(--gutter) 0; }
  .lb-bottom { position: relative; flex-direction: column; align-items: stretch; padding-top: 20px; }
  .lb-ca { width: 100%; }
  .lb-ca-addr { flex: 1; max-width: none; }
  .lb-feed { align-items: flex-start; min-height: 0; }
  #hero-map { position: fixed; }
}

@media (max-width: 1180px) and (min-width: 901px) {
  .lb-title { font-size: clamp(5rem, 12vw, 10rem); }
  .lb-hero { bottom: clamp(260px, 38vh, 380px); }
}

@media (prefers-reduced-motion: reduce) {
  .lb-title-line > span, .lb-lede, .lb-panel { animation: none; transform: none; opacity: 1; }
  .pulse-dot { animation: none; }
  #btn-start::after { display: none; }
}
