/* Market Simulation Studio, shared base styles */

* { box-sizing: border-box; }

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #dfe5ec;
  --text: #1c2733;
  --muted: #5b6b7c;
  --accent: #2456c8;
  --accent-dark: #1a3f96;
  --danger: #c0392b;
  --good: #0a7a4b;
  --bad: #b3261e;
  /* block type colours, used in builder badges and player screens */
  --c-event: #d97706;
  --c-information: #0284c7;
  --c-decision: #7c3aed;
  --c-consequence: #059669;
  --c-writing: #be185d;
  --c-result: #334155;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 30, 54, 0.08);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
p { margin: 0.25rem 0 0.75rem; }

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--accent);
}
.btn.ghost:hover { background: rgba(36, 86, 200, 0.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #96281b; }
.btn.small { padding: 0.25rem 0.7rem; font-size: 0.85rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

input[type="text"], input[type="number"], textarea, select {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(36, 86, 200, 0.35);
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 4rem; }
label { font-size: 0.85rem; font-weight: 600; color: var(--muted); display: block; margin: 0.6rem 0 0.2rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
}
.badge.event { background: var(--c-event); }
.badge.information { background: var(--c-information); }
.badge.decision { background: var(--c-decision); }
.badge.consequence { background: var(--c-consequence); }
.badge.writing { background: var(--c-writing); }
.badge.result { background: var(--c-result); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* metric chips shown to students and in tables */
.metric-chip {
  display: inline-block;
  background: #eef2f8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
  margin: 0 0.35rem 0.35rem 0;
  font-size: 0.9rem;
}
.metric-chip b { font-variant-numeric: tabular-nums; }

.change-chip {
  display: inline-block;
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
  margin: 0 0.35rem 0.35rem 0;
  font-size: 0.9rem;
  font-weight: 600;
}
.change-chip.up { background: #e2f4ea; color: var(--good); }
.change-chip.down { background: #fbe9e7; color: var(--bad); }
.change-chip.flat { background: #eef2f8; color: var(--muted); }
