:root {
  --ink: #f4f7fb;
  --muted: #9aa8bc;
  --play: #3ddc84;
  --play-ink: #0b1f14;
  --panel: #243552;
  --line: #1a2740;
  --you: #ffe566;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: #1a2438;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  scrollbar-width: thin;
  scrollbar-color: #3d5578 #121a2a;
}

/* Temaya uyumlu kaydırma çubukları */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #121a2a;
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4a678f 0%, #2f4466 100%);
  border-radius: 8px;
  border: 2px solid #121a2a;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6b87b0 0%, #3d5578 100%);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-corner {
  background: #121a2a;
}

body.is-native {
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #1a2438;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
  background: #1a2438;
  z-index: 2;
}

#top-bar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

#top-bar.hidden {
  display: none;
}

#hud {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  pointer-events: none;
  padding: 8px 14px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  font-size: 18px;
  font-weight: 900;
  color: var(--you);
  line-height: 1;
  min-width: 48px;
  text-align: left;
  letter-spacing: 0.02em;
}

#hint.hud-hint {
  display: none;
}

/* —— Sıralama (agar tarzı yarı saydam kutu) —— */
#board {
  position: absolute;
  top: 10px;
  right: 10px;
  width: min(168px, 40vw);
  padding: 8px 10px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  z-index: 3;
  pointer-events: none;
}

.board-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c5d0e0;
  margin-bottom: 4px;
}

#leaderboard {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: #eef3fa;
}

#leaderboard .you {
  color: var(--you);
}

#hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: #e8eef8;
  border: none;
  font-size: 13px;
  font-weight: 700;
  z-index: 3;
  pointer-events: none;
}

#hint.warn {
  background: rgba(140, 30, 40, 0.85);
  color: #ffe0e4;
}

/* —— Lobı / giriş (tek sayfa: gezegen | giriş | rehber) —— */
#overlay,
#death {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 14, 28, 0.72);
  z-index: 5;
  padding: 10px;
  overflow: auto;
}

.lobby-shell {
  width: min(1400px, 100%);
  min-height: min(640px, 92vh);
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 168px;
  gap: 12px;
  align-items: stretch;
}

/* Lobı yan reklam şeritleri — marka odaklı */
.ad-sky {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 14px 20px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.ad-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.ad-sky > * {
  position: relative;
  z-index: 1;
}

.ad-sky:hover {
  transform: translateY(-3px);
}

.ad-sky-left {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(56, 189, 248, 0.35), transparent 55%),
    linear-gradient(185deg, #0a1628 0%, #12304f 52%, #0b1424 100%);
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, 0.2);
}

.ad-sky-left::before {
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0 14px,
      rgba(125, 211, 252, 0.04) 14px 15px
    );
}

.ad-sky-left:hover {
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, 0.28),
    0 10px 28px rgba(14, 116, 144, 0.28);
}

.ad-sky-right {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(251, 191, 36, 0.32), transparent 55%),
    linear-gradient(185deg, #1c1208 0%, #4a2c0f 50%, #14100c 100%);
  box-shadow: inset 0 1px 0 rgba(253, 230, 138, 0.22);
}

.ad-sky-right::before {
  background:
    radial-gradient(circle at 30% 70%, rgba(253, 230, 138, 0.12), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(251, 146, 60, 0.1), transparent 35%);
}

.ad-sky-right:hover {
  border-color: rgba(253, 230, 138, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(253, 230, 138, 0.3),
    0 10px 28px rgba(180, 83, 9, 0.28);
}

.ad-sky-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(28px);
  opacity: 0.55;
  animation: ad-glow 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.ad-sky-left .ad-sky-glow {
  background: rgba(56, 189, 248, 0.55);
}

.ad-sky-right .ad-sky-glow {
  background: rgba(251, 191, 36, 0.5);
}

@keyframes ad-glow {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(-50%) scale(0.92);
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) scale(1.08);
  }
}

.ad-sky-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-sky-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin-top: 6px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  animation: ad-mark-in 0.7s ease both;
}

@keyframes ad-mark-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ad-sky-services {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ad-sky-services li {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  color: rgba(241, 245, 249, 0.9);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 5px 6px;
}

.ad-sky-left .ad-sky-services li {
  border-color: rgba(125, 211, 252, 0.18);
}

.ad-sky-right .ad-sky-services li {
  border-color: rgba(253, 230, 138, 0.2);
}

.site-credit {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  text-align: center;
}

.site-credit a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(186, 200, 220, 0.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 14, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-credit a:hover {
  color: #e0f2fe;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(12, 24, 42, 0.85);
}

.site-credit img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.ad-sky-brand {
  margin-top: 2px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: center;
}

.ad-sky-left .ad-sky-brand {
  color: #e0f2fe;
}

.ad-sky-right .ad-sky-brand {
  color: #fef3c7;
}

.ad-sky-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.72);
  text-align: center;
  line-height: 1.35;
}

.ad-sky-left .ad-sky-tag {
  color: rgba(186, 230, 253, 0.8);
}

.ad-sky-right .ad-sky-tag {
  color: rgba(253, 230, 138, 0.82);
}

.ad-sky-pitch {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  color: rgba(241, 245, 249, 0.88);
  max-width: 11em;
}

.ad-sky-cta {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #0b1220;
  background: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: center;
  width: 100%;
  max-width: 132px;
  transition: transform 0.18s ease, background 0.18s ease;
  animation: ad-cta-pulse 2.8s ease-in-out infinite;
}

.ad-sky-left .ad-sky-cta {
  background: #7dd3fc;
  color: #082f49;
}

.ad-sky-right .ad-sky-cta {
  background: #fde68a;
  color: #422006;
}

.ad-sky:hover .ad-sky-cta {
  transform: scale(1.04);
  animation: none;
}

@keyframes ad-cta-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.lobby {
  width: 100%;
  min-height: min(640px, 92vh);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 320px) minmax(200px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.lobby-col {
  background: rgba(12, 22, 40, 0.82);
  border: 1px solid rgba(126, 182, 255, 0.18);
  border-radius: 10px;
  padding: 14px 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.lang-switch {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 4px;
  z-index: 2;
}

.lang-btn {
  min-width: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 14, 28, 0.55);
  color: rgba(226, 232, 240, 0.75);
  border-radius: 6px;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  cursor: pointer;
}

.lang-btn.active {
  background: #3ddc84;
  color: #0b1f14;
  border-color: #3ddc84;
}

.lang-btn:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.lobby-center {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.lobby-col-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 900;
  color: #e8f0fa;
  letter-spacing: 0.04em;
  text-align: left;
}

.lobby-col-sub {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  color: #8aa0bd;
  text-align: left;
}

.lobby-planets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: min(560px, 74vh);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #3d5578 #121a2a;
}

.lobby-planet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  cursor: default;
  color: #c9d6ea;
  font-family: "Nunito", sans-serif;
  font-size: 10px;
  font-weight: 800;
}

.lobby-planet.selectable {
  cursor: pointer;
}

.lobby-planet.selectable:hover {
  border-color: rgba(253, 224, 71, 0.45);
  background: rgba(253, 224, 71, 0.08);
}

.lobby-planet.selected {
  border-color: #fde68a;
  color: #fff;
  background: rgba(253, 224, 71, 0.12);
}

.lobby-planet canvas {
  width: 48px;
  height: 48px;
  display: block;
}

.guide-schema {
  display: grid;
  gap: 8px;
  text-align: left;
  max-height: min(520px, 72vh);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3d5578 #121a2a;
}

.guide-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.guide-card strong {
  display: block;
  font-size: 12px;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.guide-card p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #9fb2cc;
  line-height: 1.35;
}

.guide-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.guide-red,
.guide-yellow {
  position: relative;
  box-shadow: none;
}

