:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #69746f;
  --line: #d8ded7;
  --paper: #f5f4ee;
  --panel: #ffffff;
  --green: #136f4b;
  --lime: #c7df55;
  --red: #c84b40;
  --gold: #f4b44b;
  --blue: #245c9f;
  --shadow: 0 22px 60px rgba(24, 35, 31, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(19, 111, 75, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 92, 159, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 900;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16);
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

h3 {
  margin: 0;
  font-size: 18px;
}

.module-nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.nav-item span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e6ebe4;
  font-weight: 900;
}

.nav-item.active {
  border-color: rgba(19, 111, 75, 0.3);
  background: #eef6e6;
}

.nav-item.active span {
  background: var(--lime);
}

.nav-item.locked {
  cursor: not-allowed;
  opacity: 0.58;
}

.nav-item.locked strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item.locked b {
  font-size: 13px;
  line-height: 1;
}

.match-strip {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.match-strip p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.scoreline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scoreline span {
  font-size: 13px;
  font-weight: 700;
}

.scoreline strong {
  color: var(--green);
}

main {
  padding: 28px;
}

.hero-panel {
  min-height: 282px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 22px;
}

.stadium-visual {
  height: 282px;
  border: 1px solid #b8c9bd;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 100%, rgba(244, 180, 75, 0.2), transparent 36%),
    linear-gradient(180deg, #173b35 0%, #1c684b 58%, #14533b 100%);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.stadium-visual::before {
  content: "";
  position: absolute;
  inset: 18px 24px auto;
  height: 54px;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, #f0f2e9 0 14px, #c84b40 14px 28px, #245c9f 28px 42px);
  opacity: 0.82;
}

.pitch {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -36px;
  height: 178px;
  border: 3px solid rgba(255, 255, 255, 0.76);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.65) 49% 51%, transparent 51%),
    repeating-linear-gradient(90deg, #1d8a5d 0 42px, #1b7d56 42px 84px);
  transform: perspective(420px) rotateX(50deg);
  transform-origin: bottom;
}

.pitch::before {
  content: "";
  position: absolute;
  width: 96px;
  height: 96px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  left: 50%;
  top: 44px;
  transform: translateX(-50%);
}

.ball,
.player {
  position: absolute;
  border-radius: 50%;
}

.ball {
  width: 18px;
  height: 18px;
  left: 52%;
  top: 75px;
  background: #f9faf7;
  border: 3px solid #1b1f1d;
}

.player {
  width: 20px;
  height: 20px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
}

.p1 {
  left: 24%;
  top: 58px;
  background: var(--red);
}

.p2 {
  left: 39%;
  top: 108px;
  background: var(--gold);
}

.p3 {
  right: 28%;
  top: 45px;
  background: var(--blue);
}

.p4 {
  right: 16%;
  top: 104px;
  background: white;
}

.hero-copy {
  max-width: 660px;
}

.hero-copy p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 50px rgba(24, 35, 31, 0.08);
}

.module-panel {
  display: none;
  padding: 24px;
}

.module-panel.active {
  display: block;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd4cb;
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.primary-btn,
.ghost-btn,
.copy-btn {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 900;
}

.primary-btn {
  background: var(--green);
  color: white;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.ghost-btn,
.copy-btn {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}

.result-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.result-card {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.result-card.featured {
  background: #f0f7eb;
  border-color: rgba(19, 111, 75, 0.28);
}

.result-card.wide {
  grid-column: 1 / -1;
}

.result-card p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  border-radius: 8px;
  padding: 6px 9px;
  background: #edf0ec;
  font-size: 12px;
  font-weight: 900;
}

.quiz-list {
  display: grid;
  gap: 14px;
}

.fbti-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  color: var(--ink);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 12px;
}

.mode-card:hover,
.option-btn:hover {
  border-color: rgba(19, 111, 75, 0.45);
  background: #f5faef;
}

.mode-card strong {
  font-size: 24px;
  line-height: 1.15;
}

.mode-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mode-kicker {
  width: fit-content;
  border-radius: 8px;
  padding: 6px 9px;
  background: #eef6e6;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.fbti-quiz,
.fbti-result {
  display: grid;
  gap: 16px;
}

.quiz-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.progress-track {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 8px;
  background: #e6ebe4;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.single-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
}

.single-question h3 {
  margin-bottom: 18px;
  font-size: 24px;
  line-height: 1.35;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.option-btn span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #edf0ec;
  font-weight: 900;
}

.option-btn strong {
  line-height: 1.5;
}

.option-btn.selected {
  border-color: rgba(19, 111, 75, 0.5);
  background: #eef6e6;
}

.option-btn.selected span {
  background: var(--lime);
}

.quiz-actions {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.quiz-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.result-scroll-hint {
  justify-self: center;
  color: var(--red);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.fbti-result-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 330px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: white;
}

.result-switch {
  position: absolute;
  right: 18px;
  top: 18px;
}

.personality-poster {
  border: 1px solid #e4e8e1;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.personality-poster img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.personality-copy {
  padding-top: 36px;
}

.personality-copy h3 {
  margin: 0 0 12px;
  font-size: 32px;
}

.personality-copy h3 span {
  color: var(--green);
}

.personality-copy > p {
  color: var(--muted);
  line-height: 1.75;
}

.advice-box {
  border-radius: 8px;
  padding: 14px;
  margin: 16px 0;
  background: #f4f7ed;
  border: 1px solid #d8e5bb;
}

.advice-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.subtype-hint {
  font-size: 13px;
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quiz-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: white;
}

.quiz-item p {
  margin: 0 0 12px;
  font-weight: 900;
}

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

.segmented label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.segmented input {
  width: 16px;
  min-height: 16px;
}

.chat-sim {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.bubble {
  max-width: min(760px, 92%);
  border-radius: 8px;
  padding: 13px 14px;
  line-height: 1.6;
  box-shadow: 0 10px 28px rgba(24, 35, 31, 0.08);
}

.bubble.opponent {
  background: #fff3ef;
  border: 1px solid #efd0c8;
}

.bubble.you {
  justify-self: end;
  background: #ecf6ff;
  border: 1px solid #c7daef;
}

.bubble.coach {
  max-width: 100%;
  background: #f4f7ed;
  border: 1px solid #d8e5bb;
}

.copy-btn {
  margin-top: 12px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .match-strip {
    display: none;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .stadium-visual {
    min-height: 230px;
  }
}

@media (max-width: 680px) {
  main,
  .sidebar,
  .module-panel {
    padding: 18px;
  }

  .module-nav,
  .form-grid,
  .result-layout,
  .segmented,
  .fbti-intro,
  .fbti-result-card {
    grid-template-columns: 1fr;
  }

  .result-switch {
    position: static;
    justify-self: start;
  }

  .personality-copy {
    padding-top: 0;
  }

  .quiz-actions {
    grid-template-columns: 1fr;
  }

  .result-scroll-hint {
    order: 3;
  }

  .panel-head {
    display: grid;
  }

  h2 {
    font-size: 23px;
  }
}
