/* ============================================
   PIKIT - shadcn/ui inspired design system
   Dark theme with glassmorphism overlays
   ============================================ */

/* === Design Tokens (shadcn/ui dark) === */
:root {
  --background: hsl(240 10% 3.9%);
  --foreground: hsl(0 0% 98%);
  --card: hsl(240 10% 5%);
  --card-foreground: hsl(0 0% 98%);
  --popover: hsl(240 10% 5%);
  --primary: hsl(47 100% 50%);
  --primary-foreground: hsl(240 5.9% 10%);
  --secondary: hsl(240 3.7% 15.9%);
  --muted: hsl(240 3.7% 15.9%);
  --muted-foreground: hsl(240 5% 64.9%);
  --accent: hsl(240 3.7% 15.9%);
  --destructive: hsl(0 62.8% 30.6%);
  --border: hsl(240 3.7% 15.9%);
  --ring: hsl(47 100% 50%);
  --radius: 0.75rem;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --green: hsl(142 76% 36%);
  --red: hsl(0 84% 60%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Screen Transitions === */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* === (Login screen removed — spectator-first flow) === */

/* === Buttons === */
.btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  width: 100%;
}
.btn-primary:hover { box-shadow: 0 0 20px hsla(47, 100%, 50%, 0.3); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}
.btn-outline:hover { background: var(--secondary); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  width: 100%;
  margin-top: 8px;
}

/* === Game Screen Layout (full-screen canvas) === */
#game-screen { display: none; height: 100vh; width: 100vw; }
#game-screen.active { display: flex; }

#canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#game-canvas {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

/* === Top HUD Bar === */
#top-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 20;
  pointer-events: auto;
}

#hud-left, #hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: hsla(0,0%,100%,0.08);
  border: 1px solid hsla(0,0%,100%,0.12);
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s;
}
.hud-btn:hover { background: hsla(0,0%,100%,0.15); }

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.hud-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}

.hud-value.gold { color: var(--primary); }

/* === Bottom Action Bar === */
#bottom-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 20;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background: hsla(0,0%,100%,0.08);
  border: 1px solid hsla(0,0%,100%,0.12);
  border-radius: var(--radius);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 70px;
}
.action-btn:hover { background: hsla(0,0%,100%,0.15); }
.action-btn:active { transform: scale(0.95); }

/* === Slide-out Panels === */
.slide-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 85vw);
  background: var(--card);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.slide-panel.left {
  right: auto; left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}
.slide-panel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
}

