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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFC300 0%, #FFB200 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 600px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #1D1D1D; 
    margin-bottom: 30px;
    font-size: 2.5em;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #FFC30015 0%, #FFB20015 100%);
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #FFC300;
}

.lives {
    font-size: 2em;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #1D1D1D 0%, #333333 100%);
    color: #FFC300;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 29, 29, 0.4); 
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.definition-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #555;
    line-height: 1.6;
}

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

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2em;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #1D1D1D; 
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #FFC300 0%, #FFA500 100%); 
    color: #1D1D1D;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 195, 0, 0.4); 
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message {
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.3s;
}

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

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
}

.start-screen, .game-over-screen {
    text-align: center;
}

.start-screen h2, .game-over-screen h2 {
    color: #1D1D1D; 
    margin-bottom: 20px;
}

.start-screen p, .game-over-screen p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    color: #1D1D1D;
    font-size: 1.2em;
}

.game-over-stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.game-over-stats p {
    margin: 10px 0;
    font-size: 1.2em;
}

.game-over-stats strong {
    color: #FFC300;
    font-size: 1.3em;
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-over-buttons button {
    flex: 1;
    min-width: 140px;
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.footer a {
    color: #1D1D1D;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer a:hover {
    color: #FFA500;
}

.feedback-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FFC300 0%, #FFA500 100%);
    color: #1D1D1D;
    border: none;
    border-radius: 25px;
    font-size: 0.95em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 195, 0, 0.3);
    transition: all 0.3s;
    z-index: 1000;
}

.feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 195, 0, 0.4);
}

.feedback-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.feedback-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

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

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.feedback-content h3 {
    color: #1D1D1D;
    margin-bottom: 20px;
    font-size: 1.5em;
}

#feedbackForm input,
#feedbackForm textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

#feedbackForm input:focus,
#feedbackForm textarea:focus {
    outline: none;
    border-color: #1D1D1D;
}

#feedbackForm textarea {
    min-height: 120px;
    resize: vertical;
}

.feedback-status {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: 600;
}

.feedback-status.success {
    background: #d4edda;
    color: #155724;
}

.feedback-status.error {
    background: #f8d7da;
    color: #721c24;
}

.feedback-status.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 25px 20px;
        border-radius: 15px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .game-stats {
        padding: 15px;
        margin-bottom: 20px;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .lives {
        font-size: 1.5em;
    }

    .controls {
        gap: 10px;
        margin-bottom: 20px;
    }

    button {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .controls button {
        flex: 1 1 auto;
        min-width: 0;
    }

    .definition-box {
        padding: 15px;
        min-height: 60px;
        font-size: 0.95em;
    }

    input[type="text"] {
        padding: 12px;
        font-size: 1.1em;
    }

    .submit-btn {
        padding: 12px;
        font-size: 1.1em;
    }

    .message {
        padding: 12px;
        font-size: 0.95em;
    }

    .game-over-stats {
        padding: 15px;
    }

    .game-over-stats p {
        font-size: 1.1em;
    }

    .game-over-stats strong {
        font-size: 1.2em;
    }

    .game-over-buttons button {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .footer {
        margin-top: 20px;
        padding-top: 15px;
        font-size: 0.9em;
    }

    .feedback-btn {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 0.85em;
    }

    .feedback-content {
        padding: 25px 20px;
        margin: 10px;
    }

    .feedback-content h3 {
        font-size: 1.3em;
    }

    #feedbackForm input,
    #feedbackForm textarea {
        padding: 10px;
        font-size: 0.95em;
    }

    #feedbackForm textarea {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.75em;
    }

    .stat-label {
        font-size: 0.85em;
    }

    .stat-value {
        font-size: 1.3em;
    }

    .lives {
        font-size: 1.3em;
    }

    button {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .controls {
        gap: 8px;
    }

    .definition-box {
        padding: 12px;
        font-size: 0.9em;
    }

    input[type="text"] {
        font-size: 1em;
    }

    .submit-btn {
        font-size: 1em;
    }

    .start-screen h2, .game-over-screen h2 {
        font-size: 1.4em;
    }

    .start-screen p, .game-over-screen p {
        font-size: 0.95em;
    }

    .game-over-stats p {
        font-size: 1em;
    }

    .feedback-btn {
        padding: 8px 14px;
        font-size: 0.8em;
        border-radius: 20px;
    }
}

/* Landscape mode for mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: flex-start;
    }

    .container {
        margin: 10px 0;
    }

    h1 {
        margin-bottom: 15px;
        font-size: 1.5em;
    }

    .game-stats {
        padding: 10px;
        margin-bottom: 15px;
    }

    .controls {
        margin-bottom: 15px;
    }

    button {
        padding: 8px 16px;
    }

    .definition-box {
        padding: 10px;
        min-height: 50px;
    }

    .footer {
        margin-top: 15px;
        padding-top: 10px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    button {
        min-height: 44px;
    }

    input[type="text"] {
        min-height: 44px;
    }

    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
}