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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #4682B4 50%, #191970 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

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

.game-header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-header h1 {
    color: #2E8B57;
    font-size: 2.5em;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-area {
    position: relative;
    height: 600px;
    background: url('images/background.jpg') center center / cover no-repeat;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 130px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px;
    padding-top: 15px;
    z-index: 15;
    pointer-events: none;
}

.score-display, .target-display {
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 25px;
    border: 3px solid #4682B4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.score-display {
    color: #2E8B57;
}

.target-display {
    color: #2E8B57;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 180px;
}

.target-label {
    font-size: 0.7em;
    color: #666666;
    margin-bottom: 6px;
    line-height: 1;
}

#target-hiragana {
    font-size: 4.0em;
    color: #FF6347;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.fishing-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3px;
    height: 0;
    background: #8B4513;
    transform: translateX(-50%);
    transition: all 0.8s ease-in-out;
    z-index: 10;
}

.hook {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2em;
    animation: sway 2s ease-in-out infinite alternate;
}

@keyframes sway {
    0% { transform: translateX(-50%) rotate(-5deg); }
    100% { transform: translateX(-50%) rotate(5deg); }
}

.water {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.fish-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.fish {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: swim 4s ease-in-out infinite;
    user-select: none;
    width: 140px;
    height: 105px;
}

.fish:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.fish.caught {
    animation: caught 0.5s ease-in-out;
    pointer-events: none;
}

@keyframes swim {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes caught {
    0% { transform: scale(1); }
    50% { transform: scale(1.5) rotate(360deg); }
    100% { transform: scale(0) rotate(720deg); }
}

.fish-body {
    display: inline-block;
    position: relative;
}

.fish-image {
    width: 140px;
    height: 105px;
    object-fit: contain;
}

.hiragana-text {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: 
        2px 2px 0px #000000,
        -2px -2px 0px #000000,
        2px -2px 0px #000000,
        -2px 2px 0px #000000,
        0px 2px 0px #000000,
        2px 0px 0px #000000,
        0px -2px 0px #000000,
        -2px 0px 0px #000000;
    pointer-events: none;
    z-index: 5;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid #FFFFFF;
}


.controls {
    text-align: center;
    margin-bottom: 20px;
}

.cast-btn, .new-game-btn {
    font-size: 1.3em;
    padding: 15px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cast-btn {
    background: linear-gradient(45deg, #FF6347, #FF4500);
    color: white;
}

.cast-btn:hover {
    background: linear-gradient(45deg, #FF4500, #FF6347);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.cast-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.new-game-btn {
    background: linear-gradient(45deg, #32CD32, #228B22);
    color: white;
}

.new-game-btn:hover {
    background: linear-gradient(45deg, #228B22, #32CD32);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.instructions h3 {
    color: #2E8B57;
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center;
}

.instructions p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2em;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .score, .target {
        font-size: 1.2em;
    }
    
    .game-area {
        height: 400px;
    }
    
    .fish {
        font-size: 2.5em;
    }
    
    .cast-btn, .new-game-btn {
        font-size: 1.1em;
        padding: 12px 25px;
        margin: 5px;
    }
}

/* 成功・失敗のフィードバック */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    z-index: 1000;
    pointer-events: none;
    text-align: center;
}

.feedback.success {
    color: #FFD700;
    text-shadow: 
        3px 3px 0px #FF6347,
        -3px -3px 0px #FF6347,
        3px -3px 0px #FF6347,
        -3px 3px 0px #FF6347,
        0px 3px 0px #FF6347,
        3px 0px 0px #FF6347,
        0px -3px 0px #FF6347,
        -3px 0px 0px #FF6347,
        6px 6px 8px rgba(0, 0, 0, 0.8);
    animation: successFeedback 3s ease-in-out;
}

.feedback.miss {
    color: #FF6347;
    text-shadow: 
        2px 2px 0px #8B0000,
        -2px -2px 0px #8B0000,
        2px -2px 0px #8B0000,
        -2px 2px 0px #8B0000,
        0px 2px 0px #8B0000,
        2px 0px 0px #8B0000,
        0px -2px 0px #8B0000,
        -2px 0px 0px #8B0000,
        4px 4px 6px rgba(0, 0, 0, 0.8);
    animation: missFeedback 2s ease-in-out;
}

@keyframes successFeedback {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); 
    }
    15% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.4) rotate(5deg); 
    }
    30% { 
        transform: translate(-50%, -50%) scale(1.2) rotate(-2deg); 
    }
    45% { 
        transform: translate(-50%, -50%) scale(1.3) rotate(1deg); 
    }
    60% { 
        transform: translate(-50%, -50%) scale(1.1) rotate(0deg); 
    }
    85% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.0) rotate(0deg); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg); 
    }
}

@keyframes missFeedback {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    20% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
    80% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.8); 
    }
}
