/**
 * Afrika Korps - Main Stylesheet
 * 
 * Styles for the wargame web application interface.
 * 
 * @author Steve Trabold
 * @copyright 2026 Steve Trabold
 * @license MIT
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c2c2c;
    color: #e0e0e0;
    min-height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background-color: #1a1a1a;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #444;
}

header h1 {
    color: #d4a84b;
    font-size: 1.8rem;
}

#game-info {
    display: flex;
    gap: 2rem;
}

#game-info span {
    padding: 0.5rem 1rem;
    background-color: #333;
    border-radius: 4px;
    font-weight: bold;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    padding: 1rem;
    gap: 1rem;
}

#game-container {
    flex: 1;
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    max-height: calc(100vh - 140px);
    min-height: 400px;
}

#game-canvas {
    background-color: #d4b896;
    cursor: grab;
    display: block;
}

#game-canvas:active {
    cursor: grabbing;
}

/* Legacy info panel - hidden */
#info-panel {
    display: none;
}

#info-panel section {
    background-color: #333;
    border-radius: 8px;
    padding: 1rem;
}

#info-panel h3 {
    color: #d4a84b;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
}

#hex-details, #unit-details {
    font-size: 0.9rem;
    color: #bbb;
}

#btn-sea-move {
    padding: 0.5rem 1rem;
    background-color: #2a6090;
    color: #fff;
    border: 2px solid #4a90c0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

#btn-sea-move:hover {
    background-color: #3a80b0;
}

/* Controls */
#controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#controls button {
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    background-color: #4a4a4a;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

#controls button:hover {
    background-color: #5a5a5a;
}

#btn-new-game {
    background-color: #2d5a27;
}

#btn-new-game:hover {
    background-color: #3d7a37;
}

#btn-end-phase {
    background-color: #5a4a27;
}

#btn-end-phase:hover {
    background-color: #7a6a37;
}

#btn-undo {
    background-color: #4a5568;
}

#btn-undo:hover:not(:disabled) {
    background-color: #718096;
}

#btn-undo:disabled {
    background-color: #2d3748;
    color: #718096;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Combat Panel */
#combat-panel {
    border: 2px solid #d4a84b;
}

#combat-panel h3 {
    color: #ff6b6b;
}

#combat-target, #combat-odds {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

#combat-odds-display {
    font-weight: bold;
    color: #d4a84b;
}

#combat-attackers-list, #combat-defenders-list {
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

#combat-attackers-list ul, #combat-defenders-list ul {
    margin: 0.25rem 0;
    padding-left: 1.2rem;
    list-style: disc;
}

#combat-attackers-list li {
    color: #6b9fff;
}

#combat-defenders-list li {
    color: #ff6b6b;
}

#combat-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#combat-buttons button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

#btn-resolve-combat {
    background-color: #5a272d;
    color: #fff;
}

#btn-resolve-combat:hover:not(:disabled) {
    background-color: #7a3740;
}

#btn-resolve-combat:disabled {
    background-color: #3a3a3a;
    color: #666;
    cursor: not-allowed;
}

#btn-cancel-combat {
    background-color: #4a4a4a;
    color: #fff;
}

#btn-cancel-combat:hover {
    background-color: #5a5a5a;
}

#combat-result {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
}

#combat-result-text {
    font-weight: bold;
}

/* Saves panel */
#saves-panel {
    border: 2px solid #4a9eff;
    background-color: #2a3040;
}

#saves-panel h3 {
    color: #4a9eff;
}

#saves-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.save-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: #3a4050;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.save-item:hover {
    background-color: #4a5060;
    border-left: 3px solid #4a9eff;
}

.save-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.save-info {
    font-size: 0.8rem;
    color: #aaa;
}

#btn-close-saves {
    width: 100%;
    padding: 0.5rem;
    background-color: #555;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#btn-close-saves:hover {
    background-color: #666;
}

/* Order of Battle panel - floating draggable window */
#oob-panel {
    position: fixed;
    top: 100px;
    left: 50px;
    width: 500px;
    height: 450px;
    min-width: 400px;
    min-height: 300px;
    max-width: 90vw;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 2px solid #8b6914;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    resize: both;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

#oob-panel.visible {
    display: flex;
}

#oob-panel.minimized {
    height: auto;
    min-height: auto;
}

#oob-panel.minimized #oob-panel-content {
    display: none;
}

#oob-header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 6px 6px 0 0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    user-select: none;
}

#oob-header h3 {
    color: #d4a84b;
    margin: 0;
    font-size: 1rem;
    border: none;
    padding: 0;
}

#oob-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.oob-header-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.oob-header-btn:hover {
    background-color: #444;
    color: #fff;
}

#oob-panel-content {
    padding: 0.75rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#oob-faction-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.oob-tab {
    flex: 1;
    padding: 0.5rem;
    background-color: #444;
    color: #ccc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.oob-tab:hover {
    background-color: #555;
}

.oob-tab.active {
    background-color: #d4a84b;
    color: #1a1a1a;
    font-weight: bold;
}

#oob-schedule {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.oob-turn-group {
    background-color: #333;
    border-radius: 6px;
    padding: 0.5rem;
}

.oob-turn-header {
    font-weight: bold;
    color: #d4a84b;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #555;
    font-size: 0.9rem;
}

.oob-turn-header.current-turn {
    color: #4aff4a;
}

.oob-turn-header.past-turn {
    color: #888;
}

