/* Word Puzzle Game - Orange/Yellow Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F59E0B;
    --primary-dark: #D97706;
    --secondary-color: #10B981;
    --error-color: #EF4444;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #FDE68A;
    --tile-empty: #FFFFFF;
    --tile-gray: #9CA3AF;
    --tile-yellow: #FCD34D;
    --tile-green: #10B981;
    --shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
    --shadow-lg: 0 10px 25px rgba(245, 158, 11, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

.ad-placeholder {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin: 20px auto;
    max-width: 728px;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

header {
    margin-bottom: 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

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

.new-game-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.new-game-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.attempts-box {
    background: var(--surface);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
}

.attempts-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.attempts-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-left: 8px;
}

.instructions {
    background: var(--surface);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.instructions p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.message {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.message.error {
    background: #FEE2E2;
    border-color: var(--error-color);
    color: var(--error-color);
}

.message.success {
    background: #D1FAE5;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.message.info {
    background: #FEF3C7;
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

.game-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.word-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.letter-tile {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--tile-empty);
    transition: all 0.3s;
}

.letter-tile.filled {
    border-color: var(--primary-color);
    animation: pop 0.1s ease;
}

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

.letter-tile.correct {
    background: var(--tile-green);
    border-color: var(--tile-green);
    color: white;
    animation: flip 0.5s ease;
}

.letter-tile.present {
    background: var(--tile-yellow);
    border-color: #F59E0B;
    color: white;
    animation: flip 0.5s ease;
}

.letter-tile.absent {
    background: var(--tile-gray);
    border-color: var(--tile-gray);
    color: white;
    animation: flip 0.5s ease;
}

@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    min-width: 40px;
    height: 50px;
    padding: 0 12px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.key.wide {
    min-width: 65px;
    font-size: 0.8rem;
}

.key.correct {
    background: var(--tile-green);
    border-color: var(--tile-green);
    color: white;
}

.key.present {
    background: var(--tile-yellow);
    border-color: #F59E0B;
    color: white;
}

.key.absent {
    background: var(--tile-gray);
    border-color: var(--tile-gray);
    color: white;
    opacity: 0.5;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    border: 3px solid var(--primary-color);
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.overlay-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.word-reveal {
    background: #FEF3C7;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.word-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.8rem;
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.3rem;
}

.overlay-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FB923C 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.overlay-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
}

.tips {
    background: var(--surface);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.tips h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 25px;
}

.tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
    }
    
    .new-game-btn {
        width: 100%;
    }
    
    .letter-tile {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .key {
        min-width: 32px;
        height: 45px;
        padding: 0 8px;
        font-size: 0.9rem;
    }
    
    .key.wide {
        min-width: 55px;
    }
}