/* ================= GLOBAL RESET ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: sans-serif;
    background-color: #fafafa;
    color: #333;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: black;
}
h1, h2 {
    margin-bottom: 1rem;
    text-align: center;
}

/* ================ FRANCHISE SELECTION ================ */
#franchise-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    color: white;
}

#franchise-selection h2 {
    color: white;
    margin-bottom: 2rem;
}

.franchise-options {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.franchise-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
}

.franchise-option:hover img {
    border: 4px solid #4caf50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.franchise-option.selected img {
    border: 4px solid #4caf50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
}

.franchise-option img {
    width: 500px;
    height: 500px;
    object-fit: cover;
    margin-bottom: 1rem;
    border-radius: 50%;
    border: 4px solid transparent;
    transition: all 0.3s ease;
}

.franchise-option h3 {
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

#start-game-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s ease;
}

#start-game-button.enabled {
    opacity: 1;
    pointer-events: all;
}

#start-game-button:hover {
    background-color: #388e3c;
}

@media (max-width: 600px) {
    .franchise-options {
        gap: 1rem;
    }
    
    .franchise-option img {
        width: 300px !important;
        height: 300px !important;
    }
}

/* ================ RANCE OPTIONS POPUP ================ */
#rance-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #2c2c2c;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #4caf50;
    max-width: 500px;
    width: 90%;
    text-align: center;
    color: white;
}

.popup-content h3 {
    color: #4caf50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.option-group {
    margin: 1rem 0;
    text-align: left;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.option-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: white;
}

.option-group input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #4caf50;
}

.popup-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.popup-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.popup-button.confirm {
    background-color: #4caf50;
    color: white;
}

.popup-button.confirm:hover {
    background-color: #388e3c;
}

.popup-button.cancel {
    background-color: #666;
    color: white;
}

.popup-button.cancel:hover {
    background-color: #555;
}

/* ================ LOADING SCREEN ================ */
#loading-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    width: 90%;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top: 4px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background-color: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-progress {
    height: 100%;
    background-color: #4caf50;
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ================ GAME CONTAINER ================ */
#game-container {
    width: 100%;
    max-width: 80%; /* 900px */
    background-color: black;
}
#pull-counter {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Using CSS Grid so that if the viewport is <800px, 
    we force 1 column; if ≥800px, we use 3 columns. */
.images-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (min-width: 800px) {
    .images-row {
    grid-template-columns: repeat(3, 1fr);
    }
}

.image-card {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 0.5rem;
}
.image-card img {
    height: auto;
    display: block;
    min-height: 620px;
    min-width: 340px;
    max-height: 620px;
}

.buttons-row {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

    /* Download button styling */
#download-button {
    margin: 1rem auto;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    background-color: #4caf50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: none; /* hidden until results are shown */
    transition: background-color 0.2s;
}
#download-button:hover {
    background-color: #388e3c;
}

.choice-button {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #888;
    background-color: #eee;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
}
/* Color the button text by action when unselected */
.choice-button.fuck {
    color: green;
}
.choice-button.marry {
    color: deeppink;
}
.choice-button.kill {
    color: red;
}

/* When selected, use the action's color as background */
.choice-button.fuck.selected {
    background-color: green;
    border-color: #2e7d32;
    color: #fff !important;
}
.choice-button.marry.selected {
    background-color: deeppink;
    border-color: #c2185b;
    color: #fff !important;
}
.choice-button.kill.selected {
    background-color: red;
    border-color: #c62828;
    color: #fff !important;
}
.choice-button:disabled {
    background-color: #ddd;
    border-color: #aaa;
    cursor: not-allowed;
    color: #777 !important;
}

/* Enlarge buttons a bit more on very large screens */
@media (min-width: 1200px) {
    .choice-button {
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
    }
}

#next-button {
    margin: 1rem auto;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    background-color: #2196f3;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s;
    display: block;
}
#next-button.enabled {
    opacity: 1;
    pointer-events: all;
}
/* Enlarge “Next” on big screens too */
@media (min-width: 1200px) {
    #next-button {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
    }
}

/* ============== RESULTS GRID ============== */
#results-container {
    display: none;
    width: 100%;
    margin-top: 2rem;
    background-color: black;
}
.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    background-color: black;
}
/* Each pull of three thumbnails is wrapped in a “square” border */
.pull-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 310px;   /* 3×100px + 2×5px gap */
    height: auto;
    border: 2px solid #4caf50;
    border-radius: 8px;
    background-color: black;
    padding: 5px;
}
.result-card {
    width: 100px;
    height: 120px;
    background: black;
    border: 1px solid #4caf50;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-align: center;
    overflow: hidden;
}
.result-card img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin-bottom: 4px;
    border-radius: 4px;
    display: block;
}
/* Color the result‐label text inside each card */
.result-card .label-fuck {
    color: green;
    background-color: black;
}
.result-card .label-marry {
    color: deeppink;
    background-color: black;
}
.result-card .label-kill {
    color: red;
    background-color: black;
}

/*   Mobile tweaks: keep the same single‐column pull layout & smaller gaps */
@media (max-width: 600px) {
    .images-row {
    gap: 0.5rem;
    }
    .buttons-row {
    gap: 0.3rem;
    }
    .choice-button {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    }
    #next-button {
    width: 100%;
    }
}