.oob-units-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.oob-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem;
    background-color: #444;
    border-radius: 4px;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.oob-unit:hover {
    background-color: #555;
    border-color: #d4a84b;
}

.oob-unit.on-map {
    opacity: 0.5;
    border-color: #4a4a4a;
}

.oob-unit.placing {
    border-color: #4caf50;
    box-shadow: 0 0 8px #4caf50, 0 0 12px rgba(76, 175, 80, 0.5);
    animation: pulse-placement 1.5s ease-in-out infinite;
}

@keyframes pulse-placement {
    0%, 100% { box-shadow: 0 0 8px #4caf50, 0 0 12px rgba(76, 175, 80, 0.5); }
    50% { box-shadow: 0 0 12px #4caf50, 0 0 20px rgba(76, 175, 80, 0.7); }
}

.oob-unit-sprite {
    width: 32px;
    height: 32px;
    background-size: cover;
    border-radius: 2px;
}

.oob-unit-name {
    font-size: 0.65rem;
    color: #ccc;
    text-align: center;
    max-width: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.2rem;
}

.oob-unit-stats {
    font-size: 0.6rem;
    color: #999;
}

/* Eliminated units section */
#oob-eliminated-section {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #555;
}

#oob-eliminated-header {
    font-size: 0.85rem;
    color: #c44;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.oob-unit.eliminated {
    opacity: 0.6;
    border-color: #c44;
}

.oob-unit.eliminated .oob-unit-sprite {
    filter: grayscale(50%) brightness(0.7);
}

.oob-units-row.eliminated {
    background-color: rgba(200, 60, 60, 0.1);
    border-radius: 4px;
    padding: 0.25rem;
}

/* Replacement section */
#oob-replacement-section {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #555;
}

#oob-replacement-header {
    font-size: 0.85rem;
    color: #4a9;
    margin-bottom: 0.5rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

#replacement-points-display {
    color: #6c6;
    font-weight: normal;
}

.oob-unit.replacement {
    border-color: #4a9;
}

.oob-unit.replacement .oob-unit-cost {
    font-size: 0.7rem;
    color: #6c6;
    margin-top: 0.1rem;
}

.oob-unit.replacement.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.oob-unit.replacement.can-afford:hover {
    border-color: #6cb;
    background-color: #234;
}

.oob-units-row.replacement {
    background-color: rgba(60, 150, 100, 0.1);
    border-radius: 4px;
    padding: 0.25rem;
}

#oob-replacement-actions {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #333;
    border-radius: 4px;
}

#replacement-selected-unit {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

#replacement-cost {
    font-size: 0.85rem;
    color: #6c6;
    margin-bottom: 0.5rem;
}

#replacement-locations-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 0.25rem;
}

#replacement-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.replacement-location-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background-color: #4a4;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.replacement-location-btn:hover {
    background-color: #5b5;
}

#btn-cancel-replacement {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background-color: #555;
    color: #ccc;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#btn-cancel-replacement:hover {
    background-color: #666;
}

/* Combat panel - floating draggable window */
#combat-panel {
    position: fixed;
    top: 120px;
    right: 320px;
    width: 560px;
    min-width: 480px;
    min-height: 200px;
    max-width: 90vw;
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 2px solid #c44;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1002;
    resize: both;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

#combat-panel.visible {
    display: flex;
}

#combat-panel.minimized {
    height: auto;
    min-height: auto;
}

#combat-panel.minimized #combat-panel-content {
    display: none;
}

#combat-header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 6px 6px 0 0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    user-select: none;
}

#combat-header h3 {
    color: #c44;
    margin: 0;
    font-size: 1rem;
    border: none;
    padding: 0;
}

#combat-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.combat-header-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.combat-header-btn:hover {
    background-color: #444;
    color: #fff;
}

#combat-panel-content {
    padding: 0.75rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

#combat-target,
#combat-odds {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

#combat-target-hex {
    color: #ff9;
    font-weight: bold;
}

#combat-odds-display {
    color: #4af;
    font-weight: bold;
    font-size: 1.1rem;
}

#combat-attackers-list,
#combat-defenders-list {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: #333;
    border-radius: 4px;
}

#combat-attackers-list strong {
    color: #4a4;
}

#combat-defenders-list strong {
    color: #c44;
}

#attacker-list,
#defender-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
}

#attacker-list li,
#defender-list li {
    padding: 0.2rem 0;
    color: #ccc;
}

/* Combat unit items with sprites */
.combat-unit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.combat-unit-item:hover {
    background-color: #444;
}

.combat-unit-item .unit-sprite {
    flex-shrink: 0;
    border-radius: 3px;
}

.combat-unit-info {
    font-size: 0.85rem;
}

#combat-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

#btn-resolve-combat {
    flex: 1;
    padding: 0.6rem;
    background-color: #c44;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.15s;
}

#btn-resolve-combat:hover:not(:disabled) {
    background-color: #e55;
}

#btn-resolve-combat:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
}

#btn-cancel-combat {
    padding: 0.6rem 1rem;
    background-color: #555;
    color: #ccc;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

#btn-cancel-combat:hover {
    background-color: #666;
}

#combat-result {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #442;
    border-radius: 4px;
    border-left: 4px solid #d4a84b;
}

#combat-result-text {
    color: #ff9;
    font-weight: bold;
    font-size: 1.1rem;
}

#btn-combat-ok {
    margin-left: 1rem;
    padding: 0.4rem 1rem;
    background-color: #4a4;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.15s;
}

#btn-combat-ok:hover {
    background-color: #5b5;
}

