/*
  AceLM service pages (dealer, chips, lounge, draw, ante, showdown, login,
  access denied, and the holding page). Same identity as acelm.ai: paper,
  ink, ruled grid, felt green. The class names are unchanged so the page
  markup and vest_service.js routing need no change.
*/
@font-face { font-family: "AceLM Serif"; src: url("/fonts/source-serif-display-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AceLM Serif"; src: url("/fonts/source-serif-display-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "AceLM Sans"; src: url("/fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AceLM Sans"; src: url("/fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "AceLM Sans"; src: url("/fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "AceLM Mono"; src: url("/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AceLM Mono"; src: url("/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f5f1e8; --paper-2: #ece6d8; --card: #fbf8f1;
  --ink: #16191d; --ink-2: #3a3f45; --ink-3: #5d636a;
  --rule: #cfc6b2; --rule-strong: #a99f88;
  --felt: #1e5a46; --felt-deep: #143f31; --felt-tint: #dce8df;
  --vermilion: #b43a1e; --vermilion-tint: #f3ddd3;
  --ochre: #8a5a10; --ochre-tint: #f1e5c9;
  --font-serif: "AceLM Serif", Georgia, serif;
  --font-sans: "AceLM Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "AceLM Mono", ui-monospace, Menlo, Consolas, monospace;

  /* legacy variable names used by inline styles in some pages */
  --bg-primary: var(--paper); --bg-secondary: var(--card); --bg-tertiary: var(--paper-2); --bg-card: var(--card);
  --border-color: var(--rule); --border-focus: var(--felt);
  --text-primary: var(--ink); --text-secondary: var(--ink-2); --text-muted: var(--ink-3);
  --accent-cyan: var(--felt); --accent-emerald: var(--felt); --accent-gold: var(--ochre); --accent-rose: var(--vermilion);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  background-image:
    linear-gradient(to right, rgba(22, 25, 29, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22, 25, 29, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--felt); }
:focus-visible { outline: 2px solid var(--vermilion); outline-offset: 3px; }
img { max-width: 100%; }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--paper-2); padding: 0.05em 0.3em; border-radius: 2px; }

/* Top bar */
.subsystem-top-bar {
  background: rgba(245, 241, 232, 0.95);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.9rem;
  position: sticky; top: 0; z-index: 10;
}
.top-bar-left { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.return-main-link { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink); text-decoration: none; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; }
.return-main-link:hover { color: var(--felt); }
.brand-card-mini {
  display: inline-grid; place-items: center; width: 18px; height: 24px;
  border: 1.4px solid var(--ink); border-radius: 2px; background: var(--card);
  color: var(--felt); font-size: 0.75rem; line-height: 1;
}
.sub-divider { color: var(--ink-3); }
.sub-current-badge { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2); overflow-wrap: anywhere; }
.top-bar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
.ecosystem-link { color: var(--ink-2); text-decoration: none; font-size: 0.88rem; }
.ecosystem-link:hover { color: var(--felt); text-decoration: underline; }
.ecosystem-link.highlight { color: var(--felt); font-weight: 600; }
.user-session-pill { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--rule-strong); padding: 0.2rem 0.6rem; border-radius: 2px; font-size: 0.82rem; }
.user-avatar-mini { width: 20px; height: 20px; border-radius: 50%; background: var(--felt-tint); color: var(--felt-deep); display: inline-grid; place-items: center; font-family: var(--font-mono); font-size: 0.7rem; }
.user-name-label { color: var(--ink-2); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-link-mini { color: var(--vermilion); text-decoration: none; font-size: 0.82rem; }
.logout-link-mini:hover { text-decoration: underline; }

/* Stage and card */
.subsystem-stage { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem); }
.subsystem-table-card {
  width: 100%; max-width: 760px; position: relative;
  background: var(--card); border: 1px solid var(--ink); border-radius: 8px;
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 5vw, 3.25rem);
  box-shadow: 0 12px 0 -8px var(--paper-2), 0 20px 40px -30px rgba(22, 25, 29, 0.4);
}
.card-pip { position: absolute; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.05; text-align: center; color: var(--ink); }
.pip-top-left { top: 0.9rem; left: 1rem; }
.pip-bottom-right { bottom: 0.9rem; right: 1rem; transform: rotate(180deg); }
.pip-rose { color: var(--vermilion); }
.pip-emerald { color: var(--felt); }
.pip-gold { color: var(--ochre); }
.subsystem-emblem-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.subsystem-emblem-img { width: 72px; height: auto; }
.subsystem-heading { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.015em; line-height: 1.1; text-align: center; }
.subsystem-host-badge { display: block; text-align: center; font-family: var(--font-mono); font-size: 0.82rem; color: var(--felt); margin: 0.6rem 0 1.4rem; overflow-wrap: anywhere; }
.subsystem-summary { font-size: 1.1rem; color: var(--ink-2); text-align: center; max-width: 52ch; margin: 0 auto 1.75rem; }

/* Notices */
.notice-box { border-left: 3px solid var(--felt); background: #fff; border-top: 1px solid var(--rule); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1rem 1.15rem; margin: 1.25rem 0; text-align: left; }
.notice-box.warning { border-left-color: var(--ochre); }
.notice-box.auth { border-left-color: var(--felt); }
.notice-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.98rem; margin-bottom: 0.4rem; color: var(--ink); }
.notice-title svg { flex: none; }
.notice-title.warning { color: var(--ochre); }
.notice-title.auth { color: var(--felt); }
.notice-text { font-size: 0.96rem; color: var(--ink-2); }
.notice-text strong { color: var(--ink); }

