/* ═══════════════════════════════════════════════════════
   VIP Manager – Global Styles  (Modern + Retro Pixel)
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Press+Start+2P&display=swap');

:root {
  --mario-red:    #e52222;
  --mario-blue:   #1565c0;
  --mario-yellow: #f9c800;
  --mario-green:  #2e7d32;
  --mario-sky:    #5c94fc;
  --mario-dark:   #1a1a2e;
  --mario-ground: #8b4513;
  --mario-pipe:   #1b5e20;
  --coin-gold:    #ffd700;
  --chat-bg:      #0d1117;
  --chat-accent:  #7c4dff;
  --white:        #fff;
  --font-pixel:   'Press Start 2P', monospace;
  --font-main:    'Poppins', 'Inter', sans-serif;
  --radius:       8px;
  --radius-lg:    14px;
  --transition:   0.25s ease;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.12);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.18);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.28);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 40%, #2d1b69 70%, #1a0a3e 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── NAVBAR ─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: linear-gradient(135deg, var(--mario-dark) 0%, #16213e 100%);
  border-bottom: 3px solid var(--mario-yellow);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-counters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-counter {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 12px;
  letter-spacing: 0.3px;
}

.nav-counter b {
  font-weight: 700;
}
.logo-icon { font-size: 28px; }
.logo-text {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--mario-yellow);
  text-shadow: 2px 2px 0 var(--mario-red);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}
.nav-link {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 20px;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.nav-link:hover, .nav-link.active {
  color: var(--mario-yellow);
  background: rgba(255,255,255,0.1);
}

/* ─── DIAMOND BUTTON + DROPDOWN ──────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.diamond-wrapper { position: relative; }

.btn-diamond {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  background: linear-gradient(135deg, #7c4dff, #e040fb);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(124,77,255,0.4);
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-diamond:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(124,77,255,0.6);
}
.btn-diamond .arrow { font-size: 10px; transition: transform 0.3s; }
.btn-diamond.open .arrow { transform: rotate(180deg); }

.btn-store {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  background: linear-gradient(135deg, #ff6f00, #ff8f00);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 111, 0, 0.35);
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-store:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 111, 0, 0.5);
}

.diamond-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 290px;
  background: #1a1a2e;
  border: 1.5px solid rgba(124,77,255,0.6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: slideDown 0.22s ease;
  z-index: 2000;
}
.diamond-dropdown.open { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #2a2a4a;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.diamond-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  cursor: pointer;
  transition: background 0.18s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.diamond-option:hover { background: rgba(124,77,255,0.18); }

.diamond-option .price {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--mario-yellow);
  min-width: 54px;
}
.diamond-option .arrow-right { color: #555; font-size: 14px; }
.diamond-option .gems {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: #e040fb;
}

.custom-option { border-bottom: none; }

.custom-input-area {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid #2a2a4a;
}
.custom-input-area.visible { display: flex; }

.custom-input-area label {
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 500;
  color: #aaa;
}
.custom-input-area input {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1.5px solid #7c4dff;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.custom-input-area input:focus { border-color: #e040fb; }
.custom-result {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  color: #e040fb;
}

/* ─── SECTIONS ───────────────────────────────────────── */
.section {
  display: none;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
  padding: 30px 20px;
  justify-content: center;
  align-items: flex-start;
}
.section.active { display: flex; flex-direction: column; align-items: center; }

/* ─── GAME SECTION ────────────────────────────────────── */
#gameSection {
  gap: 20px;
  background: linear-gradient(180deg, var(--mario-sky) 0%, #87ceeb 60%, #4caf50 60%, #4caf50 100%);
  padding: 40px 20px !important;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.in-game-hud {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: none;
  z-index: 10;
}



.game-controls-hint {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 500;
  color: rgba(0,0,0,0.6);
  letter-spacing: 0.3px;
}

#gameCanvas {
  width: 100%;
  height: auto;
  max-width: 1000px;
  border: 3px solid rgba(0,0,0,0.2);
  border-radius: 12px;
  display: block;
  background: var(--mario-sky);
}

.game-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.btn-pixel {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--mario-red);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229, 34, 34, 0.3);
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-pixel:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(229, 34, 34, 0.4);
}
.btn-pixel:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(229, 34, 34, 0.3);
}
.btn-pixel:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-play {
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  padding: 16px 32px;
  background: linear-gradient(135deg, #e52222, #c62828);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(229, 34, 34, 0.35);
  text-transform: uppercase;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(229, 34, 34, 0.45);
}

.btn-play:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(229, 34, 34, 0.3);
}

.btn-play:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ─── LEADERBOARD & ABOUT ─────────────────────────────── */
.section-box {
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  margin-top: 20px;
}
.section-title {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 700;
  color: var(--mario-dark);
  margin-bottom: 24px;
  text-align: center;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-main);
  font-size: 14px;
}
.leaderboard-table th, .leaderboard-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.leaderboard-table th { color: var(--mario-red); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.leaderboard-table tr:last-child td { color: var(--mario-blue); font-weight: 600; }

.about-text {
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 24px;
  color: #555;
  margin-bottom: 14px;
}

/* ─── PASSWORD MODAL (removed) ──────────────────────── */

/* ─── CHAT ───────────────────────────────────────────── */
#chatSection {
  position: fixed;
  top: 50%;
  right: 10px;
  width: clamp(310px, 29vw, 330px);
  height: 68vh;
  padding: 0;
  z-index: 3500;
  background: rgba(13, 17, 23, 0.94);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transform: translate(102%, -50%);
  transition: transform 0.28s ease;
  pointer-events: none;
}

