/* Minelyzer — v1 */
:root {
  --bg: #0B0D10;
  --bg-alt: #0F1216;
  --surface: #13171C;
  --surface-2: #1A1F26;
  --line: #242B34;
  --line-strong: #323B47;
  --text: #E8EBEF;
  --muted: #8E98A4;
  --faint: #5E6874;
  --gold: #F2B544;
  --gold-soft: rgba(242, 181, 68, .12);
  --ok: #4ADE80;
  --info: #60A5FA;
  --warn: #FBBF24;
  --radius: 14px;
  --radius-sm: 9px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 600; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 6px; z-index: 2000; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.eyebrow {
  font: 500 .75rem/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  margin-bottom: 12px;
}
.accent { color: var(--gold); }
.lead { color: var(--muted); font-size: 1.075rem; max-width: 60ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  font: 600 .95rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--gold); color: #17120A; }
.btn--primary:hover { background: #FFC75F; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--sm { padding: 9px 14px; font-size: .875rem; }
.pill {
  font: 500 .65rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold);
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(11, 13, 16, .86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.2rem/1 var(--font-display); letter-spacing: -.01em; }
.brand--small { font-size: 1rem; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav a:hover, .nav a.is-active { color: var(--text); background: var(--surface-2); }
.ticker { height: 46px; border-top: 1px solid var(--line); overflow: hidden; }

/* Hero */
.hero {
  position: relative;
  padding: 88px 0 72px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(242, 181, 68, .14), transparent 60%),
    radial-gradient(700px 360px at 0% 110%, rgba(224, 122, 63, .08), transparent 60%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 65%);
  opacity: .35;
}
.hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: end; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 700; margin-bottom: 20px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 22px 22px 20px; }
.stat dt { color: var(--muted); font-size: .8rem; margin-bottom: 8px; }
.stat dd { margin: 0; font: 600 2.1rem/1 var(--font-display); font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.section__note { color: var(--faint); font-size: .875rem; max-width: 44ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card--widget { padding: 8px; overflow: hidden; }
.tv-slot { min-height: 200px; }
.tv-fallback { padding: 40px; text-align: center; color: var(--muted); }

/* Explorer */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.field { display: block; }
.field--search { flex: 1 1 260px; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 500 .925rem var(--font-body);
}
.field select { min-width: 170px; appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238E98A4' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field input::placeholder { color: var(--faint); }
.field input:focus, .field select:focus { border-color: var(--gold); outline: none; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  font: 500 .85rem var(--font-body); transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--chip-color, var(--gold)); background: var(--surface-2); }
.chip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chip-color); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }

.explorer__body { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.map-wrap { position: relative; isolation: isolate; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0d1014; }
#map { height: 600px; width: 100%; background: #0d1014; }

.mine-panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); height: 602px; overflow: hidden; }
.mine-panel__head { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.mine-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.mine-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: transparent; color: inherit; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 12px; font: inherit;
}
.mine-item:hover { background: var(--surface-2); }
.mine-item.is-selected { background: var(--surface-2); border-color: var(--line-strong); }
.mine-item__top { display: flex; align-items: center; gap: 8px; }
.mine-item__name { font-weight: 600; font-size: .95rem; }
.mine-item__meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; font-size: .9rem; }

.dots { display: inline-flex; gap: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag--ok { color: var(--ok); background: rgba(74, 222, 128, .1); }
.tag--info { color: var(--info); background: rgba(96, 165, 250, .1); }
.tag--warn { color: var(--warn); background: rgba(251, 191, 36, .1); }
.mine-item .tag { margin-left: auto; }

/* Map markers + popups */
.mz-marker { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0B0D10; box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 0 12px var(--c); background: var(--c); transition: transform .15s; }
.mz-marker.is-selected { transform: scale(1.6); box-shadow: 0 0 0 2px #fff, 0 0 18px var(--c); }
.mz-marker--suspended { opacity: .55; }
.leaflet-container { font-family: var(--font-body); background: #0d1014; }
.leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.leaflet-popup-tip { background: var(--surface); border: 1px solid var(--line-strong); }
.leaflet-popup-content { margin: 14px 16px; min-width: 240px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-zoom a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(11,13,16,.75) !important; color: var(--faint) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pop h3 { font-size: 1.05rem; margin-bottom: 4px; }
.pop__country { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.pop__row { display: flex; justify-content: space-between; gap: 16px; font-size: .85rem; padding: 5px 0; border-top: 1px solid var(--line); }
.pop__row span:first-child { color: var(--muted); }
.pop__row span:last-child { text-align: right; font-weight: 500; }
.pop__note { margin-top: 10px; font-size: .85rem; color: var(--text); line-height: 1.5; }
.pop__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* Guide */
.guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.g-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; transition: border-color .2s, transform .2s; }
.g-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.g-card__head { display: flex; align-items: center; gap: 12px; }
.g-symbol {
  width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center;
  font: 700 1rem var(--font-display); color: #0B0D10; background: var(--c);
}
.g-card h3 { font-size: 1.15rem; }
.g-card__count { color: var(--muted); font-size: .8rem; }
.g-label { font: 500 .7rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 6px; }
.g-text { font-size: .9rem; color: var(--text); }
.g-producers { display: flex; gap: 6px; flex-wrap: wrap; }
.g-producers li { list-style: none; font-size: .8rem; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); }
.g-producers { padding: 0; margin: 0; }
.g-turkey { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.g-link { background: none; border: 0; padding: 0; color: var(--gold); font: 600 .85rem var(--font-body); cursor: pointer; text-align: left; }
.g-link:hover { text-decoration: underline; }

/* Turkey */
.turkey { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.turkey .lead { margin: 16px 0 28px; }
.turkey__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.turkey__list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.turkey__list strong { font-weight: 600; }
.turkey__list .muted { color: var(--muted); font-size: .85rem; margin-left: auto; text-align: right; }

/* Game */
.section--game { padding: 72px 0; background: linear-gradient(180deg, var(--bg) 0%, #14110A 100%); border-top: 1px solid var(--line); }
.game { display: flex; gap: 28px; align-items: center; }
.game .lead { margin-top: 12px; }

/* Footer */
.footer { padding: 40px 0; border-top: 1px solid var(--line); background: var(--bg); }
.footer__inner { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.footer__meta { color: var(--faint); font-size: .8rem; }

/* Responsive */
@media (max-width: 1024px) {
  .hero__inner, .turkey { grid-template-columns: 1fr; gap: 40px; }
  .explorer__body { grid-template-columns: 1fr; }
  .mine-panel { height: 380px; }
  #map { height: 460px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar__inner { justify-content: space-between; }
  .section { padding: 64px 0; }
  .hero { padding: 56px 0 48px; }
  .field select { min-width: 0; }
  .filters .field:not(.field--search) { flex: 1 1 140px; }
  #map { height: 380px; }
  .game { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
