:root {
  --bg: #07080c;
  --panel: #101218;
  --border: #3a3a44;
  --accent: #ff8844;
  --text: #eeeef2;
  --muted: #9aa0ae;
  --ok: #86efac;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, Segoe UI, sans-serif;
}
a { color: var(--accent); }
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}
.hero img {
  width: min(100%, 720px);
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.tag {
  color: var(--muted);
  font-size: 14px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 18px;
  margin-bottom: 18px;
}
.panel.featured {
  border-color: #5a3a28;
  box-shadow: 0 0 0 1px rgba(255, 136, 68, 0.12), 0 12px 40px rgba(0, 0, 0, 0.35);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.panel-head .sub { margin-bottom: 0; max-width: 58ch; }
.panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.panel.featured h2 {
  font-size: 17px;
  letter-spacing: 0.08em;
}
.sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.rates-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 12rem;
}
.rates-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 14px 0 10px;
}
.rates-zone-label,
.rates-sellable-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rates-sellable-label {
  cursor: pointer;
  user-select: none;
}
.rates-sellable-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.rates-toolbar select,
.rates-toolbar input[type="search"] {
  background: #0a0b10;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font: 13px/1.3 system-ui, Segoe UI, sans-serif;
}
.rates-toolbar select {
  min-width: 160px;
  max-width: min(280px, 70vw);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  cursor: pointer;
}
.rates-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
}
.rates-toolbar select:focus,
.rates-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}
.rates-summary { margin: 0; }
.rates-table-wrap {
  overflow-x: auto;
  border: 1px solid #22232c;
  border-radius: 8px;
  background: #0a0b10;
}
.rates-toggle {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a0b10;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.rates-toggle:hover {
  border-color: var(--accent);
  background: rgba(255, 136, 68, 0.12);
  color: #fff;
}
.rates-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rates-table-wrap table { margin: 0; }
.rates-table-wrap th {
  position: sticky;
  top: 0;
  background: #12141c;
  z-index: 1;
}
tr.rates-boss td {
  background: #12141c;
  border-top: 1px solid #2a2d3a;
  padding-top: 12px;
  padding-bottom: 10px;
  color: var(--text);
}
tr.rates-boss:first-child td {
  border-top: none;
}
tr.rates-item td {
  background: #0a0b10;
  color: var(--muted);
}
td.rates-item-name {
  padding-left: 1.35rem;
  color: var(--text);
}
.rates-muted {
  color: var(--muted);
  font-weight: 500;
}
.pct {
  display: inline-block;
  min-width: 4.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ok);
}
.pct.pending {
  color: var(--muted);
  font-weight: 500;
}
.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
th.num, td.num { text-align: right; }
.rates-empty {
  padding: 18px 8px 8px;
  text-align: center;
}
.rates-empty strong { color: var(--text); }
.howto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 8px;
}
@media (max-width: 720px) {
  .howto-grid { grid-template-columns: 1fr; }
  .rates-actions { align-items: stretch; width: 100%; }
  .rates-actions button { width: 100%; }
  .panel-head .sub { max-width: none; }
}
.howto-card {
  background: #0a0b10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px 14px;
}
.howto-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}
.howto-card ol,
.howto-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 13px;
}
.howto-card li { margin: 0.35rem 0; }
.howto-card p.sub { margin: 0.4rem 0 0; }
.howto-card code {
  color: var(--accent);
  font-size: 12px;
}
.gate-note { margin-bottom: 0; }
.receipt-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.receipt-title {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ok);
}
#receiptBox {
  min-height: 110px;
  border-color: #2f5d3a;
}
textarea {
  width: 100%;
  min-height: 160px;
  background: #0a0b10;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  resize: vertical;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
button {
  background: #1a1210;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #241812; }
button:disabled { opacity: 0.5; cursor: default; }
button.btn-secondary {
  color: var(--muted);
  border-color: var(--border);
  background: #12141c;
}
button.btn-secondary:hover {
  color: var(--text);
  border-color: #3a3a44;
  background: #1a1c24;
}
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: #f87171; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #22232c;
}
th { color: var(--muted); font-weight: 600; }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--warn);
  font-size: 12px;
}
footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* -- Spotlight tour coach (SpellSmasher-style) -- */
body.tour-active { overflow: hidden !important; }

.btn-tour-cta {
  appearance: none;
  border: 1px solid rgba(255, 136, 68, 0.7);
  background: rgba(255, 136, 68, 0.18);
  color: #ffc49a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  margin-top: 6px;
  box-shadow: 0 0 0 0 rgba(255, 136, 68, 0.45);
}
.btn-tour-cta.is-flash { animation: tour-cta-pulse 1.4s ease-in-out infinite; }
.btn-tour-cta.is-done {
  border-color: rgba(154, 160, 174, 0.55);
  background: rgba(154, 160, 174, 0.12);
  color: var(--muted);
  font-weight: 700;
  animation: none;
  box-shadow: none;
}
.btn-tour-cta:hover { background: rgba(255, 136, 68, 0.3); color: #fff; }
.btn-tour-cta.hidden { display: none !important; }
@keyframes tour-cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 136, 68, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(255, 136, 68, 0); filter: brightness(1.1); }
}

.tour-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  background: rgba(4, 6, 12, 0.72); pointer-events: auto;
  isolation: isolate;
}
.tour-overlay.hidden { display: none; }
.tour-overlay.tour-dim-full { background: rgba(4, 6, 12, 0.8); }
.tour-overlay:not(.tour-dim-full) { background: transparent; }

