/* style.css – ExploreLocal PWA — Full Feature Update */

/* ===================== CSS VARIABLES (THEME) ===================== */
:root {
  --bg-primary: linear-gradient(135deg, #0d0d0d, #1a1a2e);
  --bg-glass: rgba(20, 20, 35, 0.75);
  --bg-card: rgba(25, 25, 40, 0.95);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #e0e0e0;
  --text-muted: #aaa;
  --accent: #ff7e5f;
  --accent2: #feb47b;
  --success: #22c55e;
  --error: #ef4444;
  --info: #3b82f6;
  --header-bg: rgba(20, 20, 30, 0.7);
  --timer-color: #feb47b;
}

[data-theme="light"] {
  --bg-primary: linear-gradient(135deg, #f0f4ff, #e8f0fe);
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-card: rgba(255, 255, 255, 0.97);
  --bg-input: rgba(0, 0, 0, 0.05);
  --border-color: rgba(0, 0, 0, 0.1);
  --text-primary: #1a1a2e;
  --text-muted: #555;
  --header-bg: rgba(255, 255, 255, 0.85);
  --timer-color: #e05a2b;
}

/* ===================== GLOBAL RESET ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  transition: background 0.4s, color 0.3s;
}

/* ===================== HEADER ===================== */
header {
  position: absolute;
  top: 0;
  width: 100%;
  padding: 0.7rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  z-index: 500;
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff7e5f, #feb47b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===================== PROGRESS BAR ===================== */
.progress-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.progress-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar-bg {
  width: 80px;
  height: 6px;
  background: var(--border-color);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7e5f, #feb47b);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== STREAK BADGE ===================== */
.streak-badge {
  background: linear-gradient(135deg, #ff6b35, #f7c59f);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
  animation: streak-glow 2s ease-in-out infinite alternate;
}

@keyframes streak-glow {
  from { box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4); }
  to { box-shadow: 0 4px 16px rgba(255, 107, 53, 0.8); }
}

/* ===================== COIN COUNT ===================== */
.coin-count {
  font-weight: 700;
  font-size: 0.9rem;
  color: #feb47b;
  white-space: nowrap;
}

/* ===================== BUTTONS ===================== */
.primary-btn {
  background: linear-gradient(45deg, #ff7e5f, #feb47b);
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255, 126, 95, 0.5);
}

.primary-btn:active { transform: translateY(0); }

.secondary-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9rem;
  transition: transform 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
}

.secondary-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.1); }

.icon-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
}

.icon-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.12); }

/* ===================== MAP ===================== */
.map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.ar-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ===================== START BUTTON ===================== */
.start-btn {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(255, 126, 95, 0.5);
  animation: float-btn 3s ease-in-out infinite;
}

