body {
    background-color: #111;
    color: #fff;
    font-family: 'Courier New', monospace;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-wrapper {
    position: relative;
    width: 800px;
    height: 600px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    border: 2px solid #333;
    background: #000;
}

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

#ui-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; /* UIがない場所はCanvasをクリック可能に */
}

.screen {
    display: none;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}
.screen.active { display: flex; }
.screen.overlay-mode { background: transparent; pointer-events: none; display: none; } /* 戦闘中は背景透明 */
.screen.overlay-mode.active { display: block; }

.title { font-size: 48px; text-shadow: 0 0 10px #0ff; margin-bottom: 40px; }
.panel { background: #222; padding: 30px; border: 1px solid #444; border-radius: 8px; text-align: center; }

input {
    display: block; width: 200px; margin: 10px auto; padding: 10px;
    background: #000; border: 1px solid #555; color: #fff; text-align: center; font-size: 16px;
}

button {
    background: #d32f2f; color: #fff; border: none; padding: 10px 25px;
    font-size: 18px; cursor: pointer; margin-top: 15px; transition: 0.2s;
    font-family: inherit;
    border: 1px solid #ff5252;
}
button:hover { background: #ff5252; box-shadow: 0 0 15px #f00; }

.header-status {
    position: absolute; top: 0; left: 0; width: 100%;
    background: rgba(0, 50, 100, 0.8); padding: 10px; box-sizing: border-box;
    display: flex; justify-content: space-around; font-weight: bold; font-size: 20px;
}

/* ガチャ演出 */
#gacha-display { margin: 20px; font-size: 24px; min-height: 100px; }
.chest { font-size: 60px; animation: bounce 1s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }