/** {*/
/*    border: 1px solid red;*/
/*}*/

body, button, input {
    font-family: 'Overpass Mono', monospace;
}

body {
    background-color: #d2c5a2; /* Weathered beige */
    margin: 0;
    height: 100dvh; /* Lock height to viewport for modern mobile browsers */
    width: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.film-strip {
    position: fixed;
    top: 0;
    width: 80px;
    height: 100%;
    background-color: #1a1a1a;
    z-index: -1;
    background-image: 
        /* Left perforations */
        linear-gradient(to bottom, #d2c5a2 70%, transparent 70%),
        /* Right perforations */
        linear-gradient(to bottom, #d2c5a2 70%, transparent 70%),
        /* Center frames */
        linear-gradient(to bottom, #d2c5a2 90%, transparent 90%);
    background-position: 
        8px 0,   /* Left perforations */
        62px 0,   /* Right perforations */
        20px 10px; /* Center frames */
    background-size: 
        10px 15px, /* Perforations size */
        10px 15px, /* Perforations size */
        40px 65px; /* Frames size */
    background-repeat: repeat-y;
}

.film-strip.left {
    left: 0;
}

.film-strip.right {
    right: 0;
}

.score-increase {
    color: #2ecc71 !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.score-decrease {
    color: #e74c3c !important;
    transform: scale(0.9);
    transition: all 0.2s ease;
}

#score {
    transition: all 0.3s ease;
}

#title {
    text-align: center;
}

#title h1 {
    font-family: 'Notable', sans-serif;
    font-size: 3rem;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#title h3 {
    font-size: 1.2rem;
    margin-top: 0;
    font-style: italic;
}

#title p {
    margin: 10px 0;
}

.row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 960px;
    padding: 12px;
}

#plot-text {
    padding: 12px;
    background-color: #f5f0e1;
    border: 1px solid #c2b592;
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.plot-update {
    transform: scale(0.98);
}

#answer-container {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.answer-popup {
    background-color: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
    text-align: center;
    margin: 0;
}

h1 {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

h2 {
    font-size: 1.4rem;
    color: #333;
    margin: 0;
    text-align: center;
}

h3 {
    font-size: 0.9rem;
    color: #444;
    margin: 0;
    padding: 5px;
    text-align: center;
}

#hint-container {
    display: none;
    align-items: center;
    justify-content: center;
}

#hint-container h3 {
    margin: 0;
}

.search-input-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-wrapper {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-buttons-mobile {
    display: flex;
    gap: 10px;
}

#movie-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    color: #333;
    background-color: #f5f0e1;
    padding: 8px 12px;
    border: 1px solid #c2b592;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    outline: none;
    transition: all 0.3s ease;
}

#movie-search:focus {
    border-color: #a09578;
    background-color: #fffdf5;
}

#movie-search::placeholder {
    color: #888;
}

#skip, #hint {
    font-size: 16px;
    color: #333;
    background-color: #f5f0e1;
    padding: 8px 12px;
    border: 1px solid #c2b592;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#skip:hover, #hint:hover {
    background-color: #e8e0c8;
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    overflow-y: auto;
    max-height: 250px;
    z-index: 20;
    box-sizing: border-box;
}
.result-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    color: #333;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.1s;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background-color: #f0f0f0;
}
@media (max-width: 600px) {
    body {
        justify-content: center;
        padding-bottom: 10dvh; /* Push content slightly up from center */
        box-sizing: border-box;
        overflow: hidden; /* Prevent scrolling on mobile */
    }

    .row {
        padding: 6px 16px;
        max-width: 450px; /* Constrain width on mobile for better proportions */
        box-sizing: border-box;
    }

    #title h1 {
        font-size: 1.8rem;
        line-height: 1.1;
        margin-bottom: 4px;
    }

    #title h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    #plot-text {
        font-size: 1.1rem;
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    #title p {
        margin: 4px 0;
    }

    .search-input-container {
        width: 100%;
    }

    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .search-buttons-mobile {
        width: 100%;
        gap: 8px;
    }

    .search-buttons-mobile button {
        flex: 1;
        padding: 12px; /* Slightly larger touch target */
        font-size: 16px;
    }

    #movie-search {
        width: 100%;
        box-sizing: border-box;
        padding: 12px; /* Slightly larger touch target */
        font-size: 16px; /* Prevent auto-zoom on iOS */
    }

    #skip, #hint {
        width: 100%;
        box-sizing: border-box;
    }

    #search-results {
        margin-top: 4px;
        z-index: 100;
    }

    .result-item {
        font-size: 16px;
        padding: 12px;
    }
}

@media (max-width: 800px) {
    .film-strip {
        display: none;
    }
}
