/* =============================================
   KingshotPro — Global Styles
   Dark theme | Gold accent | Mobile-first
   ============================================= */

:root {
  --bg:        #0d0d0f;
  --surface:   #16181f;
  --surface-2: #1e2030;
  --border:    #2a2d3e;
  --gold:      #f0c040;
  --gold-dim:  #c09828;
  --gold-glow: rgba(240, 192, 64, 0.15);
  --text:      #e8e8ec;
  --text-muted:#7a7d8e;
  --text-dim:  #4a4d5e;
  --green:     #4caf82;
  --red:       #e05c5c;
  --blue:      #5c8ce0;
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --radius:    8px;
  --radius-lg: 14px;
  --nav-h:     56px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 24px;
}

.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.nav-spacer { flex: 1; }

/* ---- PAGE WRAPPER ---- */
.page {
  padding-top: calc(var(--nav-h) + 24px);
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- HERO ---- */
.hero {
  padding: 48px 0 56px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero h1 span { color: var(--gold); }

.hero-sub {
  font-size: clamp(15px, 2.5vw, 18px);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
}

/* ---- FID FORM ---- */
.fid-form {
  max-width: 480px;
  margin: 0 auto;
}

.fid-input-row {
  display: flex;
  gap: 8px;
}

.fid-input-row input {
  flex: 1;
  min-width: 0;
}

.fid-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}

/* ---- FORM ELEMENTS ---- */
input[type="text"],
input[type="number"],
select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius);
  width: 100%;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%237a7d8e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

input::placeholder { color: var(--text-dim); }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group { margin-bottom: 16px; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gold);
  color: #0d0d0f;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ---- PROFILE CARD ---- */
.profile-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.profile-card.visible { display: block; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.profile-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.profile-stat {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.profile-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ---- ADVISORY SECTION ---- */
.advisory {
  display: none;
  margin-top: 32px;
}

.advisory.visible { display: block; }

.advisory-header {
  text-align: center;
  margin-bottom: 20px;
}

.advisory-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.advisory-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-width: 860px;
  margin: 0 auto;
}

.advice-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  border-left: 3px solid var(--gold);
}

.advice-rank {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
}

.advice-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.advice-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- SECTION ---- */
section {
  padding: 48px 0;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

/* ---- TOOL CARDS (homepage grid) ---- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  border-color: var(--gold);
  text-decoration: none;
}

.tool-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.tool-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.tool-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.tool-link {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

/* ---- HOW IT WORKS ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.step {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: #0d0d0f;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.step h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.step p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- CALCULATOR PAGE ---- */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .calc-layout {
    grid-template-columns: 340px 1fr;
  }
}

.calc-inputs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.calc-inputs h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

.calc-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.calc-results h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

.result-placeholder {
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* ---- RESULT ITEMS ---- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.result-item {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px;
}

.result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}

.result-value.large { font-size: 24px; }

.result-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- RANGE SLIDER ---- */
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--gold);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  height: 4px;
}

.range-val {
  min-width: 44px;
  text-align: right;
  font-weight: 600;
  color: var(--gold);
  font-size: 15px;
}

/* ---- TABS ---- */
.tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---- DATA TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-gold { background: var(--gold-glow); color: var(--gold); }
.badge-green { background: rgba(76, 175, 130, 0.15); color: var(--green); }
.badge-red   { background: rgba(224, 92, 92, 0.15); color: var(--red); }
.badge-blue  { background: rgba(92, 140, 224, 0.15); color: var(--blue); }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.alert-info {
  background: rgba(92, 140, 224, 0.1);
  border: 1px solid rgba(92, 140, 224, 0.3);
  color: #a0beff;
}

.alert-warn {
  background: rgba(240, 192, 64, 0.1);
  border: 1px solid rgba(240, 192, 64, 0.3);
  color: var(--gold);
}

.alert-error {
  background: rgba(224, 92, 92, 0.1);
  border: 1px solid rgba(224, 92, 92, 0.3);
  color: var(--red);
}

/* ---- GIFT CODES ---- */
.codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.code-card.active { border-color: var(--green); }
.code-card.expired { opacity: 0.5; }

.code-string {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.code-rewards {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.code-expiry {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---- DIVIDER ---- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ---- PAGE HEADER ---- */
.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.back-link {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.back-link:hover { color: var(--text); text-decoration: none; }

/* ---- FOOTER ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 16px;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: flex-start;
}

.footer-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.footer-note {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 300px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ---- LOADING STATE ---- */
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- UTILITIES ---- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .profile-stat { padding: 10px 6px; }
  .profile-stat-value { font-size: 15px; }

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

  .result-grid { grid-template-columns: repeat(2, 1fr); }

  .fid-input-row { flex-direction: column; }
  .fid-input-row input,
  .fid-input-row .btn { width: 100%; }
}
