/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent zoom on mobile when double-tapping */
button, .control-btn, .game-btn, .start-btn, .continue-btn {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent zoom on canvas and game elements */
#tetris-canvas, .tetris-container, .game-container {
    touch-action: manipulation;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #e8f5e8 0%, #d4e7d4 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Section Management */
.section {
    display: none;
    min-height: 100vh;
    padding: 20px 0;
    animation: fadeIn 0.6s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Welcome Section */
.birthday-header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.birthday-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d5a3d;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

.description {
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.7;
}

.start-btn, .continue-btn {
    background: linear-gradient(45deg, #7fb069, #a8c686);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(127, 176, 105, 0.3);
    font-family: 'Poppins', sans-serif;
}

.start-btn:hover, .continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(127, 176, 105, 0.4);
}

.disclaimer {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 15px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Game Section */
.game-container {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 20px auto;
    max-width: 700px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.game-container h2 {
    font-size: 1.8rem;
    color: #2d5a3d;
    margin-bottom: 15px;
    font-weight: 600;
}

.game-instruction {
    font-size: 1rem;
    color: #666;
    margin-bottom: 30px;
}

.doors-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.door {
    width: 80px;
    height: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
    perspective: 1000px;
}

.door-face {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #8B4513, #A0522D);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 3px solid #654321;
}

.door:hover .door-face {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.door-number {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFD700;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.door-handle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.door.selected .door-face {
    background: linear-gradient(145deg, #4CAF50, #66BB6A);
    border-color: #2E7D32;
}

.door.opened .door-face {
    transform: rotateY(-60deg);
    opacity: 0.6;
}

.door.opened {
    cursor: not-allowed;
}

.door.winner .door-face {
    background: linear-gradient(145deg, #FFD700, #FFC107);
    border-color: #FF8F00;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.game-message {
    font-size: 1.1rem;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    font-weight: 500;
}

.game-message.info {
    background: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    border: 2px solid rgba(33, 150, 243, 0.3);
}

.game-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #388E3C;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.game-actions {
    margin-top: 20px;
}

.game-btn {
    background: linear-gradient(45deg, #2196F3, #42A5F5);
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 0 10px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(33, 150, 243, 0.3);
}

/* Tetris Game Styles */
.tetris-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #FFA500;
}

.score, .lines {
    background: rgba(255, 165, 0, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 165, 0, 0.3);
}

#tetris-canvas {
    border: 3px solid #00FFFF;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 8px 20px rgba(0, 255, 255, 0.3);
    max-width: 100%;
    height: auto;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.control-btn {
    background: linear-gradient(45deg, #800080, #A020F0);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    min-width: 80px;
    box-shadow: 0 4px 12px rgba(128, 0, 128, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(128, 0, 128, 0.4);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(128, 0, 128, 0.3);
}

/* Reveal Section */
.reveal-container {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 20px auto;
    max-width: 500px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.reveal-container h2 {
    font-size: 2rem;
    color: #5a8a6b;
    margin-bottom: 20px;
    font-weight: 700;
}

.reveal-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.7;
}

.present-box {
    background: linear-gradient(135deg, #FFE0B2, #FFCC80);
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    border: 3px solid #FF8F00;
    box-shadow: 0 8px 20px rgba(255, 143, 0, 0.2);
}

.present-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.present-box h3 {
    color: #E65100;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.present-description {
    color: #BF360C;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Hotels Section */
.hotels-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 20px auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hotels-container h2 {
    text-align: center;
    font-size: 2rem;
    color: #4a7c59;
    margin-bottom: 15px;
    font-weight: 700;
}

.hotels-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
}

.hotels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.hotel-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.hotel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #7fb069;
}

.hotel-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.hotel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hotel-card:hover .hotel-image img {
    transform: scale(1.05);
}

.hotel-content {
    padding: 20px;
}

.hotel-content h3 {
    color: #5a8a6b;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.hotel-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.hotel-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hotel-features span {
    background: linear-gradient(45deg, #e91e63, #f06292);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.final-message {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f0f8f0, #e8f5e8);
    border-radius: 15px;
    border: 3px solid #7fb069;
}

.final-message h3 {
    color: #4a7c59;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.final-message p {
    color: #5a8a6b;
    font-size: 1.1rem;
    line-height: 1.7;
    font-weight: 500;
}

/* Tablet Styles */
@media (min-width: 768px) {
    .birthday-header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.4rem;
    }
    
    .description {
        font-size: 1.1rem;
    }
    
    .doors-container {
        gap: 25px;
    }
    
    .door {
        width: 100px;
        height: 150px;
    }
    
    .hotels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .hotel-image {
        height: 250px;
    }
    
    .game-container, .birthday-header, .reveal-container {
        max-width: 700px;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .birthday-header h1 {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .doors-container {
        gap: 40px;
    }
    
    .door {
        width: 120px;
        height: 180px;
    }
    
    .hotels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .hotel-image {
        height: 220px;
    }
    
    .game-container, .birthday-header, .reveal-container {
        max-width: 800px;
    }
    
    .hotels-container {
        max-width: 1100px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(233, 30, 99, 0.3);
    animation: modalSlideIn 0.4s ease-out;
}

.modal-message {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-message.success {
    color: #388E3C;
}

.modal-message.info {
    color: #1976D2;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animations */
@keyframes confetti {
    0% { transform: translateY(-100vh) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #e91e63;
    animation: confetti 3s linear infinite;
    z-index: 1000;
}

.confetti:nth-child(odd) {
    background: #FFD700;
    animation-delay: -0.5s;
}

.confetti:nth-child(even) {
    background: #4CAF50;
    animation-delay: -1s;
}
