/* Golarion Idle – base styles. Served locally, no external fonts or assets. */

:root {
    --bg: #17140f;
    --surface: #221d16;
    --text: #e8e0d0;
    --muted: #a89c86;
    --accent: #c89b4a;
    --border: #3a3226;
    --radius: 6px;
    --danger: #a3412f;
    --danger-bg: #3a1c16;
    --danger-text: #e58a77;
    --success: #5f7f4a;
    --success-text: #a9cf8d;
    color-scheme: dark;
}

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

html {
    font-size: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.6;
}

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

.site-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.brand {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

h1 {
    margin-top: 0;
    color: var(--accent);
    font-weight: normal;
}

.lead {
    font-size: 1.15rem;
}

.status {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
}

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

.site-footer p {
    margin: 0;
}

/* --- Navigation --- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.site-nav a {
    text-decoration: none;
}

form.inline {
    display: inline;
    margin: 0;
}

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

.link-button:hover,
.site-nav a:hover {
    text-decoration: underline;
}

/* --- Layout helpers --- */
.container.narrow {
    max-width: 28rem;
}

.prose h2 {
    margin-top: 2rem;
    font-size: 1.15rem;
}

.prose blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    background: var(--surface);
    font-style: italic;
}

.panel {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.panel h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.panel.danger {
    border-color: var(--danger);
}

.hint,
.field-hint {
    color: var(--muted);
    font-size: 0.875rem;
}

.field-hint {
    margin: -0.25rem 0 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- Forms --- */
.form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form label {
    margin-top: 0.5rem;
}

.form label.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

input:focus,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button,
.button {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--bg);
    font: inherit;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary,
button.secondary {
    background: transparent;
    color: var(--accent);
}

button.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: var(--text);
}

.site-nav .link-button {
    margin: 0;
}

/* --- Messages --- */
.notice,
.error-box {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
}

.notice {
    border: 1px solid var(--accent);
    background: var(--surface);
}

.error-box {
    border: 1px solid var(--danger);
    background: var(--danger-bg);
}

.field-error {
    margin: 0;
    color: var(--danger-text);
    font-size: 0.875rem;
}

/* --- One-time codes --- */
.code-box {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
}

.secret-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    word-break: break-all;
    user-select: all;
}

/* --- Admin: content --- */
.facts {
    display: grid;
    /* The term column grows with its content but never beyond 40 %, so long terms wrap instead of squeezing the
       description off the screen on phones. */
    grid-template-columns: fit-content(40%) minmax(0, 1fr);
    gap: 0.25rem 1rem;
    margin: 1rem 0 0.5rem;
}

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

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

details {
    margin: 0.75rem 0;
}

summary {
    cursor: pointer;
    color: var(--accent);
}

.issues {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
}

.issues li {
    margin: 0.25rem 0;
}

