:root {
  --bg-top: #26326b;
  --bg-mid: #19224d;
  --bg-bottom: #0f1531;
  --board-bg: #111730;
  --board-border: #334385;
  --cell-empty: #1b2448;
  --gold: #ffcc29;
  --gold-dark: #d49600;
  --pink: #ff477e;
  --pink-dark: #c9184a;
  --green: #2ec4b6;
  --blue-accent: #4cc9f0;
  --text-light: #ffffff;
  --text-muted: #a6b4e8;
  --card-surface: rgba(24, 33, 74, 0.88);
  --card-border: rgba(255, 255, 255, 0.16);
}

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

html,
body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 50% 12%, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bottom) 100%);
  color: var(--text-light);
  touch-action: none;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 470px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 8px) 12px env(safe-area-inset-bottom, 10px);
  z-index: 1;
}

/* Arka Plan Işıltıları */
.bg-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.42;
}

.orb-1 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255, 71, 126, 0.75) 0%, rgba(255, 71, 126, 0) 70%);
  top: -100px;
  left: -90px;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(67, 97, 238, 0.75) 0%, rgba(67, 97, 238, 0) 70%);
  bottom: -120px;
  right: -100px;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 204, 41, 0.45) 0%, rgba(255, 204, 41, 0) 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ============================================================================
   1. GİRİŞ EKRANI (START SCREEN)
   ============================================================================ */
.start-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: radial-gradient(circle at 50% 15%, rgba(44, 59, 128, 0.96) 0%, rgba(13, 18, 43, 0.98) 100%);
  backdrop-filter: blur(10px);
}

.start-screen.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

.start-card {
  width: 100%;
  max-height: 96dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(35, 48, 105, 0.95) 0%, rgba(19, 26, 61, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.birthday-pill {
  background: linear-gradient(90deg, #ff477e, #ff85a1, #ff477e);
  background-size: 200% 100%;
  animation: shimmer 3s infinite linear;
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(255, 71, 126, 0.45);
}

.logo-wrap {
  margin: 2px 0;
}

.game-logo {
  font-family: 'Fredoka', sans-serif;
  display: flex;
  flex-direction: column;
  line-height: 0.92;
  letter-spacing: 1px;
}

.logo-top {
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(180deg, #fff6cc 0%, #ffcc29 55%, #ff9900 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #945200) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.logo-bottom {
  font-size: 2.35rem;
  font-weight: 700;
  background: linear-gradient(180deg, #a8ecff 0%, #38b6ff 55%, #0077ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #003e8a) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.logo-sub {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #cbd5ff;
}

/* Maskot Kutusu */
.hero-mascot-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(13, 19, 46, 0.65);
  border: 1.5px solid rgba(255, 204, 41, 0.35);
  border-radius: 20px;
  padding: 10px 12px;
  width: 100%;
}

.hero-avatar-ring {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 18px rgba(255, 204, 41, 0.45);
  background: #1e2959;
  overflow: visible;
}

.hero-avatar-ring canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.hero-floating-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  animation: floatBob 2s infinite ease-in-out;
}

.hero-quote {
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.32;
  color: #eef2ff;
}

/* Sahte Rekor Tablosu */
.leaderboard-card {
  width: 100%;
  background: rgba(12, 17, 40, 0.72);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 10px 12px;
}

.leaderboard-title {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

.lb-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 204, 41, 0.22) 0%, rgba(255, 71, 126, 0.18) 100%);
  border: 1px solid rgba(255, 204, 41, 0.5);
}

.lb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.lb-badge {
  font-size: 1.15rem;
}

.lb-name {
  font-weight: 800;
  color: #fff;
  display: block;
}

.lb-note {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
}

.lb-score {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold);
}

.start-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.app-version {
  margin-top: 8px;
  padding: 6px 12px;
  cursor: default;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.7;
  text-align: center;
}

/* ============================================================================
   BUTON STİLLERİ (3D ARCADE GLOSSY)
   ============================================================================ */
.btn-primary {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 13px 20px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #4cd964 0%, #28a745 100%);
  box-shadow: 0 5px 0 #19692c, 0 8px 20px rgba(40, 167, 69, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #19692c, 0 4px 10px rgba(40, 167, 69, 0.3);
}

