body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

main {
    background-image: url('../assets/screens/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 40px);
}

.stage {
    display: grid;
    grid-template-rows: repeat(12, 1fr);
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    aspect-ratio: 8 / 12;
    height: calc(100vh - 40px);
    max-height: 800px;
    background-color: #f0f0f0aa;
    border: 3px solid #333;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
}

.stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.info-panel {
    background-color: rgba(255, 255, 255, 0.9);
    border: 3px solid #333;
    border-radius: 8px;
    padding: 20px;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.avatar-gif {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    border: 3px solid #0066cc;
    background-color: #f0f8ff;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-gif.animating {
    animation: avatarThrow 0.8s ease-in-out;
}

@keyframes avatarThrow {
    0% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    25% {
        transform: scale(1.1) rotate(-5deg);
        box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    }

    50% {
        transform: scale(1.2) rotate(0deg);
        box-shadow: 0 6px 16px rgba(0, 102, 204, 0.6);
    }

    75% {
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
    }

    100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

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

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
    color: #0066cc;
    background-color: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .stage {
        height: 60vh;
        max-height: 500px;
    }

    .info-panel {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        min-width: auto;
        width: 100%;
        max-width: 600px;
    }

    .info-section {
        margin-bottom: 0;
        flex: 1;
        min-width: 120px;
    }
}

/* スタート画面のスタイル */
.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
}

.start-content {
    background-color: rgba(255, 255, 255, 0.95);
    border: 4px solid #333;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    max-width: 400px;
    width: 90%;
}

.start-content h1 {
    font-size: 36px;
    color: #333;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stage-info {
    background-color: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0 30px 0;
}

.stage-info h2 {
    font-size: 28px;
    color: #0066cc;
    margin: 0 0 15px 0;
}

.stage-info p {
    font-size: 18px;
    color: #555;
    margin: 8px 0;
    font-weight: bold;
}

.start-button {
    background: linear-gradient(45deg, #ff6b6b, #ff8e53);
    border: 3px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    padding: 15px 40px;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.start-button:hover {
    background: linear-gradient(45deg, #ff5252, #ff7043);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.how-to-play-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-how-to-play-button {
    display: block;
    background: linear-gradient(45deg, #2196F3, #1976D2);
    border: 2px solid #333;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    text-decoration: none;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    margin-top: 10px;
}

.game-how-to-play-button:hover {
    background: linear-gradient(45deg, #1976D2, #1565C0);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.game-how-to-play-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* クリア画面のオーバーレイスタイル */
.clear-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
}

.clear-content {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 90%;
    animation: bounceIn 0.8s ease-out;
}

.clear-title {
    font-size: 48px;
    color: #fff;
    margin: 0 0 30px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    animation: pulse 2s infinite;
}

.clear-info {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.clear-info p {
    font-size: 20px;
    color: #333;
    margin: 12px 0;
    font-weight: bold;
}

.clear-info span {
    color: #0066cc;
    font-size: 24px;
}

/* ゲームオーバー画面のオーバーレイスタイル */
.gameover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
}

.gameover-content {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 90%;
    animation: bounceIn 0.8s ease-out;
}

.gameover-title {
    font-size: 48px;
    color: #fff;
    margin: 0 0 30px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    animation: pulse 2s infinite;
}

.gameover-info {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    margin-bottom: 25px;
}

.gameover-info p {
    font-size: 20px;
    color: #333;
    margin: 12px 0;
    font-weight: bold;
}

.gameover-info span {
    color: #e74c3c;
    font-size: 24px;
}

.restart-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.restart-button:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* 全ゲームクリア画面のオーバーレイスタイル */
.allclear-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 140, 0, 0.9));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
}

.allclear-content {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: 6px solid #fff;
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 90%;
    animation: bounceIn 1s ease-out;
    position: relative;
    overflow: hidden;
}

.allclear-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
    pointer-events: none;
}

.allclear-title {
    font-size: 52px;
    color: #fff;
    margin: 0 0 30px 0;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
    font-weight: bold;
    animation: pulse 2s infinite;
    background: linear-gradient(45deg, #fff, #ffe55c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.allclear-info {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.allclear-info p {
    font-size: 22px;
    color: #333;
    margin: 15px 0;
    font-weight: bold;
}

.allclear-info span {
    color: #FF6B35;
    font-size: 26px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.allclear-message {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border: 2px solid #FFD700;
}

.allclear-message p {
    font-size: 20px;
    color: #2c3e50;
    margin: 10px 0;
    font-weight: 600;
    line-height: 1.4;
}

.allclear-restart-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
}

.allclear-restart-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}
