/* ============================================================
   TheX10 Shared Menu Theme — Songkran Pool Villa
   Include via: <link rel="stylesheet" href="/menu-theme.css">
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600;700;800;900&display=swap');

/* ── Menu Overlay (covers game canvas) ── */
.x10-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, #0f2b3c 0%, #163a50 30%, #1a4a60 60%, #0d2030 100%);
  font-family: 'Kanit', sans-serif;
  overflow: hidden;
}
.x10-menu-overlay.hidden { display: none; }

/* ── Water / Songkran background effects ── */
.x10-menu-overlay::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 30% 90%, rgba(77,184,212,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 10%, rgba(255,107,157,0.08) 0%, transparent 40%);
  pointer-events: none;
}

/* Floating water bubbles */
.x10-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.x10-bubble {
  position: absolute;
  bottom: -20px;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), rgba(77,184,212,0.15));
  animation: x10-rise var(--d) ease-in infinite;
  animation-delay: var(--dl);
}
@keyframes x10-rise {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  100% { transform: translateY(-110vh) scale(0.3); opacity: 0; }
}

/* ── Menu Card (9:16 ratio container) ── */
.x10-menu-card {
  position: relative;
  width: 90%;
  max-width: 360px;
  max-height: 90vh;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-y: auto;
  z-index: 1;
}

/* ── Game Icon ── */
.x10-game-icon {
  font-size: 64px;
  margin-bottom: 4px;
  animation: x10-bounce 2s ease-in-out infinite;
}
@keyframes x10-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Title ── */
.x10-game-title {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 3px 12px rgba(0,0,0,0.5);
}
.x10-game-title span {
  display: block;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Subtitle ── */
.x10-game-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  font-weight: 400;
}

/* ── Songkran Badge ── */
.x10-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FF6B9D, #FF7B54);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 30px;
  box-shadow: 0 3px 10px rgba(255,107,157,0.35);
  letter-spacing: 1px;
}

/* ── Best Score ── */
.x10-best {
  font-size: 12px;
  color: #FFD700;
  font-weight: 600;
  padding: 6px 16px;
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 20px;
  background: rgba(255,215,0,0.08);
}

/* ── Button Group ── */
.x10-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
}

/* ── Primary Button (Play) ── */
.x10-btn-play {
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4DB8D4, #2A8BA8);
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(77,184,212,0.4);
  transition: all 0.15s;
  width: 100%;
  letter-spacing: 1px;
}
.x10-btn-play:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(77,184,212,0.5); }
.x10-btn-play:active { transform: translateY(1px); box-shadow: none; }

/* ── CASUAL Button ── */
.x10-btn-casual {
  font-family: 'Kanit', sans-serif;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4DB8D4, #2A8BA8);
  border: none; border-radius: 14px;
  padding: 13px 20px; cursor: pointer; width: 100%;
  box-shadow: 0 4px 14px rgba(77,184,212,0.35);
  transition: all 0.15s; letter-spacing: 0.5px;
}
.x10-btn-casual:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(77,184,212,0.45); }
.x10-btn-casual:active { transform: translateY(1px); box-shadow: none; }