.btn-gold-share {
  font-size: 0.96rem;
  padding: 12px 16px;
  background: linear-gradient(180deg, #ffdf6b 0%, #f59e0b 100%);
  color: #161b33;
  box-shadow: 0 5px 0 #92400e, 0 8px 20px rgba(245, 158, 11, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.btn-gold-share:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #92400e, 0 4px 10px rgba(245, 158, 11, 0.35);
}

.btn-whatsapp {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 11px 16px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #25d366 0%, #128c7e 100%);
  box-shadow: 0 4px 0 #075e54, 0 6px 16px rgba(37, 211, 102, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn-whatsapp:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #075e54;
}

.btn-secondary {
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 9px 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  color: #e2e8ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover,
.btn-secondary:active {
  background: rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
}

/* ============================================================================
   2. ANA OYUN EKRANI (GAME SCREEN)
   ============================================================================ */
.game-screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

/* Üst Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 21, 49, 0.78);
  border: 1.5px solid rgba(255, 204, 41, 0.4);
  border-radius: 14px;
  padding: 4px 10px;
}

.pill-icon {
  font-size: 1.15rem;
}

.pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.pill-label {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.pill-val {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.current-score-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-score {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 3px 0 #101738, 0 5px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.main-score.score-pop {
  transform: scale(1.22);
  color: var(--gold);
}

.streak-badge {
  font-size: 0.65rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ff477e, #ff9900);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 2px;
  box-shadow: 0 2px 8px rgba(255, 71, 126, 0.5);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 29, 66, 0.85);
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.icon-btn:active {
  transform: translateY(2px);
}

.gift-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff477e;
  border: 2px solid #131936;
  display: none;
}

.gift-btn.unlocked .gift-dot {
  display: block;
  background: #4cd964;
  animation: pulseScale 1.2s infinite;
}

/* Doğum Günü Hedef & Cüzdan Katlama Barı */
.goal-progress-wrap {
  background: rgba(15, 21, 49, 0.75);
  border: 1px solid rgba(255, 204, 41, 0.25);
  border-radius: 12px;
  padding: 5px 10px 7px;
  cursor: pointer;
}

.goal-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #d9e2ff;
  margin-bottom: 4px;
}

.goal-reward-pill {
  background: rgba(255, 204, 41, 0.2);
  color: var(--gold);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 900;
}

.goal-progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  overflow: visible;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff477e 0%, #ffcc29 100%);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.tier-tick {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.wallet-mini-badge {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 900;
  background: rgba(255, 204, 41, 0.18);
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 204, 41, 0.35);
}

/* Yeni Karakter & Ödül Açıldı Bildirimi (Toast) */
.tier-unlock-toast {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 94%;
  background: linear-gradient(135deg, #2b1954 0%, #161f4a 100%);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 20px rgba(255, 204, 41, 0.55);
  animation: modalPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.tier-unlock-toast canvas {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.toast-text-col {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.toast-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  color: var(--gold);
}

.toast-desc {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
}

/* CANLI MANİTA AVATARI & KONUŞMA BALONU */
.manita-live-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(28, 39, 87, 0.92) 0%, rgba(18, 25, 58, 0.92) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 6px 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s, transform 0.2s;
}

.manita-live-bar.bar-panic {
  border-color: #ff477e;
  box-shadow: 0 0 18px rgba(255, 71, 126, 0.4);
  animation: panicShake 0.55s infinite;
}

.manita-live-bar.bar-celebrate {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 204, 41, 0.5);
}

.manita-avatar-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: #151e42;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.manita-avatar-wrapper canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.avatar-mood-emoji {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.05rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.speech-bubble-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speech-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speech-name {
  font-weight: 900;
  font-size: 0.76rem;
  color: var(--gold);
}

.speech-mood-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.2);
  color: #80ffdb;
}

.speech-mood-tag.mood-panic {
  background: rgba(255, 71, 126, 0.28);
  color: #ff9ebb;
}

.speech-mood-tag.mood-guilty {
  background: rgba(255, 204, 41, 0.25);
  color: #ffe17d;
}

