:root {
    --primary-brown: #8B4513;
    --wood-color: #DEB887;
    --gold: #FFD700;
    --deep-blue: #1e3d59;
    --ocean-blue: #3498db;
}
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--ocean-blue), var(--deep-blue));
    font-family: 'Pirata One', cursive;
    background-image: url('images/ocean-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}
.game-container {
    max-width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    box-sizing: border-box;
}
header {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding-top: 2px;
}
h1 {
    margin: 10px 0 20px 0;
    text-align: center;
    color: var(--gold);
    font-size: 3.5em;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.6),
        3px 3px 5px rgba(0, 0, 0, 0.6);
}
.game-stats {
    display: flex;
    justify-content: space-between;
    width: 90%;
    max-width: 1000px;
    margin: 15px auto;
    padding: 0;
}
.barrel-container {
    margin-right: auto;
    margin-left: 100px;
}
.chest-container {
    margin-left: auto;
    margin-right: 100px;
}
.barrel, .chest {
    width: 100%;
    padding: 10px 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to bottom, #DEB887, #8B4513);
    border-radius: 20px;
    border: 4px solid var(--gold);
    color: #fff;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: statsGlow 2s infinite alternate;
    min-width: 180px;
}
.plank-button {
    background: linear-gradient(to bottom, #DEB887, #8B4513);
    border: 3px solid var(--primary-brown);
    padding: 15px 30px;
    font-family: 'Pirata One', cursive;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}
.plank-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    animation: glowEffect 1.5s infinite;
}
.plank-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.game-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(100px, 160px));
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: 80vw;
    max-width: 1000px;
    margin: auto;
    padding: 10px;
    position: relative;
    top: -20px;
    justify-content: center;
    align-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}
