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

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.game-container {
    background: rgba(0, 0, 0, 0.85);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    text-align: center;
    max-width: 800px;
    width: 90%;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#round-info {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(139, 69, 19, 0.4);
    border-radius: 10px;
    border: 2px solid #8B4513;
}

#round-title {
    font-size: 1.8em;
    color: #FFD700;
    margin-bottom: 15px;
}

#enemy-name {
    font-size: 1.4em;
    color: #FFA500;
    margin-bottom: 10px;
}

#enemy-dialogue {
    font-size: 2.5em;
    font-style: italic;
    color: #FFFFE0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#character-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid #8B4513;
}

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

.character-image {
    width: 150px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    transition: transform 0.3s ease;
}

.character-image:hover {
    transform: scale(1.05);
}

.character-label {
    margin-top: 10px;
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#vs-text {
    font-size: 3em;
    font-weight: bold;
    color: #FF4500;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: pulse 2s infinite;
}

#game-area {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    padding: 40px;
    margin: 20px 0;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px solid #8B4513;
}

#status-text {
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease;
}

.ready {
    color: #FFD700;
    animation: pulse 1s infinite;
}

.draw {
    color: #FF4500;
    font-size: 3em !important;
    animation: flash 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes flash {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#result-area {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

#result-title {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.win {
    color: #00FF00;
}

.lose {
    color: #FF4500;
}

.flying {
    color: #FF0000;
}

#result-text {
    font-size: 1.2em;
    margin-bottom: 10px;
}

#reaction-time {
    font-size: 1.1em;
    color: #FFD700;
    margin-bottom: 15px;
}

button {
    background: linear-gradient(45deg, #8B4513, #D2691E);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:hover {
    background: linear-gradient(45deg, #A0522D, #F4A460);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(0);
}

#final-results {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    border: 2px solid #FFD700;
}

#results-summary {
    text-align: left;
    margin: 20px 0;
    font-size: 1.1em;
}

.round-result {
    margin: 10px 0;
    padding: 10px;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 5px;
    border-left: 4px solid #8B4513;
}

#instructions {
    margin-top: 20px;
    padding: 15px;
    background: rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    font-size: 0.9em;
    color: #FFFFE0;
}

#instructions p {
    margin: 5px 0;
}

.game-clear {
    color: #00FF00;
    font-size: 2.2em;
    animation: celebration 2s ease-in-out;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        width: 95%;
    }
    
    #character-area {
        flex-direction: column;
        gap: 20px;
    }
    
    .character-image {
        width: 120px;
        height: 160px;
    }
    
    #vs-text {
        font-size: 2em;
        margin: 10px 0;
    }
    
    h1 {
        font-size: 2em;
    }
}
/* 導入画面のスタイル */
#intro-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    margin: 20px 0;
}

#intro-content {
    width: 100%;
    max-width: 800px;
}

#dialogue-box {
    background: rgba(0, 0, 0, 0.9);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.1);
    animation: glow 2s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    height: 350px;
    width: 80%;
    max-width: 800px;
    margin: 0 auto;
}

@keyframes glow {
    from {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.1);
    }
    to {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8), inset 0 0 25px rgba(255, 215, 0, 0.2);
    }
}

#dialogue-text {
    font-size: 2.8em;
    color: #FFFFE0;
    line-height: 1.4;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 1);
    font-weight: bold;
    letter-spacing: 1px;
}

#dialogue-button {
    background: linear-gradient(45deg, #8B4513, #A0522D);
    color: #FFFFE0;
    border: 3px solid #FFD700;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    margin-top: auto;
    flex-shrink: 0;
}

#dialogue-button:hover {
    background: linear-gradient(45deg, #A0522D, #CD853F);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
    border-color: #FFF700;
}

#dialogue-button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}
/* ボーナス祝い画面 */
#bonus-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #FFD700);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.celebration-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    border: 3px solid #FFD700;
    animation: pulse 2s ease-in-out infinite;
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 50px rgba(255, 215, 0, 0.8); }
    50% { transform: scale(1.05); box-shadow: 0 0 80px rgba(255, 215, 0, 1); }
    100% { transform: scale(1); box-shadow: 0 0 50px rgba(255, 215, 0, 0.8); }
}

