/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF006E;
    --secondary-color: #FB5607;
    --accent-color: #FFBE0B;
    --purple-color: #8338EC;
    --blue-color: #3A86FF;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --card-bg: rgba(255, 255, 255, 0.1);
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --border-glow: rgba(255, 0, 110, 0.5);
    --success-color: #00ff88;
    --danger-color: #ff4757;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(131, 56, 236, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 0, 110, 0.3);
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px var(--primary-color);
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
}

.current-score, .high-score {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-color);
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 1rem;
    padding-bottom: 5rem;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.game-logo {
    margin-bottom: 2rem;
}

.game-logo i {
    font-size: 4rem;
    color: var(--primary-color);
    text-shadow: 0 0 30px var(--primary-color);
    margin-bottom: 1rem;
}

.game-logo h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.game-description {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* Difficulty Selection */
.difficulty-selection {
    margin-bottom: 2rem;
}

.difficulty-selection h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.difficulty-btn {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 1rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
    transform: translateY(-2px);
}

.difficulty-btn.selected {
    border-color: var(--primary-color);
    background: rgba(255, 0, 110, 0.2);
    box-shadow: 0 0 30px rgba(255, 0, 110, 0.4);
}

.difficulty-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.difficulty-btn span {
    display: block;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.difficulty-btn small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Buttons */
.primary-btn, .secondary-btn, .danger-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(255, 0, 110, 0.6);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    background: var(--card-bg);
    color: var(--text-light);
    border: 2px solid var(--blue-color);
}

.secondary-btn:hover {
    background: rgba(58, 134, 255, 0.2);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.4);
}

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

.danger-btn:hover {
    background: #ff3742;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

/* Game Screen */
.game-header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.level-indicator {
    color: var(--accent-color);
    font-weight: bold;
}

.timer {
    color: var(--secondary-color);
    font-weight: bold;
    font-family: monospace;
}

.words-counter {
    text-align: center;
    color: var(--text-muted);
}

/* Letters Container */
.letters-container {
    margin-bottom: 1.5rem;
}

.letters-area {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    min-height: 120px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.letter-tile {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--purple-color), var(--blue-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.letter-tile:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(131, 56, 236, 0.5);
}

.letter-tile.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

.letter-tile.used {
    opacity: 0.3;
    pointer-events: none;
}

.shuffle-btn {
    background: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.shuffle-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 190, 11, 0.5);
}

/* Word Formation */
.word-formation {
    margin-bottom: 1.5rem;
}

.word-input-area {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.word-builder {
    min-height: 60px;
    border: 2px dashed var(--primary-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: rgba(255, 0, 110, 0.1);
}

.word-builder.drag-over {
    background: rgba(255, 0, 110, 0.3);
    border-color: var(--accent-color);
}

.word-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.submit-btn {
    background: var(--success-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #00e67a;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.clear-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #ff3742;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

/* Hints Section */
.hints-section {
    margin-bottom: 1.5rem;
    text-align: center;
}

.hint-btn {
    background: var(--accent-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 20px;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.hint-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 190, 11, 0.5);
}

.hint-display {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 190, 11, 0.3);
    display: none;
    backdrop-filter: blur(10px);
}

.hint-display.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Found Words */
.found-words {
    margin-bottom: 1.5rem;
}

.found-words h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-align: center;
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.word-tag {
    background: linear-gradient(45deg, var(--blue-color), var(--purple-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    animation: popIn 0.3s ease;
}

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

/* Game Actions */
.game-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Stats Screen */
.stats-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.stats-content h2 {
    color: var(--accent-color);
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 0, 110, 0.2);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    text-align: left;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* FAQ Section */
.faq-content {
    max-width: 600px;
    margin: 0 auto;
}

.faq-content h2 {
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-light);
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 0, 110, 0.1);
}

.faq-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.show {
    padding: 0 1.5rem 1.5rem 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 0, 110, 0.3);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: bold;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    margin: 1rem;
    border: 2px solid var(--primary-color);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(255, 0, 110, 0.3);
}

.modal-content h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.game-end-stats {
    margin: 1.5rem 0;
}

.game-end-stats p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.new-record {
    color: var(--success-color);
    font-weight: bold;
    animation: pulse 1s infinite;
}

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

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .score-display {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .difficulty-buttons {
        gap: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .letter-tile {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding: 0.5rem;
        padding-bottom: 5rem;
    }
    
    .game-header,
    .word-input-area,
    .letters-area {
        padding: 1rem;
    }
    
    .letter-tile {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 0.5rem;
    }
}

/* Animations and Effects */
.glow-effect {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 5px var(--primary-color); }
    to { box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

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

.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
.nav-item:focus,
.difficulty-btn:focus,
.faq-question:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --card-bg: rgba(255, 255, 255, 0.2);
        --text-muted: #ffffff;
    }
}
