/* FFXIV Bestiary Tracker - same dark and gold look as my other tools */

:root {
  --bg: #101109;
  --panel: #1a1c14;
  --panel-lift: #22251b;
  --line: #343827;
  --ink: #e9e5d6;
  --muted: #9c9a86;
  --gold: #c9a84c;
  --gold-dim: rgba(201, 168, 76, 0.16);
  --done: #7fae5a;

  --wrap: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 20px 70px;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(90% 60% at 50% -10%, rgba(201, 168, 76, 0.09), rgba(0, 0, 0, 0) 70%);
  background-repeat: no-repeat;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip { position: absolute; left: -999px; }
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--gold);
  color: #191a12;
}

a { color: var(--gold); }

/* Top strip */
.site {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.site-home {
  font-weight: 600;
  text-decoration: none;
}
.site-home:hover { text-decoration: underline; }

.site-tag {
  font-size: 14px;
  color: var(--muted);
}

/* Heading block */
.intro {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 36px 0 26px;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gold);
}

.lede {
  margin: 0 0 16px;
  max-width: 62ch;
  font-size: 18px;
  color: var(--ink);
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 5px 13px;
  font-size: 14px;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 999px;
}

/* Panels */
.panel {
  max-width: var(--wrap);
  margin: 0 auto 20px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--muted);
}
.count strong {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.bar {
  height: 10px;
  overflow: hidden;
  background: #0d0e08;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8f7a35, var(--gold));
  transition: width 0.25s ease;
}

.breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}
.breakdown strong {
  color: var(--ink);
  font-size: 16px;
}

/* Filter row */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: flex-end;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.control label,
.control-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.control input[type="search"],
.control select {
  min-width: 220px;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--panel-lift);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.control-actions {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  cursor: pointer;
}
.toggle input { accent-color: var(--gold); width: 17px; height: 17px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: var(--panel-lift);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.is-on {
  color: #191a12;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}

.btn {
  padding: 9px 16px;
  font: inherit;
  font-size: 15px;
  color: #191a12;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { background: #d8b95f; }

.btn-quiet {
  color: var(--ink);
  background: var(--panel-lift);
  border-color: var(--line);
}
.btn-quiet:hover { background: #2b2f22; }

.share-out {
  max-width: var(--wrap);
  margin: -6px auto 20px;
  padding: 12px 16px;
  font-size: 14px;
  word-break: break-all;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Shared list notice */
.notice {
  max-width: var(--wrap);
  margin: 0 auto 20px;
  padding: 16px 20px;
  background: var(--gold-dim);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 12px;
}
.notice p { margin: 0 0 12px; }
.notice-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* The table */
.table-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 0;
  text-align: left;
  background: var(--panel-lift);
  border-bottom: 1px solid var(--line);
}

thead button {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
thead button:hover { color: var(--ink); }
thead button.is-sorted { color: var(--gold); }
thead button.is-sorted::after {
  content: " \25B2";
  font-size: 10px;
}
thead button.is-sorted.is-desc::after { content: " \25BC"; }

.col-gourd {
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.col-tick button { text-align: center; }

tbody tr { border-bottom: 1px solid rgba(52, 56, 39, 0.6); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(201, 168, 76, 0.05); }

tbody td {
  padding: 12px 14px;
  font-size: 15px;
  vertical-align: middle;
}

.cell-name {
  font-weight: 600;
  font-size: 16px;
}

.col-n, tbody td:first-child {
  width: 62px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.col-lv, tbody td:nth-child(3) {
  width: 62px;
  font-variant-numeric: tabular-nums;
}

.cell-gourd { width: 80px; color: var(--muted); }
.cell-gourd.has-gourd {
  color: var(--gold);
  cursor: help;
  border-bottom: 1px dotted rgba(201, 168, 76, 0.5);
}

.cell-tick { width: 82px; text-align: center; }
.cell-tick input {
  width: 20px;
  height: 20px;
  accent-color: var(--done);
  cursor: pointer;
}

tbody tr.is-tamed td { color: var(--muted); }
tbody tr.is-tamed .cell-name {
  color: var(--done);
  text-decoration: line-through;
  text-decoration-color: rgba(127, 174, 90, 0.5);
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid;
}
.tag-overworld { color: #8fbf6a; border-color: rgba(143, 191, 106, 0.4); background: rgba(143, 191, 106, 0.1); }
.tag-dungeon { color: #79a9d1; border-color: rgba(121, 169, 209, 0.4); background: rgba(121, 169, 209, 0.1); }
.tag-trial { color: #b98ed4; border-color: rgba(185, 142, 212, 0.4); background: rgba(185, 142, 212, 0.1); }
.tag-raid { color: #d98a7a; border-color: rgba(217, 138, 122, 0.4); background: rgba(217, 138, 122, 0.1); }
.tag-alliance-raid { color: #dda05f; border-color: rgba(221, 160, 95, 0.4); background: rgba(221, 160, 95, 0.1); }
.tag-quest { color: var(--gold); border-color: rgba(201, 168, 76, 0.4); background: var(--gold-dim); }

.empty {
  margin: 0;
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

.note {
  max-width: var(--wrap);
  margin: 16px auto 0;
  font-size: 14px;
  color: var(--muted);
}

/* Footer */
.footer {
  max-width: var(--wrap);
  margin: 46px auto 0;
  padding-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.footer p { margin: 6px 0; }

.support {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.support a {
  padding: 8px 16px;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.support a:hover { background: var(--panel-lift); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Phones get cards instead of a wide table */
@media (max-width: 820px) {
  body { padding: 0 14px 56px; }

  .intro h1 { font-size: 31px; }
  .lede { font-size: 17px; }

  .control input[type="search"],
  .control select { min-width: 0; width: 100%; }

  .control { width: 100%; }
  .control-actions { margin-left: 0; flex-wrap: wrap; }

  .table-wrap { background: none; border: 0; border-radius: 0; }

  thead { display: none; }

  table, tbody, tr, td { display: block; width: 100%; }

  tbody tr {
    margin-bottom: 12px;
    padding: 6px 4px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 14px;
    text-align: right;
  }

  tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--muted);
  }

  .col-n, tbody td:first-child,
  .col-lv, tbody td:nth-child(3),
  .cell-gourd, .cell-tick { width: auto; }

  .cell-tick { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .bar span { transition: none; }
}