#chatSection.chat-hidden {
  transform: translate(102%, -50%);
  pointer-events: none;
}

#chatSection.active {
  transform: translate(0, -50%);
  pointer-events: auto;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: transparent;
}

.chat-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.chat-status {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: #b7f7ff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 8px; height: 8px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(76,175,80,0); }
}

.btn-exit-chat {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  width: 30px;
  height: 30px;
  padding: 0;
  background: rgba(255,255,255,0.08);
  color: #d8e5f5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-exit-chat:hover { background: rgba(255,255,255,0.16); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 2px;
}
.msg-left  { align-self: flex-start; align-items: flex-start; }
.msg-right { align-self: flex-end;   align-items: flex-end; }

.msg-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 19px;
  word-break: break-word;
}
.msg-left  .msg-bubble {
  background: rgba(255, 255, 255, 0.1);
  color: #eaf2ff;
}
.msg-right .msg-bubble {
  background: rgba(53, 196, 255, 0.2);
  color: #fff;
}

.msg-time {
  font-family: var(--font-main);
  font-size: 10px;
  color: rgba(220, 232, 246, 0.55);
  padding: 0 4px;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 12px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: #111825;
  border: 1px solid #2e3b4e;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: #35c4ff; }

.btn-emoji {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #2e3b4e;
  background: #111825;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.btn-emoji:hover {
  border-color: #35c4ff;
}

.btn-send {
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #2f89ff, #35c4ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-send:hover { opacity: 0.9; }

.emoji-picker {
  display: none;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px 10px 12px;
  background: rgba(10, 16, 25, 0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.emoji-picker.open {
  display: grid;
}

.emoji-item {
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 0;
}

.emoji-item:hover {
  background: rgba(53, 196, 255, 0.18);
}

body.chat-open #gameSection {
  padding-right: 345px !important;
  transition: padding-right 0.28s ease;
}

@media (max-width: 1024px) {
  #chatSection {
    width: clamp(300px, 36vw, 330px);
    height: 68vh;
  }

  body.chat-open #gameSection {
    padding-right: 335px !important;
  }
}

@media (max-width: 760px) {
  #chatSection {
    top: 50%;
    right: 8px;
    width: min(92vw, 330px);
    height: 70vh;
    border-radius: 14px;
  }

  body.chat-open #gameSection {
    padding-right: 0 !important;
  }
}

/* ─── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #1a1a2e;
  color: #fff;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 26px;
  border-radius: 30px;
  border: 1.5px solid rgba(124,77,255,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  box-shadow: var(--shadow-md);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── MODALS (Payment & Store) ──────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}
.overlay.visible { display: flex; }

.modal {
  position: relative;
  background: #1a1a2e;
  border: 2px solid rgba(124,77,255,0.6);
  border-radius: 16px;
  padding: 36px;
  width: 90%;
  text-align: left;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  animation: popIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: #766;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--mario-red); }

.modal-title {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(124,77,255,0.3);
}

/* ─── PAYMENT MODAL ─────────────────────────────────── */
.payment-modal {
  max-width: 420px;
}

.payment-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border-left: 3px solid #e040fb;
}

.plan-info {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.plan-info span:first-child {
  color: #ffeb3b;
  font-weight: 700;
}

.plan-info span:last-child {
  color: #e040fb;
  font-weight: 700;
}

.txn-id {
  font-family: var(--font-main);
  font-size: 12px;
  color: #aaa;
}

.txn-id span {
  color: #7c4dff;
  font-weight: 600;
  font-family: monospace;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding: 20px;
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
}

.qr-image {
  width: 260px;
  height: 260px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.qr-instruction {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: #333;
  text-align: center;
}

.payment-actions {
  display: flex;
  gap: 10px;
}

.btn-paid {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(76,175,80,0.35);
}

.btn-paid:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76,175,80,0.45);
}

.btn-cancel {
  flex: 1;
  padding: 14px 18px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ─── STORE MODAL ───────────────────────────────────── */
.store-modal {
  max-width: 500px;
}

.store-balance {
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(224,64,251,0.15);
  border-radius: 8px;
  border-left: 3px solid #e040fb;
}

.store-balance span {
  color: #e040fb;
  font-weight: 700;
}

.store-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.store-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: #0d1117;
  border: 1.5px solid rgba(124,77,255,0.3);
  border-radius: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.store-item:hover {
  border-color: #7c4dff;
  background: rgba(124,77,255,0.08);
  transform: translateY(-2px);
}

.store-item-icon {
  font-size: 32px;
  text-align: center;
  margin-bottom: 8px;
}

.store-item-name {
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-item-price {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: #e040fb;
  display: flex;
  align-items: center;
  gap: 4px;
}

.store-item-desc {
  font-family: var(--font-main);
  font-size: 11px;
  color: #aaa;
  margin-top: 6px;
  line-height: 16px;
}

.store-item.purchased {
  opacity: 0.5;
  cursor: not-allowed;
}

.store-item.purchased::after {
  content: '✓ Owned';
  font-family: var(--font-main);
  font-size: 11px;
  color: #4caf50;
  font-weight: 700;
  margin-top: 8px;
  text-align: center;
}



/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .logo-text  { font-size: 11px; }
  .btn-diamond { font-size: 12px; padding: 8px 14px; }
  #gameCanvas { width: 100%; height: auto; }
  .game-stats { gap: 14px; font-size: 13px; padding: 10px 18px; }
  .section-box { padding: 24px 20px; }
}