.close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
}
.close-btn:hover { background: var(--secondary); color: var(--foreground); }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* === Cards === */
.card {
  background: hsla(0,0%,100%,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.card-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.info-row .label { color: var(--muted-foreground); }
.info-row .value { font-weight: 600; }
.info-row .value.gold { color: var(--primary); font-size: 15px; }

/* === Shop Grid === */
.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: hsla(0,0%,100%,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.shop-item:hover {
  background: hsla(47,100%,50%,0.06);
  border-color: hsla(47,100%,50%,0.2);
}
.shop-item:active { transform: scale(0.98); }

.shop-item-icon {
  width: 36px; height: 36px;
  image-rendering: pixelated;
  flex-shrink: 0;
  border-radius: 6px;
  background: hsla(0,0%,100%,0.05);
  display: block;
}

.shop-item-info { flex: 1; min-width: 0; }

.shop-item-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item-price {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.shop-item-stat {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* === Block Guide === */
.block-guide-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.block-guide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  font-size: 12px;
  border-radius: 6px;
}

.block-guide-color {
  width: 24px; height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid hsla(0,0%,100%,0.1);
}

.block-guide-icon {
  width: 24px; height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid hsla(0,0%,100%,0.1);
  image-rendering: pixelated;
}

.block-guide-name { flex: 1; font-weight: 500; }
.block-guide-reward { color: var(--primary); font-weight: 600; }
.block-guide-spawn { color: var(--muted-foreground); font-size: 10px; }

/* === Modal === */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  width: min(400px, 90vw);
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-content { transform: scale(1); }

.modal-body {
  padding: 16px;
  overflow-y: auto;
}

/* === Leaderboard === */
.lb-row {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  font-size: 13px;
  border-bottom: 1px solid hsla(0,0%,100%,0.05);
}

.lb-rank {
  width: 24px;
  text-align: center;
  font-weight: 800;
  color: var(--muted-foreground);
}
.lb-rank.gold { color: var(--primary); }
.lb-rank.silver { color: #C0C0C0; }
.lb-rank.bronze { color: #CD7F32; }

.lb-name {
  flex: 1;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.lb-profit { font-weight: 700; font-size: 12px; }
.lb-profit.positive { color: var(--green); }
.lb-profit.negative { color: var(--red); }

/* === Floating Chat (always visible) === */
.chat-floating {
  position: absolute;
  bottom: 68px;
  left: 8px;
  width: min(300px, 48vw);
  z-index: 15;
  display: flex;
  flex-direction: column;
  pointer-events: none; /* messages are see-through */
}

.chat-messages-floating {
  overflow-y: auto;
  max-height: 150px;
  min-height: 40px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom: none;
  pointer-events: auto;
  mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 25%, black 100%);
}
.chat-messages-floating::-webkit-scrollbar { width: 2px; }
.chat-messages-floating::-webkit-scrollbar-track { background: transparent; }
.chat-messages-floating::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.chat-msg {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 3px;
  word-break: break-word;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.chat-msg.system {
  color: rgba(255,255,255,0.4);
  font-style: italic;
  font-size: 10px;
  text-align: center;
  padding: 1px 4px;
}

.chat-name {
  font-weight: 700;
  color: var(--primary);
  margin-right: 5px;
  text-shadow: 0 0 6px rgba(255,215,0,0.3);
}
.chat-name::after { content: ':'; }
.chat-text { color: rgba(255,255,255,0.85); }

/* Chat input area — hidden by default, shown on toggle */
.chat-input-area-floating {
  display: none;
  gap: 4px;
  pointer-events: auto;
}
.chat-floating.input-open .chat-input-area-floating {
  display: flex;
}

/* Chat open button */
.chat-open-btn {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.15s;
}
.chat-open-btn:hover {
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.9);
}
.chat-floating.input-open .chat-open-btn {
  display: none;
}

#chat-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-family: var(--font);
  background: rgba(0,0,0,0.7);
  border: 1px solid hsla(0,0%,100%,0.15);
  border-radius: 0 0 0 var(--radius);
  color: white;
  outline: none;
  transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--ring); }
#chat-input::placeholder { color: #555; }

.btn-chat-send {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font);
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 0 0 var(--radius) 0;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-chat-send:hover { opacity: 0.9; }

/* === Jackpot Overlay === */
#jackpot-overlay {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  pointer-events: none;
  max-width: 90vw;
  width: max-content;
}

.jackpot-alert {
  background: rgba(40, 30, 10, 0.8);
  color: #FFD700;
  padding: 6px 14px;
  border: 2px solid #FFD700;
  font-weight: 700;
  font-size: 12px;
  font-family: "Courier New", monospace;
  margin-bottom: 4px;
  animation: jackpotIn 0.3s ease, jackpotOut 0.3s ease 3s forwards;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80vw;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  image-rendering: pixelated;
}

@keyframes jackpotIn {
  from { transform: translateY(-40px) scale(0.8); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes jackpotOut {
  to { transform: translateY(-20px) scale(0.9); opacity: 0; }
}

/* === Rare Block Banner === */
.rare-block-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  color: #fff;
  margin-bottom: 4px;
  animation: rareBannerIn 0.3s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.75);
}


.rare-block-banner.jackpot {
  background: rgba(60, 0, 60, 0.8);
  border-color: #FFD700;
  color: #FFD700;
  text-shadow: 0 0 6px #FFD700;
  font-size: 13px;
  padding: 8px 16px;
  animation: rareBannerIn 0.3s ease;
}

.rare-block-banner.diamond {
  background: rgba(0, 40, 40, 0.8);
  border-color: #00CED1;
  color: #00CED1;
  text-shadow: 0 0 6px #00CED1;
  animation: rareBannerIn 0.3s ease;
}

.rare-block-banner.gold {
  background: rgba(40, 30, 0, 0.8);
  border-color: #FFD700;
  color: #FFD700;
  text-shadow: 0 0 6px #FFD700;
  animation: rareBannerIn 0.3s ease;
}

.rare-block-banner.netherite {
  background: rgba(40, 25, 15, 0.85);
  border-color: #C8A882;
  color: #C8A882;
  text-shadow: 0 0 6px #C8A882;
  animation: rareBannerIn 0.3s ease;
}

.rare-block-banner.fade-out { animation: rareBannerOut 0.5s ease forwards; }

.rare-banner-emoji { font-size: 14px; z-index: 1; }
.rare-banner-text { z-index: 1; font-size: 11px; }
.rare-banner-player { color: #FFD700; }
.rare-banner-block { color: #fff; font-weight: 900; font-size: 12px; }
.rare-banner-reward { color: #FFD700; font-weight: 900; margin-left: 4px; font-size: 12px; }

@keyframes rareBannerIn {
  from { transform: translateY(-80px) scale(0.5); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes rareBannerOut {
  to { transform: translateY(-40px) scale(0.8); opacity: 0; }
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* === Toast Notifications === */
/* Notification toggle buttons */
.notif-toggle-btn {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #555;
  color: #aaa;
  font-size: 10px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  transition: none;
}
.notif-toggle-btn.on {
  border-color: #22c55e;
  color: #22c55e;
}
.notif-toggle-btn.off {
  border-color: #555;
  color: #555;
  text-decoration: line-through;
}

#toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  padding: 6px 12px;
  font-size: 11px;
  font-family: "Courier New", monospace;
  animation: toastIn 0.2s ease, toastOut 0.2s ease 2.5s forwards;
  max-width: 260px;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.8);
}
.toast.success { background: rgba(22, 101, 52, 0.8); border-color: #22c55e; color: #22c55e; }
.toast.error { background: rgba(127, 29, 29, 0.8); border-color: #ef4444; color: #ef4444; }
.toast.info { background: rgba(30, 58, 138, 0.8); border-color: #3b82f6; color: #3b82f6; }

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(100px); opacity: 0; }
}

/* === Panel Backdrop === */
.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.panel-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* === My Info Profile Button === */
.hud-btn-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  background: hsla(0,0%,100%,0.08);
  border: 1px solid hsla(0,0%,100%,0.12);
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.hud-btn-profile:hover { background: hsla(0,0%,100%,0.15); }
.hud-btn-profile { position: relative; }
.hud-balance-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* === Credit Tooltip (hover popup on balance) === */
.credit-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #1a1a2e;
  border: 1px solid hsla(0,0%,100%,0.12);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 60;
}
.hud-btn-profile:hover .credit-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.credit-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
  color: var(--muted-foreground);
}
.credit-tooltip-row span:last-child {
  font-weight: 700;
  color: var(--foreground);
}

/* === My Info Credit Sub-rows === */
.myinfo-credit-sub {
  padding-left: 12px;
}
.myinfo-credit-sub .myinfo-label {
  font-size: 11px;
  color: var(--muted-foreground);
  opacity: 0.8;
}
.myinfo-credit-sub .myinfo-value {
  font-size: 11px;
  opacity: 0.9;
}

/* === My Info Popup === */
.myinfo-popup {
  position: absolute;
  top: 52px;
  right: 8px;
  width: 300px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.myinfo-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.myinfo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.myinfo-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
}
.myinfo-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  color: var(--muted-foreground); cursor: pointer;
  font-size: 16px; border-radius: 4px;
}
.myinfo-close:hover { background: var(--secondary); color: var(--foreground); }

.myinfo-body { padding: 12px; }
.myinfo-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  border: 2px solid var(--border);
}
.myinfo-name {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 12px;
}

.myinfo-stats {
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.myinfo-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.myinfo-stat-row.highlight {
  background: hsla(0,0%,100%,0.04);
  border: 1px solid var(--border);
  margin-top: 4px;
}
.myinfo-label { color: var(--muted-foreground); font-weight: 500; }
.myinfo-value { font-weight: 700; color: var(--foreground); }
.myinfo-value.gold { color: var(--primary); }

.myinfo-actions {
  display: flex; flex-direction: column; gap: 6px;
}

.btn-destructive {
  background: var(--destructive);
  color: #fff;
  border: none;
}
.btn-destructive:hover { opacity: 0.9; }

/* === Reduced motion === */
/* === Quest System === */
.quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}

.quest-item {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: opacity 0.2s;
}

.quest-item.completed {
  opacity: 0.6;
  border-left: 3px solid var(--green);
  border-color: var(--green);
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.quest-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--foreground);
}

.quest-check {
  font-size: 14px;
}

.quest-desc {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-bottom: 6px;
}

.quest-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), hsl(47 100% 60%));
  border-radius: 3px;
  transition: width 0.3s ease;
}

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

