/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
header {
    background: linear-gradient(90deg, #ff6b00 0%, #ff8533 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

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

/* Game Info */
.game-info {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.word-info, .attempts-info {
    background: rgba(255, 107, 0, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 0, 0.3);
}

.word-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#word-category {
    color: #ff8533;
    font-weight: bold;
}

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.game-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.grid-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.tile {
    width: 50px;
    height: 50px;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    background: #2d2d2d;
    color: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tile::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 ease;
}

.tile.filled {
    border-color: #ff6b00;
    background: #3d3d3d;
    animation: fillTile 0.3s ease;
}

.tile.filled::before {
    left: 100%;
}

.tile.correct {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
    animation: correctTile 0.6s ease;
}

.tile.present {
    background: #FF9800;
    border-color: #FF9800;
    color: white;
    animation: presentTile 0.6s ease;
}

.tile.absent {
    background: #666;
    border-color: #666;
    color: white;
    animation: absentTile 0.6s ease;
}

@keyframes fillTile {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes correctTile {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

@keyframes presentTile {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

@keyframes absentTile {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* Keyboard */
.keyboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
}

.key {
    background: #444;
    border: none;
    color: white;
    padding: 1rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s ease;
    min-width: 40px;
    position: relative;
    overflow: hidden;
}

.key::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 0, 0.3), transparent);
    transition: left 0.3s ease;
}

.key:hover {
    background: #555;
    transform: translateY(-2px);
}

.key:hover::before {
    left: 100%;
}

.key:active {
    transform: translateY(0);
}

.key-action {
    background: #ff6b00;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
}

.key-action:hover {
    background: #ff8533;
}

.key.correct {
    background: #4CAF50;
}

.key.present {
    background: #FF9800;
}

.key.absent {
    background: #666;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    margin: 5% auto;
    padding: 0;
    border: 2px solid #ff6b00;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(90deg, #ff6b00 0%, #ff8533 100%);
    padding: 1rem 1.5rem;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.close:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-body {
    padding: 1.5rem;
    color: white;
    line-height: 1.6;
}

/* Ejemplos en el modal de ayuda */
.example {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.example-word {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.example .tile {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

/* Estadísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ff6b00;
}

.stat-label {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 0.5rem;
}

/* Botón compartir */
.share-button {
    background: linear-gradient(90deg, #ff6b00 0%, #ff8533 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
    margin: 1rem 0;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 0, 0.4);
}

.next-game {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 0, 0.2);
}

#countdown {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #ff6b00;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        text-align: center;
    }
    
    .tile {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .key {
        padding: 0.8rem 0.6rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .key-action {
        padding: 0.8rem 1rem;
        font-size: 0.7rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .tile {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .key {
        padding: 0.6rem 0.4rem;
        font-size: 0.7rem;
        min-width: 30px;
    }
    
    .key-action {
        padding: 0.6rem 0.8rem;
        font-size: 0.6rem;
    }
}