@keyframes float-btn {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* ===================== REGION BAR ===================== */
.region-bar {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 450;
  display: flex;
  gap: 0.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.4rem;
}

.region-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.region-btn.active {
  background: linear-gradient(45deg, #ff7e5f, #feb47b);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 126, 95, 0.4);
}

/* ===================== CLUE PANEL ===================== */
.clue-panel {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
  border-radius: 16px;
  width: 92%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 400;
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 80px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.clue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.clue-header h2 { font-size: 1.1rem; }

/* ===================== TIMER ===================== */
.clue-timer {
  background: rgba(254, 180, 123, 0.15);
  border: 1px solid rgba(254, 180, 123, 0.3);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--timer-color);
}

.timer-warning {
  animation: timer-blink 0.5s ease-in-out infinite alternate;
  color: #ef4444 !important;
}

@keyframes timer-blink {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

/* ===================== HINTS ===================== */
.hints-container {
  margin: 0.8rem 0;
}

.hint-btn {
  background: rgba(254, 180, 123, 0.12);
  border: 1px solid rgba(254, 180, 123, 0.3);
  color: #feb47b;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.hint-btn:hover:not(:disabled) { background: rgba(254, 180, 123, 0.2); }
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.hint-text {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(254, 180, 123, 0.08);
  border-left: 3px solid #feb47b;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  animation: fadeIn 0.3s ease;
}

/* ===================== PHOTO CHALLENGE ===================== */
.photo-section {
  margin: 0.8rem 0;
}

.photo-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}

#photo-input {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.4rem;
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.photo-preview img {
  width: 100%;
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 120px;
  object-fit: cover;
}

/* ===================== ANSWER INPUT ===================== */
#answer-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  margin: 0.7rem 0 0.8rem;
  transition: border-color 0.2s;
}

#answer-input:focus { outline: none; border-color: #ff7e5f; }

/* Shake animation for wrong answer */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.shake { animation: shake 0.5s ease; }

/* ===================== AUTH MODAL ===================== */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.auth-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 90%;
  max-width: 380px;
  border: 1px solid var(--border-color);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.auth-card h2 { margin-bottom: 0.3rem; font-size: 1.4rem; }

.auth-card input[type="email"],
.auth-card input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.auth-card input:focus { outline: none; border-color: #ff7e5f; }

.close-auth-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 1rem;
  text-decoration: underline;
  font-family: inherit;
}

/* ===================== DAILY REWARD CARD ===================== */
.daily-card {
  background: linear-gradient(135deg, rgba(25, 25, 45, 0.98), rgba(30, 30, 55, 0.98));
  border: 1px solid rgba(254, 180, 123, 0.3);
}

.daily-anim {
  font-size: 3.5rem;
  animation: bounce-emoji 1s ease infinite alternate;
  margin-bottom: 0.5rem;
}

@keyframes bounce-emoji {
  from { transform: translateY(0) rotate(-5deg); }
  to { transform: translateY(-10px) rotate(5deg); }
}

.streak-display {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ff6b35;
  margin-top: 0.8rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 107, 53, 0.1);
  border-radius: 12px;
  display: inline-block;
}

/* ===================== REWARD MODAL ===================== */
.reward-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.reward-card {
  background: var(--bg-card);
  padding: 2.5rem 2rem;
  border-radius: 20px;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(254, 180, 123, 0.3);
  min-width: 280px;
}

.reward-anim {
  font-size: 4rem;
  animation: celebrate 0.6s ease infinite alternate;
  margin-bottom: 0.5rem;
}

@keyframes celebrate {
  from { transform: scale(1) rotate(-5deg); }
  to { transform: scale(1.15) rotate(5deg); }
}

/* ===================== SOUND FAB ===================== */
.sound-fab {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sound-fab:hover { transform: scale(1.1); }

/* ===================== TOAST NOTIFICATIONS ===================== */
.toast {
  position: fixed;
  top: 80px;
  right: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(10px);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.toast-show { transform: translateX(0); }

.toast-success { background: rgba(34, 197, 94, 0.9); }
.toast-error { background: rgba(239, 68, 68, 0.9); }
.toast-info { background: rgba(59, 130, 246, 0.9); }

/* ===================== CHECKPOINT PIN ANIMATION ===================== */
@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 8px #ff7e5f; }
  50% { box-shadow: 0 0 20px #ff7e5f, 0 0 40px rgba(255, 126, 95, 0.3); }
}

/* ===================== USER LOCATION ===================== */
.user-location-pin {
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ===================== UTILITY ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== SUBPAGES (Leaderboard / Admin) ===================== */
body.scrollable-page {
  overflow: auto;
  background: var(--bg-primary);
}

.page-center {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem;
  padding-top: 5rem;
}

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.card-header h2 { font-size: 1.6rem; font-weight: 700; }

/* Leaderboard */
.table-card { width: 100%; max-width: 650px; }

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
}

.leaderboard-table th, .leaderboard-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th { font-weight: 700; color: #feb47b; }
.leaderboard-table tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Admin */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.admin-header h2 { font-size: 1.8rem; font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem; }
@media (max-width: 850px) { .admin-grid { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 1.2rem; display: flex; flex-direction: column; }
.form-group label { font-size: 0.9rem; margin-bottom: 0.5rem; color: #feb47b; font-weight: 600; }
.form-group input, .form-group textarea {
  padding: 0.8rem; border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit; font-size: 1rem;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #ff7e5f; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-group-row { grid-template-columns: 1fr; } }

.submit-btn { width: 100%; margin-top: 1rem; padding: 0.8rem; }

.clue-list { list-style: none; max-height: 500px; overflow-y: auto; }
.clue-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem; border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.6rem; border-radius: 8px;
}
.clue-item:hover { background: rgba(255, 255, 255, 0.04); }
.clue-info { display: flex; flex-direction: column; gap: 0.35rem; padding-right: 1rem; }
.clue-meta { font-size: 0.8rem; color: var(--text-muted); }
.clue-actions { display: flex; gap: 0.5rem; }
.clue-actions button { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.no-checkpoints, .loading-text { text-align: center; color: var(--text-muted); padding: 2rem; font-style: italic; }

.clue-list::-webkit-scrollbar { width: 6px; }
.clue-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.clue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.clue-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===================== VOICE ANSWER ===================== */
.voice-section {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.voice-btn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.voice-btn:hover { background: rgba(59, 130, 246, 0.25); }

.voice-btn.voice-listening {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  animation: pulse-btn 1s infinite alternate;
}

@keyframes pulse-btn {
  from { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  to { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.voice-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

/* ===================== STATS MODAL ===================== */
.stats-card {
  max-width: 460px;
  width: 94%;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.stat-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.8rem 0.5rem;
  text-align: center;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ===================== ACHIEVEMENTS / BADGES ===================== */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.badge-item.unlocked {
  background: rgba(254, 180, 123, 0.1);
  border-color: rgba(254, 180, 123, 0.35);
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.badge-icon { font-size: 1.4rem; }

.badge-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-unlock {
  margin-top: 0.8rem;
  animation: popIn 0.4s ease;
}

/* ===================== AVATAR PICKER ===================== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.avatar-choice {
  font-size: 1.8rem;
  padding: 0.4rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.avatar-choice:hover { transform: scale(1.15); background: rgba(255,255,255,0.1); }

.avatar-choice.selected {
  border-color: var(--accent);
  background: rgba(255, 126, 95, 0.15);
  transform: scale(1.1);
}

/* ===================== MINI MAP ===================== */
.mini-map-container {
  position: absolute;
  bottom: 6rem;
  right: 1.5rem;
  width: 160px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 450;
}

#mini-map { width: 100%; height: 100%; }

/* ===================== COLOR SWATCHES ===================== */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: rgba(255,255,255,0.5);
}

/* ===================== EXTRA FABs ===================== */
.minimap-fab {
  position: absolute;
  bottom: 9rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.colortheme-fab {
  position: absolute;
  bottom: 12rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.notif-fab {
  position: absolute;
  bottom: 15rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.minimap-fab:hover, .colortheme-fab:hover, .notif-fab:hover { transform: scale(1.1); }

/* ===================== WEATHER WIDGET ===================== */
.weather-widget {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* ===================== WIDE MODALS ===================== */
.modal-wide { max-width: 520px; width: 96%; }

/* ===================== LEADERBOARD ===================== */
.lb-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 280px; overflow-y: auto; }

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.lb-rank { font-size: 1.1rem; min-width: 28px; }
.lb-avatar { font-size: 1.3rem; }
.lb-name { flex: 1; font-weight: 600; }
.lb-coins { color: #fcd34d; font-weight: 700; }
.lb-streak { color: #f97316; }

/* ===================== CHAT ===================== */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 0.8rem;
  padding: 0.4rem;
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.chat-avatar { font-size: 1.1rem; }
.chat-name { font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-right: 0.4rem; }
.chat-text { font-size: 0.85rem; }

.chat-input-row {
  display: flex;
  gap: 0.5rem;
}

.chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
}

/* ===================== DAILY CHALLENGE ===================== */
.dc-card {
  background: var(--bg-input);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1rem;
  margin-top: 0.8rem;
}

.dc-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.dc-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.8rem; }

.dc-reward-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.dc-status { font-size: 0.8rem; padding: 0.2rem 0.6rem; border-radius: 6px; background: rgba(255,255,255,0.08); }

/* ===================== LOOT BOX ===================== */
.loot-box-anim {
  font-size: 4rem;
  text-align: center;
  display: block;
  margin-bottom: 0.5rem;
  animation: lootSpin 0.5s ease;
}

@keyframes lootSpin {
  from { transform: rotateY(0deg) scale(0.5); opacity: 0; }
  to { transform: rotateY(360deg) scale(1); opacity: 1; }
}

.loot-result {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--accent);
}

.loot-rarity {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.8rem;
  border-radius: 8px;
  display: inline-block;
  margin: 0 auto;
  width: 100%;
}

.rarity-common { background: rgba(156,163,175,0.2); color: #9ca3af; }
.rarity-rare { background: rgba(59,130,246,0.2); color: #60a5fa; }
.rarity-epic { background: rgba(168,85,247,0.2); color: #c084fc; }
.rarity-legendary { background: rgba(251,191,36,0.2); color: #fbbf24; }

/* ===================== SHARE ===================== */
.share-card-preview {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  margin: 0.8rem 0;
}

.whatsapp-btn {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.2s;
}

.whatsapp-btn:hover { transform: scale(1.03); }

/* ===================== STORY MODE ===================== */
.story-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 340px; overflow-y: auto; }

.story-chapter {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.story-active {
  background: rgba(255,126,95,0.08);
  border-color: rgba(255,126,95,0.4);
  cursor: pointer;
}

.story-active:hover { transform: translateX(3px); }
.story-done { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.2); }
.story-locked { opacity: 0.4; }

.story-emoji { font-size: 1.8rem; min-width: 2.2rem; }
.story-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.story-desc { font-size: 0.78rem; color: var(--text-muted); }
.story-objective { font-size: 0.8rem; color: var(--accent); margin-top: 0.3rem; font-weight: 600; }
.story-reward { font-size: 0.88rem; font-weight: 700; color: #fcd34d; margin-left: auto; white-space: nowrap; }

/* ===================== MULTIPLAYER ===================== */
.mp-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.mp-code-display {
  background: var(--bg-input);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
}

.mp-players-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 180px; overflow-y: auto; }

.mp-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 0.88rem;
}

/* ===================== LEFT SIDE FABs ===================== */
.left-fabs-container {
  position: absolute;
  left: 1.2rem;
  bottom: 6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 400;
  pointer-events: none;
}

.left-fab {
  pointer-events: auto;
  position: relative !important;
  left: auto !important;
  bottom: auto !important;
  min-width: 44px;
  height: 44px;
  padding: 0 0.8rem;
  border-radius: 22px;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  white-space: nowrap;
}

.left-fab:hover {
  transform: scale(1.06);
  background: rgba(255,126,95,0.15);
  border-color: var(--accent);
}

.actions-menu-btn {
  display: none;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 520px) {
  header {
    padding: 0.5rem 0.8rem;
  }
  header h1 {
    font-size: 1.1rem;
  }
  .user-info {
    gap: 0.25rem;
  }
  .streak-badge {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
  .coin-count {
    font-size: 0.8rem;
  }
  .icon-btn, .secondary-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 6px;
  }
  .secondary-btn {
    width: auto;
    padding: 0 0.5rem;
    height: 28px;
  }
  
  .progress-wrap { display: none; }
  .clue-panel { bottom: 1rem; padding: 1rem; width: 92%; left: 4%; transform: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
  .minimap-fab, .colortheme-fab, .notif-fab { display: none; }
  .weather-widget { display: none; }
  
  /* Mobile Actions Menu */
  .actions-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: absolute;
    left: 1.2rem;
    bottom: 5.5rem;
    z-index: 450;
    height: 40px;
    padding: 0 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  
  .left-fabs-container {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 26, 0.92);
    backdrop-filter: blur(12px);
    z-index: 1500;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    gap: 0.8rem;
    pointer-events: auto;
  }
  
  .left-fabs-container.active {
    display: flex;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  .left-fabs-container::before {
    content: "🗺️ Game Features";
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    text-shadow: 0 0 10px rgba(255,126,95,0.3);
  }
  
  .left-fabs-container::after {
    content: "✕ Tap background to close";
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
  }
  
  .left-fabs-container .left-fab {
    width: 80%;
    max-width: 250px;
    height: 46px;
    font-size: 0.95rem;
    padding: 0 1.2rem;
    border-radius: 10px;
    justify-content: flex-start;
  }
}
