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

body {
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

.hidden {
    display: none !important;
}

/* Landing Screen */
#landing-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a0f08 0%, #2a1810 40%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.landing-content {
    width: 440px;
    background: linear-gradient(to bottom, #2a1810, #1f120a);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 0 60px rgba(196, 151, 60, 0.15);
}

.landing-title {
    text-align: center;
    color: #ffd700;
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 8px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    margin-bottom: 4px;
}

.landing-subtitle {
    text-align: center;
    color: #a08860;
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 24px;
}

.landing-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.landing-tab {
    flex: 1;
    padding: 8px;
    background: #3a2515;
    border: 1px solid #5a3a1a;
    color: #a08860;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    transition: background 0.2s;
}

.landing-tab:hover {
    background: #4a3520;
}

.landing-tab.active {
    background: #4a3520;
    color: #ffd700;
    border-bottom-color: #4a3520;
}

.landing-panel {
    border: 1px solid #5a3a1a;
    border-radius: 0 0 4px 4px;
    padding: 16px;
    background: rgba(58, 37, 21, 0.5);
}

.landing-field {
    margin-bottom: 12px;
}

.landing-field label {
    display: block;
    color: #c4973c;
    font-size: 12px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.landing-field input,
.landing-field select {
    width: 100%;
    padding: 8px 10px;
    background: #1a0f08;
    border: 1px solid #5a3a1a;
    color: #e8d5a3;
    font-size: 14px;
    border-radius: 4px;
    outline: none;
}

.landing-field input:focus,
.landing-field select:focus {
    border-color: #c4973c;
}

.landing-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(to bottom, #5a4520, #3a2515);
    border: 2px solid #c4973c;
    color: #ffd700;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 8px;
    transition: background 0.2s;
    letter-spacing: 1px;
}

.landing-btn:hover {
    background: linear-gradient(to bottom, #6a5530, #4a3520);
}

.landing-info {
    color: #a08860;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.landing-error {
    color: #cc4444;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Objectives Panel */
#objectives-panel {
    position: fixed;
    top: 70px;
    left: 10px;
    width: 180px;
    background: rgba(26, 15, 8, 0.9);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 8px;
    z-index: 15;
}

#objectives-title {
    color: #c4973c;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.obj-row {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.obj-label {
    color: #a08860;
    font-size: 11px;
    flex: 1;
}

.obj-value {
    font-size: 11px;
    font-weight: bold;
}

.obj-bar {
    width: 100%;
    height: 3px;
    background: #1a0f08;
    border-radius: 2px;
}

.obj-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s;
}

/* Multiplayer HUD */
#mp-hud {
    position: fixed;
    bottom: 60px;
    left: 10px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 220px;
}

#mp-players {
    background: rgba(26, 15, 8, 0.9);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 6px 8px;
}

#mp-players-title {
    color: #c4973c;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#mp-players-list {
    color: #e8d5a3;
    font-size: 12px;
}

.mp-player-entry {
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mp-player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mp-player-host {
    color: #ffd700;
    font-size: 10px;
    margin-left: auto;
}

#mp-share {
    background: rgba(26, 15, 8, 0.9);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#mp-copy-link {
    padding: 4px 10px;
    background: #3a2515;
    border: 1px solid #c4973c;
    color: #ffd700;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
}

#mp-copy-link:hover {
    background: #4a3520;
}

#mp-room-code {
    color: #a08860;
    font-size: 11px;
}

#mp-chat {
    background: rgba(26, 15, 8, 0.9);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    max-height: 150px;
    display: flex;
    flex-direction: column;
}

#mp-chat-messages {
    padding: 6px 8px;
    overflow-y: auto;
    max-height: 110px;
    font-size: 11px;
    color: #e8d5a3;
}

.mp-chat-msg {
    margin-bottom: 2px;
}

.mp-chat-name {
    color: #c4973c;
    font-weight: bold;
}

#mp-chat-input {
    border: none;
    border-top: 1px solid #5a3a1a;
    background: rgba(26, 15, 8, 0.7);
    color: #e8d5a3;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
    border-radius: 0 0 4px 4px;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
}

