:root {
  --bg: #030714;
  --panel: rgba(7, 14, 34, 0.8);
  --panel-border: rgba(108, 247, 255, 0.18);
  --text: #f5fbff;
  --soft: #a9bfd6;
  --cyan: #6cf7ff;
  --pink: #ff7ad9;
  --gold: #ffdb6e;
  --green: #8effc5;
  --red: #ff698f;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  user-select: none;
  -webkit-user-select: none;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(66, 117, 204, 0.3), transparent 28%),
    radial-gradient(circle at 78% 20%, rgba(255, 122, 217, 0.14), transparent 20%),
    linear-gradient(180deg, #071024 0%, var(--bg) 100%);
}

button,
canvas {
  touch-action: manipulation;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

.stars,
.stars::before,
.stars::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}

.stars {
  background-image:
    radial-gradient(circle at 10% 16%, rgba(255, 255, 255, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 28% 70%, rgba(255, 255, 255, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 64% 26%, rgba(255, 255, 255, 0.8) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 84% 78%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px);
}

.stars::before {
  background-image:
    radial-gradient(circle at 18% 30%, rgba(108, 247, 255, 0.55) 0 1.5px, transparent 2px),
    radial-gradient(circle at 62% 12%, rgba(255, 122, 217, 0.5) 0 2px, transparent 3px);
  animation: pulse 6s ease-in-out infinite alternate;
}

.stars::after {
  background: linear-gradient(120deg, transparent 15%, rgba(255, 255, 255, 0.08) 50%, transparent 85%);
  transform: translateX(-100%);
  animation: comet 12s linear infinite;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

#game-board {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.hud {
  position: absolute;
  z-index: 2;
  width: min(340px, calc(100vw - 24px));
  padding: 18px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hud-left {
  top: 12px;
  left: 12px;
}

.hud-right {
  top: 12px;
  right: 12px;
}

.eyebrow,
.label,
.card span {
  display: block;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 10px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(108, 247, 255, 0.26);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
}

.brand-tag {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 0.88rem;
}

.menu-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 0 18px rgba(142, 255, 197, 0.45));
  flex-shrink: 0;
}

.description {
  margin: 0 0 16px;
  color: var(--soft);
  line-height: 1.6;
}

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

.card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 36, 79, 0.78), rgba(8, 14, 34, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card span {
  margin-bottom: 8px;
}

.card strong {
  font-size: 1.4rem;
}

.tips,
.info-card {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(4, 10, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--soft);
  line-height: 1.6;
}

.tips p,
.info-card ul {
  margin: 0;
}

.tips p + p,
.info-card li + li {
  margin-top: 6px;
}

.info-card ul {
  margin-top: 8px;
  padding-left: 18px;
}

.menu-credit {
  margin: 14px 0 0;
  color: rgba(245, 251, 255, 0.72);
  font-size: 0.8rem;
  text-align: right;
}

.player-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 10px;
}

.player-form input {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
}

.player-form input:focus {
  outline: 2px solid rgba(108, 247, 255, 0.3);
  outline-offset: 2px;
}

.compact-button {
  width: auto;
  padding: 12px 16px;
}

.backend-status {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: var(--soft);
}

