:root {
  --page: #f6f5ef;
  --surface: #ffffff;
  --ink: #17221b;
  --muted: #667064;
  --line: #ddd8ca;
  --green: #2f6f3a;
  --green-strong: #1f5a2c;
  --yellow: #c79523;
  --orange: #c46a21;
  --red: #b83a31;
  --gray: #73786f;
  --shadow: 0 18px 55px rgba(36, 45, 35, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(246, 245, 239, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  letter-spacing: 1px;
  transform: rotate(90deg);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #2c352e;
  font-weight: 650;
}

.topnav a {
  padding: 10px 12px;
  border-radius: 8px;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  background: #e7ecdf;
}

.selector-app {
  display: grid;
  gap: 18px;
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 2vw, 28px);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 62px);
  line-height: 1;
}

h2 {
  font-size: clamp(22px, 2vw, 32px);
  line-height: 1.08;
}

.score-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 560px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.score-key span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(520px, 1fr) minmax(280px, 390px);
  gap: 16px;
  align-items: stretch;
}

.tech-panel,
.result-panel,
.zone-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tech-panel,
.result-panel {
  padding: 16px;
}

.panel-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tech-list {
  display: grid;
  gap: 8px;
}

.tech-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  text-align: left;
  background: #f8f7f1;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.tech-button:hover {
  border-color: #b9c8ae;
}

.tech-button[aria-pressed="true"] {
  background: #e5efdb;
  border-color: #90ac7d;
}

.tech-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.18;
}

.tech-average {
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.map-stage {
  min-width: 0;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 460px;
  aspect-ratio: 1186 / 811;
  background: #d9ddcf;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zone-layer {
  position: absolute;
  inset: 0;
}

.zone-marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  min-width: 132px;
  max-width: 178px;
  transform: translate(-50%, -50%);
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid currentColor;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 24, 17, 0.22);
  cursor: pointer;
}

.zone-marker:hover,
.zone-marker.is-active {
  z-index: 3;
  background: #fff;
  transform: translate(-50%, -50%) scale(1.04);
}

.zone-marker[data-status="good"] {
  color: var(--green);
}

.zone-marker[data-status="ok"] {
  color: var(--yellow);
}

.zone-marker[data-status="hard"] {
  color: var(--orange);
}

.zone-marker[data-status="bad"] {
  color: var(--red);
}

.zone-marker[data-status="no"] {
  color: var(--gray);
}

.zone-label {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.12;
}

.zone-stars {
  display: block;
  margin-top: 4px;
  color: currentColor;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.result-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.selected-tech p,
.zone-detail p,
.bundle p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.overall-score {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--green-strong);
  font-size: 22px;
  font-weight: 900;
}

.score-number {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.zone-detail {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.zone-detail h3,
.bundle h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--green-strong);
  font-size: 19px;
  font-weight: 900;
}

.detail-score[data-status="ok"] {
  color: var(--yellow);
}

.detail-score[data-status="hard"] {
  color: var(--orange);
}

.detail-score[data-status="bad"] {
  color: var(--red);
}

.detail-score[data-status="no"] {
  color: var(--gray);
}

.icon-list,
.bundle-list,
.rank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  background: #f3f1e8;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #273229;
  font-size: 13px;
  font-weight: 750;
}

.warning {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff1dc;
  border: 1px solid #e2b469;
  border-radius: 8px;
  color: #5b3513;
  font-size: 14px;
  line-height: 1.4;
}

.zone-table {
  padding: 16px;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.zone-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 12px;
  background: #faf9f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.zone-card.is-active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.zone-card strong {
  font-size: 15px;
  line-height: 1.15;
}

.zone-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.zone-card .zone-stars {
  margin-top: 0;
}

.loading,
.error {
  min-height: 240px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 1220px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .result-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 820px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow: visible;
  }

  .toolbar {
    align-items: start;
    flex-direction: column;
  }

  .score-key {
    justify-content: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

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

  .map-wrap {
    min-height: 360px;
  }

  .zone-marker {
    min-width: 112px;
    max-width: 134px;
    padding: 7px 8px;
  }

  .zone-label {
    font-size: 12px;
  }

  .zone-stars {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .selector-app {
    padding: 12px;
  }

  .tech-list,
  .zone-grid {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    min-height: 300px;
  }

  .zone-marker {
    min-width: 98px;
    max-width: 116px;
  }

  .zone-marker:nth-child(2n) {
    display: none;
  }
}
