/* ============================================
   PROBLEMAS DE SOMA E SUBTRAÇÃO V2 - GAME CSS
   Resolução de problemas matemáticos contextualizados
   Layout 2026 - Mobile First
   ============================================ */

:root {
    --primary-color: #667eea;
    --primary-dark: #5e4fa2;
    --secondary-color: #764ba2;
    --success-color: #51CF66;
    --error-color: #FF6B6B;
    --warning-color: #FFB84D;
    --text-dark: #2d3748;
    --text-light: #4a5568;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   GAME CONTAINER
   ============================================ */

.game-container {
    background: var(--bg-gradient);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: var(--card-shadow);
    min-height: 600px;
    position: relative;
    margin-bottom: 30px;
    font-family: var(--font-primary);
}

/* ============================================
   FULLSCREEN BUTTON
   ============================================ */

.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.fullscreen-btn svg {
    color: white;
}

/* ============================================
   MODE SELECTION SCREEN
   ============================================ */

.mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
}

.mode-card {
    background: white;
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--bg-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.3);
}

.mode-card:hover::before {
    transform: scaleX(1);
}

.mode-icon {
    font-size: 80px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.mode-card:hover .mode-icon {
    transform: scale(1.2) rotate(10deg);
}

.mode-card h3 {
    color: var(--primary-dark);
    font-size: 24px;
    font-weight: 700;
    margin: 15px 0;
    font-family: var(--font-primary);
}

.mode-card p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
    margin: 15px 0;
    font-family: var(--font-secondary);
}

.mode-examples {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    text-align: left;
}

.mode-examples li {
    color: var(--success-color);
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0;
    padding-left: 5px;
    font-family: var(--font-secondary);
}

/* ============================================
   GAME PLAY SCREEN
   ============================================ */

/* Stats Header */
.stats-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 15px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
}

.stat-value {
    display: block;
    color: white;
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-primary);
}

/* Problem Display Area */
.problem-area {
    background: white;
    border-radius: 20px;
    padding: 40px 35px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.problem-icon {
    font-size: 60px;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.problem-text {
    color: var(--text-dark);
    font-size: 20px;
    line-height: 1.8;
    font-weight: 600;
    max-width: 600px;
    font-family: var(--font-secondary);
}

/* Answers Grid */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.answer-option {
    background: white;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 25px 20px;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: var(--font-primary);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--bg-gradient);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: 0;
}

.answer-option:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.answer-option:hover::before {
    width: 300px;
    height: 300px;
    opacity: 0.1;
}

.answer-option span {
    position: relative;
    z-index: 1;
}

.answer-option:active {
    transform: translateY(-2px) scale(0.98);
}

/* Correct Answer Animation */
.answer-option.correct {
    animation: correctPulse 0.6s ease;
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    25% { transform: scale(1.15) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1.2); }
}

/* Wrong Answer Animation */
.answer-option.wrong {
    animation: wrongShake 0.5s ease;
    background: var(--error-color);
    border-color: var(--error-color);
    color: white;
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px) rotate(-2deg); }
    20%, 40%, 60%, 80% { transform: translateX(8px) rotate(2deg); }
}

/* Disabled state (after answer) */
.answer-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Feedback Message */
.feedback-message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
    font-family: var(--font-secondary);
}

.feedback-message.show {
    opacity: 1;
    transform: translateY(0);
}

