@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f8ff;
    color: #333;
}

header {
    background-color: #ffcc00;
    padding: 20px;
    text-align: center;
    border-bottom: 5px solid #ff4500;
}

header h1 {
    font-family: 'Lobster', cursive;
    color: #ff4500;
    margin: 0;
    font-size: 3em;
    text-shadow: 2px 2px #fff;
}

nav {
    background-color: #ff6347;
    padding: 10px;
    text-align: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    margin: 0 15px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #ff4500;
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
    margin-top: 40px;
}

/* Game Selection Cards */
.game-cards-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.game-card {
    background: white;
    border: 3px solid #ff4500;
    border-radius: 15px;
    padding: 20px;
    width: 250px;
    text-align: center;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.game-card:hover {
    transform: scale(1.05);
}

.game-card h4 {
    font-family: 'Lobster', cursive;
    font-size: 1.5em;
    color: #ff4500;
    margin-top: 0;
}

/* Game Layout Specifics */
.game-container {
    display: flex;
    background: white;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    overflow: hidden;
    /* Responsive Height to fit viewport */
    width: 100%;
    height: 75vh;
    min-height: 400px;
    align-items: stretch; /* Stretch children (panels) to fill height */
}

.left-panel {
    flex: 1;
    background-color: #e6f7ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #ddd;
    padding: 10px;
    position: relative; /* For absolute positioning of speaker button */
    overflow: hidden; /* Ensure image stays inside */
}

/* Responsive Image Scaling */
.left-panel img, .left-panel .image-display {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 1;
}

.right-panel {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    overflow: hidden; /* Prevent spill */
}

/* Restored Styles for Letter Jacht & Woord Bouwer */
.word-display {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Reduced gap */
    width: 100%;
    flex-wrap: nowrap; /* Force single line */
}

.options-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 100px;
    width: 100%;
    flex-wrap: nowrap; /* Force single line for options too */
}

/* Standardized Game Letter Box (Responsive) */
.game-letter, .dropzone, .static-letter, .draggable {
    /* Responsive Sizing using Clamp */
    width: clamp(30px, 9vw, 80px);
    height: clamp(30px, 9vw, 80px);
    font-size: clamp(1rem, 5vw, 3rem);

    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin: 2px;
    box-sizing: border-box;
    flex-shrink: 1; /* Allow shrinking if needed */
    aspect-ratio: 1 / 1; /* Maintain square shape */
}

/* Dropzones */
.dropzone {
    border: 3px dashed #333;
    border-radius: 10px;
    background-color: #f9f9f9;
}

/* Static letters */
.static-letter {
    /* Inherits shared styles above */
}

.draggable {
    background: white;
    border: 2px solid #ccc;
    border-radius: 10px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 4px 5px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    padding: 0;
}

.draggable:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.dragging {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.8;
    /* Ensure dragged clone keeps size */
    width: 80px;
    height: 80px;
    font-size: 3rem;
}

.cursive-text {
    /* Font family set dynamically via JS/Settings */
    font-weight: normal;
}

/* Speaker Button Style */
.speaker-button-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid #ffcc00;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.speaker-button-overlay:hover {
    transform: scale(1.1);
    background-color: #fff;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        height: auto; /* Allow growth */
        min-height: 85vh;
    }

    .left-panel {
        flex: 0 0 35vh; /* Fixed height for image area */
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #ddd;
    }

    .right-panel {
        flex: 1;
        width: 100%;
        padding: 10px;
    }

    .word-display, .options-area {
        gap: 2px;
    }
}
