* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.timer {
    font-size: 1.5em;
    font-weight: 700;
    color: #e74c3c;
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer::before {
    content: '⏱️';
    font-size: 1.2em;
}

.word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    justify-content: center;
}

.word-item {
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.word-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.word-item:hover::before {
    left: 100%;
}

.word-item.found {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
    transform: scale(0.95);
}

.grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 3px;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cell {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cell.selected {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.cell.found {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.scoreboard {
    margin-top: 25px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.scoreboard h2 {
    color: #2c3e50;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 15px;
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f2f6;
}

th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.current-player {
    background: linear-gradient(135deg, #e1f5fe, #b3e5fc) !important;
    font-weight: 700;
    position: relative;
}

.current-player::before {
    content: '▶';
    position: absolute;
    left: 5px;
    color: #3498db;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

button {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.instructions {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #fff9e6, #ffeaa7);
    border-radius: 15px;
    font-size: 0.95em;
    border: 1px solid rgba(243, 156, 18, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.congratulations, .game-over {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.congratulations {
    border-top: 6px solid #27ae60;
}

.game-over {
    border-top: 6px solid #e74c3c;
}

.congratulations h2 {
    color: #27ae60;
    margin-top: 0;
    font-size: 2.2em;
    margin-bottom: 15px;
}

.game-over h2 {
    color: #e74c3c;
    margin-top: 0;
    font-size: 2.2em;
    margin-bottom: 15px;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999;
}

.stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid #e9ecef;
}

.category-info {
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
    color: #6c757d;
    font-size: 1.1em;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 12px;
    background: #e9ecef;
    border-radius: 10px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.time-warning {
    color: #e74c3c;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.player-setup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 450px;
    width: 90%;
    backdrop-filter: blur(10px);
}

.player-setup h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: 700;
}

.player-setup input {
    width: 100%;
    padding: 15px;
    margin: 20px 0;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1em;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.player-setup input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.ranking-medal {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    margin-right: 10px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
}

.silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
}

.bronze {
    background: linear-gradient(135deg, #cd7f32, #e6a15c);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .grid {
        grid-template-columns: repeat(15, 1fr);
        gap: 2px;
        padding: 10px;
    }
    
    .cell {
        width: 25px;
        height: 25px;
        font-size: 0.9em;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 100%;
        max-width: 250px;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 12px 8px;
    }
}