:root {
    --primary-color: #FF8C00;
    --secondary-color: #8B4513;
    --bg-color: #2C1A0B;
    --text-color: #FFFFFF;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #1a1a1a;
    font-family: var(--font-family);
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 800px;
    height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    background-color: #87CEEB;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#score-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    pointer-events: auto;
}

#score,
#lives,
#high-score {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#high-score {
    font-size: 18px;
    opacity: 0.8;
}

#pause-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(5px);
    font-family: var(--font-family);
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

#pause-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
}

h1 {
    font-size: 48px;
    margin-bottom: 16px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

p {
    font-size: 24px;
}

button {
    margin-top: 24px;
    padding: 12px 32px;
    font-size: 20px;
    font-family: var(--font-family);
    font-weight: bold;
    color: var(--text-color);
    background: linear-gradient(45deg, var(--primary-color), #FF4500);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.6);
}

button:active {
    transform: translateY(1px);
}

/* Tutorial Screen Styles */
.tutorial-content {
    max-width: 700px;
    max-height: 280px;
    overflow-y: auto;
    padding: 0 20px;
}

.tutorial-section {
    margin-bottom: 20px;
}

.tutorial-section h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.key {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 12px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.action {
    font-size: 14px;
    text-align: center;
}

.scoring-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.icon {
    font-size: 24px;
}

.points {
    font-weight: bold;
    color: var(--primary-color);
    min-width: 80px;
}

.desc {
    font-size: 14px;
}

.tip {
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 5px 0;
    backdrop-filter: blur(5px);
}

/* Scrollbar styling for tutorial */
.tutorial-content::-webkit-scrollbar {
    width: 8px;
}

.tutorial-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.tutorial-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.tutorial-content::-webkit-scrollbar-thumb:hover {
    background: #FF4500;
}

.tutorial-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}