.quest-progress-text {
  font-size: 10px;
  color: var(--muted-foreground);
  text-align: right;
}

.quest-reward {
  font-size: 11px;
  color: #FFD700;
  font-weight: 600;
  margin-bottom: 4px;
}

.quest-tier {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted-foreground);
  background: hsla(0,0%,100%,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  letter-spacing: 0.3px;
}

.quest-completed-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: hsla(142,70%,45%,0.12);
  border-radius: 4px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.quest-complete-btn {
  margin-top: 6px;
  width: 100%;
  font-size: 11px;
  padding: 6px 10px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === (Field selection screen removed — toggle in HUD) === */

/* === Field Toggle (HUD) === */
.field-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-toggle-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.field-toggle-label.hardcore-label {
  color: var(--muted-foreground);
}

.field-toggle.active .field-toggle-label:first-child {
  color: var(--muted-foreground);
}
.field-toggle.active .hardcore-label {
  color: hsl(0, 80%, 65%);
  text-shadow: 0 0 6px rgba(255, 50, 50, 0.4);
}
.field-toggle:not(.active) .field-toggle-label:first-child {
  color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: hsla(0, 0%, 100%, 0.12);
  border: 1px solid hsla(0, 0%, 100%, 0.18);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: var(--foreground);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: hsla(0, 80%, 50%, 0.3);
  border-color: hsla(0, 80%, 50%, 0.5);
  box-shadow: 0 0 8px rgba(255, 50, 50, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: hsl(0, 80%, 60%);
}

/* === Hardcore Confirmation Modal === */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.confirm-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  padding: 28px 24px 20px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.confirm-modal-overlay.open .confirm-modal {
  transform: scale(1) translateY(0);
}

.confirm-modal-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: hsl(0, 80%, 60%);
  margin-bottom: 8px;
}

.confirm-modal-text {
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.5;
  margin-bottom: 16px;
}

.confirm-modal-text strong {
  color: hsl(0, 80%, 65%);
}

.confirm-modal-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
  cursor: pointer;
  margin-bottom: 18px;
  user-select: none;
}