.guide-red {
  background: radial-gradient(circle at 35% 30%, #fff5f5, #f87171 45%, #b91c1c 75%, #7f1d1d);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35), 0 0 12px rgba(239, 68, 68, 0.45);
}

.guide-yellow {
  background: radial-gradient(circle at 35% 30%, #fffef7, #fde047 40%, #f59e0b 75%, #b45309);
  box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.4), 0 0 12px rgba(251, 191, 36, 0.45);
  border-radius: 0;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.guide-red::before,
.guide-yellow::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(
    from 10deg,
    transparent 0 8deg,
    currentColor 8deg 14deg,
    transparent 14deg 30deg,
    currentColor 30deg 36deg,
    transparent 36deg 52deg,
    currentColor 52deg 58deg,
    transparent 58deg 74deg,
    currentColor 74deg 80deg,
    transparent 80deg 96deg,
    currentColor 96deg 102deg,
    transparent 102deg 118deg,
    currentColor 118deg 124deg,
    transparent 124deg 140deg,
    currentColor 140deg 146deg,
    transparent 146deg 162deg,
    currentColor 162deg 168deg,
    transparent 168deg 184deg,
    currentColor 184deg 190deg,
    transparent 190deg 206deg,
    currentColor 206deg 212deg,
    transparent 212deg 228deg,
    currentColor 228deg 234deg,
    transparent 234deg 250deg,
    currentColor 250deg 256deg,
    transparent 256deg 272deg,
    currentColor 272deg 278deg,
    transparent 278deg 294deg,
    currentColor 294deg 300deg,
    transparent 300deg 316deg,
    currentColor 316deg 322deg,
    transparent 322deg 338deg,
    currentColor 338deg 344deg,
    transparent 344deg 360deg
  );
  opacity: 0.55;
  z-index: -1;
  mask: radial-gradient(circle, transparent 42%, #000 48%);
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 48%);
}

.guide-red::before {
  color: #f87171;
}

.guide-yellow::before {
  color: #fbbf24;
  /* yıldız ikonunda ışın halkası yok — uçlar clip-path’te */
  opacity: 0;
}

.guide-cloud {
  background: radial-gradient(circle at 40% 40%, rgba(226, 232, 240, 0.85), rgba(100, 116, 139, 0.5));
  border: 1px dashed rgba(226, 232, 240, 0.45);
}

.guide-bonus {
  background: conic-gradient(from 40deg, #34d399, #38bdf8, #a78bfa, #fb7185, #34d399);
}

.guide-pellets {
  grid-template-columns: 1fr;
  gap: 6px;
}

.guide-pellet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #c9d6ea;
}

.guide-pellet-row b {
  color: #fde68a;
}

.pellet-dot {
  display: inline-block;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #38bdf8 70%, #0369a1);
}

.pellet-dot.sm {
  width: 8px;
  height: 8px;
}

.pellet-dot.lg {
  width: 16px;
  height: 16px;
}

.guide-tip {
  grid-template-columns: 1fr;
  border-color: rgba(126, 182, 255, 0.22);
}

.guest-box {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.guest-nick-label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #a9bdd8;
  margin-bottom: 8px;
}

.guest-nick-label input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 12px;
}

.guest-nick-label input:focus {
  outline: none;
  border-color: #fde68a;
}

.menu {
  width: min(360px, 92vw);
  text-align: center;
  padding: 8px 0 4px;
}

@media (max-width: 1100px) {
  .lobby-shell {
    grid-template-columns: 132px minmax(0, 1fr) 132px;
  }
  .ad-sky-pitch {
    display: none;
  }
  .ad-sky-logo {
    width: 52px;
    height: 52px;
  }
  .ad-sky-services li {
    font-size: 10px;
    padding: 4px 5px;
  }
}