/* Resource bar */
#resource-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, #2a1810, #1a0f08);
    border-bottom: 2px solid #c4973c;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    z-index: 10;
}

#game-version {
    position: absolute;
    bottom: 4px;
    left: 10px;
    color: rgba(196, 151, 60, 0.4);
    font-size: 10px;
    z-index: 5;
    pointer-events: none;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e8d5a3;
    font-size: 14px;
    font-weight: bold;
}

.resource-icon {
    font-size: 16px;
}

/* Toolbar */
#toolbar {
    position: absolute;
    top: 68px;
    right: 0;
    width: 140px;
    bottom: 0;
    background: linear-gradient(to right, #2a1810, #1f120a);
    border-left: 2px solid #c4973c;
    padding: 8px;
    overflow-y: auto;
    z-index: 10;
}

#toolbar-search {
    margin-bottom: 8px;
}

#toolbar-search-input {
    width: 100%;
    padding: 5px 8px;
    background: #1a0f08;
    border: 1px solid #5a3a1a;
    color: #e8d5a3;
    font-size: 12px;
    border-radius: 3px;
    outline: none;
}

#toolbar-search-input:focus {
    border-color: #c4973c;
}

.toolbar-section {
    margin-bottom: 12px;
}

.toolbar-section h3 {
    color: #c4973c;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid #5a3a1a;
}

.tool-btn {
    display: block;
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 3px;
    background: #3a2515;
    color: #e8d5a3;
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    transition: all 0.15s;
}

.tool-btn:hover {
    background: #4a3520;
    border-color: #c4973c;
}

.tool-btn.active {
    background: #c4973c;
    color: #1a0f08;
    border-color: #e8d5a3;
    font-weight: bold;
}

/* Info panel */
#info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(42, 24, 16, 0.97);
    border: 3px solid #c4973c;
    border-radius: 8px;
    padding: 20px 24px;
    color: #e8d5a3;
    z-index: 100;
    box-shadow: 0 0 40px rgba(0,0,0,0.7), inset 0 0 15px rgba(196,151,60,0.05);
}

#info-panel.hidden {
    display: none;
}

#info-title {
    font-size: 20px;
    font-weight: bold;
    color: #c4973c;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #5a3a1a;
    text-align: center;
}

#info-content {
    font-size: 14px;
    line-height: 1.6;
}

#info-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #c4973c;
    font-size: 22px;
    cursor: pointer;
    padding: 2px 6px;
}

#info-close:hover {
    color: #e8d5a3;
}

#info-panel::-webkit-scrollbar {
    width: 6px;
}

#info-panel::-webkit-scrollbar-thumb {
    background: #5a3a1a;
    border-radius: 3px;
}

/* Speed controls */
#speed-controls {
    position: absolute;
    bottom: 10px;
    right: 150px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.speed-btn {
    width: 36px;
    height: 30px;
    background: #3a2515;
    color: #e8d5a3;
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-btn:hover {
    background: #4a3520;
    border-color: #c4973c;
}

.speed-btn.active {
    background: #c4973c;
    color: #1a0f08;
}

/* Gods panel */
#gods-panel {
    position: absolute;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    background: rgba(42, 24, 16, 0.95);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 16px;
    color: #e8d5a3;
    z-index: 25;
}

#gods-panel.hidden {
    display: none;
}

#gods-panel-title {
    font-size: 18px;
    font-weight: bold;
    color: #c4973c;
    text-align: center;
    margin-bottom: 12px;
}

#gods-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #c4973c;
    font-size: 20px;
    cursor: pointer;
}

.god-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(90, 58, 26, 0.4);
    border-radius: 4px;
}

.god-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.god-name {
    font-weight: bold;
    min-width: 55px;
    font-size: 13px;
}

.god-domain {
    font-size: 11px;
    color: #a08860;
    min-width: 70px;
}

.god-bar-container {
    flex: 1;
    height: 10px;
    background: #1a0f08;
    border-radius: 5px;
    overflow: hidden;
}

.god-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s;
}

.god-mood {
    font-size: 11px;
    min-width: 65px;
    text-align: right;
}