/* Combat panel layout with CRT */
#combat-main-area {
    display: flex;
    gap: 0.75rem;
}

#combat-unit-selection {
    flex: 1;
    min-width: 180px;
}

#combat-crt-container {
    flex-shrink: 0;
}

#combat-crt-header {
    font-size: 0.75rem;
    color: #888;
    text-align: center;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

#combat-crt {
    border-collapse: collapse;
    font-size: 0.65rem;
}

#combat-crt th,
#combat-crt td {
    padding: 2px 4px;
    text-align: center;
    border: 1px solid #444;
    min-width: 22px;
}

#combat-crt th {
    background-color: #333;
    color: #aaa;
    font-weight: normal;
}

#combat-crt th:first-child {
    background-color: transparent;
    border: none;
}

#combat-crt td:first-child {
    background-color: #333;
    color: #aaa;
    font-weight: bold;
}

/* CRT heat map colors */
#combat-crt .crt-ae {
    background-color: #b33;
    color: #fff;
}

#combat-crt .crt-ab {
    background-color: #c66;
    color: #fff;
}

#combat-crt .crt-ex {
    background-color: #c90;
    color: #fff;
}

#combat-crt .crt-de {
    background-color: #393;
    color: #fff;
}

/* Highlight the current odds column */
#combat-crt th.crt-highlight,
#combat-crt td.crt-highlight {
    box-shadow: inset 0 0 0 2px #fff;
}

/* Highlight the rolled result */
#combat-crt td.crt-rolled {
    box-shadow: inset 0 0 0 3px #ff0;
    font-weight: bold;
    animation: pulse-result 1s ease-in-out infinite;
}

@keyframes pulse-result {
    0%, 100% { box-shadow: inset 0 0 0 3px #ff0; }
    50% { box-shadow: inset 0 0 0 3px #ffa; }
}

@keyframes pulse-border {
    0%, 100% { border-color: #f80; }
    50% { border-color: #fc0; }
}

/* Retreat section within combat panel */
#retreat-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #432;
    border-radius: 4px;
    border: 2px solid #f80;
    animation: pulse-border 1.5s ease-in-out infinite;
}

#retreat-info {
    margin-bottom: 0.5rem;
    color: #fa0;
}

#retreat-unit-name {
    font-weight: bold;
    color: #ff0;
}

#retreat-valid-hexes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

#retreat-valid-hexes button {
    padding: 0.4rem 0.6rem;
    background-color: #f80;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}

#retreat-valid-hexes button:hover {
    background-color: #fa3;
}

/* Exchange section within combat panel */
#exchange-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #432;
    border-radius: 4px;
    border: 2px solid #c44;
    animation: pulse-border-red 1.5s ease-in-out infinite;
}

@keyframes pulse-border-red {
    0%, 100% { border-color: #c44; }
    50% { border-color: #f66; }
}

#exchange-info {
    margin-bottom: 0.5rem;
    color: #f88;
    font-weight: bold;
}

#exchange-cf-counter {
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.25rem;
    background-color: #333;
    border-radius: 4px;
}

#exchange-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.exchange-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    min-width: 60px;
    transition: all 0.2s;
}

.exchange-unit:hover {
    border-color: #c44;
    background-color: #444;
}

.exchange-unit.selected {
    border-color: #f66;
    background-color: #533;
    box-shadow: 0 0 8px rgba(255, 100, 100, 0.5);
}

.exchange-unit-sprite {
    width: 32px;
    height: 32px;
    background-size: cover;
    border-radius: 2px;
}

.exchange-unit-cf {
    font-size: 0.75rem;
    color: #f88;
    font-weight: bold;
    margin-top: 0.25rem;
}

#exchange-actions {
    text-align: center;
}

#btn-apply-exchange {
    padding: 0.5rem 1.5rem;
    background-color: #555;
    color: #888;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: not-allowed;
    font-weight: bold;
}

#btn-apply-exchange:not(:disabled) {
    background-color: #c44;
    color: #fff;
    border-color: #f66;
    cursor: pointer;
}

#btn-apply-exchange:not(:disabled):hover {
    background-color: #d55;
}

/* Advance after combat section */
#advance-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #444;
}

#advance-info {
    margin-bottom: 0.5rem;
    color: #6b9fff;
}

#advance-units-label {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

#advance-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.advance-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    min-width: 60px;
    transition: all 0.2s;
}

.advance-unit:hover {
    border-color: #69f;
    background-color: #444;
}

.advance-unit.selected {
    border-color: #6b9fff;
    background-color: #335;
    box-shadow: 0 0 8px rgba(100, 150, 255, 0.5);
}

#advance-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

#btn-apply-advance {
    padding: 0.5rem 1.5rem;
    background-color: #555;
    color: #888;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: not-allowed;
    font-weight: bold;
}

#btn-apply-advance:not(:disabled) {
    background-color: #36c;
    color: #fff;
    border-color: #69f;
    cursor: pointer;
}

#btn-apply-advance:not(:disabled):hover {
    background-color: #47d;
}

#btn-decline-advance {
    padding: 0.5rem 1.5rem;
    background-color: #444;
    color: #ccc;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#btn-decline-advance:hover {
    background-color: #555;
}

/* Stacking elimination section */
#stacking-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #444;
}

#stacking-info {
    margin-bottom: 0.5rem;
    color: #ff9900;
}

#stacking-units-label {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

#stacking-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stacking-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 4px;
    cursor: pointer;
    min-width: 60px;
    transition: all 0.2s;
}