.leaderboard-card {
  margin-top: 14px;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.tab-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.tab-button.active {
  color: #02111f;
  background: linear-gradient(135deg, var(--gold), #f7b955);
}

.leaderboard-list {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
  color: var(--soft);
  line-height: 1.6;
}

.leaderboard-list li + li {
  margin-top: 6px;
}

.buttons {
  display: grid;
  gap: 10px;
}

.primary-button,
.ghost-button,
.control-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button,
.ghost-button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.primary-button {
  background: linear-gradient(135deg, var(--cyan), #2bc9f5);
  color: #02111f;
  box-shadow: 0 14px 28px rgba(43, 201, 245, 0.35);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-button:hover,
.ghost-button:hover,
.control-button:hover {
  transform: translateY(-2px);
}

.mobile-controls {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.mobile-topbar {
  display: none;
}

.mini-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #02111f;
  background: linear-gradient(135deg, var(--cyan), #2bc9f5);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.mini-button.mini-button-secondary {
  color: var(--text);
  background: rgba(7, 14, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
}


.middle-controls {
  display: flex;
  gap: 52px;
}

.control-button {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  font-size: 1.35rem;
}

/* ------------------- Oyun ici minimal HUD ------------------- */
.mini-hud {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  display: none;
  gap: 8px;
}

.mini-live {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 60px;
  margin: 0;
  padding: 8px 14px;
  display: none;
  list-style: none;
  border-radius: 14px;
  background: rgba(4, 10, 25, 0.55);
  border: 1px solid rgba(108, 247, 255, 0.14);
  backdrop-filter: blur(6px);
  font-size: 0.78rem;
  color: var(--soft);
  line-height: 1.7;
  min-width: 140px;
}

.mini-live li strong {
  color: var(--text);
}

body.playing .mini-hud {
  display: flex;
}

body.playing .mini-live {
  display: block;
}

body.playing .hud-left,
body.playing .hud-right {
  display: none;
}

.chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(4, 10, 25, 0.55);
  border: 1px solid rgba(108, 247, 255, 0.14);
  backdrop-filter: blur(6px);
}

.chip span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.chip strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.chip-shield {
  border-color: rgba(142, 255, 197, 0.5);
}

.chip-shield span,
.chip-shield strong {
  color: var(--green);
}

.chip-shield.hidden {
  display: none;
}

/* ------------------- Yardim butonu & paneli ------------------- */
.help-fab {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(108, 247, 255, 0.35);
  border-radius: 50%;
  background: rgba(4, 10, 25, 0.7);
  color: var(--cyan);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(108, 247, 255, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.help-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 0 26px rgba(108, 247, 255, 0.45);
}

.help-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 4, 14, 0.78);
  backdrop-filter: blur(8px);
}

.help-modal.hidden {
  display: none;
}

.help-card {
  position: relative;
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.help-card h2 {
  margin: 0 0 18px;
  text-align: center;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.9rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px rgba(108, 247, 255, 0.4);
}

.help-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.help-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(4, 10, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.help-item h3 {
  margin: 10px 0 6px;
  font-size: 0.95rem;
  color: var(--cyan);
}

.help-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--soft);
  line-height: 1.5;
}

.demo {
  position: relative;
  height: 86px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, rgba(20, 36, 79, 0.6), rgba(3, 7, 20, 0.9));
  overflow: hidden;
}

/* Demo: yilan noktalari */
.demo-snake {
  position: absolute;
  top: 50%;
  left: 12%;
  display: flex;
  gap: 3px;
}

.demo-snake i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(108, 247, 255, 0.8);
  animation: slither 1.4s ease-in-out infinite;
}

.demo-snake i:nth-child(even) {
  background: var(--pink);
  box-shadow: 0 0 10px rgba(255, 122, 217, 0.8);
}

.demo-snake i:nth-child(1) { animation-delay: 0s; }
.demo-snake i:nth-child(2) { animation-delay: -0.12s; }
.demo-snake i:nth-child(3) { animation-delay: -0.24s; }
.demo-snake i:nth-child(4) { animation-delay: -0.36s; }
.demo-snake i:nth-child(5) { animation-delay: -0.48s; }
.demo-snake i:nth-child(6) { animation-delay: -0.6s; }

.demo-snake.fast i {
  animation-duration: 0.55s;
}

.demo-snake.small i {
  width: 9px;
  height: 9px;
}

@keyframes slither {
  0%, 100% { transform: translateY(-9px); }
  50% { transform: translateY(9px); }
}

.demo-cursor {
  position: absolute;
  top: 26%;
  right: 16%;
  width: 14px;
  height: 14px;
  border-left: 2px solid #fff;
  border-top: 2px solid #fff;
  transform: rotate(12deg);
  animation: cursorMove 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

@keyframes cursorMove {
  from { transform: translate(0, 0) rotate(12deg); }
  to { transform: translate(-22px, 26px) rotate(12deg); }
}

.dash {
  position: absolute;
  height: 2px;
  width: 26px;
  background: linear-gradient(90deg, rgba(108, 247, 255, 0), rgba(108, 247, 255, 0.9));
  animation: dashFly 0.7s linear infinite;
}

.dash.d1 { top: 28%; animation-delay: 0s; }
.dash.d2 { top: 50%; animation-delay: 0.22s; }
.dash.d3 { top: 72%; animation-delay: 0.44s; }

@keyframes dashFly {
  from { right: -30px; opacity: 1; }
  to { right: 110%; opacity: 0; }
}

.orb {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: orbPulse 1.2s ease-in-out infinite alternate;
}

.orb.o1 { top: 30%; left: 22%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.orb.o2 { top: 62%; left: 40%; background: #9ef0ff; box-shadow: 0 0 10px #9ef0ff; animation-delay: 0.3s; }
.orb.o3 { top: 40%; left: 60%; background: #ff9ecb; box-shadow: 0 0 10px #ff9ecb; animation-delay: 0.6s; }

@keyframes orbPulse {
  from { transform: scale(0.75); }
  to { transform: scale(1.25); }
}

.demo-head {
  position: absolute;
  top: 42%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(108, 247, 255, 0.9);
  animation: headEat 3s linear infinite;
}

@keyframes headEat {
  from { left: -24px; }
  to { left: 105%; }
}

.boom {
  position: absolute;
  top: 50%;
  right: 22%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  animation: boomRing 1.6s ease-out infinite;
}

@keyframes boomRing {
  0% { transform: scale(0.4); opacity: 1; box-shadow: 0 0 18px rgba(255, 122, 217, 0.9); }
  100% { transform: scale(4); opacity: 0; }
}

.hole-core {
  position: absolute;
  top: 50%;
  left: 34%;
  width: 22px;
  height: 22px;
  margin: -11px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.9);
}

.hole-ring {
  position: absolute;
  top: 50%;
  left: 34%;
  border-radius: 50%;
  border: 2px solid rgba(200, 140, 255, 0.75);
  border-bottom-color: transparent;
  animation: spinRing 1.4s linear infinite;
}

.hole-ring.r1 { width: 38px; height: 38px; margin: -19px; }
.hole-ring.r2 { width: 54px; height: 54px; margin: -27px; animation-duration: 2.2s; animation-direction: reverse; }

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.planet {
  position: absolute;
  top: 50%;
  right: 18%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #f2b38a, #d06f47);
  box-shadow: 0 0 16px rgba(208, 111, 71, 0.7);
  animation: floaty 3.4s ease-in-out infinite alternate;
}

@keyframes floaty {
  from { transform: translateY(-6px); }
  to { transform: translateY(6px); }
}

.pow {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  font-weight: 700;
  color: #04111f;
  animation: orbPulse 1.1s ease-in-out infinite alternate;
}

.pow.p1 { left: 8%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.pow.p2 { left: 32%; background: var(--gold); box-shadow: 0 0 14px var(--gold); animation-delay: 0.2s; }
.pow.p3 { left: 56%; background: var(--green); box-shadow: 0 0 14px var(--green); animation-delay: 0.4s; }
.pow.p4 { left: 80%; background: #c8a7ff; box-shadow: 0 0 14px #c8a7ff; animation-delay: 0.6s; }

/* Demo: gorev XP cubugu */
.demo-quest {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quest-demo-track {
  width: 70%;
  height: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.quest-demo-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  box-shadow: 0 0 12px rgba(255, 219, 110, 0.6);
  animation: questFill 2.6s ease-in-out infinite;
}

@keyframes questFill {
  0% { width: 8%; }
  70% { width: 100%; }
  100% { width: 100%; }
}

.quest-demo-xp {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  animation: xpPop 2.6s ease-in-out infinite;
}

@keyframes xpPop {
  0%, 60% { opacity: 0; transform: scale(0.6); }
  75% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

/* Demo: canli olaylar (meteor + altin yem) */
.event-meteor {
  position: absolute;
  top: -18px;
  left: 10%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a86a3f, #4a2c16);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.9);
  animation: meteorFall 2.2s linear infinite;
}

.event-meteor::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 8px;
  width: 3px;
  height: 24px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 120, 30, 0), rgba(255, 120, 30, 0.85));
  transform: rotate(-24deg);
}

@keyframes meteorFall {
  from { transform: translate(0, -20px); opacity: 1; }
  85% { opacity: 1; }
  to { transform: translate(70px, 96px); opacity: 0; }
}

.event-gold {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: orbPulse 1s ease-in-out infinite alternate;
}

.event-gold.g1 { top: 30%; left: 58%; }
.event-gold.g2 { top: 62%; left: 42%; animation-delay: 0.3s; }
.event-gold.g3 { top: 46%; left: 76%; animation-delay: 0.6s; }

/* Demo: sohbet balonu */
.demo-chat .demo-snake {
  left: 30%;
  top: 62%;
}

.chat-demo-bubble {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(245, 251, 255, 0.94);
  color: #04111f;
  font-size: 0.8rem;
  font-weight: 700;
  animation: bubblePop 2.4s ease-in-out infinite;
}

.chat-demo-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(245, 251, 255, 0.94);
  border-bottom: 0;
}

@keyframes bubblePop {
  0%, 15% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  25%, 80% { opacity: 1; transform: translateX(-50%) scale(1); }
  95%, 100% { opacity: 0; transform: translateX(-50%) scale(0.8); }
}

/* Demo: izleme gozu */
.watch-eye {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 24px;
  margin: -12px -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #04111f 0 6px, #6cf7ff 6px 9px, #f5fbff 9px);
  box-shadow: 0 0 18px rgba(108, 247, 255, 0.6);
  animation: eyeBlink 3s ease-in-out infinite;
}

@keyframes eyeBlink {
  0%, 42%, 50%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(0.1); }
}

.watch-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px solid rgba(108, 247, 255, 0.5);
  animation: watchPulse 2s ease-out infinite;
}

.watch-ring.wr1 { width: 46px; height: 46px; margin: -23px; }
.watch-ring.wr2 { width: 46px; height: 46px; margin: -23px; animation-delay: 1s; }

@keyframes watchPulse {
  from { transform: scale(0.8); opacity: 1; }
  to { transform: scale(2); opacity: 0; }
}

/* ------------------- Giris ekrani tanitim animasyonu ------------------- */
.intro-anim {
  position: relative;
  height: 74px;
  margin: 0 0 14px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(20, 36, 79, 0.55), rgba(3, 7, 20, 0.9));
  border: 1px solid rgba(108, 247, 255, 0.12);
  overflow: hidden;
}

.intro-snake {
  position: absolute;
  top: 50%;
  display: flex;
  gap: 3px;
  animation: introCruise 6s linear infinite;
}

.intro-snake i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(108, 247, 255, 0.85);
  animation: slither 1.3s ease-in-out infinite;
}

.intro-snake i:nth-child(even) {
  background: var(--pink);
  box-shadow: 0 0 9px rgba(255, 122, 217, 0.85);
}

.intro-snake i:nth-child(1) { animation-delay: 0s; }
.intro-snake i:nth-child(2) { animation-delay: -0.11s; }
.intro-snake i:nth-child(3) { animation-delay: -0.22s; }
.intro-snake i:nth-child(4) { animation-delay: -0.33s; }
.intro-snake i:nth-child(5) { animation-delay: -0.44s; }
.intro-snake i:nth-child(6) { animation-delay: -0.55s; }
.intro-snake i:nth-child(7) { animation-delay: -0.66s; }
.intro-snake i:nth-child(8) { animation-delay: -0.77s; }

@keyframes introCruise {
  from { left: -120px; }
  to { left: 110%; }
}

.intro-food {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  animation: orbPulse 1.3s ease-in-out infinite alternate;
}

.intro-food.f1 { top: 22%; left: 18%; background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.intro-food.f2 { top: 64%; left: 48%; background: #9ef0ff; box-shadow: 0 0 9px #9ef0ff; animation-delay: 0.35s; }
.intro-food.f3 { top: 30%; left: 76%; background: #ff9ecb; box-shadow: 0 0 9px #ff9ecb; animation-delay: 0.7s; }

.intro-hole {
  position: absolute;
  top: 50%;
  right: 8%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: #000;
  border: 2px solid rgba(200, 140, 255, 0.7);
  border-bottom-color: transparent;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.8);
  animation: spinRing 1.8s linear infinite;
}

.intro-features {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  text-align: left;
}

.intro-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--soft);
}

.fi {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: orbPulse 1.4s ease-in-out infinite alternate;
}

.fi-eat { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.fi-fight { background: var(--pink); box-shadow: 0 0 8px var(--pink); animation-delay: 0.3s; }
.fi-rank { background: var(--green); box-shadow: 0 0 8px var(--green); animation-delay: 0.6s; }

#intro-help-button {
  margin-bottom: 16px;
}

/* ------------------- Sohbet ------------------- */
.chat-fab {
  top: 152px;
}

.chat-row {
  position: absolute;
  z-index: 6;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(560px, calc(100vw - 20px));
}

.chat-row.hidden {
  display: none;
}

.chat-row button {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(108, 247, 255, 0.3);
  background: rgba(4, 10, 25, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 120ms ease, background 120ms ease;
}

.chat-row button:hover {
  transform: scale(1.08);
  background: rgba(108, 247, 255, 0.18);
}

/* ------------------- Seyirci modu ------------------- */
.spectate-bar {
  position: absolute;
  z-index: 6;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(4, 10, 25, 0.85);
  border: 1px solid rgba(255, 219, 110, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 24px rgba(255, 219, 110, 0.2);
}

.spectate-bar.hidden {
  display: none;
}

#spectate-label {
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.spectate-bar .compact-button {
  white-space: nowrap;
}

/* ------------------- Gunun oyuncusu ------------------- */
.today-player {
  margin: 0 0 16px;
  padding: 8px 18px;
  display: inline-block;
  border-radius: 999px;
  background: rgba(255, 219, 110, 0.1);
  border: 1px solid rgba(255, 219, 110, 0.35);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  animation: pulse 3s ease-in-out infinite alternate;
}

.today-player.hidden {
  display: none;
}

/* Skin secici hucreleri */
.skin-grid button canvas {
  border-radius: 10px;
}

/* ------------------- Dil secici ------------------- */
.lang-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.lang-switch button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.lang-switch button:hover {
  transform: scale(1.15);
}

.lang-switch button.active {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(108, 247, 255, 0.5);
  transform: scale(1.1);
}

/* ------------------- Karsilama sayfasi ------------------- */
.landing-screen {
  position: absolute;
  inset: 0;
  z-index: 12;
  overflow-y: auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(66, 117, 204, 0.25), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(255, 122, 217, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(3, 7, 20, 0.94), rgba(1, 4, 14, 0.98));
  backdrop-filter: blur(6px);
}

.landing-screen.hidden {
  display: none;
}

.landing-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 18px 30px;
  text-align: center;
}

.landing-logo {
  width: 130px;
  height: 130px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
}

.landing-hero .auth-sub {
  max-width: 560px;
  margin: 0 auto 18px;
}

.landing-anim {
  max-width: 620px;
  margin: 0 auto 22px;
}

.landing-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 34px;
}

.landing-buttons .ghost-button,
.landing-buttons .primary-button {
  width: auto;
  min-width: 160px;
}

.landing-play {
  font-size: 1.1rem;
  padding: 16px 34px;
  animation: playPulse 2.2s ease-in-out infinite;
}

@keyframes playPulse {
  0%, 100% { box-shadow: 0 14px 28px rgba(43, 201, 245, 0.35); transform: scale(1); }
  50% { box-shadow: 0 16px 44px rgba(43, 201, 245, 0.6); transform: scale(1.04); }
}

.landing-admin {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  text-align: left;
}

.landing-card {
  margin-top: 0;
}

.landing-rewards-note {
  margin: 8px 0 10px;
  font-size: 0.82rem;
}

.landing-rewards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.landing-reward {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 219, 110, 0.18);
}

