:root {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --accent-color: #2ea043; /* Greenish */
    --accent-hover: #3fb950;
    --secondary-color: #8b949e;
    --card-bg: #161b22;
    --border-color: #30363d;
    --turkey-color: #d9534f;
    --coin-color: #f1c40f;
    --wall-color: #30363d;
    --path-color: #0d1117;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

h1 {
    margin: 0;
    color: var(--text-color);
}

.banner {
    background-color: rgba(46, 160, 67, 0.2);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
    display: inline-block;
}

.hidden {
    display: none !important;
}

.game-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

canvas {
    background-color: var(--path-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: block;
    max-width: 100%;
    height: auto;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    padding-top: 40px; /* Space from top */
    border-radius: 8px;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    padding: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 250px;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
}

button:hover {
    background-color: var(--accent-hover);
}

input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

.controls-mobile {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.dpad-row {
    display: flex;
    gap: 10px;
}

.dpad-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    padding: 0;
    margin: 5px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.leaderboard-section {
    width: 100%;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

footer {
    margin-top: 20px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .controls-mobile {
        display: flex;
    }
}
