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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* Neon Glow Effects */
.neon-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px currentColor;
}

.neon-btn {
    background: linear-gradient(45deg, #FF006E, #FB5607);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(255, 0, 110, 0.3),
        0 0 20px rgba(255, 0, 110, 0.2),
        0 0 30px rgba(255, 0, 110, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.neon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 15px rgba(255, 0, 110, 0.5),
        0 0 30px rgba(255, 0, 110, 0.3),
        0 0 45px rgba(255, 0, 110, 0.2);
}

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

/* Header */
header {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 0, 110, 0.3);
}

header h1 {
    font-size: 2rem;
    background: linear-gradient(45deg, #FF006E, #FB5607, #FFBE0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
}

/* Main Content */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sections */
.section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

.theme-selector, .difficulty-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.theme-selector label, .difficulty-selector label {
    font-weight: bold;
    color: #FFBE0B;
    text-shadow: 0 0 10px rgba(255, 190, 11, 0.5);
}

select {
    padding: 8px 12px;
    border-radius: 15px;
    border: 2px solid #FFBE0B; /* maior contraste */
    background: #1b1730; /* fundo mais escuro p/ contraste */
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 0 0 rgba(255, 190, 11, 0);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #FF006E; /* destaque no foco */
    box-shadow:
        0 0 0 2px rgba(255, 0, 110, 0.25),
        0 0 12px rgba(255, 0, 110, 0.35);
    background: #211b3a;
}

/* Hover melhora legibilidade do contorno */
select:hover {
    border-color: #FF006E;
}

/* Opções do dropdown com alto contraste (suporte varia entre navegadores) */
select option {
    background-color: #0f0f23;
    color: #ffffff;
}

select option:checked {
    background-color: #3A86FF;
    color: #ffffff;
}

select:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Game Stats */
.game-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(131, 56, 236, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(131, 56, 236, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #FFBE0B;
    margin-bottom: 5px;
}

#found-count, #total-count, #game-timer, #game-score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #3A86FF;
    text-shadow: 0 0 10px rgba(58, 134, 255, 0.5);
}

/* Grid Container */
.grid-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 0, 110, 0.3);
    overflow-x: auto;
}

#coordinate-labels-top {
    display: flex;
    margin-left: 30px;
    margin-bottom: 5px;
}

.coord-label-top {
    width: 25px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #FFBE0B;
    font-weight: bold;
}

.grid-with-labels {
    display: flex;
}

#coordinate-labels-left {
    display: flex;
    flex-direction: column;
    margin-right: 5px;
}

.coord-label-left {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #FFBE0B;
    font-weight: bold;
}

#game-grid {
    display: grid;
    gap: 1px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    border-radius: 8px;
}

.grid-cell {
    width: 25px;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    cursor: default;
}

.grid-cell:hover {
    background: rgba(255, 0, 110, 0.2);
    transform: scale(1.1);
}

.grid-cell.found {
    background: linear-gradient(45deg, #3A86FF, #8338EC);
    color: white;
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.5);
}

/* Seleção por cliques */
.grid-cell.preview {
    background: rgba(255, 0, 110, 0.25);
}

.grid-cell.selected {
    background: rgba(58, 134, 255, 0.35);
    outline: 2px solid #3A86FF;
}

/* Input Section */
.input-section {
    margin: 20px 0;
}

.word-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

#word-input, #coordinate-input {
    padding: 12px 16px;
    border-radius: 20px;
    border: 2px solid #8338EC;
    background: rgba(131, 56, 236, 0.1);
    color: white;
    font-size: 16px;
    min-width: 200px;
    flex: 1;
}

#word-input::placeholder, #coordinate-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#word-input:focus, #coordinate-input:focus {
    outline: none;
    border-color: #FF006E;
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
}

.hint-section {
    text-align: center;
    margin: 15px 0;
}

.hint-btn {
    background: linear-gradient(45deg, #FFBE0B, #FB5607);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 190, 11, 0.5);
}

#hint-display {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 190, 11, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 190, 11, 0.3);
    color: #FFBE0B;
    font-weight: bold;
    min-height: 20px;
}

/* Words Section */
.words-section {
    margin: 20px 0;
}

.words-section h3 {
    color: #3A86FF;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(58, 134, 255, 0.5);
}

#words-list, #found-words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 40px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.word-item {
    background: rgba(131, 56, 236, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    border: 1px solid rgba(131, 56, 236, 0.5);
    color: white;
    font-size: 0.9rem;
}

.word-item.found {
    background: rgba(58, 134, 255, 0.3);
    border-color: rgba(58, 134, 255, 0.7);
    text-decoration: line-through;
}

/* Stats Page */
.stats-container {
    max-width: 600px;
    margin: 0 auto;
}

.stats-container h2 {
    text-align: center;
    color: #3A86FF;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(58, 134, 255, 0.5);
}

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

.stat-card {
    background: rgba(131, 56, 236, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(131, 56, 236, 0.3);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 0, 110, 0.5);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #FF006E;
    text-shadow: 0 0 15px rgba(255, 0, 110, 0.5);
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #FFBE0B;
    font-size: 0.9rem;
}

.danger-btn {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

/* Help Page */
.help-container {
    max-width: 700px;
    margin: 0 auto;
}

.help-container h2 {
    text-align: center;
    color: #3A86FF;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(58, 134, 255, 0.5);
}

.help-content {
    display: grid;
    gap: 20px;
}

.help-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 0, 110, 0.3);
}

.help-item h3 {
    color: #FF006E;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 0, 110, 0.5);
}

.help-item p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* FAQ Section */
.faq-section {
    margin: 40px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.faq-section h2 {
    text-align: center;
    color: #3A86FF;
    margin-bottom: 30px;
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(58, 134, 255, 0.5);
}

.faq-container {
    display: grid;
    gap: 15px;
}

.faq-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 0, 110, 0.3);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    color: white;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    font-size: 1.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);
    color: #FF006E;
}

.faq-icon {
    font-size: 1.5rem;
    color: #FFBE0B;
    transition: transform 0.3s ease;
}

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

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

.faq-answer:not([hidden]) {
    padding: 20px;
    max-height: 200px;
}

.faq-answer p {
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

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

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item:hover, .nav-item.active {
    color: #FF006E;
    background: rgba(255, 0, 110, 0.1);
    transform: translateY(-2px);
}

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

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

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .theme-selector, .difficulty-selector {
        min-width: unset;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .word-input-container {
        flex-direction: column;
    }
    
    #word-input, #coordinate-input {
        min-width: unset;
    }
    
    .grid-container {
        padding: 10px;
    }
    
    .coord-label-top, .coord-label-left, .grid-cell {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .help-item, .faq-item {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 10px;
    }
    
    .coord-label-top, .coord-label-left, .grid-cell {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Game Complete Animation */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.celebrate {
    animation: celebrate 0.6s ease-in-out;
}

/* Success Message */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #3A86FF, #8338EC);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(58, 134, 255, 0.5);
    animation: fadeIn 0.5s ease-in-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #FF006E;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