.celebration-title {
    font-size: 3em;
    color: #FF6347;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bonus-announcement {
    margin: 30px 0;
}

.bonus-text {
    font-size: 2.5em;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
}

.bonus-amount {
    font-size: 4em;
    color: #32CD32;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.celebration-message {
    margin: 30px 0;
}

.celebration-message p {
    font-size: 1.5em;
    color: #333;
    margin: 10px 0;
    font-weight: bold;
}

.fireworks {
    font-size: 2em;
    margin: 20px 0;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#celebration-continue {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.3em;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-weight: bold;
}

#celebration-continue:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #FFA500, #FF6347);
}
/* スタート画面 */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#start-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

#start-content h2 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#start-content p {
    font-size: 1.2em;
    color: #555;
    margin: 15px 0;
    line-height: 1.6;
}

#start-button {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.5em;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: bold;
}

#start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #4ECDC4, #FF6B6B);
}

/* Underground Labor Screen Styles */
#underground-labor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.labor-content {
    text-align: center;
    color: #666;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #333;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.labor-header {
    margin-bottom: 40px;
}

.labor-title {
    font-size: 3em;
    color: #444;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.prisoner-number {
    font-size: 1.2em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.labor-scene {
    position: relative;
    margin: 40px 0;
}

.darkness-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.7) 70%);
    pointer-events: none;
}

.despair-message {
    font-size: 2em;
    color: #8B0000;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.fate-message {
    font-size: 1.5em;
    color: #555;
    margin-bottom: 30px;
}

.labor-description {
    margin: 30px 0;
    line-height: 2;
}

.labor-description p {
    font-size: 1.2em;
    color: #777;
    margin: 10px 0;
    opacity: 0.8;
}

.labor-animation {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.pickaxe {
    font-size: 3em;
    animation: mining 2s infinite;
}

.rocks {
    font-size: 2em;
    opacity: 0.7;
}

@keyframes mining {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

.labor-counter {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

.labor-counter p {
    font-size: 1.3em;
    color: #666;
    margin: 10px 0;
}

.remaining-time {
    color: #8B0000 !important;
    font-weight: bold;
}

#accept-fate {
    background: linear-gradient(45deg, #333, #555);
    color: #999;
    border: 2px solid #444;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 30px;
}

.despair-quote {
    font-size: 1.1em !important;
    color: #555 !important;
    font-style: italic;
    margin: 15px 0 !important;
    opacity: 0.9;
    border-left: 3px solid #444;
    padding-left: 15px;
}

.chains {
    font-size: 2.5em;
    opacity: 0.6;
    animation: rattle 3s infinite;
}

@keyframes rattle {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(2deg); }
    20% { transform: rotate(-2deg); }
    30% { transform: rotate(1deg); }
    40% { transform: rotate(-1deg); }
    50% { transform: rotate(0deg); }
}

.despair-counter {
    color: #8B0000 !important;
    font-weight: bold;
    font-size: 1.2em !important;
}

#despair-level {
    animation: despairPulse 2s infinite;
}

@keyframes despairPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Rules Screen Styles */
#rules-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #2C1810 0%, #1A0F08 100%);
}

#rules-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
}

.rules-title {
    font-size: 3.5em;
    color: #FFD700;
    margin-bottom: 40px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 1);
    font-weight: bold;
}

.rules-box {
    background: rgba(0, 0, 0, 0.8);
    border: 4px solid #FFD700;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.rule-item {
    margin: 25px 0;
    padding: 20px;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FFD700;
}

.rule-item h3 {
    font-size: 1.8em;
    color: #FFD700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
}

.rule-item p {
    font-size: 1.4em;
    color: #FFFFE0;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1);
}

#start-game-button {
    background: linear-gradient(45deg, #8B4513, #A0522D);
    color: #FFFFE0;
    border: 3px solid #FFD700;
    padding: 20px 50px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#start-game-button:hover {
    background: linear-gradient(45deg, #A0522D, #CD853F);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

#accept-fate:hover {
    background: linear-gradient(45deg, #444, #666);
    color: #bbb;
}