.confirm-modal-check input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
}

.btn-modal {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
}

.btn-hardcore {
  background: hsl(0, 70%, 45%);
  color: #fff;
}
.btn-hardcore:hover {
  background: hsl(0, 70%, 50%);
  box-shadow: 0 0 16px rgba(255, 50, 50, 0.3);
}

@keyframes hardcorePulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255, 50, 50, 0.2); }
  50% { box-shadow: 0 0 12px rgba(255, 50, 50, 0.4); }
}

/* === Spawn Alert Overlay (absolute top center) === */
#spawn-alert-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  gap: 6px;
}

/* === Rare Block Spawn Alert === */
.rare-spawn-alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 215, 0, 0.4);
  animation: spawnAlertIn 0.3s ease;
  max-width: 80vw;
  text-align: center;
}

.rare-spawn-alert.diamond {
  border-color: rgba(0, 206, 209, 0.6);
  text-shadow: 0 0 6px rgba(0, 206, 209, 0.6);
}

.rare-spawn-alert.jackpot {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 215, 0, 0.8);
  text-shadow: 0 0 6px #FFD700;
}

.rare-spawn-emoji { font-size: 12px; }
.rare-spawn-text { font-size: 11px; }

@keyframes spawnAlertIn {
  0% { transform: translateY(-30px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes spawnAlertOut {
  to { transform: translateY(-20px) scale(0.9); opacity: 0; }
}

.rare-spawn-alert.fade-out {
  animation: spawnAlertOut 0.4s ease forwards;
}

/* === My Info: Compact stats row (always visible above tabs) === */
.myinfo-stats-compact {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
}
.myinfo-stat-mini { text-align: center; }

/* === My Info: Tab buttons === */
.myinfo-tabs {
  display: flex;
  gap: 2px;
  background: var(--secondary);
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 10px;
}
.myinfo-tab {
  flex: 1;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.myinfo-tab.active {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* === My Info: Tab content panels === */
.myinfo-tab-content { display: none; }
.myinfo-tab-content.active { display: block; }

/* === Deposit / Withdraw: Rate badge === */
.rate-badge {
  text-align: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: hsla(47, 100%, 50%, 0.1);
  color: var(--primary);
  border: 1px solid hsla(47, 100%, 50%, 0.2);
  margin-bottom: 12px;
}
.rate-badge.withdraw {
  background: hsla(0, 80%, 50%, 0.1);
  color: hsl(0, 80%, 65%);
  border-color: hsla(0, 80%, 50%, 0.2);
}

/* === Deposit / Withdraw: Input group === */
.deposit-input-group { margin-bottom: 10px; }
.deposit-label {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-bottom: 4px;
  display: block;
}
.deposit-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.deposit-input {
  flex: 1;
  min-width: 0;
  max-width: 100px;
  padding: 8px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s;
}
.deposit-input:focus { border-color: var(--ring); }
/* Remove number input spinners */
.deposit-input::-webkit-outer-spin-button,
.deposit-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.deposit-input[type=number] { -moz-appearance: textfield; }

.deposit-unit {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}

/* === Amount +/- Buttons === */
.amount-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: var(--font);
  user-select: none;
  line-height: 1;
}
.amount-btn:hover { background: hsla(0,0%,100%,0.12); border-color: var(--ring); }
.amount-btn:active { transform: scale(0.92); }
.amount-btn.plus { color: var(--green); }
.amount-btn.minus { color: var(--red); }

.deposit-preview {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.deposit-preview strong { color: var(--primary); }

/* === Withdraw button variant === */
.btn-withdraw { background: hsl(0, 70%, 45%); color: #fff; }
.btn-withdraw:hover { background: hsl(0, 70%, 50%); }

/* === High-Value Reward Feed (right side) === */
#reward-feed {
  position: fixed;
  top: 52px;
  right: 8px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  max-width: 220px;
}
.reward-feed-item {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #FFD700;
  background: rgba(0,0,0,0.85);
  border: 2px solid rgba(255,215,0,0.4);
  padding: 4px 8px;
  animation: feedSlideIn 0.3s ease-out;
}
.reward-feed-item.fade-out {
  opacity: 0;
  transition: opacity 0.5s;
}
@keyframes feedSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Landscape Warning === */
#landscape-warning {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.95);
  font-family: 'Courier New', monospace;
  color: #fff;
}
.landscape-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 14px;
}
@media (orientation: landscape) and (max-width: 1024px) {
  #landscape-warning { display: block; }
}

/* === Reconnection / Error Overlays === */
#reconnect-overlay,
#connect-error-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.9);
  font-family: 'Courier New', monospace;
  color: #fff;
}
.reconnect-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 13px;
}

/* === Responsive: Mobile === */
@media (max-width: 768px) {
  .slide-panel { width: 85vw; }
  #chat-overlay { width: calc(100vw - 16px); left: 8px; }
  #toast-container { right: 8px; bottom: 80px; }
  .hud-stat { gap: 1px; }
  .hud-label { font-size: 9px; }
  .hud-value { font-size: 13px; }
  #reward-feed { max-width: 160px; }
}
