:root{
  --wm-bg: #020617;
  --wm-card: rgba(15,23,42,.78);
  --wm-border: rgba(148,163,184,.14);
  --wm-text: #e5e7eb;
  --wm-soft: #9ca3af;
  --wm-accent: #8b5cf6;
  --wm-safe-b: env(safe-area-inset-bottom, 0px);
  --wm-safe-t: env(safe-area-inset-top, 0px);
}

html,body{ height:100%; }
body{
  padding-bottom: calc(74px + var(--wm-safe-b));
}

/* --- Topbar: compact on mobile --- */
.wm-nav-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;height:42px;
  border-radius:14px;
  border:1px solid var(--wm-border);
  background: rgba(2,6,23,.55);
  color: var(--wm-text);
  cursor:pointer;
}

.wm-nav-toggle:active{ transform: translateY(1px); }

@media (max-width: 900px){
  .topbar .topbar-right{ display:none !important; } /* hide desktop links */
  .topbar{ padding-top: calc(10px + var(--wm-safe-t)) !important; }
}

/* --- Drawer --- */
.wm-scrim{
  position:fixed; inset:0;
  background: rgba(2,6,23,.65);
  opacity:0; pointer-events:none;
  transition: opacity .18s ease;
  z-index: 9998;
}

.wm-drawer{
  position:fixed;
  top:0; right:0;
  height:100%;
  width:min(86vw, 360px);
  background: rgba(2,6,23,.92);
  border-left: 1px solid var(--wm-border);
  box-shadow: 0 30px 90px rgba(0,0,0,.75);
  transform: translateX(110%);
  transition: transform .22s ease;
  z-index: 9999;
  padding: calc(18px + var(--wm-safe-t)) 16px 16px 16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

body.wm-nav-open .wm-scrim{ opacity:1; pointer-events:auto; }
body.wm-nav-open .wm-drawer{ transform: translateX(0); }

.wm-drawer .wm-drawer-title{
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 14px;
  color: var(--wm-soft);
  text-transform: uppercase;
}

.wm-drawer a{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px 12px;
  border:1px solid var(--wm-border);
  border-radius:16px;
  text-decoration:none;
  color: var(--wm-text);
  background: rgba(15,23,42,.55);
}

.wm-drawer a[aria-current="page"]{
  border-color: rgba(139,92,246,.55);
  box-shadow: 0 18px 50px rgba(139,92,246,.12);
}

.wm-drawer .wm-close{
  margin-top:auto;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--wm-border);
  background: rgba(15,23,42,.55);
  color: var(--wm-text);
  cursor:pointer;
}