.god-festival {
    padding: 2px 6px;
    background: #5a3a1a;
    border: 1px solid #8a6a3a;
    border-radius: 3px;
    color: #e8d5a3;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.god-festival:hover {
    background: #c4973c;
    color: #1a0f08;
}

.god-festival-size {
    padding: 1px 4px;
    background: #3a2515;
    color: #e8d5a3;
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.ratings-compact {
    margin-left: auto;
}

/* Message History panel */
#msg-history-panel {
    position: absolute;
    top: 80px;
    right: 150px;
    width: 380px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(42, 24, 16, 0.97);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e8d5a3;
    z-index: 25;
}

#msg-history-panel.hidden {
    display: none;
}

#msg-history-title {
    font-size: 16px;
    font-weight: bold;
    color: #c4973c;
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #5a3a1a;
}

#msg-history-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: #c4973c;
    font-size: 18px;
    cursor: pointer;
}

.msg-entry {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    border-left: 3px solid;
}

.msg-entry.warning { border-color: #e8a030; background: rgba(80, 40, 10, 0.4); }
.msg-entry.event { border-color: #40c080; background: rgba(20, 50, 40, 0.4); }
.msg-entry.request { border-color: #c060c0; background: rgba(50, 20, 50, 0.4); }
.msg-entry.success { border-color: #60c060; background: rgba(20, 50, 20, 0.4); }
.msg-entry.info { border-color: #c4973c; background: rgba(42, 24, 16, 0.4); }

#msg-history-panel::-webkit-scrollbar {
    width: 6px;
}
#msg-history-panel::-webkit-scrollbar-thumb {
    background: #5a3a1a;
    border-radius: 3px;
}

/* Overseer bar */
#overseer-bar {
    position: absolute;
    top: 40px;
    left: 0;
    right: 140px;
    height: 28px;
    background: linear-gradient(to bottom, #1f120a, #2a1810);
    border-bottom: 1px solid #5a3a1a;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 2px;
    z-index: 10;
    overflow-x: auto;
    overflow-y: hidden;
}

#overseer-bar::-webkit-scrollbar {
    height: 3px;
}

#overseer-bar::-webkit-scrollbar-thumb {
    background: #5a3a1a;
    border-radius: 2px;
}

.overseer-btn {
    padding: 2px 6px;
    background: #3a2515;
    color: #c4973c;
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.overseer-btn:hover {
    background: #4a3520;
    border-color: #c4973c;
    color: #e8d5a3;
}

.overseer-btn.active {
    background: #c4973c;
    color: #1a0f08;
    border-color: #e8d5a3;
}

/* Overseer panel */
#overseer-panel {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(42, 24, 16, 0.97);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 16px 20px;
    color: #e8d5a3;
    z-index: 25;
}

#overseer-panel.hidden {
    display: none;
}

#overseer-panel-title {
    font-size: 18px;
    font-weight: bold;
    color: #c4973c;
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #5a3a1a;
}

#overseer-panel-content {
    font-size: 13px;
    line-height: 1.6;
}

#overseer-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #c4973c;
    font-size: 20px;
    cursor: pointer;
}

#overseer-close:hover {
    color: #e8d5a3;
}

/* Overseer tables */
.overseer-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.overseer-table th {
    text-align: left;
    color: #c4973c;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-bottom: 1px solid #5a3a1a;
}

.overseer-table td {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(90, 58, 26, 0.3);
    font-size: 13px;
}

.overseer-table tr:hover {
    background: rgba(90, 58, 26, 0.3);
}

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

.overseer-section {
    margin: 12px 0;
}

.overseer-section h3 {
    color: #c4973c;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #5a3a1a;
}

