* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
    background: #464775;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background 0.5s ease;
}

body.title-active {
    overflow: hidden;
}

/* ハードモード用の電脳世界風背景 */
body.hard-mode {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0033 50%, #000033 100%);
    position: relative;
}

body.hard-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

body.hard-mode::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

body.hard-mode > * {
    position: relative;
    z-index: 1;
}

/* ヘルモード用のさらに暗い背景 */
body.hell-mode {
    background: linear-gradient(135deg, #000000 0%, #1a0000 50%, #000000 100%);
}

body.hell-mode::before {
    background: 
        linear-gradient(90deg, rgba(139, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(0deg, rgba(139, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: gridMove 15s linear infinite;
}

body.hell-mode::after {
    background: radial-gradient(circle at 20% 50%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(139, 0, 0, 0.3) 0%, transparent 50%);
    animation: glowPulse 2s ease-in-out infinite;
}

/* ヘッダースタイル */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.header-link:hover {
    color: #60a5fa;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.title-screen {
    position: fixed;
    top: 70px;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    max-width: 700px;
    width: calc(100% - 40px);
    overflow-y: hidden; /* デフォルトはスクロール無効 */
    overflow-x: hidden;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s;
}

/* アコーディオンが開いている場合のみスクロール有効 */
.title-screen.scrollable {
    overflow-y: auto;
}

.title-screen::-webkit-scrollbar {
    width: 8px;
}

.title-screen::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.title-screen::-webkit-scrollbar-thumb {
    background: #6264A7;
    border-radius: 10px;
}

.title-screen::-webkit-scrollbar-thumb:hover {
    background: #464775;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.title-content {
    text-align: center;
    padding: 40px;
}

.title-image-container {
    margin-bottom: 20px;
    animation: titleImageFloat 3s ease-in-out infinite;
}

@keyframes titleImageFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title-image {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(98, 100, 167, 0.3);
    transition: transform 0.3s ease;
}

.title-image:hover {
    transform: scale(1.05);
}

.title {
    font-size: 36px;
    margin-bottom: 20px;
    color: #6264A7;
    font-weight: 600;
}

.title-description {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

/* ストーリーボックス */
.story-box {
    background: linear-gradient(135deg, #6264A7 0%, #464775 100%);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(98, 100, 167, 0.3);
    overflow: hidden;
}

.story-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: white;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.story-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.story-toggle-icon {
    font-size: 24px;
}

.story-toggle-text {
    flex: 1;
    text-align: left;
}

.story-toggle-arrow {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.story-box.expanded .story-toggle-arrow {
    transform: rotate(180deg);
}

.story-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.story-box.expanded .story-content {
    max-height: 1000px;
}

.story-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: story-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes story-glow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10%, -10%); }
}

.story-text {
    position: relative;
    z-index: 1;
    color: white;
    text-align: left;
    font-size: 15px;
    line-height: 1.9;
    padding: 0 30px 30px 30px;
}

.story-text p {
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.story-text p:last-child {
    margin-bottom: 0;
}

.story-divider {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin: 24px 0 !important;
    padding: 12px 0;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

.highlight {
    font-weight: 700;
    font-size: 18px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    padding: 0 4px;
}

.story-mission {
    margin-top: 24px !important;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    line-height: 2;
}

.instructions-box {
    background: #f9f9f9;
    border-radius: 15px;
    margin-bottom: 30px;
    overflow: hidden;
}

.instructions-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.instructions-toggle:hover {
    background: rgba(98, 100, 167, 0.1);
}

.instructions-toggle-icon {
    font-size: 24px;
}

.instructions-toggle-text {
    flex: 1;
    text-align: left;
}

.instructions-toggle-arrow {
    font-size: 16px;
    transition: transform 0.3s ease;
    color: #6264A7;
}

.instructions-box.expanded .instructions-toggle-arrow {
    transform: rotate(180deg);
}

.instructions-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.instructions-box.expanded .instructions-content {
    max-height: 500px;
}

.instructions-list {
    list-style: none;
    padding: 0 25px 25px 25px;
    margin: 0;
}

.instructions-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

.instructions-list li:last-child {
    border-bottom: none;
}

.instructions-list strong {
    color: #333;
}

.button-start {
    padding: 15px 50px;
    font-size: 24px;
    background: #6264A7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14);
    margin: 10px auto 0 auto;
    display: block;
}

.button-start:hover {
    background: #464775;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
}

.button-hard {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    position: relative;
    overflow: hidden;
}

.button-hard:hover {
    background: linear-gradient(135deg, #ff5252 0%, #dc4a5c 100%);
    transform: scale(1.05);
}

.button-hell {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #8B0000 100%);
    position: relative;
    overflow: hidden;
    animation: hellPulse 2s ease-in-out infinite;
}

.button-hell:hover {
    background: linear-gradient(135deg, #660000 0%, #B22222 50%, #660000 100%);
    transform: scale(1.05);
}

@keyframes hellPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
    }
    50% {
        box-shadow: 0 0 40px rgba(220, 20, 60, 1);
    }
}

.button-hard::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.credits-in-instructions {
    padding: 15px 0 0 0;
    margin-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 12px;
    color: #888;
}

.sound-notice {
    margin-top: 20px;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.game-container {
    max-width: 900px;
    width: calc(100% - 40px);
    margin: 80px auto 20px auto;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header {
    background: #F3F2F1;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #E1DFDD;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.game-title {
    font-size: 28px;
    margin: 0;
    color: #333;
}

.stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.bug-hp-container {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.bug-hp-bar-wrapper {
    width: 100%;
    height: 20px;
    background: #ffcccc;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bug-hp-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #cc0000 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.bug-hp-text {
    text-align: center;
    font-weight: bold;
    color: #cc0000;
    font-size: 14px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-value.normal { color: #00aa00; }
.stat-value.warning { color: #ffa500; }
.stat-value.danger { color: #ff0000; }

.canvas-container {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

#gameCanvas {
    display: block;
    border: 2px solid #ddd;
    border-radius: 5px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    transition: border-color 0.3s ease;
}

#gameCanvas.alert-warning {
    border: 4px solid #F7630C;
    box-shadow: 0 0 15px rgba(247, 99, 12, 0.5);
}

#gameCanvas.alert-danger {
    border: 4px solid #C4314B;
    box-shadow: 0 0 20px rgba(196, 49, 75, 0.6);
}

.canvas-container.shake {
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.controls {
    background: #F3F2F1;
    border-radius: 4px;
    padding: 20px;
    border: 1px solid #E1DFDD;
    transition: all 0.3s ease;
    position: relative;
}

.controls.bug-invaded {
    background: rgba(220, 20, 60, 0.1);
    border: 2px solid rgba(220, 20, 60, 0.5);
    animation: invasionPulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
}

@keyframes invasionPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(220, 20, 60, 0.5);
    }
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

h3 {
    margin-bottom: 10px;
    color: #333;
}

.button-primary {
    padding: 8px 20px;
    font-size: 14px;
    background: #6264A7;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
}

.button-primary:hover {
    background: #464775;
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-back {
    background: #C4314B;
}

.button-back:hover {
    background: #A3202F;
}

.emoji-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.emoji-button {
    padding: 5px;
    background: #ffffff;
    border: 1px solid #E1DFDD;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-button img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.emoji-button:hover {
    background: #F3F2F1;
    border-color: #6264A7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.emoji-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #FAF9F8;
}

.emoji-button.emoji-exists {
    opacity: 0.4;
    background: #EDEBE9;
    border-color: #C8C6C4;
    cursor: not-allowed;
}

.emoji-button.cannot-add {
    background: #FDE7E9;
    border-color: #C4314B;
    animation: shake-button 0.3s;
}

@keyframes shake-button {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.emoji-button .key-hint {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: #fff;
    background: #6264A7;
    border-radius: 2px;
    padding: 2px 4px;
    font-weight: 600;
}

.emoji-button.being-eaten {
    animation: beingEaten 0.5s ease-in-out infinite;
    border-color: #DC143C;
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.5);
}

@keyframes beingEaten {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(0.95) rotate(-2deg);
    }
    50% {
        transform: scale(0.9) rotate(0deg);
    }
    75% {
        transform: scale(0.95) rotate(2deg);
    }
}

.emoji-button.eaten {
    pointer-events: none;
    cursor: not-allowed;
    animation: bossEaten 0.6s ease-out forwards;
    position: relative;
}

.emoji-button.eaten::after {
    content: '🦷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    animation: biteAppear 0.6s ease-out;
    z-index: 10;
}

@keyframes bossEaten {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1) grayscale(0%);
    }
    30% {
        transform: scale(1.1) rotate(-5deg);
        filter: brightness(1.5) hue-rotate(180deg);
    }
    60% {
        transform: scale(0.9) rotate(5deg);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.7) rotate(0deg);
        opacity: 0.3;
        filter: brightness(0.5) grayscale(100%);
        background: #2a2a2a !important;
        border: 2px solid #8B0000 !important;
    }
}

@keyframes biteAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
    }
}

@keyframes warningFlash {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.1);
    }
    60% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

.custom-emoji-form {
    display: flex;
    gap: 10px;
}

.custom-emoji-input {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.custom-emoji-input:focus {
    outline: none;
    border-color: #2196F3;
}

.button-add {
    padding: 12px 24px;
    font-size: 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.button-add:hover {
    background: #1976D2;
}

.button-add:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.victory-image-container {
    margin-bottom: 20px;
    display: none;
}

.game-over-overlay.victory .victory-image-container {
    display: block;
    animation: victoryImageFloat 2s ease-in-out infinite, victoryImageAppear 1s ease-out;
}

.victory-image {
    max-height: 200px;
    max-width: 200px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6),
                0 0 60px rgba(255, 215, 0, 0.4);
    transition: transform 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.victory-image:hover {
    transform: scale(1.1) rotate(5deg);
}

@keyframes victoryImageFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-3deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-15px) rotate(3deg); }
}

@keyframes victoryImageAppear {
    0% { 
        opacity: 0; 
        transform: scale(0) rotate(-180deg); 
    }
    60% { 
        transform: scale(1.2) rotate(10deg); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotate(0deg); 
    }
}

.game-over-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 50px 60px;
    border-radius: 20px;
    text-align: center;
    display: none;
    z-index: 1000;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.game-over-overlay.show {
    display: block;
    animation: fadeIn 0.5s, pulse 2s infinite;
}

.game-over-overlay.victory {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95) 0%, rgba(255, 165, 0, 0.95) 100%);
    border: 3px solid gold;
    animation: fadeIn 0.5s, victoryPulse 2s infinite, victoryShine 3s infinite;
    padding: 50px 100px;
    min-width: 800px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes victoryPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 10px 50px rgba(255, 215, 0, 0.5); }
    50% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 20px 80px rgba(255, 215, 0, 0.8); }
}

@keyframes victoryShine {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

.game-over-title {
    font-size: 48px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.game-over-overlay.victory .game-over-title {
    font-size: 56px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                 0 0 40px rgba(255, 215, 0, 0.6),
                 0 4px 10px rgba(0, 0, 0, 0.3);
    animation: titleBounce 1s ease-out;
}

@keyframes titleBounce {
    0% { transform: translateY(-100px) scale(0); opacity: 0; }
    50% { transform: translateY(10px) scale(1.2); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.victory-story {
    font-size: 18px;
    line-height: 1.8;
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.victory-story p {
    margin: 10px 0;
}

.game-over-stats {
    font-size: 24px;
    margin-bottom: 30px;
    line-height: 1.8;
    font-weight: bold;
}

.game-over-overlay.victory .game-over-stats {
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.instructions h4 {
    margin-bottom: 10px;
    color: #333;
}

.instructions ul {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 5px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .stats {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .stat-item {
        flex: 1 1 40%;
    }

    .emoji-buttons {
        gap: 8px;
    }

    .emoji-button {
        padding: 8px 12px;
        font-size: 20px;
    }
}

/* ストーリーボタンのスタイル */
.story-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.video-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

.video-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
    background: linear-gradient(135deg, #ee5a24, #ff6b6b);
}

.video-button-icon {
    font-size: 18px;
}

/* 動画モーダルのスタイル */
.video-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: 10000;
}

.video-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 90%;
}

.video-close-button {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    transition: all 0.3s ease;
}

.video-close-button:hover {
    background: #ff3742;
    transform: scale(1.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .story-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .video-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .video-modal-content {
        margin: 20px;
        padding: 15px;
    }
}