.landing-reward span {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold);
}

.landing-credit {
  margin-top: 8px;
  text-align: center;
}

.landing-footer-links {
  margin: 22px 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.landing-footer-links a {
  color: var(--soft);
  text-decoration: none;
}

.landing-footer-links a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.seo-text {
  margin-top: 16px;
  text-align: left;
}

.seo-text h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: var(--cyan);
}

.seo-text p {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: var(--soft);
  line-height: 1.65;
}

/* Oyun ici menu */
.menu-card {
  display: grid;
  gap: 10px;
}

.menu-title {
  margin: 0 0 8px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.1em;
  text-shadow: 0 0 20px rgba(108, 247, 255, 0.4);
}

.menu-fab {
  top: 106px;
}

#auth-email.hidden {
  display: none;
}

/* ------------------- XP / Seviye / Gorevler ------------------- */
.xp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.level-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #f7b955);
  color: #02111f;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.xp-track {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 10px rgba(108, 247, 255, 0.5);
  transition: width 600ms ease;
}

.quest-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.quest-empty {
  margin: 0;
  font-size: 0.82rem;
}

.quest-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.quest-item.done {
  border-color: rgba(142, 255, 197, 0.4);
  background: rgba(142, 255, 197, 0.07);
}

.quest-text {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text);
}

