/* ============= GLOBAL STYLES ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d5016;
    --secondary-color: #7cb342;
    --dark-bg: #0f1d0a;
    --panel-bg: rgba(30, 50, 20, 0.95);
    --border-color: #8bc34a;
    --text-light: #e8f5e9;
    --text-dark: #1b2e15;
    --success-color: #4caf50;
    --error-color: #f44336;
    --human-color: #4a90e2;
    --dwarf-color: #795548;
    --elf-color: #66bb6a;
    --orc-color: #d32f2f;
    --grass-color: #558b2f;
    --forest-color: #33691e;
    --stone-color: #6d6d6d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1b3a1b 0%, #0f2a0f 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

.landing-page {
    background-image: url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1920');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 29, 10, 0.85) 0%, rgba(27, 58, 27, 0.85) 100%);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============= HEADER ============= */
.main-header {
    background: linear-gradient(180deg, rgba(30, 50, 20, 0.95) 0%, rgba(20, 40, 15, 0.8) 100%);
    border-bottom: 3px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.6) 0%, rgba(30, 60, 15, 0.6) 100%);
    transition: all 0.3s ease;
    font-weight: bold;
}

.main-nav a:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 195, 74, 0.5);
}

/* ============= MAIN CONTENT ============= */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--panel-bg) 0%, rgba(20, 40, 15, 0.95) 100%);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(0, 0, 0, 0.2);
}

.panel.large {
    max-width: 900px;
}

.about-panel {
    background: linear-gradient(135deg, rgba(46, 68, 24, 0.95) 0%, rgba(18, 32, 17, 0.95) 100%);
    border-color: rgba(139, 195, 74, 0.8);
}

.about-lead {
    text-align: center;
    color: #dcefd5;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.team-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-color);
}

.future-card {
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.15), rgba(76, 175, 80, 0.05));
    border-style: dashed;
}

.team-card-footnote {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    font-style: italic;
}

.team-card-header {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.team-card p {
    color: #cfe9cb;
    font-size: 0.95rem;
    line-height: 1.5;
}

.about-footer {
    text-align: center;
    color: #f2f8f0;
    font-style: italic;
    margin-top: 10px;
}

.panel h2 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ============= FORMS ============= */
.game-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.form-group input {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(139, 195, 74, 0.5);
    background: rgba(45, 80, 22, 0.3);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: 2px solid var(--border-color);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 195, 74, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.form-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ============= TRIBE SELECTION ============= */
.tribe-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.tribe-option {
    padding: 20px;
    border: 3px solid transparent;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tribe-option:hover {
    transform: scale(1.05);
}

.tribe-option.selected {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.3) 0%, rgba(85, 139, 47, 0.3) 100%);
    box-shadow: 0 0 20px rgba(139, 195, 74, 0.6);
}

.tribe-option.human { border-color: var(--human-color); }
.tribe-option.dwarf { border-color: var(--dwarf-color); }
.tribe-option.elf { border-color: var(--elf-color); }
.tribe-option.orc { border-color: var(--orc-color); }

.tribe-option h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.tribe-option p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* ============= RULES SECTION ============= */
.rules-content {
    text-align: left;
}

.rules-content h3 {
    color: var(--secondary-color);
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.rules-content ul {
    list-style: none;
    padding-left: 20px;
}

.rules-content ul li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

.rules-content ul li:before {
    content: "⚔️";
    position: absolute;
    left: 0;
}

.tribes-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.tribe-info {
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.5) 0%, rgba(30, 60, 15, 0.5) 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.tribe-info h4 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.tribe-info p {
    margin: 8px 0;
}

.tribe-info em {
    color: var(--secondary-color);
    font-style: italic;
}

/* ============= SERVER STATUS ============= */
.status-info {
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.5) 0%, rgba(30, 60, 15, 0.5) 100%);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid rgba(139, 195, 74, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid rgba(218, 165, 32, 0.3);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.status-value {
    color: var(--text-light);
    font-size: 1.1rem;
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.status-dot.offline {
    background: var(--error-color);
}

.server-info {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 10px;
}

.server-info h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.server-info ul {
    list-style: none;
}

.server-info ul li {
    padding: 8px 0;
    font-size: 1.1rem;
}

/* ============= SHOWCASE ============= */
.showcase {
    margin-top: 60px;
    padding: 60px 0;
    background: rgba(0, 0, 0, 0.3);
    border-top: 3px solid var(--border-color);
    border-bottom: 3px solid var(--border-color);
}

.showcase h2 {
    text-align: center;
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 30px;
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(218, 165, 32, 0.4);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.feature h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.feature p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ============= MESSAGES ============= */
.error-message {
    color: var(--error-color);
    background: rgba(244, 67, 54, 0.2);
    padding: 12px;
    border-radius: 5px;
    border: 2px solid var(--error-color);
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.2);
    padding: 12px;
    border-radius: 5px;
    border: 2px solid var(--success-color);
    margin-top: 10px;
    display: none;
}

.success-message.show {
    display: block;
}

/* ============= FOOTER ============= */
.main-footer {
    background: rgba(20, 15, 10, 0.95);
    border-top: 3px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
}

.main-footer p {
    margin: 5px 0;
    color: var(--text-light);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav a {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .panel {
        padding: 25px;
    }
    
    .tribe-selection {
        grid-template-columns: 1fr;
    }
    
    .tribes-info {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

/* ============= GAME PAGE STYLES ============= */
.game-page {
    background: #1a1410;
}

.game-container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    grid-template-rows: auto 1fr;
    height: 100vh;
    gap: 0;
}

.game-header {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, #2d1f15 0%, #1a1410 100%);
    border-bottom: 3px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    color: var(--text-light);
    font-weight: bold;
}

.btn-logout {
    padding: 8px 16px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.btn-logout:hover {
    background: #b71c1c;
}

.sidebar {
    background: rgba(40, 30, 20, 0.95);
    border-right: 2px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.sidebar h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.village-list {
    list-style: none;
}

.village-item {
    padding: 12px;
    margin: 8px 0;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.village-item:hover {
    background: rgba(218, 165, 32, 0.2);
    transform: translateX(5px);
}

.village-item.active {
    border-color: var(--secondary-color);
    background: rgba(218, 165, 32, 0.3);
}

.main-game-area {
    background: #0d0a08;
    overflow: hidden;
    position: relative;
}

.game-view {
    display: none;
    height: 100%;
}

.game-view.active {
    display: block;
}

.info-panel {
    background: rgba(40, 30, 20, 0.95);
    border-left: 2px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
}

.resource-display {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(218, 165, 32, 0.3);
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-name {
    color: var(--secondary-color);
    font-weight: bold;
}

.resource-value {
    color: var(--text-light);
    font-weight: bold;
}

/* Loading screen */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(218, 165, 32, 0.3);
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