@media (max-width: 900px) {
  .lobby-shell {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ad-sky {
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 14px;
  }
  .ad-sky-glow {
    display: none;
  }
  .ad-sky-logo {
    margin-top: 0;
    width: 40px;
    height: 40px;
  }
  .ad-sky-brand {
    margin-top: 0;
    font-size: 16px;
  }
  .ad-sky-tag,
  .ad-sky-services {
    display: none;
  }
  .site-credit a {
    font-size: 11px;
  }
  .ad-sky-cta {
    margin-top: 0;
    width: auto;
    padding: 7px 12px;
    animation: none;
  }
  .lobby {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .lobby-planets,
  .guide-schema {
    max-height: 220px;
  }
  .lobby-planets {
    grid-template-columns: repeat(4, 1fr);
  }
}

.logo {
  font-weight: 900;
  font-size: clamp(36px, 10vw, 56px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.logo.small {
  font-size: clamp(28px, 8vw, 40px);
  margin-bottom: 10px;
}

.logo-arka {
  color: #7eb6ff;
  text-shadow: 3px 3px 0 #0d1a2e;
}

.logo-io {
  color: #ffe566;
  text-shadow: 3px 3px 0 #0d1a2e;
}

.menu-sub {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
  color: #c9d6ea;
}

.auth-gate {
  margin: 0 0 12px;
  text-align: left;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.auth-tab {
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #c9d6ea;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 10px;
  cursor: pointer;
}

.auth-tab.active {
  border-color: #7eb6ff;
  background: rgba(126, 182, 255, 0.18);
  color: #fff;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
}

.auth-form.hidden {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #a9bdd8;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 12px;
}

.auth-form input:focus {
  outline: none;
  border-color: #7eb6ff;
}

.auth-submit {
  margin-top: 4px;
}

.google-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #3c4043;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.google-btn:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.google-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.google-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.google-icon svg {
  display: block;
}

.guest-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}

.auth-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #9fbad8;
  text-align: center;
}

.auth-status.error {
  color: #fda4af;
}

.menu-play.hidden,
.auth-gate.hidden,
.profile-chip.hidden {
  display: none !important;
}

.profile-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  font-weight: 800;
  color: #ffe566;
}

.link-btn.tiny {
  font-size: 12px;
  padding: 0;
  margin: 0;
}

.play-btn:disabled,
.play-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.mode-rooms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 12px 11px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: #d7e2f2;
  cursor: pointer;
  text-align: left;
  box-shadow: none;
  font-family: "Nunito", sans-serif;
}

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.45);
  filter: brightness(1.06);
}

.mode-card.selected {
  border-color: #3ddc84;
  background: rgba(61, 220, 132, 0.16);
  color: #fff;
  box-shadow: 0 3px 0 #249a5c;
}

.mode-card[data-mode="team"].selected {
  border-color: #7eb6ff;
  background: rgba(126, 182, 255, 0.16);
  box-shadow: 0 3px 0 #4a7fc0;
}

.mode-title {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.mode-desc {
  font-size: 11px;
  font-weight: 700;
  color: #a9bdd8;
  line-height: 1.25;
}

.mode-card.selected .mode-desc {
  color: #e8f0fa;
}

.team-picker-wrap {
  margin: 0 0 14px;
  width: 100%;
}

.team-picker-wrap.hidden {
  display: none;
}

.team-picker-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #a9bdd8;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.team-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.team-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 10px 9px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #e8f0fa;
  cursor: pointer;
  text-align: left;
  font-family: "Nunito", sans-serif;
  box-shadow: none;
}

.team-chip:hover {
  filter: brightness(1.08);
}

