/* Nardi premium app tokens.
   Dark obsidian shell, restrained brass accents, board materials reserved for game surfaces. */

:root {
  --obsidian: #0B1712;
  --graphite: #11171B;
  --charcoal: #171A1D;
  --slate: #101D18;
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(239, 202, 120, 0.18);

  --walnut-dark: #29170d;
  --walnut: #4b2d1a;
  --walnut-light: #68442a;
  --smoked-oak: #5b3a24;
  --leather-deep: #372215;
  --felt-deep: #07100D;
  --felt: #102619;

  --point-ivory: #cdb490;
  --point-ivory-2: #a58b67;
  --point-onyx: #2c2118;
  --point-onyx-2: #16100b;
  --point-divider: rgba(0, 0, 0, 0.35);

  --checker-ivory: #ebdeca;
  --checker-ivory-hi: #fff5e2;
  --checker-ivory-lo: #ab956f;
  --checker-onyx: #161311;
  --checker-onyx-hi: #433b35;
  --checker-onyx-lo: #050505;

  --brass: #d6a84e;
  --brass-hi: #f0d27a;
  --brass-lo: #9a6b2f;
  --emerald: #62b488;
  --ruby: #b85b54;
  --warn: #d6a84e;
  --coin: #e7bf62;

  --text-primary: #f4efe7;
  --text-secondary: #b8b0a4;
  --text-muted: #7e817d;
  --text-on-brass: #17120a;

  --surface-0: #0f1418;
  --surface-1: #11171b;
  --surface-2: #171a1d;
  --surface-3: #101d18;
  --surface-glow: rgba(214, 168, 78, 0.08);
  --surface-glow-strong: rgba(214, 168, 78, 0.16);
  --panel-edge: rgba(220, 176, 88, 0.16);
  --panel-edge-strong: rgba(239, 202, 120, 0.45);
  --panel-shadow: 0 18px 44px -28px rgba(0, 0, 0, 0.92);
  --gradient-app-background: radial-gradient(circle at 50% 0%, rgba(24, 86, 58, 0.28) 0%, transparent 38%), radial-gradient(circle at 20% 30%, rgba(18, 72, 48, 0.18) 0%, transparent 28%), linear-gradient(180deg, #091310 0%, #0B1713 45%, #07100D 100%);

  --win: #62b488;
  --loss: #c96a5a;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-raise: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 28px -20px rgba(0, 0, 0, 0.92);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 44px -28px rgba(0, 0, 0, 0.92);
  --shadow-deep: 0 28px 80px -34px rgba(0, 0, 0, 0.98);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  --ff-sans: "Geist", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  --ff-display: "Instrument Serif", "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --ff-numeric: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);

  --bottom-nav-height: 92px;
  --cta-dock-height: 106px;
  --app-max-width: 440px;

  --sa-top: env(safe-area-inset-top, 0px);
  --sa-right: env(safe-area-inset-right, 0px);
  --sa-bot: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --tg-safe-top: 0px;
  --tg-safe-right: 0px;
  --tg-safe-bottom: 0px;
  --tg-safe-left: 0px;
  --tg-content-safe-top: 0px;
  --tg-content-safe-right: 0px;
  --tg-content-safe-bottom: 0px;
  --tg-content-safe-left: 0px;
  --tg-header-reserve: 0px;
  --nardi-root-safe-top: max(var(--sa-top), var(--tg-safe-top), var(--tg-content-safe-top), var(--tg-header-reserve));
  --nardi-root-safe-right: max(var(--sa-right), var(--tg-safe-right), var(--tg-content-safe-right));
  --nardi-root-safe-bottom: max(var(--sa-bot), var(--tg-safe-bottom), var(--tg-content-safe-bottom));
  --nardi-root-safe-left: max(var(--sa-left), var(--tg-safe-left), var(--tg-content-safe-left));
  --nardi-root-page-top: calc(var(--nardi-root-safe-top) + 8px);
  --nardi-root-page-bottom: calc(var(--nardi-root-safe-bottom) + var(--bottom-nav-height) + var(--page-bottom-extra, 0px) + 12px);
  --nardi-root-toast-top: calc(var(--nardi-root-safe-top) + 88px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--obsidian);
  color: var(--text-primary);
  font-family: var(--ff-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "cv02";
  overscroll-behavior: none;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-height, 100dvh);
  background: var(--gradient-app-background);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

button {
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.t-display {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.018em;
}

.t-display-lg {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: 50px;
  line-height: 0.94;
  letter-spacing: -0.024em;
}

.t-h1 {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.014em;
}

.t-h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.012em;
}

.t-h3 {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.24;
  letter-spacing: -0.008em;
}

.t-body {
  font-size: 14.5px;
  line-height: 1.48;
  color: var(--text-primary);
  letter-spacing: -0.004em;
}

.t-body-sm {
  font-size: 13px;
  line-height: 1.44;
  color: var(--text-secondary);
  letter-spacing: -0.002em;
}

.t-caption {
  font-size: 11.5px;
  line-height: 1.34;
  color: var(--text-secondary);
}

.t-label {
  font-size: 10.5px;
  line-height: 1.28;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.085em;
  font-weight: 700;
}

.t-serif {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 400;
}

.t-numeric {
  font-family: var(--ff-numeric);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.row {
  display: flex;
  align-items: center;
}

.col {
  display: flex;
  flex-direction: column;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.grow {
  flex: 1 1 auto;
  min-width: 0;
}

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-frame {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  min-height: var(--app-height, 100dvh);
  margin: 0 auto;
  background: var(--gradient-app-background);
  overflow: hidden;
}

.page {
  padding-top: var(--nardi-root-page-top);
  padding-right: max(0px, var(--nardi-root-safe-right));
  padding-bottom: var(--nardi-root-page-bottom);
  padding-left: max(0px, var(--nardi-root-safe-left));
  min-height: 100dvh;
  min-height: var(--app-height, 100dvh);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.fixed-mobile-shell {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - var(--nardi-root-safe-left) - var(--nardi-root-safe-right)), var(--app-max-width));
  max-width: 100vw;
  z-index: 120;
  pointer-events: none;
}

.fixed-mobile-shell > * {
  pointer-events: auto;
}

.fixed-mobile-shell--nav {
  bottom: 0;
}

.fixed-mobile-shell--cta {
  bottom: var(--nardi-root-safe-bottom);
  z-index: 140;
}

.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.35 0'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.45'/></svg>");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}
