@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Orbitron:wght@400;700&display=swap');

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-title {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-board {
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.game-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 217, 61, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

#gameCanvas {
    border: 3px solid #4a5568;
    border-radius: 15px;
    background: #2d3748;
    display: block;
    margin: 0 auto;
    cursor: crosshair;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

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

.btn-secondary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

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

.btn-success {
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(81, 207, 102, 0.4);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Orbitron', monospace;
}

.stat-label {
    font-size: 0.9rem;
    color: #cbd5e0;
    margin-top: 5px;
}

.kanji-input-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.kanji-display {
    text-align: center;
    margin-bottom: 15px;
}

.current-kanji {
    font-size: 4rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.kanji-info {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.kanji-input {
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    background: white;
    transition: all 0.3s ease;
    min-width: 200px;
}

.kanji-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.level-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.level-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.level-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: #667eea;
}

.level-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.settings-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-label {
    color: #cbd5e0;
    font-weight: 500;
}

.font-size-controls {
    display: flex;
    gap: 5px;
}

.font-size-btn {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.font-size-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.message-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #51cf66, #40c057);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.message-display.show {
    transform: translateX(0);
}

.message-display.error {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-over-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.game-over-modal.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: 'Orbitron', monospace;
}

.modal-stats {
    margin-bottom: 30px;
}

.modal-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .game-title {
        font-size: 1.8rem;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .control-group {
        justify-content: center;
    }
    .current-kanji {
        font-size: 3rem;
    }
    .input-group {
        flex-direction: column;
    }
    .kanji-input {
        min-width: 100%;
    }
}

/* アニメーション */
@keyframes enemyHit {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

@keyframes correctAnswer {
    0% { background-color: #51cf66; }
    100% { background-color: transparent; }
}

@keyframes wrongAnswer {
    0% { background-color: #ff6b6b; }
    100% { background-color: transparent; }
}

.hit-animation {
    animation: enemyHit 0.3s ease;
}

.shoot-animation {
    animation: towerShoot 0.2s ease;
}

.correct-animation {
    animation: correctAnswer 0.5s ease;
}

.wrong-animation {
    animation: wrongAnswer 0.5s ease;
} 