/* Pills */
.status-pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 1.25rem 0; }
.sub-pill { font-family: var(--font-mono); font-size: 0.76rem; padding: 0.2rem 0.55rem; border: 1px solid var(--rule-strong); border-radius: 2px; color: var(--ink-2); background: #fff; }
.sub-pill.active { color: var(--felt); border-color: var(--felt); }
.sub-pill.gold { color: var(--ochre); border-color: var(--ochre); }

/* Buttons */
.action-buttons-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.75rem; }
.btn-suit, .btn-cyan, .btn-emerald, .btn-outline, .vest-btn-secondary, .oauth-btn, .vest-oauth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans); font-weight: 500; font-size: 0.98rem;
  padding: 0.7rem 1.1rem; border-radius: 3px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  transition: background 150ms ease, color 150ms ease;
}
.btn-cyan, .btn-emerald, .oauth-btn, .vest-oauth-btn { background: var(--ink); color: var(--paper); }
.btn-cyan:hover, .btn-emerald:hover, .oauth-btn:hover, .vest-oauth-btn:hover { background: var(--felt-deep); border-color: var(--felt-deep); color: var(--paper); }
.btn-outline:hover, .vest-btn-secondary:hover { background: var(--paper-2); }
.btn-provider-pretend { opacity: 0.6; cursor: not-allowed; }
.pretend-badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ochre); }

/* Dashboard panels (signed-in pages) */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; margin-top: 1.75rem; text-align: left; }
.dash-panel { background: #fff; border: 1px solid var(--rule); padding: 1rem; }
.dash-panel-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.dash-panel-value { font-family: var(--font-serif); font-size: 1.5rem; color: var(--ink); margin: 0.25rem 0; overflow-wrap: anywhere; }
.dash-panel-sub { font-size: 0.88rem; color: var(--ink-2); }
.sha-hash, .binary-name { font-family: var(--font-mono); font-size: 0.84rem; overflow-wrap: anywhere; }

/* Footer */
.subsystem-footer { border-top: 1px solid var(--rule); padding: 1.25rem clamp(1rem, 4vw, 2rem); text-align: center; font-size: 0.85rem; color: var(--ink-3); background: var(--paper-2); }
.subsystem-footer a { color: var(--ink-2); }

/* Tables used by portal pages */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rule); font-size: 0.92rem; }
th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

@media (max-width: 600px) {
  .subsystem-top-bar { flex-direction: column; align-items: flex-start; }
  .card-pip { display: none; }
  .action-buttons-group > * { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Review 06: the same card mark as acelm.ai (scripts/site_layout.py MARK) */
.brand-mark-mini { width: 17px; height: 23px; flex: none; }

/* Dealer: the dealer button instead of a card corner index */
.pip-dealer .dealer-button { display: inline-grid; place-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 1.5px solid var(--ink); box-shadow: inset 0 0 0 3px #fbf8f1, inset 0 0 0 4px #1e5a46; background: #fbf8f1;
  font-family: var(--font-serif); font-weight: 600; font-size: 0.95rem; line-height: 1; color: var(--ink); }

/* Card suits: the owner's shapes (public/imgs/suits/), inline SVG in the text colour. */
.suit-icon { display: inline-block; width: 0.62em; height: 0.62em; vertical-align: -0.02em; fill: currentColor; }
.card-pip .suit-icon { display: block; margin: 0.1em auto 0; }

/* Card corners: real card images from the green deck (public/imgs/cards/green/); Dealer shows the dealer icon. */
.card-pip .pip-card { display: block; width: 2.4rem; height: auto; border-radius: 3px; box-shadow: 0 6px 12px -10px rgba(22, 25, 29, 0.45); }
.card-pip .pip-dealer-icon { width: 2.4rem; box-shadow: none; }

/* Access denied: the signed-in address, so people can see which account was refused. */
.denied-email { display: inline-block; margin: 0 0 1.25rem; padding: 0.35rem 0.75rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff;
  font-family: var(--font-mono); font-size: 0.88rem; color: var(--ink); overflow-wrap: anywhere; }

/* Request early access (server/pages/request-access.html, filled in by vest_service.js) */
.request-card { max-width: 640px; text-align: left; }
.request-card .subsystem-heading, .request-card .subsystem-summary { text-align: left; }
.request-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.request-form label { display: grid; gap: 0.35rem; font-weight: 500; color: var(--ink); font-size: 0.95rem; }
.request-form .hint, .request-form .opt { font-weight: 400; color: var(--ink-3); font-size: 0.85rem; }
.request-form .opt { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.request-form input, .request-form textarea { font: inherit; font-weight: 400; padding: 0.6rem 0.75rem; border: 1px solid var(--rule-strong, #a99f88); border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
.request-form textarea { resize: vertical; min-height: 4.5rem; }
.request-form input:focus-visible, .request-form textarea:focus-visible { outline: 2px solid var(--felt); outline-offset: 1px; }
.request-form button.btn-suit { cursor: pointer; border: 0; font: inherit; }
.request-errors { margin: 0; padding-left: 1.1rem; }
.request-fine { font-size: 0.85rem; color: var(--ink-3); margin: 0.75rem 0 0; }
