/* Basic Reset and Body Styling */
body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Screen container */
.screen {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Card Styling */
.card {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    color: #1a73e8;
    margin-top: 0;
}

h2 {
    color: #5f6368;
}

p {
    color: #5f6368;
    line-height: 1.6;
}

/* Input and Button Styling */
input[type="text"], input[type="number"] {
    width: calc(100% - 22px);
    padding: 12px 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

button, .menu-btn {
    width: 100%;
    padding: 12px;
    background-image: linear-gradient(45deg, #1a73e8, #4a90e2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

button:hover, .menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

button:disabled {
    background-image: none;
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Main Menu on Index Page */
.main-menu {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.menu-btn.alt {
    background-image: linear-gradient(45deg, #6c757d, #868e96);
}

/* Gender Selection Styling */
.gender-selection {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}
.gender-selection label {
    font-size: 16px;
    cursor: pointer;
}

/* --- MODAL STYLES --- */
#modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 99;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    width: 90%;
    max-width: 500px;
}
.modal-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: right;
    position: relative;
}
.modal-content h3 { color: #1a73e8; }
.modal-content ul, .modal-content ol { padding-right: 20px; }
.modal-content li { margin-bottom: 10px; }
.close-btn {
    position: absolute;
    top: 10px;
    left: 15px; /* Changed to left for LTR look on a single button */
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    width: auto;
    padding: 0;
    box-shadow: none;
}

/* Utility Class */
.hidden {
    display: none !important;
}

/* Status Messages */
.status-message {
    margin-top: 15px;
    font-weight: bold;
}
.status-message.error { color: #d93025; }
.status-message.success { color: #1e8e3e; }

/* Game View */
#timer-display {
    font-size: 48px;
    font-weight: bold;
    color: #1a73e8;
    margin: 10px 0;
}
#voting-area {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.vote-btn {
    background-image: none;
    background-color: #f0f2f5;
    color: #333;
    border: 1px solid #ddd;
}
.vote-btn:hover { background-color: #e0e2e5; }
.vote-btn:disabled {
    background-image: none;
    background-color: #1e8e3e;
    color: white;
    border-color: #1e8e3e;
}

/* Results View */
.results-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.reveal-btn { background-image: linear-gradient(45deg, #34a853, #5cb85c); }
.final-results-grid {
    display: grid;
    gap: 15px;
}
.result-card {
    background-color: #f0f2f5;
    padding: 15px;
    border-radius: 8px;
    border-right: 5px solid #1a73e8;
    text-align: right;
}
.result-card.final {
    border-color: #fbbc05; /* Gold */
    animation: pulse 1.5s infinite;
    background-color: #fffbeb;
}
.result-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}
.result-card p {
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Host View Specifics */
.question-panel {
    border-top: 1px solid #eee;
    margin-top: 20px;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#question-select, #custom-question-input {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.question-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    min-height: 50px;
}
