/* Miare Quiz Game - MiareFastUI Design */

:root {
    --miare-purple: #701f83;
    --miare-yellow: #fdb813;
    --miare-purple-light: #8b2aa0;
    --miare-purple-dark: #5a1869;
    
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, var(--miare-purple) 0%, var(--miare-purple-dark) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* Landing Page */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 80px;
    color: var(--miare-yellow);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.game-title {
    color: white;
    font-size: 2.5rem;
    margin: 1rem 0 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.game-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* Card */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.card h2, .card h3 {
    color: var(--miare-purple);
    margin-bottom: 0.5rem;
}

/* Input */
.input-group {
    margin: 1.5rem 0;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--miare-purple);
    box-shadow: 0 0 0 3px rgba(112, 31, 131, 0.1);
}

/* Button */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.btn-primary {
    background: var(--miare-purple);
    color: white;
}

.btn-primary:hover {
    background: var(--miare-purple-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Game Screen */
#gameScreen {
    padding: 0;
}

.game-header {
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 10;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.info-item .material-icons {
    color: var(--miare-purple);
}

.question-progress {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.game-content {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Timer */
.timer-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.timer-ring {
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: rgba(112, 31, 131, 0.1);
    stroke-width: 8;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--miare-yellow);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
}

/* Question */
.question-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.question-text {
    color: var(--miare-purple);
    font-size: 1.5rem;
    text-align: center;
    line-height: 1.6;
}

/* Answers */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .answers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.answer-btn {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--miare-purple);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.answer-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-btn.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.answer-btn.incorrect {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

/* Leaderboard */
.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.trophy-icon {
    font-size: 80px;
    color: var(--miare-yellow);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.leaderboard-header h1 {
    color: white;
    margin-top: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.player-final-score {
    text-align: center;
    padding: 1rem 0;
}

.player-final-score h2 {
    font-size: 3rem;
    color: var(--miare-purple);
    margin-top: 0.5rem;
}

.leaderboard-list {
    margin-top: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.leaderboard-item:hover {
    background: var(--bg-primary);
}

.leaderboard-rank {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rank-number {
    width: 40px;
    height: 40px;
    background: var(--miare-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.rank-number.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: var(--miare-purple);
}

.rank-number.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: var(--text-primary);
}

.rank-number.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 100%);
    color: white;
}

.player-info h4 {
    margin-bottom: 0.25rem;
}

.player-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.leaderboard-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--miare-purple);
}

/* Utilities */
.text-secondary {
    color: var(--text-secondary);
}

/* Persian Digits Helper */
.persian-digit {
    font-feature-settings: "ss01";
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 1s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s;
}