/* ── RANKING Button ── */
.x10-btn-ranking {
  font-family: 'Kanit', sans-serif;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border: none; border-radius: 14px;
  padding: 13px 20px; cursor: pointer; width: 100%;
  box-shadow: 0 4px 14px rgba(245,158,11,0.35);
  transition: all 0.15s; letter-spacing: 0.5px;
}
.x10-btn-ranking:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(245,158,11,0.45); }
.x10-btn-ranking:active { transform: translateY(1px); box-shadow: none; }
.x10-btn-ranking:disabled, .x10-btn-ranking.locked {
  background: linear-gradient(135deg, #475569, #334155);
  box-shadow: none; cursor: not-allowed; opacity: 0.7;
}
.x10-ranking-info {
  font-size: 10px; color: rgba(255,255,255,0.4);
  text-align: center; margin-top: -4px;
}
.x10-ranking-info.open { color: #22c55e; }

/* ── Mode Badge (in-game) — bottom-left, small, semi-transparent ── */
.x10-mode-badge {
  position: fixed; bottom: 6px; left: 6px; z-index: 8000;
  font-family: 'Kanit', sans-serif; font-size: 8px; font-weight: 700;
  padding: 3px 8px; border-radius: 12px;
  pointer-events: none; letter-spacing: 0.5px;
  opacity: 0.6;
}
.x10-mode-badge.casual {
  background: rgba(77,184,212,0.7); color: #fff;
}
.x10-mode-badge.ranking {
  background: rgba(245,158,11,0.75); color: #fff;
}

/* ── Secondary Button ── */
.x10-btn-sec {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 11px 20px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
}
.x10-btn-sec:hover { background: rgba(255,255,255,0.15); color: #fff; }
.x10-btn-sec:active { transform: translateY(1px); }

/* ── Home Button ── */
.x10-btn-home {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s;
}
.x10-btn-home:hover { color: #FFD700; }

/* ── Villa Footer ── */
.x10-footer {
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 2px;
  margin-top: 4px;
}

/* ============================================================
   SCOREBOARD OVERLAY (in-game)
   ============================================================ */
.x10-sb-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(8px);
  font-family: 'Kanit', sans-serif;
}
.x10-sb-overlay.hidden { display: none; }

.x10-sb-card {
  width: 92%; max-width: 380px; max-height: 85vh;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.x10-sb-header {
  padding: 16px 18px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.x10-sb-header h2 {
  font-size: 16px; font-weight: 800; color: #FFD700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.x10-sb-header p {
  font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 2px;
}

/* Day Toggle */
.x10-sb-day-toggle {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.x10-sb-day-btn {
  flex: 1; padding: 10px 4px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.35);
  background: none; border: none;
  cursor: pointer; transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.x10-sb-day-btn.active {
  color: #fff;
  border-bottom-color: #4DB8D4;
  background: rgba(77,184,212,0.08);
}

/* Tabs */
.x10-sb-tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.x10-sb-tab {
  flex: 1; padding: 10px 4px;
  font-family: 'Kanit', sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.4);
  background: none; border: none;
  cursor: pointer; transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.x10-sb-tab.active {
  color: #FFD700;
  border-bottom-color: #FFD700;
  background: rgba(255,215,0,0.05);
}

/* Body */
.x10-sb-body {
  flex: 1; overflow-y: auto; padding: 10px 14px;
  -webkit-overflow-scrolling: touch;
}

/* Rows */
.x10-sb-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; margin-bottom: 3px;
  border-radius: 10px; background: rgba(255,255,255,0.03);
}
.x10-sb-row:nth-child(1) { background: rgba(255,215,0,0.1); border: 1px solid rgba(255,215,0,0.25); }
.x10-sb-row:nth-child(2) { background: rgba(192,192,192,0.06); border: 1px solid rgba(192,192,192,0.15); }
.x10-sb-row:nth-child(3) { background: rgba(205,127,50,0.06); border: 1px solid rgba(205,127,50,0.15); }
.x10-sb-rank { font-size: 16px; width: 26px; text-align: center; flex-shrink: 0; }
.x10-sb-rnum { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.35); width: 26px; text-align: center; flex-shrink: 0; }
.x10-sb-info { flex: 1; min-width: 0; }
.x10-sb-name { font-size: 13px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x10-sb-detail { font-size: 9px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.x10-sb-detail b { color: #4DB8D4; }
.x10-sb-pts { font-size: 14px; font-weight: 800; color: #FFD700; flex-shrink: 0; }
.x10-sb-empty { text-align: center; color: rgba(255,255,255,0.3); font-size: 12px; padding: 20px 0; }

/* Footer */
.x10-sb-footer {
  padding: 10px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.x10-sb-close {
  font-family: 'Kanit', sans-serif;
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 10px 24px;
  cursor: pointer; width: 100%;
  transition: all 0.15s;
}
.x10-sb-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
