/* CORNER MERCHANT — main stylesheet
 * Dark theme · monospace accents · modern type stack
 * Brand: street + math, bold but not flashy
 */

:root {
  --bg-0: #0a0a0b;
  --bg-1: #131316;
  --bg-2: #1c1c22;
  --bg-3: #26262e;
  --line: #2e2e38;
  --text-0: #f4f4f6;
  --text-1: #c8c8d0;
  --text-2: #8b8b96;
  --accent: #d4af37;        /* gold — Merchant's mark */
  --accent-2: #2dd4bf;      /* teal — chip color */
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 4px;
  --max-w: 1280px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', Menlo, Monaco, 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

button, .btn {
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
button:hover, .btn:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
}

input, select, textarea {
  background: var(--bg-1);
  color: var(--text-0);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
}

/* ─── LAYOUT ─────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

header.site-header {
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
header.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.logo span { color: var(--text-0); }
nav.main-nav {
  display: flex;
  gap: 24px;
}
nav.main-nav a {
  color: var(--text-1);
  font-size: 14px;
}
nav.main-nav a:hover { color: var(--accent); text-decoration: none; }
nav.main-nav a.active { color: var(--accent); }

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.chip-balance {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-weight: bold;
}

/* ─── HERO ───────────────────────────────────────────────────── */

.hero {
  padding: 80px 0 60px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--accent); }
.hero .tagline {
  font-size: 20px;
  color: var(--text-1);
  max-width: 700px;
  margin: 0 auto 32px;
}
.hero .cta-row {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.hero .cta-row .btn { padding: 12px 24px; font-size: 16px; }

/* ─── TRAINER GRID ───────────────────────────────────────────── */

.section-title {
  font-size: 28px;
  margin: 60px 0 8px;
  letter-spacing: -0.5px;
}
.section-subtitle {
  color: var(--text-2);
  font-size: 15px;
  margin-bottom: 32px;
}

.trainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.trainer-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.trainer-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.trainer-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.trainer-card .name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.trainer-card .meta {
  color: var(--text-2);
  font-size: 12px;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.trainer-card .features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trainer-card .feature {
  background: var(--bg-3);
  color: var(--text-1);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
}
.trainer-card .floor-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 2px;
}
.trainer-card .floor-badge.house { background: var(--bg-3); color: var(--text-2); }
.trainer-card .floor-badge.street { background: var(--accent); color: var(--bg-0); }

/* ─── ROOM/LOBBY ─────────────────────────────────────────────── */

.lobby-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.room-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.room-card .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.room-card .room-name { font-weight: 600; }
.room-card .stake {
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 13px;
}
.room-card .row2 {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.room-card .seats {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.room-card .seat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.room-card .seat-dot.filled { background: var(--accent); border-color: var(--accent); }
.room-card .actions {
  display: flex;
  gap: 8px;
}
.room-card .actions button { flex: 1; }

/* ─── STORE ──────────────────────────────────────────────────── */

.store-section {
  margin-bottom: 48px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.product-card.featured {
  border-color: var(--accent);
  position: relative;
}
.product-card.featured::before {
  content: 'BEST VALUE';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-0);
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: bold;
}
.product-card .product-label {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 4px;
}
.product-card .product-amount {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent-2);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.product-card .product-price {
  font-size: 18px;
  color: var(--text-0);
  margin-bottom: 16px;
}
.product-card button {
  width: 100%;
}

/* ─── PRICING TIERS ──────────────────────────────────────────── */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}
@media (max-width: 768px) {
  .tier-grid { grid-template-columns: 1fr; }
}

.tier-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
}
.tier-card.featured {
  border-color: var(--accent);
  transform: scale(1.02);
}
.tier-card .tier-name {
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.tier-card .tier-price {
  font-size: 40px;
  font-weight: bold;
  margin-bottom: 4px;
}
.tier-card .tier-price small { font-size: 14px; color: var(--text-2); }
.tier-card ul {
  list-style: none;
  margin: 24px 0;
}
.tier-card ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-1);
}
.tier-card ul li::before { content: '✓ '; color: var(--accent-2); font-weight: bold; }

/* ─── PROFILE ────────────────────────────────────────────────── */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card .label {
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.stat-card .value {
  font-size: 24px;
  font-weight: bold;
  font-family: var(--font-mono);
}

/* ─── ROOM (in-game) ─────────────────────────────────────────── */

.game-table {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 480px;
}
.game-log {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 200px;
  overflow-y: auto;
  margin-top: 16px;
}
.game-log .entry { padding: 2px 0; }
.game-log .entry.system { color: var(--text-2); }
.game-log .entry.action { color: var(--accent-2); }
.game-log .entry.win { color: var(--success); }
.game-log .entry.error { color: var(--danger); }

/* ─── FOOTER ─────────────────────────────────────────────────── */

footer.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 80px;
  font-size: 12px;
  color: var(--text-2);
}
footer.site-footer .legal {
  max-width: 800px;
  margin: 16px 0 0;
  line-height: 1.6;
}

/* ─── UTILITIES ──────────────────────────────────────────────── */

.muted { color: var(--text-2); }
.accent { color: var(--accent); }
.success { color: var(--success); }
.danger { color: var(--danger); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.flex-row { display: flex; gap: 16px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 1000;
  animation: slidein 0.3s;
}
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }
@keyframes slidein {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