.card {
    width: 100%;
    aspect-ratio: 1;
    max-width: 160px;
    margin: 0;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid var(--gold);
}
.card:hover:not(.flipped):not(.matched) {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}
.card.flipped {
    animation: cardFlip 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.card.matched {
    animation: cardMatch 0.5s ease-in-out;
    border: 3px solid #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    pointer-events: none;
}
.card.wrong {
    animation: wrongShake 0.5s ease-in-out;
}
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gold);
}
.card-front {
    background: url('images/card-back.png') center/cover;
    border: 3px solid var(--gold);
}
.card-back {
    background: #F5F5DC    ;
    transform: rotateY(180deg);
    border: 3px solid var(--gold);
}
.card-back img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: brightness(1.2);
}
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 5px 0;
    width: 100%;
    max-width: 600px;
}
.scroll-select {
    background: linear-gradient(to bottom, var(--gold), #d4ac0d);
    border: 3px solid var(--primary-brown);
    padding: 8px 15px;
    font-family: 'Pirata One', cursive;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 8px;
    color: #8B4513;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    min-width: 150px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}
.scroll-select:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}
/* Add particle styles */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleAnim 1.5s ease-out forwards;
    z-index: 1000;
}
@keyframes particleAnim {
    0% {
        transform: scale(0) translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translate(var(--x, 100px), var(--y, -100px)) rotate(360deg);
        opacity: 0;
    }
}
@keyframes cardFlip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(180deg); }
}
@keyframes cardMatch {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
@keyframes wrongShake {
    0%, 100% { transform: translateX(0) rotateY(180deg); }
    25% { transform: translateX(-10px) rotateY(180deg); }
    75% { transform: translateX(10px) rotateY(180deg); }
}
@keyframes floatEffect {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}
@keyframes glowEffect {
    0% { box-shadow: 0 0 5px var(--gold); }
    50% { box-shadow: 0 0 20px var(--gold); }
    100% { box-shadow: 0 0 5px var(--gold); }
}
/* Add sparkle effect for matched cards */
.card.matched .card-back {
    animation: sparkle 1.5s ease-in-out infinite;
}
@keyframes sparkle {
    0% { filter: brightness(100%) contrast(100%); }
    50% { filter: brightness(150%) contrast(120%); }
    100% { filter: brightness(100%) contrast(100%); }
}

/* Add these new styles at the beginning of your CSS file */
.landing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.landing-content {
    background: rgba(0, 0, 0, 0.6);
    padding: 40px;
    border-radius: 20px;
    margin-top: 30px;
    border: 3px solid var(--gold);
}

.game-description {
    color: white;
    font-size: 1.5em;
    margin-bottom: 30px;
    line-height: 1.4;
}

.start-button {
    display: inline-block;
    text-decoration: none;
    color: white;
    margin-top: 30px;
    font-size: 1.8em;
    padding: 20px 60px;
}

/* Modify your existing game-board styles for the game page */
.game-page .game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-page .game-board {
    display: grid;
    gap: 15px;
    width: 95%;
    max-width: 1400px;
    margin: 10px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.game-page .card {
    width: 100%;
    aspect-ratio: 1;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 12px;
}

.game-page header {
    margin-bottom: 20px;
}

.game-page .controls {
    margin: 20px 0;
}

/* Update the game stats display */
.game-page .game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.game-page .barrel,
.game-page .chest {
    padding: 10px 20px;
    min-width: 150px;
}

/* Make sure cards scale properly */
@media (max-width: 768px) {
    .game-page .card {
        max-width: 80px;
        max-height: 80px;
    }
    
    .game-page .game-board {
        padding: 10px;
        gap: 5px;
    }
}

/* Add glow animation for stats */
@keyframes statsGlow {
    from {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

/* Update game board to remove gaps between cards */
.game-board {
    display: grid;
    gap: 8px;
    width: 95%;
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

/* Update card styles */
.card {
    aspect-ratio: 1;
    border-radius: 12px;
    margin: 0;
    border: 2px solid var(--gold);
}

.card-front, .card-back {
    border-radius: 10px;
    border: 2px solid var(--gold);
}

/* Add ambient glow to the game container */
.game-container {
    position: relative;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Make the title more prominent */
h1 {
    font-size: 4em;
    color: var(--gold);
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px;
    animation: titleGlow 2s infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.5),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 0.7),
            2px 2px 4px rgba(0, 0, 0, 0.5);
    }
}

/* Update difficulty select to match the theme */
.scroll-select {
    background: linear-gradient(to bottom, var(--gold), #d4ac0d);
    border: 3px solid var(--primary-brown);
    padding: 15px 30px;
    font-size: 1.4em;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.scroll-select:hover {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Make sure the game board fills available space */
.game-page .game-board {
    gap: 8px;
    padding: 15px;
}

.game-page .card {
    width: 100%;
    aspect-ratio: 1;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-stats {
        gap: 20px;
    }
    
    .barrel, .chest {
        padding: 15px 25px;
        font-size: 1.5em;
    }
    
    h1 {
        font-size: 3em;
    }
}

/* Update game stats spacing */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 400px;
    margin: 15px auto;
    width: 95%;
    max-width: 1200px;
    padding: 0 20px;
}

.barrel-container, .chest-container {
    flex: 0 0 auto;
    min-width: 250px;
}

.barrel, .chest {
    padding: 25px 50px;
    border-radius: 20px;
    font-size: 2.4em;
    min-width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Add media query for smaller screens */
@media (max-width: 1200px) {
    .game-stats {
        padding: 0 20px;
    }
    
    .barrel-container, .chest-container {
        min-width: 200px;
    }
    
    .barrel, .chest {
        padding: 20px 40px;
        font-size: 2em;
    }
}

@media (max-width: 900px) {
    .game-stats {
        gap: 300px;
    }
}

@media (max-width: 600px) {
    .game-stats {
        gap: 200px;
    }
}

/* Add specific grid layouts for each difficulty */
.game-board[data-difficulty="easy"] {
    grid-template-columns: repeat(6, minmax(100px, 150px));
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 90vw;
    max-width: 1200px;
    height: auto;
    aspect-ratio: 2;
    margin: 0 auto;
    padding: 8px;
    justify-content: center;
}

.game-board[data-difficulty="medium"] {
    grid-template-columns: repeat(6, 150px);
    justify-content: center;
}

.game-board[data-difficulty="hard"] {
    grid-template-columns: repeat(8, 150px);
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .card {
        max-width: 100px;
        max-height: 100px;
    }
    
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 120px);
        gap: 12px;
    }
    
    .game-board[data-difficulty="medium"] {
        grid-template-columns: repeat(6, 120px);
    }
    
    .game-board[data-difficulty="hard"] {
        grid-template-columns: repeat(8, 120px);
    }
}

@media (max-width: 1100px) {
    .card {
        max-width: 80px;
        max-height: 80px;
    }
    
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 90px);
        gap: 10px;
    }
    
    .game-board[data-difficulty="medium"] {
        grid-template-columns: repeat(6, 90px);
        gap: 10px;
    }
    
    .game-board[data-difficulty="hard"] {
        grid-template-columns: repeat(8, 90px);
        gap: 8px;
    }
}

@media (max-width: 800px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 70px);
        gap: 8px;
    }
    
    .game-board[data-difficulty="medium"] {
        grid-template-columns: repeat(6, 70px);
        gap: 8px;
    }
    
    .game-board[data-difficulty="hard"] {
        grid-template-columns: repeat(8, 70px);
        gap: 5px;
    }
}

