:root {
    --bg-image: url('../photo/background_games.jpg');
    --primary-color: #C5A059;
    --primary-hover: #d4b06a;
    --secondary-color: #667eea;
    --secondary-hover: #7389ff;
    --bg-overlay: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
}

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), var(--bg-image);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-color);
}

.page-header {
    text-align: center;
    margin: 100px auto 40px;
    margin-top: 150px;
    padding: 0 20px;
}

.page-header h1 {
    font-size: 2.5em;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-style: italic;
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0;
}

@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
    }
}

.game-board, .leaderboard-section {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leaderboard-section h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.leaderboard-container {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    flex-grow: 1;
    overflow-y: auto;
    max-height: 480px;
}

.game-instructions {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #ddd;
}
.game-instructions p { margin: 0 0 10px 0; }
.game-instructions ul { margin: 0; padding-left: 20px; }
.game-instructions li { margin-bottom: 5px; }

.game-controls {
    display: flex;
    gap: 10px;
}

.game-controls input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 5px;
    transition: all 0.2s ease;
}

.game-controls input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.2);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), #8e7340);
}
.btn-primary:hover {
    background: linear-gradient(45deg, var(--primary-hover), #a6874b);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.3);
}

.btn-secondary {
    background: linear-gradient(45deg, var(--secondary-color), #4c63d2);
}
.btn-secondary:hover {
    background: linear-gradient(45deg, var(--secondary-hover), #5b72e8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.game-status {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    color: #4CAF50;
    min-height: 24px;
}

.history-container {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.history-table th {
    padding: 10px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-weight: 500;
}

.history-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1.1rem;
    color: #fff;
}

.history-table td:nth-child(2) {
    font-family: 'Courier New', monospace;
}

.result-a { color: #4db8ff; font-weight: bold; }
.result-b { color: #ff9800; font-weight: bold; }

@media (max-width: 600px) {
    .game-controls { flex-direction: column; }
    .game-controls input { margin-bottom: 10px; width: 100%; box-sizing: border-box; }
    button { width: 100%; }
}