.data {
    width: 100%;
    margin-top: 0.5rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data th,
.data td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data th {
    color: var(--muted);
    font-weight: normal;
}

.panel {
    overflow-x: auto;
}

/* --- Guild --- */
.guild-gold {
    font-size: 1.1rem;
}

.slots {
    margin-bottom: 1.5rem;
}

.roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.card {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
}

.card-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.badge {
    padding: 0 0.4rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
}

.badge-ready {
    border: 1px solid var(--success);
    color: var(--success-text);
}

.badge-busy {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.badge-wounded {
    border: 1px solid var(--danger);
    color: var(--danger-text);
}

/* Alpha notice (A3) */
.badge-alpha {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.alpha-note {
    margin-bottom: 0.5rem;
}

.alpha-text {
    white-space: pre-line;
}

/* Place of a template offer below its title (ADR-026) */
.mission-subtitle {
    display: block;
    font-weight: normal;
}

/* Boss missions on the board (Lieferung 12) */
.badge-boss {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.room {
    margin: 1rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.room h3 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    margin: 0;
    font-size: 1.05rem;
}

/* --- Adventurer creation and stats --- */
select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.preview {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.preview-title {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
}

.boosts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.boosts label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attributes {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.attributes th,
.attributes td {
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--border);
}

.attributes th {
    color: var(--muted);
    font-weight: normal;
    font-size: 0.8rem;
}

.attributes .key {
    color: var(--accent);
    font-weight: bold;
}

/* --- Missions --- */
.chain {
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.chain-party {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: center;
    margin: 0 0 0.25rem;
}

.runs {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
}

.runs li {
    margin: 0.35rem 0;
}

.runs li > * {
    margin-right: 0.35rem;
}

button.small {
    margin-top: 0;
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.degree-crit_success,
.degree-success,
.chain-completed {
    border: 1px solid var(--success);
    color: var(--success-text);
}

.degree-failure,
.degree-crit_failure,
.chain-retreated {
    border: 1px solid var(--danger);
    color: var(--danger-text);
}

.chain-active {
    border: 1px solid var(--accent);
    color: var(--accent);
}

input[type="number"] {
    width: 8rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.inline-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form select {
    width: auto;
}

.inline-form button {
    margin-top: 0;
}

/* --- Combat report --- */
.report {
    padding-left: 1.5rem;
    font-size: 0.925rem;
}

.report li {
    margin: 0.2rem 0;
}

.report .report-round {
    margin-top: 0.75rem;
    list-style: none;
    margin-left: -1.5rem;
    color: var(--accent);
    font-weight: bold;
}

/* Round headers and the summary carry no number and must not advance the numbering either. */
.report .report-round,
.report .report-summary {
    counter-increment: list-item 0;
}

.report .report-summary {
    list-style: none;
    margin-left: -1.5rem;
    font-weight: bold;
}

/* --- Herald --- */
.herald-masthead {
    margin: 0 0 0.5rem;
    border-bottom: 3px double var(--accent);
    color: var(--accent);
    font-size: 1.6rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    text-align: center;
}

.herald h1 {
    font-size: 1.5rem;
}

.herald-gauge {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.herald-news li {
    margin: 0.5rem 0;
}

.trend-rising {
    border: 1px solid var(--success);
    color: var(--success-text);
}

.trend-falling {
    border: 1px solid var(--danger);
    color: var(--danger-text);
}

.trend-stable {
    border: 1px solid var(--border);
    color: var(--muted);
}

.herald-archive {
    padding-left: 1.25rem;
}

.actions-cell form,
.actions-cell details {
    margin: 0.2rem 0;
}

.actions-cell .form {
    min-width: 12rem;
}

/* --- Handbook --- */
.sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.sub-nav a[aria-current="page"] {
    color: var(--text);
    text-decoration: none;
    font-weight: bold;
}

.toc {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.info-grid .card-title {
    margin: 0;
    color: var(--accent);
}

.card-heading {
    margin: 1rem 0 0.25rem;
    font-size: 1rem;
    color: var(--muted);
}

/* .facts itself is defined above (admin section); cards use tighter spacing. */
.info-grid .facts {
    gap: 0.25rem 0.75rem;
    margin: 0.5rem 0;
}

.facts dd .hint {
    display: block;
}

.attribute-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.75rem;
}

/* --- Bounty board filter --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 1rem;
    margin: 0 0 1rem;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
    color: var(--muted);
}

.hint-block {
    display: block;
}

/* Combat values of an item in the merchant list. */
.item-stats {
    display: block;
}

/* Feat options below the selection: one block per feat, clearly separated. */
.feat-options {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.feat-options li {
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}

.feat-options li strong {
    display: block;
}

.equipment th {
    text-align: left;
    white-space: nowrap;
}

.equipment select {
    max-width: 22rem;
}

/* Level-up boosts (ADR-027 P2): attribute checkboxes in one wrapping row. */
form.boosts {
    margin-top: 0.4rem;
}

form.boosts fieldset {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 0.4rem;
    padding: 0;
    border: 0;
}

form.boosts legend {
    width: 100%;
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.9em;
}

/* --- Phones (alpha check 21.11.2026) ---
   Tables with class "stack" turn into one card per row; each cell shows its column name from data-label. */
@media (max-width: 40rem) {
    .data.stack thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .data.stack tr {
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border);
    }

    .data.stack td {
        display: block;
        padding: 0.15rem 0;
        border-bottom: 0;
    }

    .data.stack td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--muted);
    }

    .toc li {
        padding: 0.2rem 0;
    }
}