@media (max-height: 800px) {
    h1 {
        font-size: 2.5em;
        margin: 0;
    }
    
    .barrel, .chest {
        padding: 10px 20px;
        font-size: 1.8em;
    }
    
    .scroll-select {
        padding: 8px 15px;
        font-size: 1.1em;
    }
}

/* Update the game board layout for easy mode */
.game-board[data-difficulty="easy"] {
    grid-template-columns: repeat(6, minmax(100px, 150px));
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 90vw;
    max-width: 1200px;
    height: auto;
    aspect-ratio: 2;
    margin: 0 auto;
    padding: 8px;
    justify-content: center;
}

/* Update card sizing for better fit */
.game-board[data-difficulty="easy"] .card {
    width: 100%;
    aspect-ratio: 1;
    max-width: 150px;
    margin: auto;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 120px);
        gap: 12px;
    }
}

@media (max-width: 1100px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 90px);
        gap: 10px;
    }
}

@media (max-width: 800px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 70px);
        gap: 8px;
    }
}

/* Update difficulty explanation positioning and style */
.difficulty-explanation {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--gold);
    color: white;
    text-align: left;
    max-width: 200px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    z-index: 1000;
}

.difficulty-explanation h2 {
    color: var(--gold);
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.2em;
}

.difficulty-explanation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.difficulty-explanation li {
    margin: 8px 0;
    font-size: 1em;
    padding-left: 25px;
    position: relative;
}

.difficulty-explanation li::before {
    content: '☠';
    position: absolute;
    left: 0;
    color: var(--gold);
}

/* Update landing content to use more vertical space */
.landing-content {
    background: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 20px;
    border: 3px solid var(--gold);
    margin-top: 20px;
    max-width: 600px;
}

.game-description {
    color: white;
    font-size: 1.5em;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .difficulty-explanation {
        position: static;
        margin: 10px auto;
        max-width: 90%;
    }
}

/* Update header and title to be more compact */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    padding-top: 2px;
}

h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Update game stats to be more compact */
.game-stats {
    margin: 5px auto;
    gap: 50px;
}

.barrel, .chest {
    padding: 5px 20px;
    font-size: 1.8em;
    min-width: 160px;
}

/* Make cards bigger and adjust game board layout */
.game-board[data-difficulty="easy"] {
    grid-template-columns: repeat(6, minmax(120px, 180px));
    gap: 12px;
    width: 95vw;
    max-width: 1400px;
    margin-top: 5px;
    padding: 10px;
}

/* Update card sizing */
.game-board[data-difficulty="easy"] .card {
    width: 100%;
    aspect-ratio: 1;
    max-width: 180px;
    margin: auto;
}

/* Update responsive breakpoints for larger cards */
@media (max-width: 1400px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 140px);
        gap: 10px;
    }
}

@media (max-width: 1100px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 110px);
        gap: 8px;
    }
}

@media (max-width: 800px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 85px);
        gap: 6px;
    }
}

/* Adjust controls spacing */
.controls {
    margin: 5px 0;
    gap: 15px;
}

.scroll-select {
    padding: 8px 20px;
    font-size: 1.2em;
}

/* Update game container spacing */
.game-container {
    gap: 3px;
    padding: 3px;
}

/* Update controls positioning */
.controls {
    position: absolute;
    top: 10px;
    right: 20px;
    margin: 0;
    gap: 15px;
    width: auto;
    z-index: 100;
}

/* Update scroll select styling for new position */
.scroll-select {
    padding: 8px 15px;
    font-size: 1.1em;
    min-width: 120px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
    border: 2px solid var(--gold);
}

/* Update game container to allow absolute positioning */
.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 3px;
    height: 100vh;
    box-sizing: border-box;
}

/* Center the game board and adjust spacing */
.game-board[data-difficulty="easy"] {
    grid-template-columns: repeat(6, minmax(120px, 180px));
    gap: 12px;
    width: 95vw;
    max-width: 1400px;
    margin: auto;
    padding: 10px;
    position: relative;
    top: -20px; /* Move board up slightly to center it better */
}

