/* Dark Theme Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #121212;
    --primary-color: #c02942;
    --secondary-color: #542437;
    --text-color: #f0f0f0;
    --accent-color: #ecd078;
    --card-bg: #1e1e1e;
    --button-hover: #a0223a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    position: relative;
}

.game-header {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    width: 100%;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

/* Modal styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

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

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
    position: relative;
}

.modal.hidden .modal-content {
    transform: translateY(-20px);
}

.modal-title {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.instructions {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.5;
}

.keyboard-controls, .touch-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.key {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    margin: 5px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.touch-icon {
    font-size: 24px;
    margin: 0 10px;
}

.start-btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.start-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

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

.canvas-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 12px 24px;
    border-radius: 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: absolute;
    bottom: 10%;
    left: 10%;
    transform: translateX(-50%);
    z-index: 10;
}

.btn:hover {
    background-color: var(--button-hover);
    transform: translateX(-50%) translateY(-2px);
}

.btn:active {
    transform: translateX(-50%) translateY(1px);
}

/* Hide the image elements */
.hidden-images {
    display: none;
}

/* Orientation detection */
.orientation-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.orientation-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border: 3px solid var(--text-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    transform: rotate(90deg);
    position: relative;
}

.orientation-icon::after {
    content: "↺";
    position: absolute;
    font-size: 30px;
    top: -30px;
    right: -10px;
}

/* Media Queries */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .instructions {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    .orientation-message {
        display: flex;
        flex-direction: column;
    }
    
    .game-container {
        display: none;
    }
}

/* Fullscreen mode styles */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}

.fullscreen-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Breathing animation for fullscreen button */
@keyframes breathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.fullscreen-btn {
    animation: breathe 2s infinite ease-in-out;
}

/* Win screen animation */
@keyframes celebration {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#winModal .modal-content {
    animation: celebration 2s ease-in-out infinite;
    background-color: var(--card-bg);
    border: 3px solid var(--accent-color);
}

#winModal .modal-title {
    color: var(--accent-color);
    font-size: 2.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#playAgainButton {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

#playAgainButton:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

#playAgainButton:active {
    transform: translateY(1px);
}

/* Confetti effect for win screen */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    opacity: 0.7;
    animation: confetti-fall 4s ease-in-out infinite;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}