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

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

#game-container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #4F46E5, #3730A3);
    color: white;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.7rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}

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

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

#game-area {
    position: relative;
    height: 400px;
    background: linear-gradient(180deg, #1E1B4B 0%, #312E81 100%);
    overflow: hidden;
}

.base {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    z-index: 10;
}

.enemy {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.1s linear;
}

.enemy-sprite {
    font-size: 2rem;
}

.enemy-word {
    background: rgba(0, 0, 0, 0.6);
    color: #E0E7FF;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
}

.enemy-word .matched {
    color: #4ADE80;
}

.enemy-word .current {
    color: #FACC15;
    text-decoration: underline;
}

.input-display {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    color: white;
    font-family: monospace;
    display: none;
    /* Hidden normally, useful for debug or mobile fallback */
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 20;
}

.hidden {
    display: none !important;
}

#start-screen h2 {
    font-size: 2rem;
    color: #1F2937;
}

.btn-primary {
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #4F46E5, #3730A3);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.stars {
    font-size: 3rem;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 1.8rem;
    color: #1F2937;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 24px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4F46E5;
}

.result-label {
    font-size: 0.9rem;
    color: #6B7280;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-secondary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    background: #F3F4F6;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #E5E7EB;
}

.laser {
    position: absolute;
    width: 4px;
    height: 10px;
    background: #FACC15;
    z-index: 5;
    transition: all 0.2s;
}