/* File: css/wsp-game-styles.css */
/* Version: 1.2: Added game progress display styles */

#wsp-game-mode-container {
    max-width: 960px;
    margin: 20px auto;
}

#wsp-level-selection-view .wsp-unit-study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#wsp-game-levels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.wsp-game-level-btn {
    position: relative; /* For status badge positioning */
    padding: 20px 30px;
    font-size: 1.2em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden; /* Hide overflowing badge parts */
}

.wsp-game-level-btn:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* Level Status Badge */
.wsp-level-status {
    position: absolute;
    top: -10px;
    right: -30px;
    transform: rotate(45deg);
    padding: 20px 30px 5px 30px;
    font-size: 10px;
    font-weight: bold;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.wsp-level-status.completed {
    background-color: #ffc107; /* Yellow */
    color: #212529;
}

.wsp-level-status.incomplete {
    background-color: #6c757d; /* Gray */
}


/* Game Board */
#wsp-game-board-view {
    border: 2px solid #343a40;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background-color: #f0f8ff; /* AliceBlue */
    height: 70vh;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

#wsp-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #343a40;
    color: white;
    flex-shrink: 0;
}

#wsp-game-level-title {
    font-weight: bold;
    font-size: 1.2em;
}

#wsp-game-score,
#wsp-game-progress {
    font-size: 1.1em;
}

#wsp-game-board {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#wsp-game-falling-area {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.wsp-falling-item {
    position: absolute;
    top: -50px; /* Start off-screen */
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #ffc107;
    color: #212529;
    border: 2px solid #e0a800;
    border-radius: 25px;
    font-size: 1.5em;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 3px 5px rgba(0,0,0,0.2);
}

#wsp-game-options-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background-color: #e9ecef;
    border-top: 2px solid #ced4da;
    flex-shrink: 0;
}

.wsp-game-option-btn {
    padding: 12px 18px;
    font-size: 1em;
    border: 1px solid #6c757d;
    background-color: white;
    border-radius: 5px;
    cursor: pointer;
    flex-grow: 1;
    max-width: 200px;
    transition: all 0.2s ease;
}

.wsp-game-option-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.wsp-game-option-btn.correct {
    background-color: #28a745;
    color: white;
    border-color: #1c7430;
    transform: scale(1.05);
}

.wsp-game-option-btn.incorrect {
    background-color: #dc3545;
    color: white;
    border-color: #b02a37;
}

.wsp-game-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#wsp-game-controls {
    padding: 10px;
    text-align: center;
    background-color: #343a40;
    color: white;
    flex-shrink: 0;
}

#wsp-game-controls button {
    margin-left: 10px;
}

/* Game Over Overlay */
#wsp-game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    z-index: 100;
    backdrop-filter: blur(3px);
}

#wsp-game-over-box {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

#wsp-game-over-box h2 {
    margin-top: 0;
    font-size: 2em;
    color: #dc3545;
}

#wsp-game-over-box h2.success {
    color: #28a745;
}

#wsp-game-over-buttons {
    margin-top: 20px;
}

#wsp-game-over-buttons button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 0 10px;
    cursor: pointer;
    border-radius: 5px;
    border: none;
}

#wsp-game-retry-btn { background-color: #28a745; color: white; }
#wsp-game-quit-btn { background-color: #6c757d; color: white; }

/* Modal styles for game page (prefix with -game to avoid conflicts) */
#wsp-textbook-selection-modal-game {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    z-index: 10001;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

#wsp-textbook-selection-modal-game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
}