/* 三國天命 - 主要樣式 */

:root {
    /* Color Theme - 三國主題色彩 */
    --primary-color: #8B4513;     /* 古銅色 */
    --secondary-color: #DAA520;   /* 金色 */
    --accent-color: #DC143C;      /* 深紅色 */
    --text-primary: #2F2F2F;      /* 深灰 */
    --text-secondary: #666666;    /* 中灰 */
    --text-light: #FFFFFF;        /* 白色 */
    --background: #F5F5DC;        /* 米色背景 */
    --surface: #FFFFFF;           /* 白色表面 */
    --surface-alt: #FFF8DC;       /* 淺米色 */
    --border: #D3D3D3;            /* 淺灰邊框 */
    --shadow: rgba(0, 0, 0, 0.1); /* 陰影 */

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                   'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 2rem;       /* 32px */

    /* Spacing */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;

    /* Transitions */
    --transition: all 0.2s ease;
}

/* Base Styles */
body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    overflow: hidden; /* Prevent scrolling on game screens */
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* Loading Screen */
#loading-screen {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    flex-direction: column;
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-8);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-light);
    animation: spin 1s ease-in-out infinite;
    margin: var(--space-4) auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Main Menu */
#main-menu {
    background: linear-gradient(
        rgba(139, 69, 19, 0.9),
        rgba(218, 165, 32, 0.9)
    ), url('../assets/images/background.jpg') center/cover;
}

.menu-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.game-header .game-title {
    font-size: var(--font-size-3xl);
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    font-weight: bold;
}

.game-header .game-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.main-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Game Screen Layout */
#game-screen {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

#game-screen .game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-4);
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 2px 4px var(--shadow);
}

.player-info-full {
    display: flex;
    gap: var(--space-8);
    align-items: center;
    width: 100%;
    justify-content: space-around;
}

.player-basic {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-level {
    font-size: var(--font-size-sm);
    color: var(--secondary-color);
    font-weight: bold;
}

.player-attributes {
    display: flex;
    gap: var(--space-4);
}

.attribute {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.attr-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.attr-value {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--accent-color);
}

.player-resources {
    display: flex;
    gap: var(--space-4);
}

.resource {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.resource-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.resource-value {
    font-size: var(--font-size-base);
    font-weight: bold;
    color: var(--primary-color);
}



.game-main {
    flex: 1;
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    overflow: hidden;
}

.event-log {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-4);
    box-shadow: 0 2px 8px var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
}

.map-overview {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--space-4);
    box-shadow: 0 2px 8px var(--shadow);
}

.map-container {
    flex: 1;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-info-full {
        flex-direction: column;
        gap: var(--space-3);
        justify-content: center;
    }

    .player-attributes {
        gap: var(--space-2);
        justify-content: center;
    }

    .player-resources {
        justify-content: center;
    }

    .game-main {
        flex-direction: column;
    }

    .main-nav {
        width: 100%;
    }
}