:root {
  --bg-main: #030b1d;
  --bg-deep: #071327;
  --card: rgba(5, 14, 34, 0.92);
  --card-soft: rgba(14, 27, 54, 0.88);
  --line: rgba(109, 140, 199, 0.18);
  --text: #f3f7ff;
  --muted: #a9bad9;
  --blue: #7db2ff;
  --pill: #162747;
  --accent: #ffa35b;
  --accent-2: #2d5bff;
  --good: #3ddc97;
  --mid: #ffbd59;
  --low: #ff7a7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top center, rgba(255, 163, 91, 0.08), transparent 20%),
    radial-gradient(circle at left center, rgba(0, 90, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #021028 0%, #030916 100%);
}

body {
  min-height: 100vh;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 40px;
}

.page-header {
  padding: 28px 30px 30px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(2, 10, 28, 0.96), rgba(3, 11, 29, 0.92));
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4vw, 4.2rem);
  line-height: 1.04;
}

.subtitle {
  margin: 18px 0 0;
  max-width: 1100px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.status-panel {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(3, 11, 29, 0.96), rgba(5, 15, 36, 0.94));
  box-shadow: var(--shadow);
}

.status-panel > div {
  min-width: 0;
}

.status-label {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-panel strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--text);
  word-break: break-word;
}

.layout-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 380px;
  gap: 24px;
  align-items: start;
}

.main-column,
.side-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-panel,
.history-panel,
.shot-visual-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(3, 11, 29, 0.96), rgba(5, 15, 36, 0.94));
  box-shadow: var(--shadow);
}

.step-panel,
.history-panel {
  padding: 24px;
}

.step-panel h2,
.history-panel h2 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  line-height: 1.2;
}

#step-instruction,
#result-details,
.history-list {
  color: var(--muted);
  line-height: 1.7;
}

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

.option-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(109, 140, 199, 0.18);
  border-radius: 22px;
  padding: 22px;
  background: rgba(18, 30, 58, 0.82);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 178, 255, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.option-card.selected {
  border-color: rgba(125, 178, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(125, 178, 255, 0.14) inset;
  background: rgba(25, 41, 77, 0.94);
}

.option-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.3;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(25, 45, 82, 0.96);
  color: #d7e5ff;
  font-size: 0.84rem;
}

.meta-row {
  margin-top: 16px;
}

.rating-good,
.rating-mid,
.rating-low {
  font-weight: 700;
}

.rating-good {
  color: var(--good);
}

.rating-mid {
  color: var(--mid);
}

.rating-low {
  color: var(--low);
}

.action-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 12px 28px rgba(45, 91, 255, 0.24);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(109, 140, 199, 0.18);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.shot-visual-card {
  padding: 18px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot-visual-card img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 18px;
  display: block;
}

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

.history-list li + li {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

#result-details p {
  margin: 0 0 10px;
}

#result-details p:last-child {
  margin-bottom: 0;
}

.serve-builder {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
}

.serve-builder-section h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text);
}

.tag-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-pill {
  border: 1px solid rgba(109, 140, 199, 0.22);
  background: rgba(18, 30, 58, 0.82);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.18s ease;
}

.filter-pill:hover {
  border-color: rgba(125, 178, 255, 0.45);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--accent-2);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 1200px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    order: -1;
  }
}

@media (max-width: 900px) {
  .status-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1500px);
    padding-top: 16px;
  }

  .page-header,
  .step-panel,
  .history-panel {
    padding: 20px;
  }

  .page-header h1 {
    font-size: 2.4rem;
  }

  .step-panel h2,
  .history-panel h2 {
    font-size: 1.5rem;
  }
}

.serve-builder {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.serve-builder-section h3,
.serve-match-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--text);
}

.tag-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-pill {
  border: 1px solid rgba(109, 140, 199, 0.22);
  background: rgba(18, 30, 58, 0.82);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.18s ease;
}

.filter-pill:hover {
  border-color: rgba(125, 178, 255, 0.45);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: var(--accent-2);
  border-color: transparent;
  color: #fff;
}

.serve-match-card {
  margin-top: 4px;
}

.serve-result-card {
  cursor: default;
}