/* MAISON — minimalist premium casino */

:root {
  --bg: #050505;
  --surface: #0d0d0d;
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.12);
  --text: #f4f4f4;
  --text-2: rgba(255,255,255,0.55);
  --text-3: rgba(255,255,255,0.32);
  --text-4: rgba(255,255,255,0.18);
  --accent: #ffffff;
  --win: #c8b88a;     /* subtle warm gold for wins */
  --loss: rgba(255,255,255,0.32);
  --red: #b8413a;
  --green: #2c6e3f;
  --pad: 24px;
  --font-sans: "Geist", "Söhne", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --font-serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: #1a1a1a;
  color: var(--text);
  font-feature-settings: "ss01", "tnum", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Phone container ─── */
/* Web wrapper — full viewport, centers .app horizontally */
.phone-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255,255,255,0.025), transparent 60%),
    #0a0a0a;
}

/* ─── Generic ─── */
.app {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* Desktop: hairline borders left/right of the content column */
@media (min-width: 481px) {
  .app {
    border-left: 1px solid var(--line-2);
    border-right: 1px solid var(--line-2);
  }
}

/* Mobile column kept narrow on every screen — "phone app on desktop" feel */

.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.serif { font-family: var(--font-serif); font-weight: 400; }

.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
  font-weight: 500;
}

.divider { height: 1px; background: var(--line); }

/* ─── Top bar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad) 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.topbar .brand { color: var(--text-2); font-weight: 500; }
.topbar .balance {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text);
  font-weight: 500;
  text-transform: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.topbar .icon-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  margin: -6px;
}
.topbar .icon-btn:active { color: var(--text); }

/* ─── Pressable ─── */
.press {
  cursor: pointer;
  transition: opacity 120ms ease, transform 120ms ease;
}
.press:active { opacity: 0.6; transform: scale(0.99); }

/* ─── Btn primary (sparing) ─── */
.btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  height: 52px;
  padding: 0 24px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  flex: 1;
  transition: background 120ms, border-color 120ms;
  font-feature-settings: "tnum";
}
.btn:hover { border-color: rgba(255,255,255,0.22); }
.btn:active { background: rgba(255,255,255,0.04); }
.btn[disabled] { opacity: 0.3; pointer-events: none; }
.btn.primary {
  background: var(--text);
  color: #050505;
  border-color: var(--text);
}
.btn.primary:active { background: rgba(255,255,255,0.85); }

/* ─── Chip selector ─── */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  cursor: pointer;
  transition: all 120ms;
  background: transparent;
}
.chip.active {
  background: var(--text);
  color: #050505;
  border-color: var(--text);
}
.chip:hover:not(.active) { color: var(--text); }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 320ms ease both; }

