:root {
    --main: #FF9800;
    --bg-color: #FFF8E1;
    --modal-bg: rgba(0, 0, 0, 0.8);
}

body { 
    margin: 0; overflow: hidden; 
    background-color: var(--bg-color);
    background-image: radial-gradient(#FFE0B2 15%, transparent 16%), radial-gradient(#FFE0B2 15%, transparent 16%);
    background-size: 60px 60px; background-position: 0 0, 30px 30px;
    font-family: 'Mochiy Pop One', sans-serif; 
    touch-action: none; user-select: none; color: #5D4037;
}

canvas { display: block; width: 100%; height: 100%; }

.ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

.indicator {
    position: absolute; width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.8); border: 3px solid #FF5252;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    z-index: 90; pointer-events: none; transition: transform 0.1s;
}

.screen { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(255, 248, 225, 0.98); 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    z-index: 100; pointer-events: auto; overflow-y: auto;
    transition: opacity 0.3s;
}
.hidden { display: none !important; }

.btn { 
    background: #FF9800; color: white; padding: 15px 40px; font-size: 24px; 
    border: 4px solid #E65100; border-radius: 50px; cursor: pointer; margin: 10px;
    box-shadow: 0 6px 0 #bf360c; font-family: inherit; transition: transform 0.1s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #bf360c; }
.btn-blue { background: #42A5F5; border-color: #1565C0; box-shadow: 0 6px 0 #0D47A1; }
.btn-green { background: #4CAF50; border-color: #2E7D32; box-shadow: 0 6px 0 #1B5E20; }

.title-art {
    font-size: 80px; margin: 20px 0;
    display: flex; align-items: center; gap: 20px;
}
.art-burger { animation: bounce 1s infinite alternate; }
.art-rat { animation: wiggle 0.5s infinite; filter: drop-shadow(0 0 10px red); }
.art-vs { font-size: 40px; color: #FF5252; font-weight: 900; transform: rotate(-10deg); }

@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-20px); } }
@keyframes wiggle { 0% { transform: rotate(0deg); } 25% { transform: rotate(10deg); } 75% { transform: rotate(-10deg); } }

.game-title { font-size: 50px; color: #FF9800; text-shadow: 4px 4px 0 #fff; margin-bottom: 10px; text-align: center; }
.info-text { font-size: 18px; margin-bottom: 5px; }

.hud-container { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 10px; }
.hud-box { 
    background: #fff; border: 3px solid #5D4037; border-radius: 15px; padding: 10px 20px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1); font-size: 20px;
}
.gauge-bar { width: 200px; height: 20px; background: #eee; border: 2px solid #5D4037; border-radius: 10px; overflow: hidden; }
.gauge-fill { height: 100%; background: #FFC107; transition: width 0.1s; }

#fever-overlay {
    position: absolute; top: 15%; width: 100%; text-align: center; 
    font-size: 60px; font-weight: 900; text-shadow: 4px 4px 0 #000; z-index: 5;
}
.rainbow-text { animation: rainbow 0.5s linear infinite; }
@keyframes rainbow { 
    0% { color: #ff0000; } 20% { color: #ffff00; } 40% { color: #00ff00; }
    60% { color: #00ffff; } 80% { color: #0000ff; } 100% { color: #ff00ff; }
}

.marquee-alert {
    position: absolute; top: 20%; left: 0; width: 100%; height: 60px;
    background: repeating-linear-gradient(45deg, #FF5252, #FF5252 20px, #000 20px, #000 40px);
    color: #fff; font-size: 30px; line-height: 60px; text-align: center;
    white-space: nowrap; overflow: hidden; display: none; opacity: 0.9;
    border-top: 4px solid #fff; border-bottom: 4px solid #fff;
}
.marquee-content { display: inline-block; padding-left: 100%; animation: scroll-left 4s linear infinite; }
@keyframes scroll-left { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.float-text { position: absolute; font-weight: 900; pointer-events: none; animation: floatUp 0.8s forwards; text-shadow: 2px 2px 0 #fff; -webkit-text-stroke: 1px #000; z-index: 50; }
@keyframes floatUp { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: translateY(-60px) scale(1.3); opacity: 0; } }

.sub-screen { width: 90%; max-width: 600px; background: #fff; border-radius: 10px; padding: 20px; max-height: 70vh; overflow-y: auto; border: 2px solid #ccc; }
.grid-view { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); 
    gap: 15px; 
    padding: 5px;
}

#player-name { font-size: 24px; width: 150px; text-align: center; padding: 5px; border-radius: 5px; border: 2px solid #5D4037; }

#game-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--modal-bg); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s;
}
.modal-content {
    background: #fff; padding: 30px; border-radius: 20px;
    border: 5px solid #FF9800; text-align: center;
    min-width: 300px; max-width: 90%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes scaleIn { from {transform: scale(0.8);} to {transform: scale(1);} }

.modal-title { font-size: 24px; color: #E65100; margin-bottom: 15px; border-bottom: 2px dashed #ccc; padding-bottom: 10px; }
.modal-body { font-size: 18px; margin-bottom: 20px; line-height: 1.6; }

@keyframes chomp { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(0); opacity: 0; } }
.anim-chomp { animation: chomp 0.3s forwards; }

.gacha-result-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
    margin-bottom: 15px;
}

/* ガチャアイテム表示 (図鑑用) */
#gacha-grid .gacha-item {
    border: 1px solid #ccc; border-radius: 5px; padding: 5px; 
    text-align: center; 
    height: 110px !important; 
    display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;
    position: relative; overflow: hidden;
    animation: none !important; opacity: 1 !important; transform: none !important;
    visibility: visible !important; color: #5D4037 !important; background: #fff;
}

#gacha-grid .gacha-item div { opacity: 1 !important; visibility: visible !important; color: inherit; }

/* ガチャ結果用 */
.gacha-res-item {
    background: #eee; border-radius: 10px; padding: 5px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* ★5 レインボー演出 */
#gacha-grid .gacha-item.rare-5 { 
    background: linear-gradient(124deg, #ff2400, #e81d1d, #e8b71d, #e3e81d, #1de840, #1ddde8, #2b1de8, #dd00f3, #dd00f3) !important;
    background-size: 400% 400% !important;
    animation: rainbow-bg 3s ease infinite !important; 
    border: 2px solid #fff !important;
    color: #fff !important; 
    text-shadow: 1px 1px 0 #000;
}

/* ★6 超絶アルティメット演出 */
#gacha-grid .gacha-item.rare-6 {
    background: #000 !important;
    border: 4px solid #FFD700 !important;
    box-shadow: 0 0 10px #FFD700, inset 0 0 10px #FFD700 !important;
    animation: god-pulse 1s infinite alternate !important; 
    color: #FFD700 !important;
    font-weight: 900;
    text-shadow: 0 0 5px #fff, 0 0 10px #FFD700;
}

@keyframes popIn { from { transform: scale(0); opacity:0; } to { transform: scale(1); opacity:1; } }
@keyframes rainbow-bg { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes god-pulse { 0% { box-shadow: 0 0 10px #FFD700; } 100% { box-shadow: 0 0 30px #FFD700, 0 0 60px #FFD700; } }

.god-particle {
    position: fixed; width: 10px; height: 10px; background: #FFD700;
    border-radius: 50%; pointer-events: none; z-index: 3000;
    box-shadow: 0 0 10px #fff;
    animation: particle-fly 1s ease-out forwards;
}
@keyframes particle-fly { 0% { transform: translate(0,0) scale(1); opacity:1; } 100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity:0; } }