.stacking-unit:hover {
    border-color: #f90;
    background-color: #444;
}

.stacking-unit.selected {
    border-color: #ff9900;
    background-color: #442;
    box-shadow: 0 0 8px rgba(255, 150, 0, 0.5);
}

#stacking-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

#btn-apply-stacking {
    padding: 0.5rem 1.5rem;
    background-color: #555;
    color: #888;
    border: 2px solid #666;
    border-radius: 4px;
    cursor: not-allowed;
    font-weight: bold;
}

#btn-apply-stacking:not(:disabled) {
    background-color: #c60;
    color: #fff;
    border-color: #f90;
    cursor: pointer;
}

#btn-apply-stacking:not(:disabled):hover {
    background-color: #d70;
}

/* Zoom controls */
#zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#zoom-controls button {
    padding: 0.5rem;
    font-size: 0.9rem;
}

#zoom-level {
    text-align: center;
    font-weight: bold;
    color: #d4a84b;
}

/* Footer */
footer {
    background-color: #1a1a1a;
    padding: 0.5rem 2rem;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    border-top: 1px solid #444;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* ===== Game Log Styles ===== */

#game-log-section {
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
}

#game-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#game-log-header .toggle-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
}

#game-log-header .toggle-btn:hover {
    color: #fff;
}

#game-log-container {
    display: none;
}

#game-log-entries {
    max-height: 200px;
    overflow-y: auto;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.25rem;
    font-size: 0.75rem;
    font-family: monospace;
    margin-bottom: 0.5rem;
}

.log-entry {
    padding: 0.15rem 0.25rem;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 0.5rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #666;
    min-width: 60px;
}

.log-turn {
    color: #888;
    min-width: 25px;
}

.log-text {
    flex: 1;
    color: #ccc;
}

.log-combat .log-text {
    color: #f88;
}

.log-movement .log-text {
    color: #8cf;
}

.log-reinforcement .log-text {
    color: #8f8;
}

.log-phase .log-text {
    color: #fc8;
}

.log-elimination .log-text {
    color: #f66;
}

.log-empty, .log-error {
    color: #888;
    text-align: center;
    padding: 0.5rem;
    font-style: italic;
}

.log-error {
    color: #f66;
}

#btn-refresh-log {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background-color: #444;
    color: #ccc;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#btn-refresh-log:hover {
    background-color: #555;
}

/* ===== Map Editor Styles ===== */

/* Dev mode toggle section */
#dev-mode-section {
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#dev-mode-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #d4a84b;
    font-weight: bold;
}

#dev-mode-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Editor panel - floating draggable window */
#editor-panel {
    position: fixed !important;
    top: 80px;
    right: 300px;
    width: 320px;
    height: 600px;
    min-width: 280px;
    min-height: 300px;
    max-width: 90vw;
    max-height: none !important;
    overflow: hidden !important;
    background-color: #333;
    border-radius: 8px;
    padding: 0;
    border: 2px solid #d4a84b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    resize: both !important;
    display: none;
    flex-direction: column !important;
}

/* When visible via class */
#editor-panel.visible {
    display: flex !important;
}

#editor-panel.minimized {
    height: auto !important;
    max-height: none;
    overflow: visible;
}

#editor-panel.minimized > section:not(#editor-header) {
    display: none !important;
}

#editor-header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 6px 6px 0 0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    user-select: none;
}

#editor-header h3 {
    color: #d4a84b;
    margin: 0;
    font-size: 1rem;
    border: none;
    padding: 0;
}

#editor-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.editor-header-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.editor-header-btn:hover {
    background-color: #444;
    color: #fff;
}

#editor-panel-content {
    padding: 0.75rem;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
}

/* Scrollbar styling for editor panel */
#editor-panel-content::-webkit-scrollbar {
    width: 10px;
}

#editor-panel-content::-webkit-scrollbar-track {
    background: #222;
    border-radius: 5px;
}

#editor-panel-content::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 5px;
}

#editor-panel-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

#editor-panel h3 {
    color: #d4a84b;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

#editor-panel h4 {
    color: #bbb;
    margin: 0.75rem 0 0.5rem 0;
    font-size: 0.9rem;
}

/* Editor Tab Navigation */
#editor-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #555;
    margin-bottom: 0.75rem;
}

.editor-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background-color: #2a2a2a;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.15s, color 0.15s;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.editor-tab:hover {
    background-color: #3a3a3a;
    color: #ccc;
}

.editor-tab.active {
    background-color: #444;
    color: #d4a84b;
    border-bottom: 2px solid #d4a84b;
    margin-bottom: -2px;
}

/* Tab Content */
.editor-tab-content {
    display: none;
}

.editor-tab-content.active {
    display: block;
}

/* Data Tab Styles */
#editor-data-filters {
    margin-bottom: 0.5rem;
}

#terrain-filter-options {
    margin-bottom: 0.5rem;
}

.terrain-filter-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.2rem 0;
    font-size: 0.85rem;
}

#terrain-filter-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    margin-top: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
    padding: 0.25rem;
    background-color: #2a2a2a;
    border-radius: 4px;
}

#terrain-filter-list label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.2rem;
}

#terrain-filter-list label:hover {
    background-color: #3a3a3a;
}

#data-search {
    margin-top: 0.5rem;
}

#hex-data-search {
    width: 100%;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
}

#hex-data-search:focus {
    border-color: #d4a84b;
    outline: none;
}

#editor-data-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    padding: 0.25rem 0;
}

