/* =========================================================
   strategy.css — Race Strategy page, standalone
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
  font-family: system-ui, sans-serif;
  background: #1f1f1f;
  color: #ffffff;
  height: 100%;
  overflow: hidden;
}


/* ── Page scroll container — keeps scrollbar below topbar ── */
.page-scroll {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* =========================================================
   TOPBAR
   ========================================================= */

#topbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 48px;
  background: #000;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  gap: 12px;
}

#specSwitch {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.spec-btn {
  height: 32px;
  min-width: 70px;
  padding: 0 16px;
  background: #fff;
  color: #000;
  border: 2px solid #ccc;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.spec-btn.active {
  background: #1677ff;
  color: #fff;
  border-color: #fff;
}

/* ── Beta badge ── */
.beta-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.beta-badge {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f10c45;
  background: rgba(241,12,69,0.1);
  border: 1px solid rgba(241,12,69,0.35);
  border-radius: 5px;
  padding: 3px 7px;
  cursor: default;
  user-select: none;
}

.beta-tooltip {
  display: block;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 240px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px 22px;
  z-index: 999;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.beta-tooltip.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
}

.beta-tooltip-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}

.beta-tooltip-body {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.55;
  margin-bottom: 14px;
}

.beta-tooltip-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f10c45;
  text-decoration: none;
  border: 1px solid rgba(241,12,69,0.3);
  border-radius: 8px;
  padding: 6px 12px;
  transition: background 0.15s ease;
}

.beta-tooltip-link:hover {
  background: rgba(241,12,69,0.1);
}

#rightBlock {
  display: flex;
  align-items: center;
  gap: 14px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

#logoDropdownWrap { position: relative; }

#logoDropdownBtn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
  white-space: nowrap;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease;
  font-family: system-ui, sans-serif;
}

#logoDropdownBtn:hover {
  background: rgba(255,255,255,0.13);
  border-color: rgba(255,255,255,0.35);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 999;
}

.dropdown-menu.show { opacity: 1; pointer-events: all; transform: translateY(0); }

.dropdown-item {
  display: block;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.1s ease, border-color 0.1s ease;
  font-family: system-ui, sans-serif;
}

.dropdown-item:hover { background: #f5f5f5; border-left-color: #1677ff; }
.dropdown-item.active { border-left-color: #f10c45; color: #f10c45; }

#socials { display: flex; gap: 12px; }

#socials a {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}

#socials svg {
  width: 100%; height: 100%;
  fill: none; stroke: #fff;
  stroke-width: 1.8; opacity: 0.85;
  shape-rendering: geometricPrecision;
}

#socials a:hover svg { opacity: 0.6; }

/* =========================================================
   LAYOUT
   ========================================================= */

.strategy-shell {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 24px 48px;   /* was 68px — reduced top gap */
  align-items: start;
}

/* ── NEW: page header spans full width ── */
.calc-header {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 4px;
}

.calc-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 5px;
}

.calc-subtitle {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.2);
  line-height: 1.4;
}

/* ── NEW: SEO text below results — desktop hidden, mobile shown ── */
.results-description {
  display: none;
}

/* ── NEW: MIR RIGS watermark ── */
#strategyBrand {
  position: fixed;
  top: calc(48px + 12px);
  right: 20px;
  color: rgba(255,255,255,0.22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

/* =========================================================
   INPUT PANEL
   ========================================================= */

.strategy-panel {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: 64px;
}

.section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
}

.panel-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 20px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  background: #242424;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: system-ui, sans-serif;
  -moz-appearance: textfield;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

input[type="number"]::placeholder { color: rgba(255,255,255,0.18); }

input[type="number"]:focus {
  outline: none;
  border-color: #fea700;
  background: #2a2a2a;
}

.field.has-error input[type="number"] { border-color: #f10c45; }

.error-msg {
  color: #f10c45;
  font-size: 0.65rem;
  font-weight: 600;
  margin-left: 4px;
}

.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.race-length-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.race-length-row input { flex: 1; }

.race-toggle { display: flex; gap: 4px; flex-shrink: 0; }

.race-btn {
  height: 38px;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: #2a2a2a;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: all 0.15s ease;
}

.race-btn.active {
  background: #fea700;
  border-color: #fea700;
  color: #000;
  font-weight: 800;
}

/* ── Tire rows ── */
.tire-header,
.tire-row {
  display: grid;
  grid-template-columns: 8px 58px 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tire-col-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  text-align: center;
}

.tire-row input { text-align: center; }

/* Tire dots in input panel — racing colors */
.tire-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tire-dot.soft   { background: #ff3333; }
.tire-dot.medium { background: #f5c400; }
.tire-dot.hard   { background: #ffffff; }

.tire-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
}

/* ── Action buttons ── */
.calc-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.calc-actions button {
  height: 46px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.calc-actions button:hover { opacity: 0.85; }
.calc-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

#clearBtn {
  flex: 1;
  background: #2a2a2a;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}

#calcBtn {
  flex: 2;
  background: #1677ff;
  color: #fff;
}

/* =========================================================
   RESULTS
   ========================================================= */

.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.results-placeholder {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 16px;
}

.placeholder-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
}

.result-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 22px;
}

.result-card.best {
  border-color: #fea700;
  background: #1d1b14;
}

.result-rank {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 8px;
}

.result-card.best .result-rank { color: #fea700; }

.result-time {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1;
}

.result-card.best .result-time { color: #fea700; }

.result-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-bottom: 14px;
}

/* ── Strategy sequence ── */
.result-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

/* Tire stint pill */
.stint-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #242424;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}

/* Dot inside stint pill — sized down from input dots */
.stint-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Arrow between sequence items */
.seq-arrow {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
  line-height: 1;
  align-self: center;
}

/* Fuel % shown inside a stint pill after tire change */
.stint-fuel {
  color: #fea700;
  font-weight: 700;
  font-size: 0.75rem;
  margin-left: 2px;
}

/* Unplanned fuel-only stop pill */
.pit-fuel-only {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fea700;
  background: rgba(254, 167, 0, 0.1);
  border: 1px solid rgba(254, 167, 0, 0.3);
  border-radius: 6px;
  padding: 4px 9px;
  white-space: nowrap;
}

.result-message {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px 22px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

.result-message.error {
  border-color: rgba(241,12,69,0.25);
  color: rgba(241,12,69,0.7);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {
  #topbar { padding: 0 12px; gap: 8px; }
  #socials a { width: 20px; height: 20px; }
  .spec-btn { min-width: 56px; padding: 0 12px; font-size: 11px; height: 28px; }

  /* Prevent iOS zoom on input focus */
  input[type="number"] { font-size: 16px; }

  .strategy-shell {
    grid-template-columns: 1fr;
    padding: 16px 16px 48px;   /* was 64px — reduced top gap */
    gap: 16px;
  }

  /* Hide subtitle on mobile — show SEO text at bottom instead */
  .calc-subtitle { display: none; }

  .results-description {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.2);
    line-height: 1.6;
    padding: 0 2px 8px;
  }

  .strategy-panel {
    position: static;
    border-top: 2px solid #fea700;
    border-radius: 0 0 16px 16px;
    border-left: none;
    border-right: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .fields-row { grid-template-columns: 1fr; }

  .tire-header,
  .tire-row {
    grid-template-columns: 8px 52px 1fr 1fr;
    gap: 6px;
  }
}