/* Forever Drop Rate: dark, WoW-flavoured, readable first. */

:root {
    --bg: #0f0d0b;
    --bg-raised: #1a1612;
    --bg-input: #241e18;
    --border: #3a3027;
    --text: #e8e0d2;
    --text-muted: #a8998a;
    --gold: #e6b450;
    --gold-strong: #ffd479;
    --link: #8fc3ff;
    --danger: #ff7b6b;
    --radius: 6px;
    --wrap: 72rem;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-title: Georgia, "Times New Roman", serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--font);
}

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

h1,
h2,
h3 {
    font-family: var(--font-title);
    color: var(--gold);
    line-height: 1.2;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

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

/* Header and footer */

.site-header {
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.brand {
    font-family: var(--font-title);
    font-size: 1.25rem;
    color: var(--gold-strong);
    text-decoration: none;
}

.site-main {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 48px;
}

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 16px 0;
}

/* Search */

.search {
    display: flex;
    gap: 8px;
    min-width: 0;
}

.search input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
}

.search input:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.search button {
    padding: 8px 16px;
    background: var(--gold);
    color: #1a1208;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.search button:hover,
.search button:focus-visible {
    background: var(--gold-strong);
}

.search--compact {
    flex: 1 1 18rem;
    max-width: 28rem;
}

.search--large {
    max-width: 40rem;
    margin: 0 auto;
}

.search--large input,
.search--large button {
    padding: 12px 16px;
    font-size: 1.125rem;
}

/* Blocks */

.hero {
    text-align: center;
    padding: 32px 0;
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    margin: 0 0 8px;
}

.lead {
    color: var(--text-muted);
    margin: 0 0 24px;
}

.panel {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.error-page {
    text-align: center;
}

.error-page__status {
    font-size: 3rem;
    font-family: var(--font-title);
    color: var(--text-muted);
    margin: 0;
}

.error-page__detail {
    text-align: left;
    overflow-x: auto;
    color: var(--danger);
    font-size: 0.8125rem;
}

/* ------------------------------------------------------------------ */
/* Shared bits                                                         */
/* ------------------------------------------------------------------ */

.muted,
.hint {
    color: var(--text-muted);
}

.hint {
    font-size: 0.875rem;
}

.nowrap {
    white-space: nowrap;
}

code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.narrow {
    max-width: 32rem;
    margin: 0 auto;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.notice {
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-raised);
}

.notice a {
    display: block;
}

.notice--success {
    border-color: #3d6b3a;
    background: #16251a;
}

.notice--error {
    border-color: #8a3b33;
    background: #2a1513;
}

.notice--warning {
    border-color: #8a6a2a;
    background: #2a2113;
}

/* Buttons and forms */

.button,
.form button {
    display: inline-block;
    padding: 8px 16px;
    background: var(--gold);
    color: #1a1208;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    background: var(--gold-strong);
}

.button--secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.button--secondary:hover,
.button--secondary:focus-visible {
    background: var(--border);
}

.button--danger {
    background: #8a3b33;
    color: #fff;
}

.button--danger:hover,
.button--danger:focus-visible {
    background: #a8473d;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--link);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

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

.form label {
    margin-top: 10px;
    font-weight: 600;
}

.form button {
    align-self: flex-start;
    margin-top: 16px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-row > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 14rem;
}

input:not([type]),
input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
}

textarea {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.inline,
.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.inline-form {
    margin: 16px 0;
}

.inline-form input {
    width: auto;
    flex: 1 1 12rem;
}

/* Tables */

.table-wrap {
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.table th,
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.table thead th {
    background: var(--bg-raised);
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th {
    border-bottom: 0;
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table--details th {
    width: 14rem;
    color: var(--text-muted);
    font-weight: 600;
}

.truncate {
    max-width: 28rem;
}

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--border);
}

.badge--ok {
    background: #2c5a2a;
    color: #d8f5d2;
}

.badge--duplicate {
    background: #3a3a46;
    color: #d6d6e6;
}

.badge--rejected,
.badge--error {
    background: #7a2f28;
    color: #ffe1dc;
}

.warning {
    color: #f0c674;
    font-size: 0.875rem;
}

.message {
    padding: 12px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Admin */

.brand__tag {
    font-family: var(--font);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-left: 6px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-strong);
    font-variant-numeric: tabular-nums;
}

.stat__label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.cards {
    display: grid;
    gap: 16px;
}

.card {
    padding: 16px;
}

.card--blocked {
    opacity: 0.75;
    border-color: #7a2f28;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card__head h2 {
    margin: 0;
    font-size: 1.125rem;
}

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 12px 0;
}

.facts dt {
    color: var(--text-muted);
}

.facts dd {
    margin: 0;
}

.card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.card__actions .inline-form {
    margin: 0;
}

.filters,
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 12px 0;
}

.filters a[aria-current="page"] {
    color: var(--gold-strong);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 40rem) {
    .facts {
        grid-template-columns: 1fr;
    }

    .facts dd {
        margin-bottom: 6px;
    }

    .table--details th {
        width: auto;
    }
}

/* ------------------------------------------------------------------ */
/* Public pages                                                        */
/* ------------------------------------------------------------------ */

.version-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.version-switch a {
    padding: 4px 12px;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
}

.version-switch a[aria-current="page"] {
    background: var(--gold);
    color: #1a1208;
    font-weight: 600;
}

.stat__value--small {
    font-size: 1rem;
    padding-top: 0.35rem;
}

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 8px 32px;
}

.plain-list {
    padding-left: 1.25rem;
    margin: 0;
}

.plain-list li {
    margin: 4px 0;
}

.explain {
    margin-top: 32px;
    color: var(--text-muted);
    max-width: 48rem;
}

.entry-head h1 {
    margin-bottom: 4px;
}

.entry-head p {
    margin-top: 0;
}

.lang {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-family: var(--font);
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: 0.15em;
}

.rate {
    font-weight: 700;
    color: var(--gold-strong);
    font-variant-numeric: tabular-nums;
    cursor: help;
}

.rate__range {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.thin {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    background: #3a2f1a;
    color: #f0c674;
    font-size: 0.75rem;
    white-space: nowrap;
}

section + section {
    margin-top: 24px;
}

/* Item icons (public/assets/icons, from bin/fetch-icons.php) */

.icon {
    display: inline-block;
    flex: none;
    border: 1px solid #000;
    border-radius: 4px;
    box-shadow: 0 0 0 1px var(--border);
    background: var(--bg-input);
    vertical-align: middle;
}

.icon--24 {
    width: 24px;
    height: 24px;
}

.icon--56 {
    width: 56px;
    height: 56px;
    border-radius: 8px;
}

.item-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.with-icon {
    display: flex;
    align-items: center;
    gap: 14px;
}

.plain-list--icons {
    list-style: none;
    padding-left: 0;
}

.inline-form--tight {
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 40rem) {
    body {
        font-size: 15px;
    }

    .site-header__inner {
        gap: 8px;
    }

    .search--compact {
        flex-basis: 100%;
        max-width: none;
    }

    .admin-nav {
        gap: 10px 14px;
        font-size: 0.9375rem;
    }

    .hero {
        padding: 16px 0;
    }

    .search--large input,
    .search--large button {
        padding: 10px 12px;
        font-size: 1rem;
    }

    /* The interval stays in the tooltip; the table keeps its width. */
    .rate__range {
        display: none;
    }

    .table th,
    .table td {
        padding: 6px 8px;
    }

    .icon--56 {
        width: 44px;
        height: 44px;
    }

    .with-icon {
        gap: 10px;
        font-size: 1.5rem;
    }

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

    .panel {
        padding: 16px;
    }
}

.lang-switch {
    display: flex;
    gap: 10px;
    font-size: 0.875rem;
    margin-right: auto;
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
}

.lang-switch a[aria-current="true"] {
    color: var(--gold-strong);
    font-weight: 600;
}

/* Zone maps (public/assets/maps, from bin/fetch-maps.php) */

.map {
    margin: 12px 0 20px;
    max-width: 1002px;
}

.map__svg {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-raised);
}

.map figcaption {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.map__marker {
    fill: #ffd479;
    stroke: #1a1208;
    stroke-width: 3;
}

.map__marker--node {
    fill: #7fd17a;
}

.map__marker--fishing {
    fill: #6fb7ff;
}

a .map__marker:hover,
a:focus .map__marker {
    stroke: #fff;
    stroke-width: 4;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: -8px;
}

.map-legend__dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: -8px;
    border-radius: 50%;
    border: 2px solid #1a1208;
    background: #ffd479;
}

.map-legend__dot--node {
    background: #7fd17a;
}

.map-legend__dot--fishing {
    background: #6fb7ff;
}
