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

html, body {
    height: 100%;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 25%, #CD853F 50%, #D2691E 75%, #8B4513 100%);
    background-size: 400% 400%;
    animation: woodGrain 20s ease infinite;
    font-family: 'Merriweather', serif;
    position: relative;
    overflow: hidden;
}

/* Animated wood grain background */
@keyframes woodGrain {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Wood texture overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(139, 69, 19, 0.1) 2px,
            rgba(139, 69, 19, 0.1) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(160, 82, 45, 0.05) 1px,
            rgba(160, 82, 45, 0.05) 3px
        );
    pointer-events: none;
    z-index: 1;
}

/* Floating particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 215, 0, 0.6);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    position: relative;
    z-index: 10;
    padding: 20px;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: #2F1B14;
    text-shadow: 
        3px 3px 0px #D4AF37,
        6px 6px 10px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(212, 175, 55, 0.5);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 3px;
    position: relative;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 
            3px 3px 0px #D4AF37,
            6px 6px 10px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(212, 175, 55, 0.5);
    }
    to {
        text-shadow: 
            3px 3px 0px #FFD700,
            6px 6px 10px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(255, 215, 0, 0.8);
    }
}

.title::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    border-radius: 2px;
}

.subtitle::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    border-radius: 2px;
}

.subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(3.5rem, 6vw, 4rem);
    font-weight: 600;
    color: #FF1493;
    text-shadow: 
        2px 2px 0px #8B4513,
        4px 4px 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 20, 147, 0.8),
        0 0 40px rgba(255, 20, 147, 0.5);
    margin-bottom: 50px;
    text-align: center;
    letter-spacing: 1px;
    position: relative;
    /* animation: subtitleGlow 3s ease-in-out infinite alternate;
    opacity: 0;
    animation-delay: 0.5s;
    animation-fill-mode: both; */
}
/* 
@keyframes subtitleGlow {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        text-shadow: 
            2px 2px 0px #A0522D,
            4px 4px 8px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(255, 20, 147, 1),
            0 0 60px rgba(255, 20, 147, 0.7);
    }
}

.subtitle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -50px;
    transform: translateY(-50%);
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FF1493);
    animation: lineGrow 2s ease-out 1s both;
}

.subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -50px;
    transform: translateY(-50%);
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, #FF1493, transparent);
    animation: lineGrow 2s ease-out 1s both;
}
*/

@keyframes lineGrow {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 40px;
        opacity: 1;
    }
}