/* Hex Data Table */
#hex-data-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #444;
    border-radius: 4px;
}

#hex-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#hex-data-table thead {
    position: sticky;
    top: 0;
    background-color: #333;
    z-index: 1;
}

#hex-data-table th {
    padding: 0.5rem 0.4rem;
    text-align: left;
    color: #d4a84b;
    border-bottom: 1px solid #555;
    font-weight: 600;
}

#hex-data-table td {
    padding: 0.4rem;
    border-bottom: 1px solid #3a3a3a;
    vertical-align: middle;
}

#hex-data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.1s;
}

#hex-data-table tbody tr:hover {
    background-color: #3a3a3a;
}

#hex-data-table tbody tr.selected {
    background-color: #4a4a3a;
}

#hex-data-table .terrain-cell {
    text-transform: capitalize;
}

#hex-data-table .roads-cell {
    font-size: 0.75rem;
    color: #888;
}

/* Visual Settings Section */
#editor-visual-settings {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
}

#editor-visual-settings h4 {
    color: #d4a84b;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.visual-setting-group {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dotted #333;
}

.visual-setting-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.setting-label {
    display: block;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.color-input-row label {
    font-size: 0.75rem;
    color: #999;
    min-width: 50px;
}

.color-input-row input[type="color"] {
    width: 32px;
    height: 24px;
    border: 1px solid #555;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-input-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input-row input[type="color"]::-webkit-color-swatch {
    border-radius: 2px;
    border: none;
}

.color-input-row .color-value {
    font-size: 0.7rem;
    color: #888;
    font-family: monospace;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.slider-row label {
    font-size: 0.75rem;
    color: #999;
    min-width: 100px;
}

.slider-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: #444;
    border-radius: 3px;
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #d4a84b;
    border-radius: 50%;
    cursor: pointer;
}

.slider-row input[type="range"]::-webkit-slider-thumb:hover {
    background: #e5b95c;
}

/* Terrain options grid */
#terrain-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

#terrain-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    background-color: #2a2a2a;
    font-size: 0.85rem;
    transition: background-color 0.15s;
}

#terrain-options label:hover {
    background-color: #3a3a3a;
}

#terrain-options input[type="radio"] {
    cursor: pointer;
}

#terrain-options input[type="radio"]:checked + span {
    color: #d4a84b;
    font-weight: bold;
}

/* Hex name input */
#hex-name-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #e0e0e0;
    font-size: 0.9rem;
}

#hex-name-input:focus {
    outline: none;
    border-color: #d4a84b;
}

#hex-name-input::placeholder {
    color: #666;
}

/* Sprite selector */
#editor-sprite {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
}

#editor-sprite h4 {
    color: #bbb;
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
}

#sprite-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
}

#sprite-select:focus {
    outline: none;
    border-color: #d4a84b;
}

#sprite-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #888;
}

/* Selection display */
#selected-hex-info {
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #bbb;
}

#selected-hex-info strong {
    color: #d4a84b;
}

/* Editor buttons */
#editor-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

#editor-buttons button,
#editor-save button {
    flex: 1;
    min-width: 80px;
    padding: 0.6rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background-color 0.15s;
}

#btn-editor-apply {
    background-color: #2d5a27;
    color: #fff;
}

#btn-editor-apply:hover {
    background-color: #3d7a37;
}

#btn-editor-delete {
    background-color: #5a272d;
    color: #fff;
}

#btn-editor-delete:hover {
    background-color: #7a3740;
}

#btn-editor-add {
    background-color: #275a5a;
    color: #fff;
}

#btn-editor-add:hover {
    background-color: #377a7a;
}

/* Save section */
#editor-save {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

#btn-editor-save {
    background-color: #5a4a27;
    color: #fff;
}

#btn-editor-save:hover {
    background-color: #7a6a37;
}

#editor-pending-count {
    font-size: 0.8rem;
    color: #888;
}

/* Disabled button state */
#editor-buttons button:disabled,
#editor-save button:disabled {
    background-color: #3a3a3a;
    color: #666;
    cursor: not-allowed;
}

/* Brush mode section */
#editor-brush {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #555;
}

#brush-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    color: #e0e0e0;
}

#brush-toggle-label input:checked + span,
#brush-mode-toggle:checked ~ * {
    color: #4a9;
}

#editor-brush:has(#brush-mode-toggle:checked) {
    border-color: #4a9;
    background-color: #1a3a2a;
}

#brush-hint {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Brush mode buttons */
#brush-mode-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.brush-mode-btn {
    flex: 1;
    padding: 0.5rem;
    border: 2px solid #555;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.brush-mode-btn:hover {
    background-color: #3a3a3a;
}

.brush-mode-btn.active {
    border-color: #4a9;
    background-color: #1a3a2a;
    color: #4a9;
    font-weight: bold;
}

.brush-mode-btn.delete-mode.active {
    border-color: #d44;
    background-color: #3a1a1a;
    color: #f66;
}

/* ===== Hex Lookup Section ===== */
#editor-hex-lookup {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
}

.hex-lookup-row {
    display: flex;
    gap: 0.5rem;
}

#hex-label-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: monospace;
    text-transform: uppercase;
}

#hex-label-input:focus {
    outline: none;
    border-color: #d4a84b;
}

#btn-goto-hex {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #2d5a27;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

#btn-goto-hex:hover {
    background-color: #3d7a37;
}

#hex-lookup-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #888;
}

/* ===== Focused Hex View ===== */
#editor-focused-view {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #1a3a3a;
    border-radius: 4px;
    border: 2px solid #4a9;
}

