/* ============================================================
   Old Gods of Appalachia GM Screen — styles.css
   Southern Gothic horror | early 1900s Appalachia
   ============================================================ */

:root {
    --bg:           #080604;
    --surface:      #120e08;
    --accent:       #4a3010;
    --accent-light: #7a5020;
    --text:         #d8c8a0;
    --text-dim:     #a09070;
    --muted:        #706050;
    --gold:         #c0902a;
    --danger:       #5a1a0a;
    --border:       #201808;
    --surface2:     #1a1208;
    --surface3:     #221608;
    --input-bg:     #0e0a04;
    --success:      #3a5a1a;
    --fail:         #5a1a0a;
    --tab-active:   #7a5020;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtle texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.06) 2px,
            rgba(0,0,0,0.06) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* ---- Navigation ---- */
nav.site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem;
    position: relative;
    z-index: 10;
}

nav.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

nav.site-nav a {
    color: var(--text-dim);
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

nav.site-nav a:hover { color: var(--gold); }

/* ---- Screen Wrapper ---- */
.ogoa-screen {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ---- Header ---- */
.screen-header {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 1.5rem;
    position: relative;
}

.screen-header::before,
.screen-header::after {
    content: '✦';
    color: var(--gold);
    font-size: 1rem;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}
.screen-header::before { left: 1rem; }
.screen-header::after  { right: 1rem; }

.screen-header h1 {
    font-family: Georgia, serif;
    font-size: 2.2rem;
    color: var(--gold);
    letter-spacing: 0.12em;
    text-shadow: 0 0 20px rgba(192, 144, 42, 0.3);
    line-height: 1.2;
}

.screen-header .subtitle {
    color: var(--text-dim);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.3rem;
    letter-spacing: 0.08em;
}

.screen-header .system-tag {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;
}

.tab-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    border-radius: 2px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--accent-light);
}

.tab-btn.active {
    background: var(--tab-active);
    color: #f0e0b0;
    border-color: var(--gold);
    font-weight: bold;
}

/* ---- Panels ---- */
.panel { display: none; }
.panel.active { display: block; }

/* ---- Section Headers ---- */
.panel h2 {
    font-family: Georgia, serif;
    color: var(--gold);
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent);
}

.panel h3 {
    font-family: Georgia, serif;
    color: var(--accent-light);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.7rem;
    margin-top: 0.2rem;
}

.panel h4 {
    color: var(--text-dim);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

/* ---- Grid Layouts ---- */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}

.rule-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.1rem;
    border-radius: 2px;
}

.rule-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.5rem; }
.rule-card p:last-child { margin-bottom: 0; }

/* ---- Tables ---- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 0.6rem 0;
}

th {
    background: var(--accent);
    color: #e8d8a0;
    padding: 0.45rem 0.7rem;
    text-align: left;
    font-weight: bold;
    letter-spacing: 0.04em;
    border: 1px solid var(--border);
}

td {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: top;
}

tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:hover td { background: rgba(192, 144, 42, 0.06); }

.highlight-row td { color: var(--text); }
.danger-row td { color: #c06040; }

/* ---- Difficulty Pip Display ---- */
.diff-badge {
    display: inline-block;
    min-width: 1.8rem;
    text-align: center;
    background: var(--accent);
    color: var(--gold);
    font-weight: bold;
    border-radius: 2px;
    padding: 0.1rem 0.4rem;
    font-size: 0.9rem;
}