.speech-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.24;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 8x8 OYUN TAHTASI */
.board-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bomb-mode-banner {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  background: linear-gradient(90deg, #ff477e, #d90429);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 71, 126, 0.6);
  white-space: nowrap;
}

.bomb-mode-banner button {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.board-frame {
  position: relative;
  background: var(--board-bg);
  border: 3.5px solid var(--board-border);
  border-radius: 18px;
  padding: 6px;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.6),
    inset 0 3px 8px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-frame.screen-shake {
  animation: boardShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Kombo sürerken tahta çevresinde yanıp sönen nokta ışıklar (Block Blast gibi) */
.board-frame::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  border: 3px dotted transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.board-frame.combo-active::after {
  opacity: 1;
  border-color: #b8f7a1;
  filter: drop-shadow(0 0 4px rgba(184, 247, 161, 0.9));
  animation: comboLights 0.8s steps(2) infinite;
}

.board-frame.combo-hot::after {
  border-width: 4px;
  filter: drop-shadow(0 0 6px rgba(255, 133, 162, 0.95));
  animation: comboLightsHot 0.45s steps(2) infinite;
}

@keyframes comboLights {
  0% { border-color: #b8f7a1; }
  50% { border-color: #ffe169; }
}

@keyframes comboLightsHot {
  0% { border-color: #ff85a2; }
  50% { border-color: #ffe169; }
}

@media (prefers-reduced-motion: reduce) {
  .board-frame.combo-active::after,
  .board-frame.combo-hot::after {
    animation: none;
  }
}

#board-canvas {
  display: block;
  border-radius: 12px;
}

/* Büyük Kombo Gösterisi (Tahta Üstü Katman) */
.combo-showcase {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 12;
  animation: comboPopIn 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.combo-head-burst {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  box-shadow: 0 0 30px rgba(255, 204, 41, 0.95);
  background: #1b2448;
  overflow: hidden;
  animation: spinBounce 0.9s ease-out;
}

.combo-head-burst canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.combo-title-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 4px 0 #7a4100, 0 8px 18px rgba(0, 0, 0, 0.8);
  margin-top: 4px;
}

/* Sade kombo gösterisi: yalnızca "KOMBO N!" yazısı */
.combo-showcase.compact .combo-head-burst,
.combo-showcase.compact .combo-sub-text {
  display: none;
}

/* Kombo büyüdükçe yazı büyür ve renklenir */
.combo-showcase.combo-l2 .combo-title-text {
  font-size: 2.4rem;
  color: #ffe169;
}

.combo-showcase.combo-l3 .combo-title-text {
  font-size: 2.8rem;
  color: #ff85a2;
  text-shadow: 0 4px 0 #7a1033, 0 0 22px rgba(255, 133, 162, 0.9), 0 8px 18px rgba(0, 0, 0, 0.8);
}

.combo-sub-text {
  font-size: 0.92rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(90deg, #ff477e, #7209b7);
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  text-align: center;
  max-width: 92%;
}

/* 3'LÜ BLOK TEPSİSİ */
.tray-container {
  width: 100%;
  height: 92px;
  background: rgba(14, 20, 46, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#tray-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ALT JOKER BARI */
.joker-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.joker-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, #2b3a78 0%, #1a2452 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 #0e1430, 0 6px 14px rgba(0, 0, 0, 0.35);
  text-align: left;
  min-width: 0;
  transition: transform 0.1s, filter 0.15s, border-color 0.2s;
}

.joker-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0e1430;
}

.joker-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.joker-btn.active-mode {
  border-color: var(--pink);
  background: linear-gradient(180deg, #7a1c44 0%, #470d27 100%);
  box-shadow: 0 0 16px rgba(255, 71, 126, 0.65);
}

.joker-emoji {
  font-size: 1.45rem;
  flex-shrink: 0;
}

.joker-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.joker-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.joker-title {
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  overflow-wrap: anywhere;
}

.joker-desc {
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.joker-count {
  background: var(--gold);
  color: #161b33;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

/* Sürükleme Katmanı (GPU Hızlandırmalı Sıfır Gecikmeli Katman) */
.drag-canvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 25;
  will-change: transform;
  transform: translate3d(-9999px, -9999px, 0);
}

/* Tam Ekran Doğum Günü Konfeti Yağmuru Katmanı */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 999;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   3. MODAL PENCERELER (<dialog>) - Modern Web Guidance Uyumlu
   ============================================================================ */
dialog:modal {
  overscroll-behavior: contain;
  margin: auto;
  border: none;
  background: transparent;
  padding: 14px;
  width: 100%;
  max-width: 420px;
  color: var(--text-light);
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(8, 12, 30, 0.82);
  backdrop-filter: blur(7px);
}

.dialog-card {
  background: linear-gradient(180deg, #253370 0%, #141c42 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.24);
  border-radius: 26px;
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog-pill {
  font-size: 0.74rem;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  letter-spacing: 0.6px;
}

.pill-danger {
  background: linear-gradient(90deg, #ff477e, #ff0055);
  box-shadow: 0 4px 14px rgba(255, 0, 85, 0.45);
}

.pill-gold {
  background: linear-gradient(90deg, #ff9900, #ffcc29);
  color: #161b33;
  box-shadow: 0 4px 14px rgba(255, 204, 41, 0.45);
}

.dialog-avatar-box {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3.5px solid var(--gold);
  background: #172048;
  box-shadow: 0 0 24px rgba(255, 204, 41, 0.45);
}

.dialog-avatar-box canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.dialog-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.5rem;
}

.dialog-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dialog-desc {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e4ebff;
  line-height: 1.38;
}

.dialog-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* Ödül Kuponu Bilet Tasarımı */
.reward-ticket {
  width: 100%;
  background: linear-gradient(180deg, #fffdf2 0%, #fff3c4 100%);
  color: #1d2440;
  border: 2.5px dashed #d49600;
  border-radius: 18px;
  padding: 14px 12px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ticket-header {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.88rem;
  color: #b85d00;
  text-align: center;
  border-bottom: 1.5px dashed rgba(184, 93, 0, 0.35);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.ticket-body {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.42;
  white-space: pre-line;
  color: #1f2747;
}

.ticket-footer {
  margin-top: 10px;
  text-align: center;
}

.ticket-stamp {
  display: inline-block;
  border: 2px solid #d90429;
  color: #d90429;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 6px;
  transform: rotate(-2deg);
  letter-spacing: 0.8px;
}

/* Game Over Skor Paneli */
.gameover-score-panel {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(11, 16, 38, 0.65);
  padding: 12px;
  border-radius: 16px;
}

.gameover-score-panel div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gameover-score-panel span {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
}

.gameover-score-panel strong {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.45rem;
  color: var(--gold);
}

/* Ayarlar & Koleksiyon Modalı */
.settings-card {
  text-align: left;
  align-items: stretch;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.guide-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  color: var(--gold);
  margin-top: 4px;
}

.event-blocks-guide {
  background: rgba(11, 16, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: #e4ebff;
}

.guide-badge {
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.collection-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(11, 16, 38, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

.tier-row-card.unlocked {
  background: linear-gradient(90deg, rgba(76, 217, 100, 0.18) 0%, rgba(255, 204, 41, 0.18) 100%);
  border-color: var(--gold);
}

.collection-faces-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.face-collect-item {
  background: rgba(11, 16, 38, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.face-collect-item.unlocked {
  border-color: var(--gold);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s;
}

.face-collect-item.unlocked:active {
  transform: scale(0.94);
}

.face-collect-item.locked img {
  filter: grayscale(1) brightness(0.35);
}

.face-collect-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.face-collect-item span {
  font-size: 0.63rem;
  font-weight: 800;
  color: #dce4ff;
  line-height: 1.1;
}

.settings-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-top .dialog-title {
  font-size: 1.2rem;
}

.close-x-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.settings-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #dce4ff;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(11, 16, 38, 0.8);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(11, 16, 38, 0.55);
  padding: 8px 10px;
  border-radius: 14px;
}

#settings-preview-canvas {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.photo-upload-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.btn-upload-label {
  display: inline-block;
  text-align: center;
  background: linear-gradient(180deg, #4361ee 0%, #3a0ca3 100%);
  color: #fff;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-reset-small {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

/* ============================================================================
   ANİMASYONLAR
   ============================================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.86); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

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

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes panicShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px) rotate(-0.5deg); }
  75% { transform: translateX(2px) rotate(0.5deg); }
}

@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 2px); }
}

@keyframes comboPopIn {
  0% { opacity: 0; transform: scale(0.4); }
  22% { opacity: 1; transform: scale(1.08); }
  35% { transform: scale(0.98); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15) translateY(-18px); }
}

@keyframes spinBounce {
  0% { transform: rotate(-20deg) scale(0.5); }
  60% { transform: rotate(12deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}

/* Küçük Ekranlı Telefonlar İçin Sıkılaştırma */
@media (max-height: 700px) {
  .app-shell {
    padding-top: 4px;
    padding-bottom: 4px;
  }
  .main-score {
    font-size: 1.65rem;
  }
  .manita-live-bar {
    padding: 4px 8px;
  }
  .manita-avatar-wrapper {
    width: 44px;
    height: 44px;
  }
  .tray-container {
    height: 78px;
  }
  .joker-btn {
    padding: 6px 8px;
  }
}

/* ============================================================================
   4. YENİ ÖZELLİKLER: PASTA & MUM ÜFLEME RİTÜELİ, WHATSAPP BİLDİRİMİ,
      MÜZİK KUTUSU VE KARAKTER KARTI BÜYÜTME MODALI
   ============================================================================ */

/* 🕯️ #1: Doğum Günü Pastası & Mum Üfleme Açılış Ekranı */
.cake-ceremony-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: radial-gradient(circle at 50% 22%, #3a195c 0%, #161d45 55%, #090d22 100%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cake-ceremony-screen.active {
  display: flex;
  animation: fadeIn 0.35s ease-out;
}

.cake-card,
.cake-ceremony-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(44, 29, 89, 0.96) 0%, rgba(20, 27, 64, 0.98) 100%);
  border: 2.5px solid rgba(255, 204, 41, 0.45);
  border-radius: 28px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78), 0 0 35px rgba(255, 71, 126, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cake-mascot-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(12, 18, 44, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 8px 10px;
  text-align: left;
}

.cake-mascot-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--gold);
  background: #172048;
}

.cake-mascot-avatar canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.cake-mascot-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.15rem;
}

.cake-mascot-speech {
  font-size: 0.76rem;
  font-weight: 700;
  color: #e9efff;
  line-height: 1.32;
}

.cake-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 3px 0 #703800, 0 6px 14px rgba(0, 0, 0, 0.45);
  line-height: 1.15;
}

.cake-subtitle {
  font-size: 0.84rem;
  font-weight: 700;
  color: #e4ebff;
  line-height: 1.35;
}

.cake-subtitle strong {
  color: var(--gold);
}

.cake-stage-wrap {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#cake-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 340 / 260;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 204, 41, 0.14) 0%, rgba(12, 17, 42, 0.65) 80%);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  touch-action: none;
}

.cake-candle-status {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.82rem;
  color: #ffe17d;
  background: rgba(11, 16, 38, 0.75);
  border: 1px solid rgba(255, 204, 41, 0.35);
  padding: 4px 14px;
  border-radius: 999px;
}

.cake-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.start-sub-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.start-sub-actions .btn-secondary {
  font-size: 0.78rem;
  padding: 9px 8px;
}

/* 💬 #4: Üstten İnen iOS / WhatsApp Tarzı Canlı Bildirim Banner'ı */
.whatsapp-toast {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 85;
  width: calc(100% - 24px);
  max-width: 410px;
  background: rgba(20, 28, 48, 0.95);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(37, 211, 102, 0.65);
  border-radius: 20px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72), 0 0 20px rgba(37, 211, 102, 0.25);
  cursor: pointer;
  animation: waSlideDown 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes waSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -28px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.wa-toast-avatar-wrap,
.wa-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.wa-toast-avatar-wrap canvas,
.wa-avatar-wrap canvas {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #25d366;
  display: block;
}

.wa-app-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.wa-toast-body,
.wa-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.wa-toast-top,
.wa-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.wa-sender {
  font-size: 0.76rem;
  font-weight: 900;
  color: #25d366;
}

.wa-time {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
}

.wa-message {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.28;
}

/* 🎵 #3: Müzik Kutusu Butonu Aktif Durumu */
.icon-btn.music-on {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 204, 41, 0.28), rgba(255, 71, 126, 0.28));
  box-shadow: 0 0 12px rgba(255, 204, 41, 0.45);
}

/* 📸 #5: Karakter Kartı Büyütme & İnceleme Modalı */
.persona-detail-card {
  gap: 10px;
}

.persona-detail-img-wrap {
  width: 176px;
  height: 176px;
  border-radius: 26px;
  border: 3.5px solid var(--gold);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 24px rgba(255, 204, 41, 0.4);
  background: #141c42;
}

.persona-detail-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.persona-detail-power,
.persona-power-box {
  font-size: 0.78rem;
  font-weight: 800;
  color: #80ffdb;
  background: rgba(6, 214, 160, 0.14);
  border: 1px solid rgba(6, 214, 160, 0.35);
  padding: 6px 12px;
  border-radius: 12px;
  width: 100%;
}

.persona-detail-quote,
.persona-quote-box {
  font-size: 0.84rem;
  font-weight: 700;
  font-style: italic;
  color: #ffffff;
  background: rgba(11, 16, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  border-radius: 14px;
  width: 100%;
  line-height: 1.38;
}

/* Gizli test paneli (sürüm yazısına 5 kez dokun veya ?debug=1) */
.debug-panel {
  position: fixed;
  left: 6px;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  z-index: 9999;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #7CFC9A;
  font: 600 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
  pointer-events: none;
}

.debug-controls {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: auto;
}

.debug-controls > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.debug-controls span {
  min-width: 56px;
  text-align: center;
}

.debug-controls button {
  min-width: 30px;
  height: 26px;
  border: 1px solid #7CFC9A;
  border-radius: 6px;
  background: rgba(124, 252, 154, 0.12);
  color: #7CFC9A;
  font: 700 14px/1 ui-monospace, Menlo, monospace;
}

.debug-controls .debug-reset {
  font-size: 10px;
  height: 22px;
}