/* Update header spacing */
header {
    padding-top: 10px;
    margin-bottom: 5px;
}

/* Update game stats positioning */
.game-stats {
    margin: 5px auto;
    padding: 0 20px;
    width: auto;
    min-width: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls {
        top: 5px;
        right: 10px;
    }
    
    .scroll-select {
        padding: 5px 10px;
        font-size: 1em;
        min-width: 100px;
    }
    
    .game-board[data-difficulty="easy"] {
        top: -10px;
    }
}

/* Update game board layout and centering */
.game-board[data-difficulty="easy"] {
    grid-template-columns: repeat(6, minmax(100px, 160px));
    gap: 8px; /* Reduced from 12px */
    width: 80vw; /* Reduced from 95vw to bring cards closer together */
    max-width: 1000px; /* Reduced from 1400px */
    margin: auto;
    padding: 10px;
    position: relative;
    top: -20px;
    left: -5%; /* Shift slightly left */
    justify-content: center;
    align-content: center;
}

/* Update card sizing for tighter layout */
.game-board[data-difficulty="easy"] .card {
    width: 100%;
    aspect-ratio: 1;
    max-width: 160px; /* Reduced from 180px */
    margin: 0; /* Remove auto margins */
}

/* Update responsive breakpoints for tighter layout */
@media (max-width: 1400px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 120px);
        gap: 6px;
        width: 75vw;
    }
}

@media (max-width: 1100px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 100px);
        gap: 5px;
        width: 70vw;
    }
}

@media (max-width: 800px) {
    .game-board[data-difficulty="easy"] {
        grid-template-columns: repeat(6, 80px);
        gap: 4px;
        width: 90vw;
        left: 0; /* Remove left offset on small screens */
    }
}

/* Update game container for better centering */
.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 3px;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* Update medium difficulty layout */
.game-board[data-difficulty="medium"] {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 95vw;
    max-width: 1800px;
    margin: 10px auto;
    padding: 15px;
    aspect-ratio: 2.25/1; /* This ensures 9:4 ratio */
    height: 70vh; /* Fixed height to ensure visibility */
    align-items: center;
    justify-items: center;
}

/* Medium difficulty card sizing */
.game-board[data-difficulty="medium"] .card {
    width: 100%;
    height: 100%;
    max-width: 120px;
    max-height: 120px;
    margin: 0;
    aspect-ratio: 1;
}

/* Responsive breakpoints specifically for medium difficulty */
@media (max-width: 1800px) {
    .game-board[data-difficulty="medium"] {
        gap: 8px;
        height: 65vh;
    }
}

@media (max-width: 1400px) {
    .game-board[data-difficulty="medium"] {
        gap: 6px;
        height: 60vh;
    }
}

@media (max-width: 1100px) {
    .game-board[data-difficulty="medium"] {
        gap: 5px;
        height: 55vh;
    }
}

@media (max-width: 800px) {
    .game-board[data-difficulty="medium"] {
        gap: 4px;
        height: 50vh;
    }
}

/* Remove the mobile breakpoint that changes to 6x6 */
@media (max-width: 600px) {
    .game-board[data-difficulty="medium"] {
        gap: 3px;
        height: 45vh;
    }
}

/* Update game container to handle overflow better */
.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 5px;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Update landing page title */
.landing-page h1 {
    font-size: 5.5em;
    color: var(--gold);
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.7),
        3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
    animation: titleGlow 2s infinite alternate;
}

