:root {
  --bg: #f3efe5;
  --panel: rgba(255, 251, 243, 0.88);
  --text: #1d261e;
  --muted: #586355;
  --accent: #b4472f;
  --accent-dark: #7e2d1d;
  --line: rgba(29, 38, 30, 0.12);
  --shadow: 0 20px 50px rgba(41, 27, 15, 0.14);
  --teal: #155f69;
  --teal-soft: rgba(21, 95, 105, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(196, 124, 71, 0.18), transparent 32%),
    linear-gradient(180deg, #efe7d5 0%, #f7f3ea 52%, #ece6da 100%);
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 18px 24px;
}

.hero {
  margin-bottom: 8px;
}

.daily-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent-dark);
  font-weight: 800;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.95rem, 3.6vw, 3.7rem);
  line-height: 0.95;
}

.intro {
  max-width: 680px;
  margin: 8px 0 0;
  font-size: 0.98rem;
  line-height: 1.48;
  color: var(--muted);
}

.scenario-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.scenario-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.scenario-nav-link:hover,
.field-ghost-btn:hover,
.submit-btn:hover,
.field-check-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.scenario-brand-link {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
  font-size: 1rem;
}

.panel-label,
.detail-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-dark);
}

.game-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  align-items: start;
}

.panel {
  backdrop-filter: blur(10px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.scenario-panel {
  padding: 14px;
}

.panel-header {
  display: grid;
  gap: 6px;
}

.scenario-intro,
.status-copy,
.daily-panel-copy,
.feedback-body,
.form-field input,
.form-field textarea {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.scenario-intro {
  margin: 0;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.34;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
}

.details p,
.status-copy,
.daily-panel-copy {
  margin: 0;
}

.daily-panel,
.status-card,
.spot-guide,
.summary-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(29, 38, 30, 0.08);
}

.daily-panel-title {
  margin: 0 0 8px;
  font-size: 1.34rem;
  line-height: 1.02;
}

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

.spot-guide-grid p,
.summary-list p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

.spot-guide-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.field-panel {
  padding: 0 14px 14px;
}

.field-wrap {
  position: relative;
  display: grid;
}

.draw-controls {
  position: absolute;
  top: 8px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: block;
  pointer-events: none;
}

.field-ghost-btn,
.field-check-btn,
.submit-btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.draw-controls .field-ghost-btn,
.draw-controls .field-check-btn,
.draw-controls .field-status {
  pointer-events: auto;
}

.field-ghost-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  border: 1px solid rgba(29, 38, 30, 0.08);
}

.field-check-btn,
.submit-btn {
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
}

.field-check-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.field-status {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: start;
  justify-self: center;
  width: min(100%, 420px);
  margin: 38px auto 0;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 250, 243, 0.88);
  border: 1px solid rgba(29, 38, 30, 0.08);
  box-shadow: 0 14px 30px rgba(41, 27, 15, 0.12);
}

.field-status-next {
  position: absolute;
  top: 52px;
  right: -70px;
  padding: 10px 18px;
  font-size: 0.95rem;
  box-shadow: 0 10px 24px rgba(126, 45, 29, 0.24);
}

.feedback-title {
  margin: 0;
  font-weight: 800;
  text-align: center;
}

.field-submit-reminder {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

#field {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  overflow: hidden;
  background: #f8f5ee;
  border: 1px solid rgba(29, 38, 30, 0.08);
}

.field-below-restart {
  justify-self: end;
  margin: 12px 18px 0 0;
  padding: 9px 16px;
  box-shadow: 0 10px 22px rgba(41, 27, 15, 0.12);
}

.runner-marker {
  fill: #c53f32;
}

.fielder-marker {
  fill: #273a7a;
}

.ball-marker {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 3;
}

.fielder-label {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.runner-label {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.spot-button {
  cursor: pointer;
}

.selector-track-underlay {
  fill: none;
  stroke: rgba(112, 117, 124, 0.16);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selector-track {
  fill: none;
  stroke: rgba(229, 232, 236, 0.58);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(29, 38, 30, 0.08));
}

.selector-handle {
  cursor: grab;
}

.selector-handle.is-dragging {
  cursor: grabbing;
}

.selector-handle #selector-handle-circle {
  fill: rgba(118, 123, 129, 0.96);
  stroke: rgba(248, 249, 250, 0.92);
  stroke-width: 2.5;
  filter: drop-shadow(0 6px 10px rgba(29, 38, 30, 0.32));
}

.selector-handle #selector-handle-inner {
  fill: rgba(98, 102, 108, 0.92);
  stroke: rgba(43, 47, 53, 0.34);
  stroke-width: 1.5;
  filter: none;
}

.selector-handle-text {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #fff;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.field-result {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 95, 105, 0.1);
  border: 1px solid rgba(21, 95, 105, 0.12);
}

.field-result-text {
  margin: 0;
  color: var(--teal);
  font-weight: 800;
}

.summary-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.form-field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.form-field span {
  font-size: 0.88rem;
  font-weight: 800;
  color: #5f4b37;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(29, 38, 30, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.thanks-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(29, 38, 30, 0.38);
  backdrop-filter: blur(8px);
}

.thanks-modal-card {
  width: min(100%, 460px);
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 251, 243, 0.97);
  border: 1px solid rgba(29, 38, 30, 0.08);
  box-shadow: 0 24px 60px rgba(41, 27, 15, 0.24);
}

.thanks-modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.thanks-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.thanks-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.thanks-facebook-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.thanks-facebook-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #1877f2;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  text-transform: lowercase;
}

.thanks-facebook-copy {
  font-size: 0.96rem;
  font-weight: 800;
}

.thanks-subscribe-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
}

.thanks-subscribe-input {
  width: 100%;
  border: 1px solid rgba(29, 38, 30, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.thanks-subscribe-btn {
  min-width: 156px;
}

.thanks-subscribe-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.thanks-submit-note {
  margin: 10px 0 0;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 700;
}

.hidden-submit-frame {
  position: absolute;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .draw-controls {
    position: absolute;
    top: 8px;
    left: 12px;
    right: 12px;
  }

  .details,
  .spot-guide-grid {
    grid-template-columns: 1fr;
  }

  .field-status {
    justify-items: center;
    text-align: center;
    width: min(100%, 360px);
    margin-top: 30px;
    padding-top: 18px;
  }

  .field-status-next {
    position: static;
    top: auto;
    right: auto;
    width: 100%;
    max-width: 220px;
    margin-top: 4px;
    order: 3;
  }

  .field-below-restart {
    margin-right: 12px;
  }

  .thanks-modal-card {
    padding: 20px;
  }

  .thanks-modal-actions {
    flex-direction: column;
  }

  .thanks-subscribe-form {
    grid-template-columns: 1fr;
  }

  .thanks-subscribe-btn {
    width: 100%;
  }
}