.games-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.game-button {
    background: linear-gradient(145deg, #8B4513, #A0522D);
    border: 3px solid #D4AF37;
    border-radius: 15px;
    padding: 20px 40px;
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    color: #F5DEB3;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    min-width: 280px;
    text-align: center;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.game-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.game-button:hover::before {
    left: 100%;
}

.game-button:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #FFD700;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    color: #FFD700;
}

.game-button:active {
    transform: translateY(-2px) scale(1.02);
}

.game-button:nth-child(1) {
    animation: slideInLeft 1s ease-out 0.2s both;
}

.game-button:nth-child(2) {
    animation: slideInLeft 1s ease-out 0.4s both;
}

.game-button:nth-child(3) {
    animation: slideInLeft 1s ease-out 0.6s both;
}

.game-button:nth-child(4) {
    animation: slideInLeft 1s ease-out 0.8s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Decorative elements */
.decoration {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

.decoration-1 {
    top: 15%;
    left: 10%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #D4AF37, #B8860B);
    border-radius: 50%;
    opacity: 0.7;
    animation: rotate 20s linear infinite;
}

.decoration-2 {
    top: 20%;
    right: 15%;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #CD853F, #DEB887);
    transform: rotate(45deg);
    opacity: 0.6;
    animation: rotate 15s linear infinite reverse;
}

.decoration-3 {
    bottom: 25%;
    left: 8%;
    width: 50px;
    height: 50px;
    background: conic-gradient(#D4AF37, #FFD700, #B8860B, #D4AF37);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.8;
    animation: pulse 4s ease-in-out infinite;
}

.decoration-4 {
    bottom: 15%;
    right: 12%;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #DEB887, #F5DEB3);
    border-radius: 50% 0;
    opacity: 0.5;
    animation: rotate 25s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* Height-based responsive adjustments - only when content doesn't fit */
@media (max-height: 700px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: clamp(2.5rem, 7vw, 5rem);
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: clamp(3rem, 5vw, 3.2rem);
        margin-bottom: 35px;
    }
    
    .games-grid {
        gap: 20px;
    }
    
    .game-button {
        padding: 18px 35px;
        min-width: 250px;
    }
}

@media (max-height: 600px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: clamp(2rem, 6vw, 4rem);
        margin-bottom: 6px;
    }
    
    .subtitle {
        font-size: clamp(2.6rem, 4vw, 2.4rem);
        margin-bottom: 25px;
    }
    
    .games-grid {
        gap: 15px;
    }
    
    .game-button {
        padding: 15px 30px;
        font-size: clamp(1rem, 2.8vw, 1.5rem);
        min-width: 220px;
    }
    
    .decoration {
        display: none;
    }
}

@media (max-height: 500px) {
    .container {
        padding: 8px;
    }
    
    .title {
        font-size: clamp(1.8rem, 5vw, 3rem);
        margin-bottom: 5px;
    }
    
    .subtitle {
        font-size: clamp(2.4rem, 3.5vw, 2rem);
        margin-bottom: 15px;
    }
    
    .games-grid {
        gap: 12px;
    }
    
    .game-button {
        padding: 12px 25px;
        font-size: clamp(0.9rem, 2.5vw, 1.3rem);
        min-width: 200px;
        border-radius: 12px;
    }
    
    .title::before,
    .title::after {
        display: none;
    }
    
    .subtitle::before,
    .subtitle::after {
        display: none;
    }
}

@media (max-height: 400px) {
    .container {
        padding: 5px;
    }
    
    .title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
        margin-bottom: 3px;
    }
    
    .subtitle {
        font-size: clamp(2.2rem, 3vw, 1.8rem);
        margin-bottom: 12px;
    }
    
    .games-grid {
        gap: 8px;
    }
    
    .game-button {
        padding: 8px 20px;
        font-size: clamp(0.8rem, 2.2vw, 1.1rem);
        min-width: 180px;
        border-radius: 10px;
    }
}

/* Width-based media queries for mobile devices */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: clamp(2.4rem, 3.5vw, 2.4rem);
        margin-bottom: 35px;
    }
    
    .games-grid {
        gap: 20px;
    }
    
    .game-button {
        min-width: 250px;
        padding: 18px 35px;
    }
}

@media (max-width: 480px) {
    .game-button {
        min-width: 220px;
        padding: 15px 30px;
    }
    
    .decoration {
        display: none;
    }
    
    .subtitle::before,
    .subtitle::after {
        display: none;
    }
}

/* Landscape orientation adjustments for mobile */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: clamp(10px, 2vh, 20px);
    }
    
    .title {
        font-size: clamp(1.5rem, 4vh, 3rem);
        margin-bottom: 0;
        margin-right: clamp(20px, 4vw, 40px);
        flex-shrink: 0;
    }
    
    .subtitle {
        font-size: clamp(2.2rem, 3vw, 1.8rem);
        margin-bottom: 0;
        margin-right: clamp(15px, 3vw, 30px);
        flex-shrink: 0;
    }
    
    .games-grid {
        gap: clamp(8px, 2vh, 15px);
    }
    
    .game-button {
        min-width: clamp(120px, 25vw, 200px);
        padding: clamp(8px, 2vh, 12px) clamp(15px, 3vw, 20px);
        font-size: clamp(0.7rem, 1.8vh, 1rem);
    }
}