.quest-xp {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.quest-track {
  margin-top: 6px;
  height: 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.quest-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  transition: width 500ms ease;
}

.quest-item.done .quest-fill {
  background: var(--green);
}

.death-quests {
  margin: 12px 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

/* ------------------- Killcam & paylasim ------------------- */
.killcam {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(108, 247, 255, 0.2);
  background: #030714;
  margin: 8px 0 2px;
}

.killcam-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: var(--soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#share-button,
#invite-button {
  margin-top: 10px;
}

/* ------------------- Ses dugmesi ------------------- */
.sound-fab {
  top: 60px;
}

.sound-fab.muted {
  opacity: 0.45;
}

/* ------------------- Kilitli avatarlar ------------------- */
.avatar-grid button.locked {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.avatar-grid button.locked::after {
  content: attr(data-lock);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(3, 7, 20, 0.55);
  border-radius: inherit;
}

/* ------------------- Avatar secici ------------------- */
.avatar-section {
  margin: 0 0 16px;
  text-align: left;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.avatar-grid button {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.avatar-grid button:hover {
  transform: scale(1.14);
}

.avatar-grid button.selected {
  border-color: var(--cyan);
  background: rgba(108, 247, 255, 0.14);
  box-shadow: 0 0 14px rgba(108, 247, 255, 0.45);
  transform: scale(1.1);
  animation: avatarPop 300ms ease;
}

.avatar-grid.compact {
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.avatar-grid.compact button {
  font-size: 0.95rem;
  border-radius: 9px;
  padding: 0;
}

@keyframes avatarPop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.22); }
  100% { transform: scale(1.1); }
}

/* ------------------- Giris / olum ekranlari ------------------- */
.auth-screen,
.death-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 12px;
  background: rgba(1, 4, 14, 0.72);
  backdrop-filter: blur(8px);
}

.auth-screen .auth-card,
.death-screen .auth-card {
  margin: auto;
}

.auth-screen.hidden,
.death-screen.hidden {
  display: none;
}

.auth-card {
  width: min(400px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto;
}

.auth-card h1 {
  font-size: 2.2rem;
}

.online-tag {
  color: var(--green);
  text-shadow: 0 0 18px rgba(142, 255, 197, 0.6);
}

.auth-sub {
  margin: 0 0 18px;
  color: var(--soft);
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

#auth-form {
  display: grid;
  gap: 10px;
}

#auth-form input {
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
}

#auth-form input:focus {
  outline: 2px solid rgba(108, 247, 255, 0.3);
  outline-offset: 2px;
}

.auth-error {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 0.86rem;
}

.death-card h2 {
  margin: 0 0 8px;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.06em;
  color: var(--red);
  text-shadow: 0 0 24px rgba(255, 105, 143, 0.5);
}

.death-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.death-card .ghost-button {
  margin-top: 10px;
}

.pilot-name {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cyan);
}

