/* Game Container */
#fifteen {
    position: relative;
    /* background-color: #ddd; - Removed to show map behind */
    box-shadow: 0 5px 10px rgb(0 0 0 / 65%);
    /* Transition for smooth resizing */
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 10;
    /* Above map */
}

/* Background Map */
#background-map {
    position: absolute;
    /* Size will be set by JS to match #fifteen */
    z-index: 0;
    /* Behind tiles */
    opacity: 0.2;
    /* pointer-events managed by JS */
    border-radius: 2px;
    /* Match tiles if appropriate */
}

/* Individual Tile Slot */
.slot {
    position: absolute;
    /* Styles for the tiles */
    background-repeat: no-repeat;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    /* Inner border effect */
    transition: top 0.2s ease-out, left 0.2s ease-out;
    background-color: #ddd;
    /* Fallback */

    /* Optional: make tiles rounded */
    border-radius: 2px;
}

.slot:hover {
    filter: brightness(1.1);
    z-index: 20;
}

/* Empty slot styling (optional, usually invisible or placeholder) */
.slot-empty {
    /* Usually not rendered as a div, or transparent */
}

/* Animations */
@keyframes bounce {

    from,
    20%,
    53%,
    80%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }

    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -30px, 0);
    }

    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -15px, 0);
    }

    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.bounce {
    animation-name: bounce;
    animation-duration: 1s;
    transform-origin: center bottom;
    animation-fill-mode: both;
}

@keyframes bounceOut {
    20% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    50%,
    55% {
        opacity: 1;
        transform: scale3d(1.1, 1.1, 1.1);
    }

    to {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
}

.bounceOut {
    animation-name: bounceOut;
    animation-duration: 0.75s;
    animation-fill-mode: both;
}

.animated {
    /* Base class for animations if needed, though included in classes above */
    animation-fill-mode: both;
}

/* Start Screen Overlay */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
    color: white;
    font-family: 'Courier New', monospace;
    text-align: center;
}

#start-screen h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #fbbf24;
    text-shadow: 4px 4px 0px #b45309;
}

#start-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #e5e7eb;
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #1f2937;
    background-color: #fbbf24;
    border: 4px solid #b45309;
    cursor: pointer;
    box-shadow: 0 6px 0 #b45309;
    transition: all 0.1s;
}

#start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #b45309;
}

/* Score Message Overlay */
#score-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(31, 41, 55, 0.95);
    padding: 30px;
    border: 4px solid #fbbf24;
    border-radius: 10px;
    color: white;
    font-family: 'Courier New', monospace;
    z-index: 250;
    display: none;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

#score-message h2 {
    text-align: center;
    color: #fbbf24;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2rem;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #b45309;
}

.score-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.score-total {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #4b5563;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fbbf24;
}