#editor-focused-view h4 {
    color: #4a9;
    margin: 0 0 0.75rem 0;
}

#focused-hex-label {
    font-family: monospace;
    font-weight: bold;
    color: #6cf;
}

/* Hex neighbor grid - 7 hex layout (honeycomb) */
#hex-neighbor-grid {
    position: relative;
    width: 200px;
    height: 190px;
    margin: 0 auto 0.75rem auto;
}

.neighbor-hex {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 70px;
    background-color: #555; /* This is the "border" color */
    cursor: pointer;
    transition: all 0.15s;
    /* Pointy-top hexagon clip-path */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.neighbor-hex::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background-color: #2a2a2a;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: 0;
    pointer-events: none;
}

.neighbor-hex .dir-label,
.neighbor-hex .hex-label {
    position: relative;
    z-index: 1;
}

.neighbor-hex:hover {
    background-color: #888;
}

.neighbor-hex:hover::before {
    background-color: #3a3a3a;
}

.neighbor-hex.center-hex {
    background-color: #4a9;
}

.neighbor-hex.center-hex::before {
    background-color: #2a3a2a;
}

.neighbor-hex.has-road {
    background-color: #d4a84b;
}

.neighbor-hex.has-road::before {
    background-color: #3a3a1a;
}

.neighbor-hex.road-selected {
    background-color: #ff6;
    box-shadow: 0 0 12px rgba(255, 255, 0, 0.6);
}

.neighbor-hex.road-selected::before {
    background-color: #4a4a2a;
}

/* Coastline selection styling */
.neighbor-hex.coastline-selected {
    background-color: #6cf;
    box-shadow: 0 0 12px rgba(100, 200, 255, 0.6);
}

.neighbor-hex.coastline-selected::before {
    background-color: #2a4a6a;
}

.neighbor-hex.has-coastline::before {
    background-color: #2a4a6a;
}

/* Qattara edge selection styling */
.neighbor-hex.qatara-selected {
    background-color: #a08060;
    box-shadow: 0 0 12px rgba(139, 115, 85, 0.6);
}

.neighbor-hex.qatara-selected::before {
    background-color: #5a4a3a;
}

.neighbor-hex.has-qatara::before {
    background-color: #5a4a3a;
}

.neighbor-hex .dir-label {
    font-size: 0.65rem;
    color: #999;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000;
}

.neighbor-hex .hex-label {
    font-size: 0.7rem;
    color: #ccc;
    font-family: monospace;
    text-shadow: 1px 1px 1px #000;
}

/* Hex positioning for honeycomb layout (pointy-top) */
/* Top row: NW (5) and NE (0) */
.neighbor-hex[data-dir="5"] { left: 35px; top: 0; }    /* NW */
.neighbor-hex[data-dir="0"] { left: 105px; top: 0; }   /* NE */

/* Middle row: W (4), Center (-1), E (1) */
.neighbor-hex[data-dir="4"] { left: 0; top: 55px; }    /* W */
.neighbor-hex[data-dir="-1"] { left: 70px; top: 55px; } /* Center */
.neighbor-hex[data-dir="1"] { left: 140px; top: 55px; } /* E */

/* Bottom row: SW (3) and SE (2) */
.neighbor-hex[data-dir="3"] { left: 35px; top: 110px; } /* SW */
.neighbor-hex[data-dir="2"] { left: 105px; top: 110px; } /* SE */

#focused-hex-info {
    font-size: 0.85rem;
    color: #bbb;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
}

#focused-hex-info div {
    margin: 0.25rem 0;
}

#focused-hex-roads {
    color: #d4a84b;
    font-family: monospace;
}

/* ===== Road Mode Section ===== */
#editor-road-mode {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #555;
}

#editor-road-mode h4 {
    margin: 0 0 0.5rem 0;
    color: #d4a84b;
}

#road-mode-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    color: #e0e0e0;
}

#road-curvature-control,
#road-edge-variation-control {
    margin-top: 0.75rem;
    padding: 0.5rem 0;
}

#road-curvature-control label,
#road-edge-variation-control label {
    display: block;
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 0.3rem;
}

#road-curvature-value,
#road-edge-variation-value {
    color: #d4a84b;
    font-weight: bold;
}

#road-curvature-slider,
#road-edge-variation-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    cursor: pointer;
}

#road-curvature-slider::-webkit-slider-thumb,
#road-edge-variation-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4a84b;
    cursor: pointer;
}

#road-curvature-slider::-moz-range-thumb,
#road-edge-variation-slider::-moz-range-thumb,
#coastline-effect-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4a84b;
    cursor: pointer;
    border: none;
}

/* Visual Effects section */
#editor-visual-effects {
    padding: 0.75rem;
    background: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #444;
}

#editor-visual-effects h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #4a9bd4;
}

#coastline-effect-control {
    padding: 0.5rem 0;
}

#coastline-effect-control label {
    display: block;
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 0.3rem;
}

#coastline-effect-value {
    color: #4a9bd4;
    font-weight: bold;
}

#coastline-effect-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    cursor: pointer;
}

#coastline-effect-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a9bd4;
    cursor: pointer;
}

#editor-road-mode:has(#road-mode-toggle:checked) {
    border-color: #d4a84b;
    background-color: #3a3a1a;
}

#road-direction-panel {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #555;
}

#road-direction-panel p {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

#road-directions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.road-dir-option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    background-color: #1a1a1a;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.road-dir-option:hover {
    background-color: #2a2a2a;
}