/* Leaderboard styles */
.leaderboard-container {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 15px;
    margin-top: 30px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.leaderboard-container h2 {
    color: var(--gold);
    font-size: 1.8em;
    text-align: center;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.leaderboard-scroll {
    max-height: none;
    overflow-y: visible;
}

.leaderboard {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 0.82em;
}

.leaderboard th,
.leaderboard td {
    padding: 3px 6px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    line-height: 1.1;
}

.leaderboard th {
    background: rgba(139, 69, 19, 0.6);
    color: var(--gold);
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.leaderboard tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard tr:hover {
    background: rgba(255, 215, 0, 0.1);
}

/* Custom scrollbar for webkit browsers */
.leaderboard-scroll::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.leaderboard-scroll::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

/* Adjust the start button margin */
.start-button {
    margin: 20px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .landing-page h1 {
        font-size: 4em;
    }

    .leaderboard-container {
        max-width: 90%;
        padding: 10px;
    }

    .leaderboard-container h2 {
        font-size: 1.5em;
    }

    .leaderboard {
        font-size: 0.9em;
    }

    .leaderboard th,
    .leaderboard td {
        padding: 6px;
    }
}

/* Update landing container layout */
.landing-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    position: relative;
}

.main-content {
    flex: 1;
    max-width: 700px;
    margin: 0;
    text-align: center;
    padding-left: 50px;
    padding-top: 300px; /* Increased from 250px to move content down */
}

/* Update main content positioning */
.main-content {
    flex: 1;
    max-width: 700px;
    margin: 0;
    text-align: center;
    padding-left: 50px;
    padding-top: 300px; /* Increased from 250px to move content down */
}

/* Move leaderboard up */
.leaderboard-container {
    position: absolute;
    right: 40px;
    top: 235px; /* Changed from 385px to move up */
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    width: 400px;
}

/* Update leaderboard title */
.leaderboard-container h2 {
    font-size: 2em;
    margin: 0 0 10px 0;
    color: var(--gold);
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Update table text size */
.leaderboard {
    width: 100%;
    border-collapse: collapse;
    color: white;
    font-size: 1em;
}

.leaderboard th,
.leaderboard td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    line-height: 1.3;
}

.leaderboard th {
    font-size: 1.2em;
    padding: 8px 10px;
}

/* Update responsive breakpoint */
@media (max-width: 1024px) {
    .leaderboard-container {
        width: 90%;
        max-width: 500px;
    }
}

/* Update title positioning and styling */
.landing-page h1 {
    font-size: 6.5em; /* Increased size */
    color: var(--gold);
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.7),
        3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 40px;
    animation: titleGlow 2s infinite alternate;
    position: absolute;
    top: 50px; /* Position from top */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
}

/* Adjust main content positioning */
.main-content {
    flex: 1;
    max-width: 700px;
    margin: 0;
    text-align: center;
    padding-left: 50px;
    padding-top: 300px; /* Increased from 250px to move content down */
}

/* Update leaderboard positioning */
.leaderboard-container {
    position: absolute;
    right: 40px;
    top: 235px; /* Changed from 385px to move up */
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    width: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .landing-page h1 {
        font-size: 4.5em;
        top: 30px;
    }
}

/* Add username input styles */
.username-container {
    margin-top: 15px;
    padding: 10px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    gap: 10px;
    align-items: center;
}

.username-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-family: 'Pirata One', cursive;
    font-size: 1.1em;
    outline: none;
    transition: all 0.3s ease;
}

.username-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.username-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.save-username-btn {
    background: linear-gradient(to bottom, var(--gold), #d4ac0d);
    border: 2px solid var(--primary-brown);
    border-radius: 6px;
    padding: 8px 15px;
    color: var(--primary-brown);
    font-family: 'Pirata One', cursive;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.save-username-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

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

/* Update responsive styles */
@media (max-width: 768px) {
    .username-container {
        flex-direction: column;
        gap: 10px;
    }

    .username-input,
    .save-username-btn {
        width: 100%;
    }
}

/* Add styles for current user display */
.current-user {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--gold);
    font-size: 1.2em;
    z-index: 1000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    font-family: 'Pirata One', cursive;
}

#currentUsername {
    color: white;
    margin-left: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Update responsive styles */
@media (max-width: 768px) {
    .current-user {
        font-size: 1em;
        padding: 8px 15px;
        top: 10px;
        right: 10px;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.card.matched {
    animation: cardMatch 0.5s ease-in-out;
    border: 3px solid #4CAF50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
    pointer-events: none;
}

/* Update leaderboard username font and color */
.leaderboard td:nth-child(2) {  /* Username column */
    font-family: 'Righteous', cursive;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    color: #00BFFF; /* Changed to deep sky blue */
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.4); /* Added blue glow */
}

/* Update current username display font and color */
#currentUsername {
    color: #00BFFF; /* Changed to deep sky blue */
    margin-left: 5px;
    text-shadow: 0 0 8px rgba(0, 191, 255, 0.4); /* Added blue glow */
    font-family: 'Righteous', cursive;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

/* Update username input text color */
.username-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 8px 12px;
    color: #00BFFF; /* Changed to deep sky blue */
    font-family: 'Righteous', cursive;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    outline: none;
    transition: all 0.3s ease;
}

.username-input::placeholder {
    font-family: 'Righteous', cursive;
    color: rgba(255, 255, 255, 0.6);
}

