:root {
  --bg: #FBFBFA;
  --bg-panel: #FFFFFF;
  --border: #EBEAE7;
  --text: #1D1D1F;
  --text-muted: #86868B;
  --accent: #3F7A5C;
  --accent-soft: #EAF2ED;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  font-size: 16px;
  color-scheme: light only;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  padding: 1.25rem 1.5rem;
}

.header-inner {
  max-width: 40rem;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sound-toggle {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 0.4rem;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sound-toggle:hover {
  opacity: 1;
}

.sound-toggle:active {
  transform: scale(0.88);
}

.logo-text {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
}

main {
  max-width: 40rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
  transition: max-width 0.2s ease;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

/* Desktop: use the actual screen width instead of a fixed narrow column,
   and let the form and results sit side by side */
@media (min-width: 64rem) {
  main {
    max-width: 90rem;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .site-header {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .header-inner {
    max-width: 90rem;
  }

  .site-footer {
    max-width: 90rem;
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .layout-grid {
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    gap: 4rem;
    align-items: start;
  }

  .meter-panel {
    max-width: 40rem;
  }
}

/* Ultra-wide monitors: cap growth so lines of text don't get absurd */
@media (min-width: 100rem) {
  main {
    max-width: 100rem;
  }
}

/* ---- Meter: soft shadow, no border - separation through elevation ---- */
.meter-panel {
  background: var(--bg-panel);
  border-radius: 1.25rem;
  padding: 2rem;
  margin-bottom: 3.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 12px 32px rgba(0, 0, 0, 0.05);
}

.meter-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

#estimatedFPS {
  font-size: clamp(2.25rem, 9vw, 3rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color 0.3s ease;
}

#estimatedFPS.not-achievable {
  text-decoration: underline wavy var(--text-muted);
  text-underline-offset: 0.25rem;
}

.meter-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-weight: 500;
}

.meter-target {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#targetFPSDisplay {
  color: var(--text);
  font-weight: 500;
}

.meter-bar-track {
  position: relative;
  height: 0.5rem;
  width: 100%;
  background: var(--accent-soft);
  border-radius: 1rem;
  overflow: visible;
}

.meter-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 1rem;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.meter-target-line {
  position: absolute;
  top: -0.2rem;
  bottom: -0.2rem;
  width: 0.125rem;
  border-radius: 0.125rem;
  background: var(--text);
  opacity: 0.35;
  left: 0%;
  transition: left 0.4s ease;
}

.meter-message {
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ---- Form: no boxes at all, whitespace does the separating ---- */
.form-section {
  margin-bottom: 3.5rem;
}

.field-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.field-row {
  display: flex;
  gap: 1.25rem;
  width: 100%;
}

.field-row .field-group {
  flex: 1 1 0;
  min-width: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.optional-tag {
  font-weight: 400;
  opacity: 0.8;
  font-size: 0.78rem;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: var(--bg-panel);
  border: 0.0625rem solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.98rem;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

/* ---- Combobox ---- */
.combo-wrap {
  position: relative;
  display: flex;
}

.combo-wrap input {
  padding-right: 2.4rem;
}

.combo-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  line-height: 1;
}

.combo-toggle:hover { color: var(--text); }

.combo-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: 13rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  background: var(--bg-panel);
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 12px 32px rgba(0, 0, 0, 0.08);
}

.combo-list li {
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.combo-list li:active {
  transform: scale(0.97);
}

.combo-list li:hover,
.combo-list li.active {
  background: var(--accent-soft);
}

.checkbox-field {
  padding-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-field .field-hint {
  margin-left: 1.75rem;
}

.section-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.report-block {
  padding-top: 0.5rem;
}

.report-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}

.report-btn:hover {
  opacity: 0.9;
}

.report-btn:active {
  transform: scale(0.96);
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  min-height: 1.1em;
}

.field-hint.unknown { color: var(--text); font-style: italic; }
.field-hint.matched { color: var(--accent); }

/* ---- Results: same whitespace-first approach as the form ---- */
.results-group {
  margin-bottom: 2.75rem;
}

.results-group:last-child {
  margin-bottom: 0;
}

.results-group h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.01em;
}

.step-mark {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.settings-grid {
  display: flex;
  flex-direction: column;
}

.setting-item {
  min-width: 0;
  padding: 1rem 0;
  border-bottom: 0.0625rem solid var(--border);
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.25rem 1.5rem;
  align-items: baseline;
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.setting-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.setting-why {
  grid-column: 2;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 30rem) {
  .setting-item {
    grid-template-columns: 1fr;
  }
  .setting-why {
    grid-column: 1;
  }
}

.adjustments-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.adjustments-list li {
  font-size: 0.92rem;
  padding: 0.65rem 0;
  border-bottom: 0.0625rem solid var(--border);
}

.adjustments-list li:last-child { border-bottom: none; }

.site-footer {
  max-width: 40rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 1.5rem;
  border-top: 0.0625rem solid var(--border);
}

@media (max-width: 30rem) {
  .field-row { flex-direction: column; gap: 0; }
}

@media (min-width: 30rem) and (max-width: 48rem) {
  main, .site-footer { padding-left: 2rem; padding-right: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .meter-bar-fill, .meter-target-line, #estimatedFPS { transition: none; }
}