.team-chip.selected {
  border-color: var(--team-accent, #3ddc84);
  background: color-mix(in srgb, var(--team-accent, #3ddc84) 22%, rgba(0, 0, 0, 0.35));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--team-accent, #3ddc84) 70%, #000);
}

.team-chip-name {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--team-accent, #fff);
}

.team-chip-meta {
  font-size: 10px;
  font-weight: 700;
  color: #a9bdd8;
}

.team-chip.selected .team-chip-meta {
  color: #e8f0fa;
}

.skin-row {
  margin: 0 0 16px;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 6px;
}

.costume-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #a9bdd8;
  text-align: center;
  letter-spacing: 0.04em;
}

.costume-hint {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.skins {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}

.planet-skins {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px 8px;
  gap: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: #3d5578 #121a2a;
}

.planet-opt {
  width: 64px;
}

.planet-swatch {
  width: 52px !important;
  height: 52px !important;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: transparent !important;
  box-shadow: none !important;
  display: block;
}

.avatar-opt.selected .planet-swatch {
  outline: 3px solid #fde68a;
  outline-offset: 3px;
}

.avatar-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 56px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #d7e2f2;
  box-shadow: none;
  font-family: "Nunito", sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.avatar-opt:hover {
  filter: brightness(1.08);
}

.avatar-opt.selected .avatar-swatch {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.avatar-opt.selected {
  color: #fff;
}

.avatar-opt:active {
  transform: scale(0.96);
}

.avatar-swatch {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 32% 28%, var(--av-accent, #fff) 0%, var(--av-color, #7dd3fc) 52%, color-mix(in srgb, var(--av-color) 70%, #000) 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.avatar-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.avatar-swatch[data-skin="ring"]::after {
  inset: 11px;
  border: 2.5px solid color-mix(in srgb, var(--av-accent) 80%, #fff);
  border-radius: 50%;
}

.avatar-swatch[data-skin="aurora"]::after {
  background: linear-gradient(135deg, color-mix(in srgb, var(--av-accent) 55%, transparent), transparent 55%);
}

.avatar-swatch[data-skin="grid"]::after {
  background:
    linear-gradient(var(--av-accent), var(--av-accent)) center / 40% 2px no-repeat,
    linear-gradient(var(--av-accent), var(--av-accent)) center / 2px 40% no-repeat;
  opacity: 0.65;
}

.avatar-swatch[data-skin="split"]::after {
  background: linear-gradient(90deg, transparent 50%, color-mix(in srgb, var(--av-accent) 45%, transparent) 50%);
}

.avatar-swatch[data-skin="orbit"]::after {
  inset: 10px 6px;
  border: 2px solid color-mix(in srgb, var(--av-accent) 70%, transparent);
  border-radius: 50%;
  transform: rotate(-28deg);
}

.avatar-swatch[data-skin="glass"]::after {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.45), transparent 45%);
}

.avatar-swatch[data-skin="flare"]::after {
  background: radial-gradient(circle, var(--av-accent) 0 18%, transparent 19%);
  opacity: 0.75;
}

.avatar-swatch[data-skin="slash"]::after {
  background: linear-gradient(125deg, transparent 44%, var(--av-accent) 46% 54%, transparent 56%);
  opacity: 0.7;
}

.avatar-swatch[data-skin="duo"]::after {
  background: linear-gradient(90deg, transparent 50%, #292524 50%);
  opacity: 0.55;
}

.avatar-swatch[data-skin="matte"]::after {
  inset: 12px;
  border: 1.5px solid color-mix(in srgb, var(--av-accent) 55%, transparent);
  border-radius: 50%;
}

.avatar-opt .avatar-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-opt .avatar-best {
  min-height: 12px;
  font-size: 10px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.02em;
  line-height: 1;
}

.avatar-opt .avatar-best[hidden] {
  display: block;
  visibility: hidden;
}

.play-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border: 3px solid #2bb86c;
  border-radius: 6px;
  padding: 14px 20px;
  font-family: "Nunito", sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--play-ink);
  background: var(--play);
  cursor: pointer;
  box-shadow: 0 4px 0 #249a5c;
}

.play-btn:hover {
  filter: brightness(1.05);
}

.play-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #249a5c;
}

.link-btn {
  display: inline-block;
  margin-top: 12px;
  border: none;
  background: transparent;
  color: #a9bdd8;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 8px;
  box-shadow: none;
}

.link-btn:hover {
  color: #fff;
}

.keys-legend {
  margin: 16px auto 0;
  max-width: 280px;
  padding: 12px 14px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.32);
  text-align: left;
  box-sizing: border-box;
}

.keys-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9eb0c8;
}

.keys-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keys-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  font-size: 13px;
  font-weight: 700;
  color: #d7e2f0;
}

.key-chip {
  flex: 0 0 118px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
}

.key-sep {
  flex: 0 0 auto;
  color: #6f829c;
  font-weight: 800;
}

.key-desc {
  flex: 1 1 auto;
  min-width: 0;
  color: #c5d4e8;
  font-weight: 700;
}

.menu-how {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #8fa3be;
}

.death-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

.death-score {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
  color: var(--you);
}

.death-score span {
  font-size: 22px;
}

.death-best {
  margin: -8px 0 14px;
  min-height: 1.2em;
  font-size: 13px;
  font-weight: 800;
  color: #a9bdd8;
}

.death-best.is-new {
  color: #fbbf24;
}

.hidden {
  display: none !important;
}