@keyframes pulse {
  from {
    opacity: 0.7;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes comet {
  from {
    transform: translateX(-100%) translateY(-30%) rotate(12deg);
  }
  to {
    transform: translateX(100%) translateY(30%) rotate(12deg);
  }
}

@media (max-width: 760px) {
  .game-shell {
    height: 100vh;
    height: 100dvh;
  }

  #game-board {
    height: 100vh;
    height: 100dvh;
  }

  .hud {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    padding: 14px;
    border-radius: 18px;
  }

  .hud-right {
    top: auto;
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-controls {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .middle-controls {
    gap: 18px;
  }

  .control-button {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    font-size: 1.2rem;
  }

  .mobile-topbar {
    position: absolute;
    z-index: 4;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .brand-block {
    gap: 10px;
  }

  .menu-logo {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }

  .card {
    padding: 12px;
  }

  .card strong {
    font-size: 1.2rem;
  }

  .player-form {
    grid-template-columns: 1fr;
  }

  body.mobile-playing .hud {
    display: none;
  }

  body.mobile-playing .mobile-controls {
    z-index: 3;
  }

  body.mobile-playing .mobile-topbar {
    display: flex;
  }

  body.mobile-playing .stars {
    opacity: 0.55;
  }

  /* --- Mobil oyun ici duzen: ust cakismalari coz --- */

  /* BOOST alt ortada, basparmak dostu buyuk yuvarlak buton */
  .mobile-topbar {
    position: absolute;
    z-index: 4;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    display: none;
  }

  body.playing .mobile-topbar {
    display: flex;
  }

  #mobile-boost-button {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    font-size: 0.82rem;
    box-shadow: 0 0 26px rgba(108, 247, 255, 0.5);
    opacity: 0.92;
  }

  #mobile-boost-button:active {
    transform: scale(0.92);
    box-shadow: 0 0 40px rgba(108, 247, 255, 0.9);
  }

  /* Ust cipler: kompakt, fab sutunuyla cakismasin */
  .mini-hud {
    top: 10px;
    left: 10px;
    max-width: calc(100vw - 120px);
    flex-wrap: wrap;
    gap: 5px;
  }

  .chip {
    padding: 5px 10px;
    gap: 5px;
  }

  .chip span {
    font-size: 0.52rem;
  }

  .chip strong {
    font-size: 0.85rem;
  }

  /* Ilk-3 listesi: ciplerin altina, sola */
  .mini-live {
    top: auto;
    right: auto;
    left: 10px;
    margin-top: 0;
    padding: 6px 10px;
    font-size: 0.68rem;
    line-height: 1.55;
    min-width: 0;
    max-width: 60vw;
  }

  body.playing .mini-live {
    position: absolute;
    top: 88px;
  }

  /* Sag fab sutunu: biraz kucuk */
  .help-fab {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    top: 10px;
    right: 10px;
  }

  .sound-fab {
    top: 52px;
  }

  .menu-fab {
    top: 94px;
  }

  /* Performans: mobilde backdrop-filter cok pahali, kapat */
  .chip,
  .mini-live,
  .help-fab,
  .chat-row button,
  .spectate-bar,
  .hud,
  .landing-screen,
  .auth-screen,
  .death-screen,
  .help-modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Kucuk ekranda minimap kucuk kalsin, boost butonuyla cakismasin */

  /* Giris / olum kartlari: kucuk ekranda kompakt ve kaydirilabilir */
  .auth-screen,
  .death-screen {
    padding: 12px 8px;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-logo {
    width: 64px;
    height: 64px;
  }

  .auth-card h1 {
    font-size: 1.7rem;
    margin: 4px 0 6px;
  }

  .auth-sub {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  .intro-features {
    gap: 4px;
    margin-bottom: 10px;
  }

  .intro-feature {
    font-size: 0.78rem;
  }

  .avatar-section {
    margin-bottom: 10px;
  }

  .avatar-grid {
    gap: 6px;
  }

  .avatar-grid button {
    border-radius: 12px;
    padding: 2px;
  }

  #auth-form input {
    padding: 11px 14px;
  }

  .killcam {
    height: 150px;
  }
}
