:root {
  --ink: #172126;
  --muted: #66747c;
  --line: #cfd9de;
  --panel: #ffffff;
  --bg: #f3f8f6;
  --green: #187a4d;
  --green-soft: #d9f0df;
  --gold: #b8860b;
  --gold-soft: #fff0b8;
  --orange: #c95d1c;
  --orange-soft: #ffe1c7;
  --red: #b63a3a;
  --red-soft: #f7cccc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 24px;
  background: #102820;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 4px;
  color: #cbe9d3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 28px;
}

h2 {
  font-size: 17px;
  margin-bottom: 10px;
}

.subtitle {
  margin-bottom: 0;
  color: #d9efe1;
}

.nav-link,
.footer-note a {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.app-header .nav-link {
  color: #d9efe1;
}

.nav-link:hover,
.footer-note a:hover {
  text-decoration: underline;
}

.footer-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

main {
  padding: 18px 24px 32px;
}

.profile-switcher {
  min-width: 220px;
}

label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  background: #52616a;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(220px, 330px) 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.game-form {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr repeat(3, 0.6fr) 1fr auto;
  gap: 10px;
  align-items: end;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}

.metric-card b {
  display: block;
  font-size: 20px;
}

.metric-card span {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-title-row input {
  max-width: 260px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #e7f0ec;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr.hero-row {
  cursor: pointer;
}

tr.hero-row:hover td {
  background: #f4fbf7;
}

.status-elite td,
.status-elite.card {
  background: var(--green-soft);
}

.status-good td,
.status-good.card {
  background: #e5f3cf;
}

.status-potential td,
.status-potential.card {
  background: var(--gold-soft);
}

.status-mixed td,
.status-mixed.card {
  background: var(--orange-soft);
}

.status-weak td,
.status-weak.card {
  background: var(--red-soft);
}

.advice-list,
.friend-cards {
  display: grid;
  gap: 8px;
}

.card {
  border: 1px solid var(--line);
  border-left: 7px solid var(--green);
  padding: 10px;
  background: #fff;
}

.card b {
  display: block;
  margin-bottom: 2px;
}

.muted,
.hero-detail.empty {
  color: var(--muted);
}

.hero-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.roadmap {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 1200px) {
  .hero-panel,
  .dashboard-grid,
  .game-form {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-header {
    display: grid;
  }

  main {
    padding: 12px;
  }

  .metrics-grid,
  .hero-detail-grid {
    grid-template-columns: 1fr;
  }
}