.diff-0  { background: #1a1a1a; color: var(--text-dim); }
.diff-1  { background: #1a2a0a; color: #80c040; }
.diff-2  { background: #1a2a0a; color: #80c040; }
.diff-3  { background: #2a2800; color: #c0b030; }
.diff-4  { background: #2a2800; color: #c0b030; }
.diff-5  { background: #302010; color: var(--gold); }
.diff-6  { background: #302010; color: var(--gold); }
.diff-7  { background: #3a1808; color: #c06820; }
.diff-8  { background: #3a1808; color: #c06820; }
.diff-9  { background: #4a0a0a; color: #d04020; }
.diff-10 { background: #3a0000; color: #e03030; }

/* ---- Callout Boxes ---- */
.callout {
    background: var(--surface2);
    border: 1px solid var(--accent);
    border-left: 4px solid var(--gold);
    padding: 0.8rem 1rem;
    border-radius: 2px;
    margin: 0.8rem 0;
    font-size: 0.88rem;
    color: var(--text-dim);
}

.callout strong { color: var(--text); }

.callout-dark {
    background: var(--surface);
    border-left-color: var(--danger);
}

.callout-green {
    background: rgba(20, 40, 10, 0.5);
    border-left-color: #4a8030;
}

/* ---- Tags / Badges ---- */
.tag {
    display: inline-block;
    background: var(--accent);
    color: var(--text-dim);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
    margin-right: 0.3rem;
}

.tag-gold    { background: rgba(192,144,42,0.3); color: var(--gold); }
.tag-green   { background: rgba(40,80,20,0.5); color: #80b050; }
.tag-dark    { background: rgba(90,26,10,0.5); color: #c06040; }
.tag-muted   { background: var(--border); color: var(--muted); }

/* ---- Dice Roller Tab ---- */
.roller-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 3px;
}

.roller-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.roller-controls label {
    display: block;
    color: var(--text-dim);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.roller-controls select,
.roller-controls input[type="number"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 0.5rem 0.7rem;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.roller-controls select:focus,
.roller-controls input[type="number"]:focus {
    outline: none;
    border-color: var(--gold);
}

.roll-btn {
    width: 100%;
    background: var(--accent);
    color: #f0e0b0;
    border: 1px solid var(--gold);
    padding: 0.75rem;
    font-family: Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.roll-btn:hover {
    background: var(--accent-light);
    box-shadow: 0 0 12px rgba(192, 144, 42, 0.2);
}

.roll-btn:active { transform: scale(0.98); }

.result-box {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1.2rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.result-die {
    font-size: 3rem;
    font-weight: bold;
    color: var(--gold);
    line-height: 1;
    font-family: Georgia, serif;
    text-shadow: 0 0 20px rgba(192, 144, 42, 0.5);
}

.result-outcome {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.12em;
}

.result-outcome.success { color: #80c040; }
.result-outcome.auto-success { color: #50e050; }
.result-outcome.failure  { color: #d04040; }

.result-detail {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ---- Effort Calculator ---- */
.effort-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.8rem 1rem;
    border-radius: 2px;
    margin-top: 0.8rem;
    font-size: 0.88rem;
    color: var(--text-dim);
}

/* ---- Character Tracker ---- */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.2rem;
}

.char-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent-light);
    padding: 1rem;
    border-radius: 2px;
    position: relative;
}

.char-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    gap: 0.5rem;
}

.char-name-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--accent);
    color: var(--gold);
    padding: 0.4rem 0.6rem;
    font-family: Georgia, serif;
    font-size: 1rem;
    border-radius: 2px;
}

.char-name-input:focus { outline: none; border-color: var(--gold); }

.char-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.char-meta select,
.char-meta input[type="number"] {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.3rem 0.5rem;
    font-family: Georgia, serif;
    font-size: 0.82rem;
    border-radius: 2px;
}

.char-meta select { flex: 1; }
.char-meta input[type="number"] { width: 64px; }

/* Pool rows */
.pools-section { margin-bottom: 0.8rem; }

.pool-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px 60px;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.45rem;
}

.pool-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}

.pool-bar-wrap {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.pool-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
    background: linear-gradient(90deg, var(--accent), var(--gold));
}

.pool-bar.speed-bar  { background: linear-gradient(90deg, #1a3a2a, #40b070); }
.pool-bar.intel-bar  { background: linear-gradient(90deg, #1a1a4a, #4060d0); }

.pool-current,
.pool-max,
.pool-edge {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-align: center;
    font-family: Georgia, serif;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    border-radius: 2px;
    width: 100%;
}

.pool-current:focus,
.pool-max:focus,
.pool-edge:focus { outline: none; border-color: var(--gold); }

.pool-edge { color: var(--gold); border-color: var(--accent); }

/* Recovery & Tier row */
.char-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.char-stat-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.4rem 0.5rem;
    border-radius: 2px;
    text-align: center;
}

.char-stat-block label {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.char-stat-block input {
    background: transparent;
    border: none;
    color: var(--gold);
    text-align: center;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    width: 100%;
}

.char-stat-block input:focus { outline: none; }

/* Recovery pips */
.recovery-pips {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.recovery-pip {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: var(--input-bg);
    cursor: pointer;
    transition: background 0.15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    color: transparent;
}

.recovery-pip.used {
    background: var(--accent-light);
    color: var(--gold);
}

.pip-label {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.3rem;
    width: 100%;
}

/* Remove / Add char buttons */
.char-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s, color 0.15s;
}

.char-btn:hover { background: var(--accent); color: var(--text); }
.char-btn.danger:hover { background: var(--danger); }

.add-char-btn {
    background: var(--surface);
    border: 1px dashed var(--accent-light);
    color: var(--accent-light);
    padding: 0.8rem;
    width: 100%;
    cursor: pointer;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    border-radius: 2px;
    margin-top: 1rem;
    transition: background 0.2s, color 0.2s;
}

.add-char-btn:hover {
    background: var(--surface2);
    color: var(--gold);
    border-color: var(--gold);
}

/* ---- GM Tools Tab ---- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}

.tool-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-light);
    padding: 1rem;
    border-radius: 2px;
}

.tool-section h3 { margin-top: 0; }

.intrusion-roll-area {
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 2px;
    margin-top: 0.6rem;
}

.intrusion-roll-area p { font-size: 0.85rem; color: var(--text-dim); }

.gm-roll-btn {
    background: var(--danger);
    color: #e0a080;
    border: 1px solid #8a3010;
    padding: 0.5rem 1rem;
    font-family: Georgia, serif;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 2px;
    margin-top: 0.5rem;
    width: 100%;
    transition: background 0.2s;
}

.gm-roll-btn:hover { background: #7a2a10; }

.cypher-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cypher-list li {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    border-radius: 2px;
}

.cypher-list li strong {
    color: var(--gold);
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.cypher-list li span {
    color: var(--text-dim);
    font-size: 0.82rem;
    font-style: italic;
}

.cypher-level {
    font-size: 0.75rem;
    color: var(--muted);
    float: right;
}

.entity-list {
    list-style: none;
    padding: 0;
}

.entity-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.entity-list li:last-child { border-bottom: none; }

.entity-name { color: var(--text); font-size: 0.88rem; }
.entity-tier { font-size: 0.78rem; color: var(--muted); }

/* ---- Encounter Notes ---- */
.encounter-block {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.7rem 0.9rem;
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

.encounter-block h4 { color: var(--gold); margin-bottom: 0.3rem; font-size: 0.9rem; }
.encounter-block p { font-size: 0.83rem; color: var(--text-dim); }

/* ---- Notes Tab ---- */
.notes-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notes-meta {
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
}

.notes-textarea {
    width: 100%;
    min-height: 400px;
    background: var(--input-bg);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 1rem;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.7;
    resize: vertical;
    border-radius: 2px;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.notes-btn {
    background: var(--accent);
    color: #f0e0b0;
    border: 1px solid var(--gold);
    padding: 0.5rem 1.2rem;
    font-family: Georgia, serif;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s;
}

.notes-btn:hover { background: var(--accent-light); }

/* ---- Setting Tab ---- */
.setting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
}

.setting-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--accent-light);
    padding: 1rem;
    border-radius: 2px;
}

.setting-card h3 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    margin-bottom: 0.7rem;
}

.setting-card ul {
    padding-left: 1.2rem;
    font-size: 0.88rem;
    color: var(--text-dim);
}

.setting-card ul li { margin-bottom: 0.35rem; }

.entity-category {
    margin-bottom: 0.9rem;
}

.entity-category h4 {
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--border);
}

.entity-category ul {
    list-style: none;
    padding: 0;
}

.entity-category ul li {
    font-size: 0.84rem;
    color: var(--text-dim);
    padding: 0.2rem 0;
    padding-left: 0.8rem;
    border-left: 2px solid var(--border);
    margin-bottom: 0.2rem;
}

.entity-category ul li::before {
    content: '';
}

/* ---- Folk Magic Section ---- */
.magic-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.magic-type-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 2px;
}

.magic-type-card h4 { color: var(--gold); font-size: 0.9rem; margin-bottom: 0.4rem; }
.magic-type-card p { font-size: 0.83rem; color: var(--text-dim); }

/* ---- Weapons/Gear list ---- */
.gear-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

/* ---- Quote block ---- */
blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.6rem 1rem;
    margin: 0.8rem 0;
    font-style: italic;
    color: var(--text-dim);
    font-size: 0.88rem;
    background: var(--surface2);
}

blockquote cite {
    display: block;
    font-style: normal;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.3rem;
}

/* ---- Footer ---- */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

/* ---- Save indicator ---- */
.save-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--accent);
    color: var(--gold);
    padding: 0.4rem 1rem;
    border-radius: 2px;
    font-size: 0.82rem;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 100;
    pointer-events: none;
}

.save-indicator.visible { opacity: 1; }

/* ---- Separator / ornament ---- */
.ornament {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    margin: 0.8rem 0;
    opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .screen-header h1 { font-size: 1.5rem; }
    .tabs { gap: 0.3rem; }
    .tab-btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
    .pool-row { grid-template-columns: 72px 1fr 50px 50px; }
    .roller-controls { grid-template-columns: 1fr; }
    .char-footer { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .ogoa-screen { padding: 0.8rem; }
    .pool-row { grid-template-columns: 60px 1fr 44px 44px; }
}