@keyframes flashWin {
  0% { color: var(--text); }
  35% { color: var(--win); }
  100% { color: var(--text); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ─── Number ticker (animated balance) ─── */
.ticker {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.ticker.up { color: var(--win); }
.ticker.down { color: var(--loss); }

/* ─── No scrollbars (clean) ─── */
.app *::-webkit-scrollbar { display: none; }
.app * { scrollbar-width: none; }

/* ─── Lobby specific ─── */
.lobby-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 200ms ease;
}
.lobby-row:hover { background: rgba(255,255,255,0.015); }
.lobby-row .num { color: var(--text-4); font-family: var(--font-mono); font-size: 9px; width: 36px; letter-spacing: 0.08em; }
.lobby-row .name {
  flex: 1;
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 400;
  font-family: var(--font-serif);
  font-style: italic;
}
.rules-link {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-transform: lowercase;
  letter-spacing: 0;
  font-weight: 400;
  transition: opacity 120ms;
}
.rules-link:active { opacity: 0.5; }
.lobby-row .pay { color: var(--text-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
.lobby-row .arrow { color: var(--text-3); margin-left: 12px; font-family: var(--font-mono); }

/* Locked lobby row */
.lobby-row.locked .name {
  color: var(--text-3);
}
.lobby-row.locked .num {
  color: rgba(255,255,255,0.10);
}
.lobby-row .lock-pay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.lobby-row .lock-pay .mono { font-size: 11px; }
.lobby-row.locked:hover .lock-pay {
  border-color: rgba(255,255,255,0.22);
  color: var(--text);
}

/* Unlock confirmation overlay (sheet) */
.unlock-sheet {
  position: absolute; inset: 0;
  z-index: 30;
  display: flex; flex-direction: column-reverse;
}
.unlock-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: -1;
}
.unlock-card {
  background: var(--bg);
  padding: 32px 28px 28px;
  border-top: 1px solid var(--line-2);
  animation: sheetUp 320ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Stage area for games */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Card (playing card) — flat, no gradients */
.pcard {
  background: #ece7d8;
  color: #0a0a0a;
  border-radius: 4px;
  width: 64px;
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  font-family: var(--font-serif);
  position: relative;
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
  transform-style: preserve-3d;
}
.pcard.face-down {
  background: #0a0a0a;
  color: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
}
.pcard.face-down::after {
  content: 'M';
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  color: rgba(255,255,255,0.22);
}
.pcard .rank { font-size: 20px; line-height: 1; font-weight: 500; font-style: italic; letter-spacing: -0.02em; }
.pcard .suit { font-size: 22px; line-height: 1; align-self: flex-end; }
.pcard.red { color: #b8413a; }
.pcard.held { box-shadow: 0 0 0 1.5px var(--text), 0 0 0 4px var(--bg); }

/* Daily bonus + ad */
.bonus-row {
  display: flex; align-items: stretch;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bonus-cell {
  flex: 1;
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer;
  transition: background 200ms;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
}
.bonus-cell + .bonus-cell { border-left: 1px solid var(--line); }
.bonus-cell:hover { background: rgba(255,255,255,0.02); }
.bonus-cell:disabled { cursor: default; opacity: 0.55; }
.bonus-cell:disabled:hover { background: transparent; }
.bonus-cell .bc-eye { font-size: 9px; color: var(--text-4); letter-spacing: 0.22em; text-transform: uppercase; }
.bonus-cell .bc-amt { font-family: var(--font-serif); font-style: italic; font-size: 18px; color: var(--text); margin-top: 2px; }
.bonus-cell .bc-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.bonus-cell .bc-icon { color: var(--text-2); flex-shrink: 0; margin-left: 8px; }

/* Settings / form rows */
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  background: transparent; border-left: none; border-right: none; border-top: none;
  width: 100%;
  font-family: var(--font-sans);
  text-align: left;
}
.set-row:hover { background: rgba(255,255,255,0.02); }
.set-row.danger { color: #d1786e; }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background 200ms;
}
.toggle.on { background: var(--text); border-color: var(--text); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), background 200ms;
}
.toggle.on::after { transform: translateX(16px); background: #050505; }

/* Login screen */
.login-bg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding: 48px 32px;
  overflow-y: auto;
}
.login-mark {
  font-family: var(--font-serif); font-style: italic;
  font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-3);
}
.login-title {
  font-family: var(--font-serif); font-style: italic;
  font-size: 56px; line-height: 0.95; color: var(--text);
  letter-spacing: -0.02em;
}
.login-sub {
  font-size: 13px; color: var(--text-3); line-height: 1.55;
}
.input {
  background: transparent; border: none;
  border-bottom: 1px solid var(--line-2);
  padding: 14px 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  outline: none;
  width: 100%;
  letter-spacing: 0.01em;
}
.input::placeholder { color: var(--text-4); }
.input:focus { border-bottom-color: var(--text); }

/* Kill Chrome's blue autofill background */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  border-bottom-color: var(--line-2) !important;
  transition: background-color 5000s ease-in-out 0s;
  background-clip: content-box !important;
}

/* ─── Login big-text "Enter" ─── */
.login-enter {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: flex-end;
  gap: 14px;
  align-self: flex-end;
  transition: color 240ms ease, opacity 200ms ease;
  font-weight: 400;
}
.login-enter:disabled {
  color: var(--text-4);
  cursor: not-allowed;
}
.login-enter:not(:disabled):active { opacity: 0.55; }
.login-enter .arrow {
  margin-bottom: 14px;
  opacity: 0.7;
}
.login-enter:disabled .arrow { opacity: 0.4; }

/* Char counter under name */
.input-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  margin-top: 6px;
  height: 14px;
}

/* ─── Ranking page ─── */
.rank-head {
  display: grid;
  grid-template-columns: 44px 1fr 92px;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-4);
}
.rank-row {
  display: grid;
  grid-template-columns: 44px 1fr 92px;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  position: relative;
}
.rank-row.you { background: rgba(255,255,255,0.03); }
.rank-row.you::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--text);
}
.rank-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.06em;
}
.rank-row.you .rank-num { color: var(--text); }
.rank-row.podium .rank-num { color: var(--text-2); }
.rank-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.rank-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.rank-chips {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 400;
}
.rank-row.you .rank-chips { color: var(--text); }
.rank-you-tag {
  color: var(--text-4);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-left: 8px;
  font-weight: 500;
}

/* Pencil edit (settings) */
.name-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pencil-btn {
  background: transparent;
  border: none;
  padding: 6px;
  margin: -6px;
  color: var(--text-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms ease;
}
.pencil-btn:hover { color: var(--text-2); }
.pencil-btn:active { color: var(--text); }

.name-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text);
  outline: none;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 2px 0 4px;
  width: 100%;
  caret-color: var(--text);
}
.name-input::placeholder { color: var(--text-4); }

.name-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.name-action {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  transition: all 160ms ease;
}
.name-action:hover:not(:disabled) { color: var(--text); border-color: var(--text); }
.name-action:disabled { opacity: 0.3; cursor: not-allowed; }
.name-action.confirm:not(:disabled):hover { background: var(--text); color: var(--bg); }
.checkbox {
  width: 18px; height: 18px; border-radius: 2px;
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 160ms;
  background: transparent;
}
.checkbox.on { background: var(--text); border-color: var(--text); }

/* History list */
.hist {
  position: absolute; inset: 0;
  background: var(--bg);
  z-index: 20;
  display: flex; flex-direction: column;
}
.hist-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.hist-row .game { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; }
.hist-row .delta { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hist-row .delta.win { color: var(--win); }
.hist-row .delta.loss { color: var(--text-3); }


/* ── Tip system ───────────────────────────────────────── */
.tip-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.tip-link:hover, .tip-link:active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* lobby tipped row */
.tipped-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.tipped-row:hover { border-color: var(--text-3); background: rgba(255,255,255,0.02); }
.tipped-cell { display: inline-flex; align-items: baseline; gap: 8px; }
.tc-eye {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-4);
}
.tc-num {
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.tipped-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
}

/* Tip sheet range */
.tip-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right,
    var(--accent) 0,
    var(--accent) var(--pct, 50%),
    var(--line) var(--pct, 50%),
    var(--line) 100%);
  outline: none;
  margin: 22px 0 14px;
}
.tip-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent);
}
.tip-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent);
}

.tip-card {
  /* mirror unlock-card sizing; minor accent treatment */
}