.feedback-message.correct-msg {
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.feedback-message.wrong-msg {
    color: var(--error-color);
    border: 2px solid var(--error-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: var(--font-primary);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-action:active {
    transform: translateY(-1px);
}

/* ============================================
   RESULT SCREEN
   ============================================ */

.result-screen {
    text-align: center;
    padding: 40px 20px;
}

.result-icon {
    font-size: 100px;
    margin-bottom: 25px;
    animation: zoomIn 0.6s ease;
}

@keyframes zoomIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.result-title {
    color: white;
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: var(--font-primary);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.result-message {
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    margin-bottom: 30px;
    font-family: var(--font-secondary);
    line-height: 1.6;
}

.result-medal {
    font-size: 120px;
    margin: 30px 0;
    animation: medalSpin 1s ease;
}

@keyframes medalSpin {
    0% { transform: rotateY(0) scale(0); }
    50% { transform: rotateY(180deg) scale(1.2); }
    100% { transform: rotateY(360deg) scale(1); }
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin: 40px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.result-stat {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 20px 15px;
    backdrop-filter: blur(10px);
}

.result-stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-primary);
}

.result-stat-value {
    display: block;
    color: white;
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-primary);
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 30px auto 0;
}

.btn-result {
    background: white;
    border: none;
    border-radius: 14px;
    padding: 18px 35px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: var(--font-primary);
}

.btn-result:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.btn-result:active {
    transform: translateY(-2px);
}

.btn-replay {
    background: var(--success-color);
    color: white;
}

.btn-replay:hover {
    background: #40b653;
}

.btn-switch {
    background: var(--warning-color);
    color: white;
}

.btn-switch:hover {
    background: #ffa940;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .game-container {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .fullscreen-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mode-card {
        padding: 30px 20px;
    }

    .mode-icon {
        font-size: 65px;
    }

    .mode-card h3 {
        font-size: 22px;
    }

    .stats-header {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-item {
        padding: 12px 15px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 20px;
    }

    .problem-area {
        padding: 30px 25px;
        min-height: 180px;
    }

    .problem-icon {
        font-size: 50px;
        margin-bottom: 20px;
    }

    .problem-text {
        font-size: 18px;
    }

    .answers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .answer-option {
        padding: 20px 15px;
        font-size: 28px;
        min-height: 90px;
    }

    .feedback-message {
        font-size: 16px;
        padding: 18px 20px;
        min-height: 60px;
    }

    .result-title {
        font-size: 32px;
    }

    .result-message {
        font-size: 18px;
    }

    .result-medal {
        font-size: 100px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .result-stat-value {
        font-size: 28px;
    }

    .btn-result {
        font-size: 16px;
        padding: 16px 30px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .game-container {
        padding: 25px 15px;
        border-radius: 16px;
    }

    .fullscreen-btn {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
    }

    .mode-selection h2 {
        font-size: 24px !important;
    }

    .mode-icon {
        font-size: 55px;
    }

    .mode-card h3 {
        font-size: 20px;
    }

    .mode-card p {
        font-size: 14px;
    }

    .mode-examples li {
        font-size: 13px;
    }

    .stats-header {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 10px 12px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    .problem-area {
        padding: 25px 20px;
        min-height: 160px;
    }

    .problem-icon {
        font-size: 45px;
        margin-bottom: 15px;
    }

    .problem-text {
        font-size: 16px;
        line-height: 1.6;
    }

    .answers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .answer-option {
        padding: 18px 12px;
        font-size: 26px;
        min-height: 80px;
    }

    .feedback-message {
        font-size: 15px;
        padding: 16px 18px;
        min-height: 55px;
    }

    .action-buttons {
        gap: 12px;
    }

    .btn-action {
        padding: 12px 24px;
        font-size: 15px;
    }

    .result-icon {
        font-size: 80px;
    }

    .result-title {
        font-size: 28px;
    }

    .result-message {
        font-size: 16px;
    }

    .result-medal {
        font-size: 85px;
    }

    .result-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .result-stat {
        padding: 16px 12px;
    }

    .result-stat-label {
        font-size: 11px;
    }

    .result-stat-value {
        font-size: 24px;
    }

    .result-buttons {
        gap: 12px;
    }

    .btn-result {
        font-size: 15px;
        padding: 14px 25px;
    }
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */

.game-container:fullscreen {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-container:-webkit-full-screen {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-container:-moz-full-screen {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-container:-ms-fullscreen {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