.road-dir-option:has(input:checked) {
    background-color: #3a3a1a;
    border: 1px solid #d4a84b;
}

.road-dir-option:has(input:checked) span {
    color: #d4a84b;
    font-weight: bold;
}

#road-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

#btn-apply-roads {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background-color: #5a4a27;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

#btn-apply-roads:hover {
    background-color: #7a6a37;
}

#btn-delete-roads {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background-color: #5a2727;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

#btn-delete-roads:hover {
    background-color: #7a3737;
}

/* Coastline Mode Styles */
#editor-coastline-mode {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

#coastline-mode-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#coastline-effect-control {
    margin-top: 0.75rem;
}

#coastline-direction-panel {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #1a1a2a;
    border-radius: 6px;
}

#coastline-directions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.coastline-dir-option {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    background-color: #1a1a1a;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.coastline-dir-option:hover {
    background-color: #2a2a2a;
}

.coastline-dir-option:has(input:checked) {
    background-color: #1a3a4a;
    border: 1px solid #4a9acc;
}

.coastline-dir-option:has(input:checked) span {
    color: #6cf;
    font-weight: bold;
}

#coastline-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

#btn-apply-coastline {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background-color: #27475a;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

#btn-apply-coastline:hover {
    background-color: #37678a;
}

#btn-delete-coastline {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background-color: #5a2727;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

#btn-delete-coastline:hover {
    background-color: #7a3737;
}

/* Game Notifications (reinforcement alerts, etc.) */
.game-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background-color: #2a2a2a;
    border: 2px solid #d4a84b;
    border-radius: 8px;
    padding: 1.5rem;
    min-width: 350px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
}

.notification-message {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #444;
}

.notification-message:last-of-type {
    border-bottom: none;
}

.notification-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #d4a84b;
    margin-bottom: 0.5rem;
}

.notification-text {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 0.5rem;
}

.notification-units {
    list-style: none;
    padding-left: 0;
    font-size: 0.85rem;
    color: #aaa;
}

.notification-units li {
    padding: 0.2rem 0;
    padding-left: 1rem;
    position: relative;
}

.notification-units li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #888;
}

.notification-message.allied-notif .notification-title {
    color: #6b9fff;
}

.notification-message.axis-notif .notification-title {
    color: #c4594b;
}

.notification-close-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background-color: #4a7c59;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.notification-close-btn:hover {
    background-color: #5a9c69;
}

/* ===== HEX INFO MODAL (Right-Click) ===== */
.hex-info-modal {
    position: fixed;
    display: none;
    width: 280px;
    max-height: 450px;
    background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
    border: 2px solid #d4a84b;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    z-index: 9000;
    overflow: hidden;
    font-size: 0.9rem;
}

.hex-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: #1a1a1a;
    border-bottom: 1px solid #444;
}

.hex-modal-title {
    color: #d4a84b;
    font-weight: bold;
    font-size: 0.85rem;
}

.hex-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
}

.hex-modal-close:hover {
    color: #ff6b6b;
}

.hex-modal-content {
    padding: 0.8rem;
    max-height: 380px;
    overflow-y: auto;
}

.hex-modal-name {
    color: #2c5282;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.hex-modal-terrain {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.hex-modal-label {
    color: #d4a84b;
    font-weight: bold;
}

.hex-modal-terrain-type {
    color: #aaa;
    text-transform: capitalize;
}

.hex-modal-road {
    color: #8B7355;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.hex-modal-features {
    color: #7ec8e3;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.hex-modal-divider {
    border: none;
    border-top: 1px solid #444;
    margin: 0.6rem 0;
}

.hex-modal-units-header {
    color: #d4a84b;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.hex-modal-no-units {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
}

.hex-modal-units-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hex-modal-unit {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    background: #333;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hex-modal-unit:hover {
    background: #3a3a3a;
    border-color: #d4a84b;
    transform: translateX(3px);
}

.hex-modal-unit.allied {
    border-left: 3px solid #6b9fff;
}

.hex-modal-unit.axis {
    border-left: 3px solid #c4594b;
}

.hex-modal-unit-sprite {
    flex-shrink: 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hex-modal-unit-info {
    flex: 1;
    min-width: 0;
}

.hex-modal-unit-name {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hex-modal-unit-stats {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.75rem;
}

.hex-modal-unit-stats .stat {
    color: #888;
}

.hex-modal-unit-stats .stat.attack {
    color: #ff8a80;
}

.hex-modal-unit-stats .stat.defense {
    color: #82b1ff;
}

.hex-modal-unit-stats .stat.movement {
    color: #b9f6ca;
}

/* ===== CAMERA BOUNDS EDITOR ===== */
#editor-camera-bounds {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

#editor-camera-bounds h4 {
    margin-bottom: 0.5rem;
    color: #d4a84b;
}

.bounds-hint {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.bounds-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bounds-label {
    width: 100px;
    font-size: 0.85rem;
    color: #ccc;
}

.bounds-input {
    flex: 1;
    padding: 0.4rem;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.bounds-input:focus {
    border-color: #d4a84b;
    outline: none;
}

.bounds-input.has-value {
    border-color: #4a7c59;
    background: #2a3a2e;
}

.bounds-pick-btn {
    padding: 0.4rem 0.6rem;
    background: #444;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
}

.bounds-pick-btn:hover {
    background: #555;
    border-color: #d4a84b;
}

.bounds-pick-btn.active {
    background: #4a7c59;
    border-color: #6b9c79;
    color: #fff;
}

.bounds-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.bounds-buttons button {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}

#btn-apply-bounds {
    background: #4a7c59;
    color: white;
}

#btn-apply-bounds:hover {
    background: #5a9c69;
}

#btn-clear-bounds {
    background: #8b4049;
    color: white;
}

