/* ═══════════════════════════════════════════════════════
   HUGO PLATFORM — DESIGN POLISH v1
   Minecraft-inspired premium aesthetic
   ═══════════════════════════════════════════════════════ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── ROOT OVERRIDES ── */
:root {
  --bg: #0c0e14;
  --s1: #13161f;
  --s2: #1a1e2a;
  --s3: #222838;
  --bdr: #2a3040;
  --bdr2: #3a4560;
  --t: #e8eaf0;
  --t2: #8892a8;
  --t3: #5a6478;
  --emerald: #2dd4a0;
  --emerald-d: #1a8a68;
  --ruby: #ef4466;
  --ruby-d: #a82040;
  --gold: #f5c842;
  --gold-d: #b8922a;
  --amethyst: #9b7aff;
  --amethyst-d: #6e50cc;
  --diamond: #5cc8f0;
  --diamond-d: #3a90b0;
  --redstone: #ff4444;
  --lapis: #4488ff;
  --glow: 0 0 20px rgba(45, 212, 160, 0.15);
  --glow-gold: 0 0 20px rgba(245, 200, 66, 0.15);
  --glow-amethyst: 0 0 20px rgba(155, 122, 255, 0.15);
}

/* ── GLOBAL RESETS ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--t);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bdr2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--amethyst-d); }

/* ── SELECTION ── */
::selection { background: rgba(155, 122, 255, 0.3); color: #fff; }

/* ── SUBTLE BACKGROUND TEXTURE ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(155, 122, 255, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(45, 212, 160, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── PIXEL FONTS ── */
.px, [class*="Silkscreen"] { font-family: 'Silkscreen', cursive !important; }
.mn, [class*="JetBrains"] { font-family: 'JetBrains Mono', monospace !important; }

/* ── HEADER POLISH ── */
header {
  background: linear-gradient(180deg, #1a1228 0%, #251838 50%, #1a1228 100%) !important;
  border-bottom: 3px solid var(--amethyst-d) !important;
  box-shadow: 0 4px 30px rgba(155, 122, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  padding: 10px 24px !important;
}
.logo h1 { letter-spacing: 0.5px; }
.logo-i {
  background: linear-gradient(135deg, var(--amethyst), var(--amethyst-d)) !important;
  border-color: var(--amethyst-d) !important;
  box-shadow: 0 0 15px rgba(155, 122, 255, 0.3), inset -2px -3px 0 rgba(0,0,0,.3) !important;
  transition: transform 0.3s, box-shadow 0.3s;
}
.logo-i:hover { transform: rotate(-10deg) scale(1.1); box-shadow: 0 0 25px rgba(155, 122, 255, 0.5), inset -2px -3px 0 rgba(0,0,0,.3) !important; }

/* ── CARDS / PANELS ── */
.pan, .st, .ps {
  background: var(--s1) !important;
  border: 1px solid var(--bdr) !important;
  border-radius: 6px !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pan:hover, .st:hover {
  border-color: var(--bdr2) !important;
}

/* ── STAT CARDS ── */
.st {
  position: relative;
  overflow: hidden;
}
.st::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(155, 122, 255, 0.03));
  pointer-events: none;
}
.st-v {
  background: linear-gradient(135deg, var(--t), var(--t2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.st-v.grn { background: linear-gradient(135deg, #2dd4a0, #1aab80); -webkit-background-clip: text; background-clip: text; }
.st-v.gld { background: linear-gradient(135deg, #f5c842, #e0a820); -webkit-background-clip: text; background-clip: text; }
.st-v.red { background: linear-gradient(135deg, #ef4466, #d03050); -webkit-background-clip: text; background-clip: text; }

/* ── TABS ── */
.tab, .lb-tab, .shop-cat {
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  position: relative;
  overflow: hidden;
}
.tab.on, .lb-tab.on, .shop-cat.on {
  background: rgba(155, 122, 255, 0.1) !important;
  border-color: var(--amethyst) !important;
  color: var(--amethyst) !important;
  box-shadow: 0 0 12px rgba(155, 122, 255, 0.1);
}
.tab:hover:not(.on) { color: var(--t) !important; background: var(--s2) !important; transform: translateY(-1px); }

/* ── SIDEBAR NAV ── */
.ni {
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  position: relative;
}
.ni:hover {
  transform: translateX(4px);
}
.ni.on {
  box-shadow: var(--glow-amethyst);
}
.ni.on::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--amethyst);
  border-radius: 0 3px 3px 0;
}

/* ── BUTTONS ── */
.btn {
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) !important; }

.btn.ba, .btn-g { background: var(--emerald-d) !important; border-color: #15805a !important; }
.btn.ba:hover, .btn-g:hover { background: var(--emerald) !important; }
.btn.be, .btn-b { background: var(--amethyst-d) !important; border-color: #5530aa !important; }
.btn.be:hover, .btn-b:hover { background: var(--amethyst) !important; }
.btn.bl { background: var(--diamond-d) !important; border-color: #2a7090 !important; }
.btn.bl:hover { background: var(--diamond) !important; }
.btn-r { background: var(--ruby-d) !important; border-color: #801530 !important; }
.btn-r:hover { background: var(--ruby) !important; }

/* ── INPUTS ── */
.inp, .src, input[type="number"], input[type="text"], select {
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid var(--bdr) !important;
  border-radius: 4px !important;
  color: var(--t) !important;
  font-family: 'JetBrains Mono', monospace !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.inp:focus, .src:focus, input:focus, select:focus {
  border-color: var(--amethyst) !important;
  box-shadow: 0 0 0 3px rgba(155, 122, 255, 0.1) !important;
  outline: none !important;
}

/* ── TABLES ── */
table { border-collapse: separate !important; border-spacing: 0 !important; }
th {
  background: rgba(0, 0, 0, 0.2) !important;
  padding: 6px 8px !important;
  font-size: 8px !important;
  letter-spacing: 1px !important;
  border-bottom: 2px solid var(--bdr) !important;
}
tr { transition: background 0.15s; }
tr:hover { background: rgba(155, 122, 255, 0.03) !important; }
td { padding: 5px 8px !important; }

/* ── ITEM LIST ── */
.ir {
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
}
.ir:hover {
  background: rgba(155, 122, 255, 0.04) !important;
  transform: translateX(2px);
}
.ir.on {
  background: rgba(45, 212, 160, 0.06) !important;
  border-color: rgba(45, 212, 160, 0.2) !important;
  box-shadow: inset 3px 0 0 var(--emerald);
}

/* ── PRICE COLORS ── */
.grn, .ip { color: var(--emerald) !important; }
.gld { color: var(--gold) !important; }
.red { color: var(--ruby) !important; }
.blu { color: var(--diamond) !important; }

/* ── MODALS ── */
.mbg, .modal-bg {
  backdrop-filter: blur(8px) !important;
  background: rgba(6, 8, 12, 0.85) !important;
}
.mod, .modal {
  background: var(--bg) !important;
  border: 2px solid var(--bdr) !important;
  border-radius: 8px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(155, 122, 255, 0.05) !important;
  animation: modalIn 0.25s ease-out !important;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── PLAYER AVATAR ── */
.pav {
  border: 3px solid var(--bdr) !important;
  border-radius: 4px !important;
  transition: transform 0.3s ease;
}
.pav:hover { transform: scale(1.05) rotate(-2deg); }

/* ── MC HEAD IMAGES ── */
img[src*="mc-heads"] {
  border-radius: 2px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── CHART CONTAINER ── */
canvas {
  border-radius: 4px;
}

/* ── DEALS CARDS ── */
.dr {
  border-radius: 4px !important;
  transition: all 0.2s !important;
  border-left: 3px solid var(--emerald) !important;
}
.dr:hover {
  background: rgba(45, 212, 160, 0.05) !important;
  transform: translateX(4px);
}

/* ── RANKINGS ── */
.tr_ {
  border-radius: 4px;
  transition: all 0.15s;
}
.tr_:hover {
  background: rgba(155, 122, 255, 0.04);
  transform: translateX(3px);
}
.rk {
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── LEADERBOARD ROWS ── */
.lb-row {
  border-radius: 4px !important;
  transition: all 0.2s !important;
}
.lb-row:hover { transform: translateX(4px); }
.lb-row:first-child {
  background: linear-gradient(90deg, rgba(245, 200, 66, 0.06), transparent) !important;
  border-color: var(--gold) !important;
  box-shadow: var(--glow-gold);
}

/* ── ACHIEVEMENT CARDS ── */
.ach-card {
  border-radius: 6px !important;
  transition: all 0.2s !important;
}
.ach-card:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.ach-card.done {
  background: linear-gradient(135deg, rgba(245, 200, 66, 0.04), rgba(245, 200, 66, 0.01)) !important;
  box-shadow: var(--glow-gold);
}
.ach-fill {
  background: linear-gradient(90deg, var(--amethyst-d), var(--amethyst)) !important;
  border-radius: 2px;
}

/* ── SHOP ITEMS ── */
.shop-item {
  border-radius: 6px !important;
  transition: all 0.25s !important;
}
.shop-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), var(--glow-amethyst);
  border-color: var(--amethyst) !important;
}
.shop-item .si-icon { transition: transform 0.3s; }
.shop-item:hover .si-icon { transform: scale(1.2) rotate(-5deg); }

/* ── DAILY REWARD DAYS ── */
.daily-day {
  border-radius: 6px !important;
  transition: all 0.2s !important;
}
.daily-day:hover { transform: translateY(-3px); }
.daily-day.claimed {
  background: linear-gradient(135deg, rgba(45, 212, 160, 0.08), rgba(45, 212, 160, 0.02)) !important;
}

/* ── TOAST NOTIFICATIONS ── */
.toast-item {
  border-radius: 6px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), var(--glow-gold) !important;
  backdrop-filter: blur(10px);
}

/* ── CHAT ── */
.chat-box {
  border-radius: 6px !important;
}
.chat-input button {
  background: var(--amethyst-d) !important;
  transition: background 0.15s;
}
.chat-input button:hover { background: var(--amethyst) !important; }

/* ── INVITE MODAL ── */
#inviteLinkBox {
  border-radius: 6px !important;
  transition: all 0.2s;
}
#inviteLinkBox:hover {
  border-color: var(--amethyst) !important;
  box-shadow: var(--glow-amethyst);
}

/* ── BOARD GAME CARDS ── */
.bg-card {
  border-radius: 6px !important;
  transition: all 0.25s !important;
}
.bg-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ── FOOTER ── */
footer {
  opacity: 0.6;
  transition: opacity 0.3s;
}
footer:hover { opacity: 1; }

/* ── SKELETON LOADING ── */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
.loading {
  background: linear-gradient(90deg, var(--s1) 25%, var(--s2) 50%, var(--s1) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ── DOT PULSE ── */
.dot {
  animation: dotPulse 2s ease-in-out infinite !important;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px currentColor; }
  50% { opacity: 0.4; box-shadow: 0 0 10px currentColor; }
}

/* ── COINFLIP ANIMATION POLISH ── */
@keyframes coinSpin {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(900deg) scale(1.2); filter: brightness(1.3); }
  100% { transform: rotateY(1800deg) scale(1); }
}

/* ── GAME RESULT OVERLAY ── */
#rOv .mod, #rCard {
  border-radius: 8px !important;
}

/* ── GEO GUESSR MAP ── */
.leaflet-container {
  border-radius: 6px !important;
  border: 2px solid var(--bdr) !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 8px 12px !important; }
  .w, .wrap { padding: 8px !important; }
  .stats { grid-template-columns: repeat(3, 1fr) !important; gap: 4px !important; }
  .st { padding: 6px 8px !important; }
  .st-v { font-size: 14px !important; }
  .grid { grid-template-columns: 1fr !important; }
  .tg { grid-template-columns: 1fr !important; }
  .shop-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ach-grid { grid-template-columns: 1fr !important; }
  .daily-days { gap: 4px !important; }
  .daily-day { width: 55px !important; padding: 6px 4px !important; }
  .mod, .modal { width: 96% !important; padding: 14px !important; max-height: 95vh !important; }
  .pav { height: 100px !important; }
}

/* ── SMOOTH TRANSITIONS ── */
*, *::before, *::after {
  transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ── FOCUS VISIBLE ── */
:focus-visible {
  outline: 2px solid var(--amethyst);
  outline-offset: 2px;
}

/* ── PREVENT LAYOUT SHIFT ── */
img { display: block; }
img[src=""] { display: none; }
