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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
}

.logo {
    height: 60px;
    width: auto;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.help-link {
    position: absolute;
    bottom: 10px;
    left: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
    color: white;
    text-decoration: none;
}

.help-link:hover {
    text-decoration: underline;
    opacity: 1;
}

.game-mode-header {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 500;
}

.help-section {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.help-content h3 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.2rem;
}

.help-content p {
    margin: 10px 0;
    color: #495057;
    line-height: 1.5;
}

.help-content ul {
    margin: 15px 0;
    padding-left: 20px;
    color: #495057;
}

.help-content li {
    margin: 5px 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        height: 45px;
    }
    
    .logo-container {
        gap: 10px;
    }
    
    .help-link {
        font-size: 0.8rem;
        left: 15px;
    }
    
    .game-mode-header {
        font-size: 0.8rem;
        right: 15px;
    }
}


.loading {
    padding: 40px;
    text-align: center;
}

.loading p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.game {
    padding: 20px;
}

.input-section {
    margin-bottom: 20px;
}

.guess-input {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.button-row {
    display: flex;
    gap: 10px;
}

#wordInput {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-width: 0;
}

#wordInput:focus {
    outline: none;
    border-color: #4facfe;
}

#submitBtn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

#submitBtn:active {
    transform: translateY(0);
}

.message-area {
    margin: 10px 0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.message-area.error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
    padding: 10px 15px;
}


.hint {
    text-align: center;
    color: #666;
    font-style: italic;
    padding-top: 10px;
}

.stats {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat {
    font-weight: 600;
    color: #495057;
}

#hintBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff8c00 0%, #ffcc33 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

#hintBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
}

#hintBtn:active {
    transform: translateY(0);
}

#giveUpBtn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #c0392b 0%, #ff6b6b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

#giveUpBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

#giveUpBtn:active {
    transform: translateY(0);
}

.hints-area {
    margin-bottom: 10px;
}

.hint-item {
    margin-bottom: 5px;
}

.guesses-container h3 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1rem;
}

.guesses-list {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.no-guesses {
    text-align: center;
    padding: 25px;
    color: #999;
    font-style: italic;
}

.guess-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.guess-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.guess-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.guess-item:hover {
    background-color: rgba(79, 172, 254, 0.1) !important;
}

.guess-item.last-guess {
    box-shadow: 0 0 0 3px #4facfe;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.guess-word {
    font-weight: 600;
    font-size: 1rem;
}

.guess-score {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    padding: 5px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 5px;
}

.guess-rank {
    color: #666;
    font-size: 0.9rem;
}

.victory {
    padding: 50px 30px;
    text-align: center;
}

.victory h2 {
    color: #28a745;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.victory p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #495057;
}

#secretWordDisplay {
    font-weight: bold;
    color: #4facfe;
    font-size: 1.4rem;
}

#newGameBtn {
    margin-top: 25px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

#newGameBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

#newGameBtn:active {
    transform: translateY(0);
}

#closestWords {
    margin: 25px 0;
    text-align: left;
}

#closestWords h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.github-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.github-icon {
    vertical-align: middle;
}

.github-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .logo {
        height: 35px;
    }
    
    .help-link {
        font-size: 0.75rem;
        left: 10px;
        bottom: 8px;
    }
    
    .game-mode-header {
        font-size: 0.75rem;
        right: 10px;
        bottom: 8px;
    }
    
    .game {
        padding: 15px;
    }
    
    .guess-input {
        flex-direction: column;
        gap: 8px;
    }
    
    #wordInput {
        padding: 12px 15px;
        font-size: 16px;
        min-height: 44px;
    }
    
    #submitBtn, #hintBtn, #giveUpBtn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 52px;
        flex: 1;
    }
    
    .guess-input .button-row {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 12px;
    }
    
    .stat {
        font-size: 0.95rem;
    }
    
    .guess-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 12px;
    }
    
    .guess-word {
        font-size: 1.1rem;
    }
    
    .guess-score {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .victory {
        padding: 30px 20px;
    }
    
    .victory h2 {
        font-size: 2rem;
    }
    
    .victory p {
        font-size: 1.1rem;
    }
    
    #newGameBtn {
        padding: 12px 24px;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }
    
    .loading {
        padding: 30px 20px;
    }
    
    .loading p {
        font-size: 1.1rem;
    }
    
    .message-area {
        font-size: 0.9rem;
    }
    
    .guesses-container h3 {
        font-size: 1rem;
    }
    
    footer {
        padding: 15px 10px;
    }
    
    .github-link {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 600px) and (min-width: 481px) {
    .guess-input {
        flex-direction: column;
        gap: 8px;
    }
    
    #wordInput {
        font-size: 16px;
    }
    
    #submitBtn, #hintBtn, #giveUpBtn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 52px;
        flex: 1;
    }
    
    .guess-input .button-row {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        text-align: center;
    }
    
    .guess-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
}