/* --- Bottom nav --- */
.wm-bottom-nav{
  position:fixed;
  left:12px; right:12px;
  bottom: calc(10px + var(--wm-safe-b));
  height:60px;
  border-radius:22px;
  border:1px solid var(--wm-border);
  background: rgba(2,6,23,.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 70px rgba(0,0,0,.7);
  z-index: 9997;

  display:flex;
  align-items:center;
  justify-content:space-around;
  gap:8px;
  padding: 8px 10px;
}

.wm-bottom-nav a{
  flex:1;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius:16px;
  text-decoration:none;
  color: var(--wm-soft);
  font-size: 12px;
  border:1px solid transparent;
}

.wm-bottom-nav a svg{ width:18px;height:18px; }

.wm-bottom-nav a[aria-current="page"]{
  color: var(--wm-text);
  border-color: rgba(139,92,246,.55);
  background: rgba(139,92,246,.12);
}

@media (min-width: 900px){
  body{ padding-bottom: 0; }
  .wm-bottom-nav{ display:none; }
}

/* --- Tables: prevent mobile overflow --- */
.wm-table-scroll{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  border: 1px solid var(--wm-border);
}
.wm-table-scroll table{ min-width: 640px; }

/* WM skeleton loader */
.wm-skel { background: rgba(10,14,26,.70); border: 1px solid rgba(148,163,184,.14); }
.wm-skel-line{
  height: 14px;
  border-radius: 999px;
  margin: 10px 6px;
  background: linear-gradient(90deg, rgba(148,163,184,.12), rgba(148,163,184,.22), rgba(148,163,184,.12));
  background-size: 200% 100%;
  animation: wmShimmer 1.1s infinite linear;
}
.wm-skel-title{ height: 18px; margin-top: 14px; }
.wm-skel-short{ width: 55%; }
@keyframes wmShimmer { 0%{background-position:0% 0} 100%{background-position:200% 0} }

/* Premium button + modal */
.wm-upgrade-btn{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1000;
  border: 1px solid rgba(148,163,184,.20);
  background: rgba(2,6,23,.65);
  color: rgba(226,232,240,.95);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  backdrop-filter: blur(14px);
}

.wm-premium-modal{
  position: fixed; inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.wm-premium-card{
  width: min(520px, 100%);
  background: rgba(10,14,26,.92);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.wm-premium-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.wm-premium-title{ font-size: 18px; font-weight: 800; }
.wm-premium-x{ background: transparent; border: 0; color: rgba(226,232,240,.8); font-size: 20px; }
.wm-premium-sub{ opacity:.8; margin: 10px 0 12px; }
.wm-premium-input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.55);
  color: rgba(226,232,240,.95);
  outline: none;
}
.wm-premium-cta{
  margin-top: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 0;
  background: rgba(120,140,255,.22);
  color: rgba(240,244,255,.98);
}
.wm-premium-msg{ margin-top: 10px; min-height: 18px; opacity: .9; }
.wm-premium-logout{ margin-top: 10px; width:100%; background:transparent; border:1px solid rgba(148,163,184,.18); color:rgba(226,232,240,.8); padding:10px; border-radius: 14px; }

/* === WM Match Modal (Option 2) === */
.wm-modal-open { overflow: hidden; }

.wm-match-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,.60);
  display: grid;
  place-items: center;
  padding: 16px;
}

.wm-match-modal{
  width: min(900px, 100%);
  max-height: min(82vh, 820px);
  overflow: hidden;
  border-radius: 22px;
  background: rgba(10,14,26,.92);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 22px 70px rgba(0,0,0,.60);
  backdrop-filter: blur(18px);
}

.wm-match-modal-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}

.wm-match-modal-title{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
}

.wm-match-modal-x{
  background: transparent;
  border: 0;
  color: rgba(226,232,240,.80);
  font-size: 20px;
  padding: 6px 10px;
  border-radius: 12px;
}

.wm-match-modal-body{
  padding: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Make cloned card look native inside modal */
.wm-modal-card{
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* In modal: always show expanded details even if your global CSS collapses */
.wm-match-modal .wm-match-expanded{
  display: block !important;
}

/* Mobile sizing */
@media (max-width: 600px){
  .wm-match-modal{ border-radius: 18px; }
  .wm-match-modal-body{ padding: 12px; }
}

/* Premium button + modal + preview banner */
.wm-upgrade-btn{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2500;
  border: 1px solid rgba(148,163,184,.20);
  background: rgba(2,6,23,.65);
  color: rgba(226,232,240,.95);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  backdrop-filter: blur(14px);
}

.wm-preview-banner{
  margin: 10px 14px 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(10,14,26,.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wm-preview-text{ font-size: 13px; opacity: .92; }
.wm-preview-cta{
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(120,140,255,.22);
  color: rgba(240,244,255,.98);
  white-space: nowrap;
}

.wm-premium-modal{
  position: fixed; inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.wm-premium-card{
  width: min(520px, 100%);
  background: rgba(10,14,26,.92);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

.wm-premium-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.wm-premium-title{ font-size: 18px; font-weight: 800; }
.wm-premium-x{ background: transparent; border: 0; color: rgba(226,232,240,.8); font-size: 20px; }
.wm-premium-sub{ opacity:.8; margin: 10px 0 12px; }
.wm-premium-input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.55);
  color: rgba(226,232,240,.95);
  outline: none;
}
.wm-premium-cta{
  margin-top: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 0;
  background: rgba(120,140,255,.22);
  color: rgba(240,244,255,.98);
}
.wm-premium-msg{ margin-top: 10px; min-height: 18px; opacity: .9; }
.wm-premium-logout{ margin-top: 10px; width:100%; background:transparent; border:1px solid rgba(148,163,184,.18); color:rgba(226,232,240,.8); padding:10px; border-radius: 14px; }
