/* ============================================================
   AK Poker — Apple-style theme overlay
   Loaded after the built CSS. Only overrides; no JS changes.
   ============================================================ */

:root {
  --ap-bg: #f5f5f7;
  --ap-surface: #ffffff;
  --ap-surface-2: #fbfbfd;
  --ap-text: #1d1d1f;
  --ap-text-2: #6e6e73;
  --ap-text-3: #a1a1a6;
  --ap-line: rgba(60, 60, 67, 0.12);
  --ap-accent: #0071e3;
  --ap-accent-soft: rgba(0, 113, 227, 0.1);
  --ap-green: #34c759;
  --ap-red: #ff3b30;
  --ap-radius: 16px;
  --ap-radius-sm: 12px;
  --ap-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --ap-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* react-vant theme tokens */
  --rv-primary-color: var(--ap-accent);
  --rv-link-color: var(--ap-accent);
  --rv-text-color: var(--ap-text);
  --rv-gray-1: #f5f5f7;
  --rv-gray-2: #ebebf0;
  --rv-gray-3: #d2d2d7;
  --rv-gray-7: #6e6e73;
  --rv-border-color: var(--ap-line);
  --rv-border-radius-max: var(--ap-radius-sm);
  --rv-cell-border-color: var(--ap-line);
  --rv-tabs-line-height: 2px;
}

/* ---------- Base ---------- */
html,
body {
  background: var(--ap-bg);
  color: var(--ap-text);
  font-family: var(--ap-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--ap-bg);
}

::selection {
  background: var(--ap-accent-soft);
}

/* ---------- Surfaces: cards & lists ---------- */
/* Lobby table cards (white blocks on grey) */
[class*="Card"],
[class*="card"],
[class*="Item"],
[class*="item"] {
  -webkit-backdrop-filter: none;
}

[class*="Card"],
[class*="card"] {
  border-radius: var(--ap-radius) !important;
}

/* ---------- Tabs (Hold'em / MTT / Casino) ---------- */
.van-tabs__nav {
  background: transparent !important;
}

.van-tab {
  color: var(--ap-text-2) !important;
  font-size: 15px !important;
  font-weight: 500;
  transition: color 0.2s ease;
}

.van-tab--active {
  color: var(--ap-text) !important;
  font-weight: 600;
}

.van-tabs__line {
  height: 3px !important;
  border-radius: 3px;
  background: var(--ap-accent) !important;
}

/* ---------- Buttons ---------- */
.van-button {
  border-radius: 980px !important; /* Apple pill */
  font-weight: 500;
  letter-spacing: 0;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.2s ease;
}

.van-button:active {
  transform: scale(0.97);
  opacity: 0.85;
}

.van-button--primary {
  background: var(--ap-accent) !important;
  border-color: var(--ap-accent) !important;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.van-button--default {
  background: var(--ap-surface) !important;
  color: var(--ap-text) !important;
  border: 0.5px solid var(--ap-line) !important;
}

/* ---------- Inputs ---------- */
.van-field,
.van-cell {
  background: transparent;
}

input,
textarea,
select {
  font-family: var(--ap-font);
}

.van-field__control {
  color: var(--ap-text) !important;
}

/* ---------- Dialogs / popups: frosted glass ---------- */
.van-popup,
.van-dialog {
  border-radius: 20px !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18) !important;
}

.van-popup--bottom {
  border-radius: 20px 20px 0 0 !important;
}

.van-dialog__header {
  font-weight: 600;
  font-size: 17px;
}

.van-dialog__message {
  color: var(--ap-text-2);
  font-size: 14px;
}

.van-dialog__footer .van-button,
.van-dialog__footer {
  border-radius: 0 !important;
}

.van-overlay {
  background: rgba(0, 0, 0, 0.3) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ---------- Toast ---------- */
.van-toast {
  border-radius: 14px !important;
  background: rgba(29, 29, 31, 0.82) !important;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  font-size: 14px;
}

/* ---------- Bottom tab bar: translucent blur ---------- */
.van-tabbar {
  background: rgba(255, 255, 255, 0.82) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--ap-line) !important;
}

.van-tabbar-item {
  color: var(--ap-text-3) !important;
  font-size: 11px;
}

.van-tabbar-item--active {
  color: var(--ap-accent) !important;
}

/* ---------- Nav bars ---------- */
.van-nav-bar {
  background: rgba(245, 245, 247, 0.85) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--ap-line);
}

.van-nav-bar__title {
  font-weight: 600;
  font-size: 17px;
  color: var(--ap-text);
}

/* ---------- Lists & cells ---------- */
.van-cell {
  font-size: 15px;
  color: var(--ap-text);
  padding: 14px 16px;
}

.van-cell::after {
  border-color: var(--ap-line);
}

/* ---------- Scrollbars (desktop) ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Motion: calm, not bouncy ---------- */
a,
button,
[role="button"] {
  transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

/* ---------- Dark mode: follow system ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ap-bg: #000000;
    --ap-surface: #1c1c1e;
    --ap-surface-2: #2c2c2e;
    --ap-text: #f5f5f7;
    --ap-text-2: #98989f;
    --ap-text-3: #636366;
    --ap-line: rgba(84, 84, 88, 0.45);
    --ap-accent-soft: rgba(10, 132, 255, 0.18);
    --rv-gray-1: #1c1c1e;
    --rv-gray-2: #2c2c2e;
    --rv-gray-3: #3a3a3c;
    --rv-gray-7: #98989f;
  }
  :root:not([data-theme="light"]) .van-button--primary {
    background: #0a84ff !important;
    border-color: #0a84ff !important;
  }
  :root:not([data-theme="light"]) .van-tabbar,
  :root:not([data-theme="light"]) .van-nav-bar {
    background: rgba(28, 28, 30, 0.82) !important;
  }
}
