/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #14161a;
  --bg-panel: #1c1f25;
  --bg-inset: #24282f;
  --border: #2f343d;
  --text: #e7e9ee;
  --text-muted: #98a0ad;
  --accent: #5ac36a;
  --accent-ink: #0d1a10;
  --accent-soft: #1f3324;
  --coord: #7dc3f0;
  --danger: #ff8a7a;
  --danger-soft: #3a2220;
  --radius: 10px;
  --shadow: 0 1px 3px rgb(0 0 0 / .35);
  --maxw: 940px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7;
    --bg-panel: #ffffff;
    --bg-inset: #f0f2f5;
    --border: #dfe3e9;
    --text: #1b1f26;
    --text-muted: #616b7a;
    --accent: #1f8f3a;
    --accent-ink: #ffffff;
    --accent-soft: #e6f4e9;
    --coord: #1264a3;
    --danger: #b3261e;
    --danger-soft: #fdeceb;
    --shadow: 0 1px 3px rgb(16 24 40 / .08);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }

/* ---------------------------------------------------------------- layout */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 1.7rem; height: 1.7rem; flex: none; }
.brand-name { font-size: 1.35rem; font-weight: 700; letter-spacing: .01em; }
.tagline { color: var(--text-muted); font-size: .92rem; margin: 6px 0 0; }

main { max-width: var(--maxw); margin: 0 auto; padding: 8px 20px 40px; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- notices */
.privacy-banner {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: .9rem;
  margin-bottom: 16px;
}
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.notice-error { background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger); }

/* ---------------------------------------------------------------- dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  padding: 34px 20px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 .4em; }
.dropzone-sub { color: var(--text-muted); font-size: .88rem; margin: 0 0 1em; }
.dropzone-or { color: var(--text-muted); font-size: .85rem; margin: 0 0 .8em; }
.dropzone-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.link-button {
  display: block;
  margin: 12px auto 0;
  font: inherit;
  font-size: .85rem;
  color: var(--accent);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.link-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-note { color: var(--text-muted); font-size: .8rem; margin: 14px 0 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-small { padding: 6px 12px; font-size: .85rem; font-weight: 500; }

/* ---------------------------------------------------------------- world choice */
.world-choice { margin-top: 20px; }
.world-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.world-list button {
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  cursor: pointer;
}
.world-list button:hover { border-color: var(--accent); }
.world-list .world-name { font-weight: 600; display: block; }
.world-list .world-meta { color: var(--text-muted); font-size: .82rem; }

/* ---------------------------------------------------------------- progress */
.progress-bar {
  height: 8px;
  background: var(--bg-inset);
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------------------------------------------------------------- results */
.results-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.search {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 12px 14px;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.hint { color: var(--text-muted); font-size: .82rem; margin: 6px 0 0; }
.summary { font-weight: 600; margin: 14px 0 0; min-height: 1.7em; }

/* The table is capped rather than left to run: 300 rows made the page tens of
   thousands of pixels tall and scrolled the search box out of reach. */
.table-scroll { overflow: auto; max-height: 65vh; margin-top: 8px; overscroll-behavior: contain; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 500; font-size: .82rem; position: sticky; top: 0; background: var(--bg-panel); }
td:first-child { white-space: normal; min-width: 12em; }
.coord { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--coord); }
.item-id { color: var(--text-muted); font-size: .82em; }
.empty { color: var(--text-muted); }

/* ---------------------------------------------------------------- guide */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  font: inherit;
  font-size: .88rem;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.steps { padding-left: 1.3em; margin: 0; }
.steps li { margin-bottom: .6em; }
.tip {
  background: var(--bg-inset);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  font-size: .87rem;
  margin-top: 14px;
}
kbd {
  font-family: inherit; font-size: .85em;
  background: var(--bg-inset); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.copy-row code { flex: 1 1 260px; padding: 8px 10px; }

/* ---------------------------------------------------------------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--bg-inset); border-radius: var(--radius); padding: 14px 16px; }
.card p { font-size: .87rem; color: var(--text-muted); margin-bottom: .6em; }

/* ---------------------------------------------------------------- ads */
.ad-slot { max-width: var(--maxw); margin: 12px auto; padding: 0 20px; text-align: center; min-height: 0; }
.ad-slot[hidden] { display: none; }

/* ---------------------------------------------------------------- footer */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  text-align: center;
}
.footer-links { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; }
.disclaimer { line-height: 1.6; margin: 0; }

@media (max-width: 560px) {
  .panel { padding: 16px; }
  .dropzone { padding: 24px 14px; }
  .results-head { flex-direction: column; }
}

/* ---------------------------------------------------------------- world info */
.world-info {
  background: var(--bg-inset);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 14px 0 4px;
}
.world-info h3 { margin: 0 0 10px; font-size: .95rem; }
.info-grid { display: grid; gap: 6px; }
.info-row { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: .88rem; }
.info-label { color: var(--text-muted); flex: none; min-width: 7em; }
.info-value { overflow-wrap: anywhere; }
.copyable { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copyable code { font-size: .95em; }
.biome-note { margin: 12px 0 0; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 0; }
.filters label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; color: var(--text-muted); cursor: pointer;
}
.filters input { accent-color: var(--accent); }

/* ---------------------------------------------------------------- report form */
.honeypot {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
#report-form .field { margin: 0 0 16px; }
#report-form label { display: block; font-size: .88rem; color: var(--text-muted); margin-bottom: 6px; }
#report-form .required { color: var(--danger); font-size: .78em; }
#report-form input[type="text"],
#report-form input[type="email"],
#report-form textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  resize: vertical;
}
#report-form input:focus, #report-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.report-status { margin: 12px 0 0; font-size: .88rem; min-height: 1.4em; }
.report-status-ok { color: var(--accent); }
.report-status-error { color: var(--danger); }