/* —— Mobil kontroller —— */
#touch-ui {
  --btn-size: 76px;
  --stick-size: 132px;
  --fill-a: 0.14;
  --border-a: 0.4;
  --text-a: 0.95;
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.ctrl-wrap {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ctrl-wrap .touch-btn {
  width: var(--btn-size, 62px);
  height: var(--btn-size, 62px);
  font-size: calc(var(--btn-size, 62px) * 0.2);
}

.stick-wrap .stick-base {
  width: var(--stick-size, 118px);
  height: var(--stick-size, 118px);
}

.touch-btn {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, var(--border-a));
  padding: 0;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  color: rgba(255, 255, 255, var(--text-a));
  background: rgba(8, 14, 24, calc(var(--fill-a) + 0.18));
  box-shadow: none;
  cursor: pointer;
  line-height: 1;
}

.touch-btn.boost {
  background: rgba(61, 220, 132, calc(var(--fill-a) + 0.12));
  border-color: rgba(61, 220, 132, calc(var(--border-a) + 0.25));
}

.touch-btn.split {
  background: rgba(126, 182, 255, calc(var(--fill-a) + 0.12));
  border-color: rgba(126, 182, 255, calc(var(--border-a) + 0.25));
}

.touch-btn.flare {
  background: rgba(255, 229, 102, calc(var(--fill-a) + 0.12));
  border-color: rgba(255, 229, 102, calc(var(--border-a) + 0.3));
  color: rgba(255, 248, 200, var(--text-a));
}

.touch-btn.bonus {
  background: rgba(125, 211, 252, calc(var(--fill-a) + 0.12));
  border-color: rgba(125, 211, 252, calc(var(--border-a) + 0.3));
  color: rgba(224, 242, 254, var(--text-a));
}

.touch-btn:active,
.touch-btn.active {
  transform: scale(0.94);
  filter: brightness(1.12);
}

.touch-btn:disabled {
  opacity: 0.3;
}

.stick-base {
  border-radius: 50%;
  background: rgba(8, 14, 24, calc(var(--fill-a) + 0.12));
  border: 2px solid rgba(255, 255, 255, var(--border-a));
  position: relative;
  touch-action: none;
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  margin: -19% 0 0 -19%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.65);
  will-change: transform;
}

#touch-ui.editing .touch-btn,
#touch-ui.editing .stick-base {
  outline: 2px solid rgba(255, 229, 102, 0.55);
  outline-offset: 2px;
}

.ctrl-gear {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
  pointer-events: auto;
}

.ctrl-gear:active {
  transform: scale(0.96);
}

.ctrl-gear.editing-hide {
  visibility: hidden;
}

#top-bar:has(.ctrl-gear.editing-hide) {
  opacity: 0;
  pointer-events: none;
}

#ctrl-setup {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  background: rgba(10, 18, 32, 0.55);
}

.ctrl-setup-head,
.ctrl-setup-foot {
  pointer-events: auto;
  position: relative;
  z-index: 8;
}

.ctrl-setup-head {
  padding: max(16px, env(safe-area-inset-top)) 16px 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
}

.ctrl-setup-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
}

.ctrl-setup-head p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #c5d0e0;
}

.ctrl-setup-foot {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
}

.setup-btn {
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
  min-width: 44px;
}

.setup-btn.ghost {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

.setup-btn.primary {
  background: var(--play);
  border-color: #2bb86c;
  color: var(--play-ink);
  min-width: 100px;
}

#touch-ui.editing {
  z-index: 8;
}

@media (max-width: 520px) {
  #hint {
    bottom: auto;
    top: 10px;
    max-width: 40vw;
    font-size: 11px;
    padding: 5px 8px;
  }

  #board {
    width: min(140px, 36vw);
  }

  #leaderboard {
    font-size: 11px;
  }

  .play-btn {
    font-size: 24px;
    padding: 12px 16px;
  }

  .avatar-swatch {
    width: 40px;
    height: 40px;
  }

  .mode-title {
    font-size: 16px;
  }

  .mode-desc {
    font-size: 10px;
  }

  .team-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-chip-name {
    font-size: 14px;
  }
}