.overseer-stat {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.overseer-stat .label {
    color: #a08860;
}

.overseer-stat .value {
    color: #e8d5a3;
    font-weight: bold;
}

.overseer-bar-container {
    width: 100%;
    height: 14px;
    background: #1a0f08;
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}

.overseer-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.overseer-good { color: #60cc60; }
.overseer-warn { color: #cccc60; }
.overseer-bad { color: #cc4444; }
.overseer-neutral { color: #a08860; }

/* Overseer panel scrollbar */
#overseer-panel::-webkit-scrollbar {
    width: 6px;
}

#overseer-panel::-webkit-scrollbar-track {
    background: #1a0f08;
}

#overseer-panel::-webkit-scrollbar-thumb {
    background: #5a3a1a;
    border-radius: 3px;
}

/* Modal */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(to bottom, #2a1810, #1a0f08);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 24px;
    min-width: 400px;
    color: #e8d5a3;
}

.modal-content h2 {
    color: #c4973c;
    margin-bottom: 16px;
    text-align: center;
    font-size: 20px;
}

.save-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #3a2515;
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.save-slot:hover {
    background: #4a3520;
    border-color: #c4973c;
}

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

.save-slot-name {
    font-weight: bold;
    font-size: 14px;
}

.save-slot-detail {
    font-size: 11px;
    color: #a08860;
    margin-top: 2px;
}

.save-slot-actions {
    display: flex;
    gap: 6px;
}

.save-slot-actions button {
    padding: 4px 10px;
    background: #5a3a1a;
    color: #e8d5a3;
    border: 1px solid #8a6a3a;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.save-slot-actions button:hover {
    background: #c4973c;
    color: #1a0f08;
}

.save-slot-actions button.delete-btn:hover {
    background: #cc4444;
    color: #fff;
}

.modal-close-btn {
    display: block;
    margin: 16px auto 0;
    padding: 8px 24px;
    background: #5a3a1a;
    color: #e8d5a3;
    border: 1px solid #8a6a3a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.modal-close-btn:hover {
    background: #c4973c;
    color: #1a0f08;
}

/* Trade buttons */
.trade-toggle-btn {
    padding: 2px 8px;
    background: #3a2515;
    color: #a08860;
    border: 1px solid #5a3a1a;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
}

.trade-toggle-btn:hover {
    background: #4a3520;
    border-color: #c4973c;
    color: #e8d5a3;
}

.trade-toggle-btn.trade-active-export {
    background: #2a5a2a;
    color: #60cc60;
    border-color: #60cc60;
}

.trade-toggle-btn.trade-active-export:hover {
    background: #3a6a3a;
}

.trade-toggle-btn.trade-active-import {
    background: #5a3a2a;
    color: #cc8844;
    border-color: #cc8844;
}

.trade-toggle-btn.trade-active-import:hover {
    background: #6a4a3a;
}

/* Minimap overlay buttons */
#minimap-overlays {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 160px;
    display: flex;
    gap: 2px;
    z-index: 10;
}

.overlay-btn {
    flex: 1;
    padding: 3px 0;
    background: #3a2515;
    color: #a08860;
    border: 1px solid #5a3a1a;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    transition: all 0.15s;
}

.overlay-btn:hover {
    background: #4a3520;
    border-color: #c4973c;
    color: #e8d5a3;
}

.overlay-btn.active {
    background: #c4973c;
    color: #1a0f08;
    border-color: #e8d5a3;
}

/* World Map panel */
#world-map-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(42, 24, 16, 0.97);
    border: 2px solid #c4973c;
    border-radius: 8px;
    padding: 16px;
    color: #e8d5a3;
    z-index: 30;
}

#world-map-panel.hidden {
    display: none;
}

#world-map-title {
    font-size: 18px;
    font-weight: bold;
    color: #c4973c;
    text-align: center;
    margin-bottom: 8px;
}

#world-map-canvas {
    display: block;
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    background: #1a150e;
}

#world-map-info {
    margin-top: 8px;
    min-height: 42px;
    padding: 6px 8px;
    background: rgba(26, 15, 8, 0.6);
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
}

#world-map-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #c4973c;
    font-size: 20px;
    cursor: pointer;
}

#world-map-close:hover {
    color: #e8d5a3;
}

/* Scrollbar styling */
#toolbar::-webkit-scrollbar {
    width: 6px;
}

#toolbar::-webkit-scrollbar-track {
    background: #1a0f08;
}

#toolbar::-webkit-scrollbar-thumb {
    background: #5a3a1a;
    border-radius: 3px;
}