#btn-clear-bounds:hover {
    background: #ab5059;
}

#btn-auto-bounds {
    background: #4a6b8c;
    color: white;
}

#btn-auto-bounds:hover {
    background: #5a7b9c;
}

.bounds-status {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #2a2a2a;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
}

.bounds-status.active {
    background: #2a3a2e;
    color: #8bbb8f;
    border: 1px solid #4a7c59;
}

/* =============================================================================
   IN-GAME MENU & DIALOGS
   ============================================================================= */

/* Header actions container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Header menu button */
.header-menu-btn {
    background: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    min-width: 100px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-menu-btn:hover {
    background: #555;
    border-color: #d4a84b;
}

/* Header action buttons (End Phase, OOB, etc.) */
.header-action-btn {
    background: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    min-width: 100px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-action-btn:hover {
    background: #555;
    border-color: #d4a84b;
}

.header-action-btn.primary {
    background: #d4a84b;
    color: #1a1a1a;
    border-color: #d4a84b;
    font-weight: 600;
}

.header-action-btn.primary:hover {
    background: #e6b85c;
    border-color: #e6b85c;
}

.header-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.header-action-btn.active {
    background: #5a9;
    border-color: #5a9;
    color: #fff;
}

/* Floating info panels */
.floating-info-panel {
    position: absolute;
    bottom: 10px;
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 15px;
    color: #e0e0e0;
    font-size: 0.85rem;
    min-width: 150px;
    max-width: 250px;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.floating-info-panel h4 {
    margin: 0 0 8px 0;
    color: #d4a84b;
    font-size: 0.9rem;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

#floating-hex-info {
    left: 10px;
}

#floating-unit-info {
    left: 180px;
}

/* Common overlay styles */
#game-menu-overlay,
#save-dialog-overlay,
#load-dialog-overlay,
#quit-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

#game-menu-overlay.hidden,
#save-dialog-overlay.hidden,
#load-dialog-overlay.hidden,
#quit-dialog-overlay.hidden {
    display: none;
}

/* In-Game Menu */
#game-menu {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 2px solid #d4a84b;
    border-radius: 12px;
    padding: 2rem;
    min-width: 300px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#game-menu h2 {
    color: #d4a84b;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.game-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.menu-btn:hover:not(:disabled) {
    background: #555;
    border-color: #d4a84b;
    color: #fff;
}

.menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-btn.primary {
    background: #d4a84b;
    color: #1a1a1a;
    border-color: #d4a84b;
    font-weight: 600;
}

.menu-btn.primary:hover {
    background: #e6b85c;
    border-color: #e6b85c;
}

.menu-btn.danger {
    background: #8b4049;
    border-color: #8b4049;
    color: #fff;
}

.menu-btn.danger:hover {
    background: #ab5059;
    border-color: #ab5059;
}

.menu-hint {
    margin-top: 1.5rem;
    color: #888;
    font-size: 0.9rem;
}

/* Dialog styles */
.dialog {
    background: #2c2c2c;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 350px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dialog.wide {
    min-width: 500px;
    max-width: 600px;
}

.dialog h3 {
    color: #d4a84b;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #444;
}

.dialog-content {
    margin-bottom: 1.5rem;
}

.dialog-content label {
    display: block;
    color: #e0e0e0;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.dialog-content input[type="text"],
.dialog-content textarea {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.dialog-content input[type="text"]:focus,
.dialog-content textarea:focus {
    outline: none;
    border-color: #d4a84b;
}

.dialog-content p {
    color: #c0c0c0;
    line-height: 1.5;
}

.dialog-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 0.75rem 1.5rem;
    background: #444;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.dialog-btn:hover {
    background: #555;
    border-color: #666;
}

.dialog-btn.primary {
    background: #4a7c59;
    border-color: #4a7c59;
    color: #fff;
}

.dialog-btn.primary:hover {
    background: #5a9c69;
    border-color: #5a9c69;
}

.dialog-btn.danger {
    background: #8b4049;
    border-color: #8b4049;
    color: #fff;
}

.dialog-btn.danger:hover {
    background: #ab5059;
}

/* Saves list in load dialog */
.saves-list {
    max-height: 300px;
    overflow-y: auto;
}

.saves-list .loading-text {
    color: #888;
    text-align: center;
    padding: 2rem;
}

.saves-list .no-saves {
    color: #888;
    text-align: center;
    padding: 2rem;
}

.save-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.save-item:hover {
    border-color: #d4a84b;
}

.save-item-info {
    flex: 1;
}

.save-item-name {
    color: #e0e0e0;
    font-weight: 500;
}

.save-item-details {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.save-item-actions {
    display: flex;
    gap: 0.5rem;
}

.save-item-actions button {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
}

.btn-load-save {
    background: #4a7c59;
    color: white;
}

.btn-load-save:hover {
    background: #5a9c69;
}

.btn-delete-save {
    background: #8b4049;
    color: white;
}

.btn-delete-save:hover {
    background: #ab5059;
}

/* Action button styling */
.btn-action.primary {
    background: #d4a84b;
    color: #1a1a1a;
    font-weight: 600;
    border: none;
}

.btn-action.primary:hover {
    background: #e6b85c;
}
