:root {
  --bg: #130d07;
  --panel: rgba(255, 248, 231, .94);
  --ink: #1f160d;
  --muted: #6c5b45;
  --gold: #f7b733;
  --green: #23884f;
  --orange: #f36f21;
  --line: rgba(73, 50, 24, .16);
  --shadow: 0 22px 70px rgba(0, 0, 0, .28);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(247, 183, 51, .34), transparent 32rem),
    radial-gradient(circle at top right, rgba(35, 136, 79, .28), transparent 30rem),
    linear-gradient(135deg, #140d07 0%, #281706 58%, #0f190f 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.global-home-button {
  position: fixed;
  left: calc(10px + env(safe-area-inset-left));
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 9999;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 999px;
  border: 2px solid rgba(33, 60, 36, .35);
  background: rgba(255, 250, 240, .94);
  color: #172016;
  text-decoration: none;
  font: 800 14px/1 system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.sats-app {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

.sats-header,
.room-card,
.panel {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sats-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px;
  color: var(--ink);
}

.sats-header h1,
.room-card h2,
.panel h2,
.panel h3 { margin: .1rem 0 .35rem; }
.sats-header p,
.room-card p,
.panel p { color: var(--muted); margin: 0; line-height: 1.45; }

.header-actions,
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }

.room-card {
  margin: 18px 0;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.room-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.room-stats span,
.score-card,
.wallet-grid > div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .62);
  padding: 14px;
}

.game-grid {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 18px;
  align-items: start;
}

.panel { padding: 20px; }

.profile-row,
.match-top {
  display: flex;
  gap: 14px;
  align-items: center;
}

.avatar,
.match-avatar {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-weight: 1000;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--green));
}

.wallet-grid,
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.wallet-grid span,
.score-card span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.wallet-grid b,
.score-card b {
  display: inline-block;
  margin-top: 4px;
  font-size: 2rem;
}

.wallet-grid small { margin-left: 4px; color: var(--muted); }

.seller-card,
.trade-offer {
  border: 2px solid rgba(247, 183, 51, .45);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 246, 208, .9), rgba(255, 255, 255, .65));
  padding: 16px;
  margin: 16px 0;
}

.seller-card label { display: grid; gap: 8px; margin-top: 12px; font-weight: 800; color: var(--muted); }
.seller-card input { width: 100%; }

.need-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.need {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(35, 136, 79, .12);
  border: 1px solid rgba(35, 136, 79, .25);
  font-weight: 800;
}
.need.met { background: rgba(247, 183, 51, .26); text-decoration: line-through; }

.match-panel { min-height: 430px; }
.trade-offer h3 { font-size: clamp(2rem, 5vw, 4rem); line-height: .95; }
.price {
  margin-top: 16px;
  display: inline-flex;
  gap: 7px;
  align-items: baseline;
  border-radius: 18px;
  padding: 12px 16px;
  background: #111;
  color: #fff;
  font-weight: 1000;
}
.price b { font-size: 2.5rem; color: var(--gold); }
.feedback { margin-top: 16px !important; font-weight: 800; }

.ledger {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}
.receipt {
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, .68);
}
.receipt.skip { border-left-color: #999; }
.receipt.cold { border-left-color: var(--gold); }
.receipt strong { display: block; }
.receipt small { color: var(--muted); }

.debrief { margin-top: 20px; }
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .sats-header,
  .room-card,
  .game-grid,
  .prompt-grid { grid-template-columns: 1fr; }
  .wallet-grid,
  .score-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .sats-app { width: min(100% - 18px, 1180px); padding-top: 10px; }
  .wallet-grid,
  .score-grid { grid-template-columns: 1fr; }
  .trade-offer h3 { font-size: 2.2rem; }
}

.wallet-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.wallet-tab {
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 22px;
  background: rgba(255, 248, 231, .9);
  color: var(--ink);
  padding: 15px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .2);
  cursor: pointer;
}

.wallet-tab span,
.price-adjust {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wallet-tab b {
  display: block;
  margin: 4px 0;
  font-size: 1.08rem;
}

.wallet-tab small { color: var(--muted); }
.wallet-tab.active { outline: 3px solid rgba(247, 183, 51, .82); background: #fff7d8; }

.seller-card.compact h3 { font-size: 1.35rem; }

.price-adjust {
  margin-top: 16px;
  text-transform: none;
  letter-spacing: 0;
}

.price-adjust input { width: 100%; margin-top: 8px; }

.confirm-box {
  margin: 16px 0;
  padding: 16px;
  border-radius: 20px;
  border: 2px solid rgba(247, 183, 51, .72);
  background: #fff7d8;
}

.confirm-box h3 { margin-top: 0; }

@media (max-width: 980px) {
  .wallet-switcher { grid-template-columns: 1fr; }
}

.story-grid,.bridge-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:0 0 18px}.story-card h3{margin-top:.2rem}.story-card p{line-height:1.5}@media (max-width: 980px){.story-grid,.bridge-grid{grid-template-columns:1fr}}
