* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: url('../assets/images/gallery/kiwi-birds.jpg') no-repeat center center fixed;
    background-size: contain;
    background-color: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Bird silhouettes as background using SVG */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.12;
    background: url('../assets/images/bird-silhouettes.svg') repeat;
    pointer-events: none;
}

.game-container {
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 1.2rem;
    background: rgba(0,0,0,0.5);
    padding-top: 48px;
}

h1 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    letter-spacing: 1px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    font-size: 1.1rem;
    color: #fff;
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.game-stats > div {
    background: rgba(0,0,0,0.85);
    border-radius: 6px;
    padding: 0.18rem 0.7rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    margin: 0;
    display: flex;
    align-items: center;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    perspective: 1000px;
    margin: 0 auto;
    max-width: 900px;
}

.card {
    aspect-ratio: 3/4.5;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    min-width: 200px;
    max-width: 240px;
    min-height: 240px;
    max-height: 300px;
    margin: 0 auto;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.7rem;
    background: #000;
    border: 2px solid #111;
}

.card-front {
    background: #42a5f5;
    color: white;
    font-size: 2rem;
    letter-spacing: 2px;
}

.card-back {
    transform: rotateY(180deg);
    background: #fff;
    text-align: center;
    font-size: 1.15rem;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-back img {
    width: 100%;
    height: 95%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    box-shadow: none;
    display: block;
}

.card-caption {
    width: 100%;
    height: 9%;
    background: #fff;
    color: #222;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 0 0 12px 12px;
    padding: 0.05rem 0.2rem 0.02rem 0.2rem;
    box-sizing: border-box;
    box-shadow: 0 -1px 4px rgba(33,150,243,0.05);
    line-height: 1.05;
}

.card-back p {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow-wrap: break-word;
}

.card.flipped {
    transform: rotateY(180deg);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem 2.5rem;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(33,150,243,0.10);
}

button {
    background: #42a5f5;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.2s;
}

button:hover {
    background: #1976d2;
}

@media (max-width: 1200px) {
    .game-container {
        max-width: 98vw;
    }
    .game-board {
        max-width: 98vw;
    }
    .card {
        min-width: 120px;
        max-width: 150px;
        min-height: 150px;
        max-height: 180px;
    }
}

@media (max-width: 900px) {
    .game-board {
        max-width: 95vw;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.7rem;
    }
    .card {
        min-width: 90px;
        max-width: 110px;
        min-height: 110px;
        max-height: 130px;
    }
}

@media (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .card {
        min-width: 200px;
        max-width: 240px;
        min-height: 240px;
        max-height: 300px;
    }
    h1 {
        font-size: 1.1rem;
    }
    .game-stats {
        font-size: 0.85rem;
    }
    .game-stats > div {
        padding: 0.12rem 0.4rem;
    }
    .card-back p {
        font-size: 0.75rem;
        word-break: normal;
        white-space: normal;
        padding: 0.2rem 0.2rem;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        overflow-wrap: break-word;
    }
}

.level-select {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.2rem;
    gap: 0.5rem;
    font-size: 1.1rem;
    z-index: 2;
}
.level-select label {
    color: #1976d2;
    font-weight: 600;
}
.level-select select {
    padding: 0.4rem 1rem;
    border-radius: 6px;
    border: 1px solid #90caf9;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
    transition: border 0.2s;
}
.level-select select:focus {
    border: 1.5px solid #1976d2;
}

.scoreboard-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    z-index: 2;
}
#showScoreboard {
    background: #ffd54f;
    color: #37474f;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(255,213,79,0.10);
    cursor: pointer;
    transition: background 0.2s;
}
#showScoreboard:hover {
    background: #ffe082;
}

/* Name Modal */
#nameModal input[type="text"] {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: 1px solid #90caf9;
    font-size: 1.1rem;
    width: 80%;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    outline: none;
    transition: border 0.2s;
}
#nameModal input[type="text"]:focus {
    border: 1.5px solid #1976d2;
}

/* Scoreboard Modal */
.scoreboard-modal {
    max-width: 700px;
    width: 95vw;
    max-height: 80vh;
    overflow-y: auto;
}
.scoreboard-modal h2, .scoreboard-modal h3 {
    color: #1976d2;
    margin-bottom: 0.7rem;
}
.scoreboard-modal table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2rem;
    background: #e3f2fd;
    border-radius: 8px;
    overflow: hidden;
    font-size: 1rem;
}
.scoreboard-modal th, .scoreboard-modal td {
    padding: 0.5rem 0.7rem;
    text-align: center;
}
.scoreboard-modal th {
    background: #90caf9;
    color: #263238;
    font-weight: 700;
}
.scoreboard-modal tr:nth-child(even) {
    background: #f5f5f5;
}
.scoreboard-modal tr:nth-child(odd) {
    background: #fffde7;
}
#closeScoreboard {
    background: #42a5f5;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
#closeScoreboard:hover {
    background: #1976d2;
}

.home-button {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 6px 14px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s;
    z-index: 20;
}

.home-button:hover {
    background-color: #45a049;
} 