/* Targon — TOR 2e character sheets, dark fantasy theme */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
    background: #1a1510;
    color: #d4c4a0;
    padding: 20px;
    min-height: 100vh;
}
.container { max-width: 1100px; margin: 0 auto; }

/* Header */
.sheet-header {
    background: linear-gradient(135deg, #2a2018 0%, #1a1510 100%);
    border: 2px solid #5a4a30;
    border-radius: 8px;
    padding: 25px 30px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.sheet-header h1 {
    font-size: 2.2em;
    color: #c9a84c;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(201,168,76,0.3);
    margin-bottom: 5px;
}
.sheet-header .subtitle {
    color: #8a7a5a;
    font-style: italic;
    font-size: 1.1em;
}

/* Sections */
.section {
    background: #221a12;
    border: 1px solid #4a3a25;
    border-radius: 6px;
    padding: 18px 22px;
    margin-bottom: 16px;
}
.section h2 {
    color: #c9a84c;
    font-size: 1.2em;
    border-bottom: 1px solid #4a3a25;
    padding-bottom: 6px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Info table */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
    padding: 5px 10px;
    border-bottom: 1px dotted #3a2a18;
}
.info-table td:first-child {
    color: #8a7a5a;
    width: 35%;
    font-style: italic;
}
.info-table td:last-child {
    color: #d4c4a0;
    font-weight: bold;
}

/* Attributes */
.attr-box {
    background: #1a140e;
    border: 1px solid #4a3a25;
    border-radius: 6px;
    padding: 14px;
    text-align: center;
}
.attr-box .attr-name {
    color: #8a7a5a;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.attr-box .attr-rating {
    font-size: 2.2em;
    color: #c9a84c;
    font-weight: bold;
}
.attr-box .attr-tn {
    color: #6a5a3a;
    font-size: 0.9em;
    margin-top: 4px;
}
.attr-box .attr-tn span { color: #d4c4a0; font-weight: bold; }

/* Stat bars */
.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.stat-label {
    width: 100px;
    color: #8a7a5a;
    font-size: 0.9em;
}
.stat-value {
    width: 70px;
    color: #d4c4a0;
    font-weight: bold;
    font-size: 0.95em;
}
.bar-track {
    flex: 1;
    height: 14px;
    background: #0d0a06;
    border: 1px solid #3a2a18;
    border-radius: 3px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Skills */
.skill-col h3 {
    color: #c9a84c;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid #4a3a25;
    padding-bottom: 4px;
}
.skill-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-bottom: 1px dotted #2a2018;
    font-size: 0.9em;
}
.skill-row .skill-name { color: #d4c4a0; }
.skill-row .skill-name .fav { color: #c9a84c; font-size: 0.8em; }
.skill-row .skill-rank {
    color: #c9a84c;
    font-weight: bold;
    min-width: 20px;
    text-align: right;
}

/* Combat table */
table.combat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
table.combat-table th {
    color: #8a7a5a;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid #4a3a25;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}
table.combat-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #2a2018;
    color: #d4c4a0;
}
table.combat-table tr.equipped { background: #2a2018; }
.tag-equipped {
    display: inline-block;
    background: #4a3a25;
    color: #c9a84c;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
}

/* Virtues */
.virtue-card {
    background: #1a140e;
    border-left: 3px solid #c9a84c;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
}
.virtue-card .vname { color: #c9a84c; font-weight: bold; }
.virtue-card .vsource {
    font-size: 0.8em;
    color: #6a5a3a;
    font-style: italic;
}
.virtue-card .vdesc {
    color: #b0a080;
    font-size: 0.9em;
    margin-top: 4px;
}

/* Conditions */
.condition-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cond-badge {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
}
.cond-active { background: #8b2500; color: #ffd0a0; border: 1px solid #c9501a; }
.cond-inactive { background: #1a140e; color: #4a3a25; border: 1px solid #2a2018; }

/* Feature pills */
.pill {
    display: inline-block;
    background: #2a2018;
    border: 1px solid #4a3a25;
    color: #d4c4a0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    margin: 2px;
}
.pill.flaw { border-color: #8b2500; color: #c98060; }

/* Character list */
.char-list { list-style: none; }
.char-list li {
    background: #221a12;
    border: 1px solid #4a3a25;
    border-radius: 6px;
    padding: 14px 20px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.char-list li:hover { border-color: #c9a84c; }
.char-list a {
    text-decoration: none;
    color: #c9a84c;
    font-size: 1.15em;
    font-weight: bold;
}
.char-list a:hover { text-decoration: underline; }
.char-list .char-info { color: #8a7a5a; font-size: 0.9em; margin-top: 4px; }
.char-list .inactive-tag {
    display: inline-block;
    background: #3a2a18;
    color: #6a5a3a;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-left: 8px;
}
.char-list .player-tag {
    display: inline-block;
    background: #1a2a1a;
    border: 1px solid #3a5a3a;
    color: #8ab08a;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-left: 8px;
}

/* Points */
.points-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.point-box {
    text-align: center;
    background: #1a140e;
    border: 1px solid #4a3a25;
    border-radius: 6px;
    padding: 10px 20px;
    min-width: 80px;
}
.point-box .plabel {
    color: #8a7a5a;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.point-box .pval {
    color: #c9a84c;
    font-size: 1.6em;
    font-weight: bold;
}

/* Gear list */
.gear-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gear-item {
    background: #2a2018;
    border: 1px solid #3a2a25;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    color: #b0a080;
}

/* History */
.history-text {
    color: #b0a080;
    font-style: italic;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Nav bar */
.navbar {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: #221a12;
    border: 1px solid #4a3a25;
    border-radius: 6px;
}
.navbar a {
    color: #8a7a5a;
    text-decoration: none;
    font-size: 0.95em;
    letter-spacing: 1px;
}
.navbar a:hover { color: #c9a84c; }
.navbar a.active { color: #c9a84c; font-weight: bold; }

/* Live indicator (websocket status, Phase 4) */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4a3a25;
    margin-left: 8px;
    vertical-align: middle;
}
.live-dot.connected { background: #4a7c3a; box-shadow: 0 0 6px rgba(74,124,58,0.8); }

/* Journey map */
#journey-map {
    height: 480px;
    border: 2px solid #5a4a30;
    border-radius: 6px;
    background: #d8c9a3;
}
.map-unavailable {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6a5a3a;
    font-style: italic;
}
.map-place-label {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #3a2a18;
    font-family: 'Palatino Linotype', Georgia, serif;
    font-style: italic;
    font-size: 11px;
    text-shadow: 0 0 3px #d8c9a3, 0 0 3px #d8c9a3;
}
.map-place-label::before { display: none; }
.map-event-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #8b2500;
    color: #ffd0a0;
    border: 2px solid #3a2a18;
    font-weight: bold;
    font-size: 11px;
    font-family: Georgia, serif;
}
.leaflet-popup-content-wrapper {
    background: #221a12;
    color: #d4c4a0;
    border: 1px solid #5a4a30;
    border-radius: 6px;
    font-family: 'Palatino Linotype', Georgia, serif;
}
.leaflet-popup-tip { background: #221a12; }
.leaflet-popup-content b { color: #c9a84c; }
.map-popup-result { color: #8ab08a; }
.map-league-scale {
    background: rgba(216, 201, 163, 0.85);
    border: 1px solid #5a4a30;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: Georgia, serif;
}
.map-league-scale .scale-bar {
    height: 5px;
    background: #3a2a18;
    border-left: 2px solid #3a2a18;
    border-right: 2px solid #3a2a18;
    margin-bottom: 2px;
}
.map-league-scale .scale-text {
    font-size: 11px;
    color: #3a2a18;
    font-style: italic;
}
.map-distance-badge {
    background: rgba(34, 26, 18, 0.9);
    color: #c9a84c;
    border: 1px solid #5a4a30;
    border-radius: 4px;
    padding: 5px 10px;
    font-family: 'Palatino Linotype', Georgia, serif;
    font-style: italic;
    font-size: 12px;
}

/* Wizard */
.wizard-progress { margin-top: 8px; }
.wizard-dot {
    display: inline-block; width: 12px; height: 12px; border-radius: 50%;
    background: #3a2f22; border: 1px solid #5a4a30; margin: 0 4px;
}
.wizard-dot.done { background: #c9a84c; }
.wizard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wizard-card { display: block; cursor: pointer; }
.wizard-card input { position: absolute; opacity: 0; }
.wizard-card .card-body {
    background: #241c12; border: 2px solid #4a3a24; border-radius: 8px;
    padding: 14px 16px; transition: border-color 0.15s;
    height: 100%;
}
.wizard-card input:checked + .card-body { border-color: #c9a84c; background: #2c2318; }
.wizard-card .card-title { color: #c9a84c; font-size: 1.15em; font-weight: bold; margin-bottom: 4px; }
.wizard-card .card-sub { color: #b0a080; font-style: italic; margin-bottom: 8px; }
.wizard-card .card-detail { color: #8a7a5a; font-size: 0.85em; margin-top: 4px; }
.wizard-nav { margin-top: 20px; display: flex; gap: 12px; align-items: center; }
.wizard-btn {
    background: #c9a84c; color: #1a140c; border: none; border-radius: 6px;
    padding: 10px 22px; font-family: inherit; font-size: 1em; font-weight: bold;
    cursor: pointer; text-decoration: none; display: inline-block;
}
.wizard-btn:hover { background: #ddbc60; }
.wizard-btn:disabled { background: #6a5a3a; cursor: not-allowed; }
.wizard-btn.secondary { background: #3a2f22; color: #c9a84c; border: 1px solid #5a4a30; }
.wizard-text {
    background: #1a140c; border: 1px solid #5a4a30; border-radius: 6px;
    color: #e8dcc0; padding: 10px 14px; font-family: inherit; font-size: 1.05em;
    width: 100%; max-width: 420px; display: block; margin-bottom: 12px;
}
.fav-option { display: inline-block; margin: 4px 14px 4px 0; color: #d4c4a0; cursor: pointer; }
.prof-choice { margin: 10px 0; color: #b0a080; }
.points-badge { color: #c9a84c; font-weight: bold; margin-left: 8px; }
.fav-star { color: #c9a84c; }
.xp-input {
    width: 52px; background: #1a140c; border: 1px solid #5a4a30;
    border-radius: 4px; color: #e8dcc0; padding: 4px 6px; font-family: inherit;
}
.hint { color: #8a7a5a; font-size: 0.85em; font-style: italic; }

/* Footer */
.footer {
    text-align: center;
    color: #4a3a25;
    font-size: 0.8em;
    margin-top: 20px;
    padding: 10px;
}
.footer a { color: #6a5a3a; }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