.tour-hole {
  position: fixed; border-radius: 12px;
  box-shadow:
    0 0 0 9999px rgba(4, 6, 12, 0.74),
    0 0 0 2px rgba(255, 136, 68, 0.95),
    0 0 28px 4px rgba(255, 136, 68, 0.35);
  pointer-events: none; z-index: 1;
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
  animation: tour-hole-pulse 2.2s ease-in-out infinite;
}
@keyframes tour-hole-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 9999px rgba(4, 6, 12, 0.74),
      0 0 0 2px rgba(255, 136, 68, 0.9),
      0 0 22px 2px rgba(255, 136, 68, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 9999px rgba(4, 6, 12, 0.74),
      0 0 0 3px rgba(255, 196, 154, 0.95),
      0 0 36px 6px rgba(255, 136, 68, 0.42);
  }
}

.tour-highlight {
  outline: 2px solid rgba(255, 136, 68, 0.85);
  outline-offset: 3px;
  border-radius: 8px;
  box-shadow: 0 0 0 4px rgba(255, 136, 68, 0.15);
}

.tour-card {
  position: fixed; z-index: 10;
  display: flex; flex-direction: column;
  max-width: 420px; width: min(420px, calc(100vw - 24px));
  max-height: min(82vh, 560px); overflow: hidden; padding: 0;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(28, 22, 18, 0.98) 0%, rgba(12, 12, 16, 0.99) 100%);
  border: 1px solid rgba(255, 136, 68, 0.45);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
  color: var(--text); outline: none;
}
.tour-card-shine {
  pointer-events: none; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 136, 68, 0.12) 0%, transparent 42%);
  z-index: 0;
}
.tour-card > *:not(.tour-card-shine) { position: relative; z-index: 1; }
.tour-card-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 16px 16px 8px; -webkit-overflow-scrolling: touch;
}
.tour-card-footer {
  flex: 0 0 auto; padding: 10px 16px 12px;
  border-top: 1px solid rgba(58, 58, 68, 0.85);
  background: rgba(8, 8, 12, 0.9);
}
.tour-card-enter { animation: tour-card-in 0.26s ease-out both; }
@keyframes tour-card-in {
  from { opacity: 0; } to { opacity: 1; }
}
.tour-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.tour-card-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tour-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 9px; font-size: 13px; font-weight: 900;
  color: #1a0e08; background: linear-gradient(180deg, #ffb07a 0%, #ff8844 100%);
}
.tour-icon.tour-icon-done {
  background: linear-gradient(180deg, #86efac 0%, #4ade80 100%); color: #052e16;
}
.tour-progress {
  margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent); white-space: nowrap;
}
.tour-badge {
  flex-shrink: 0; display: inline-flex; align-items: center;
  padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; color: #ffe0cc;
  background: rgba(255, 136, 68, 0.18); border: 1px solid rgba(255, 136, 68, 0.4);
}
.tour-badge.hidden, .tour-bullets.hidden, .tour-note.hidden { display: none; }
.tour-progress-track {
  height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08);
  margin: 0 0 10px; overflow: hidden;
}
.tour-progress-fill {
  height: 100%; width: 12%; border-radius: inherit;
  background: linear-gradient(90deg, #ff8844, #ffc49a);
  transition: width 0.28s ease;
}
.tour-dots {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin: 0 0 12px; flex-wrap: wrap;
}
.tour-dot {
  appearance: none; border: none; padding: 0; margin: 0;
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.16); cursor: pointer;
}
.tour-dot.done { background: rgba(255, 136, 68, 0.55); }
.tour-dot.active {
  width: 22px; background: linear-gradient(90deg, #ff8844, #ffc49a);
}
.tour-title {
  margin: 0 0 8px; font-size: 18px; font-weight: 800; line-height: 1.28;
}
.tour-body {
  margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--muted);
  white-space: pre-wrap;
}
.tour-bullets {
  margin: 0 0 12px; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.tour-bullets li {
  position: relative; padding: 7px 10px 7px 28px; border-radius: 10px;
  font-size: 13px; line-height: 1.4; color: var(--text);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.05);
}
.tour-bullets li::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(180deg, #ffb07a, #ff8844);
}
.tour-note {
  margin: 0 0 12px; padding: 8px 10px; border-radius: 10px;
  font-size: 12px; line-height: 1.45; color: #f5d98a;
  background: rgba(240, 180, 41, 0.1); border: 1px solid rgba(240, 180, 41, 0.28);
}
.tour-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.tour-actions-right { display: flex; gap: 8px; }
.tour-btn {
  appearance: none; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; cursor: pointer; min-height: 36px; border: 1px solid transparent;
}
.tour-btn-ghost {
  background: transparent; color: var(--muted); border-color: rgba(154, 160, 174, 0.35);
}
.tour-btn-secondary {
  background: rgba(58, 58, 68, 0.6); color: var(--text); border-color: var(--border);
}
.tour-btn-primary {
  background: linear-gradient(180deg, #ff9a5c, #ff8844); color: #1a0e08;
  border-color: rgba(255, 136, 68, 0.8); min-width: 96px; font-weight: 800;
}
.tour-btn:disabled { opacity: 0.4; cursor: default; }
.tour-kbd-hint {
  display: none; margin: 6px 0 0; text-align: center;
  font-size: 10px; letter-spacing: 0.04em; color: rgba(154, 160, 174, 0.65);
}
@media (hover: hover) and (pointer: fine) {
  .tour-kbd-hint { display: block; }
}
