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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, rgba(70, 70, 70, 0.3), rgba(90, 90, 90, 0.6));
    transition: height 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    width: 100%;
    padding: 2rem;
}

.elevator-visual {
    background: #333;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.elevator-shaft {
    width: 100%;
    height: 500px;
    background: linear-gradient(180deg, #222, #111);
    border: 3px solid #555;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.elevator-car {
    position: absolute;
    bottom: 50%;
    left: 10px;
    right: 10px;
    height: 200px;
    background: #444;
    border: 2px solid #666;
    border-radius: 5px;
    transition: all 0.8s ease;
}

.elevator-interior {
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
}

.passenger {
    position: absolute;
    bottom: 10px;
    width: 15px;
    height: 40px;
    background: #666;
    border-radius: 10px 10px 0 0;
    border: 1px solid #888;
}

.passenger:nth-child(6) { left: 60px; }
.passenger:nth-child(7) { left: 80px; }
.passenger:nth-child(8) { right: 60px; }

.passenger::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #888;
    border-radius: 50%;
    border: 1px solid #aaa;
}

.control-panel {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #222;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #555;
}

.floor-display {
    background: #000;
    color: #0f0;
    text-align: center;
    padding: 5px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border-radius: 3px;
    margin-bottom: 10px;
}

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.floor-btn, .emergency-btn {
    background: #555;
    color: white;
    border: 1px solid #777;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.floor-btn:hover, .emergency-btn:hover {
    background: #666;
    transform: scale(1.1);
}

.floor-btn:disabled {
    background: #0f0;
    color: #000;
    cursor: not-allowed;
}

.emergency-btn {
    grid-column: 1 / -1;
    background: #c33;
    color: white;
    border-radius: 5px;
    margin-top: 5px;
}

.door {
    position: absolute;
    top: 0;
    width: 45%;
    height: 80%;
    background: #666;
    border: 2px solid #888;
    transition: transform 0.8s ease;
}

#door-left {
    left: 5%;
    transform-origin: left;
}

#door-right {
    right: 5%;
    transform-origin: right;
}

.door.open#door-left {
    transform: rotateY(-90deg);
}

.door.open#door-right {
    transform: rotateY(90deg);
}

.emergency-phone {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.emergency-phone:hover {
    transform: scale(1.2);
}

.ceiling-panel {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: #555;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #777;
    transition: all 0.2s;
}

.ceiling-panel:hover {
    background: #666;
    transform: translateX(-50%) scale(1.05);
}

.game-interface {
    background: #2a2a2a;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.status-panel h2 {
    color: #f0f0f0;
    margin-bottom: 1rem;
    text-align: center;
}

.status-info {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.status-info > div {
    background: #1a1a1a;
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #444;
}

.time-display {
    background: #8b0000;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #ff4444;
    position: relative;
}

.time-display .time-number {
    font-size: 3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #ff4444;
    font-family: 'Courier New', monospace;
}

.time-display .time-label {
    font-size: 0.9rem;
    color: #ffcccc;
    margin-top: 0.5rem;
}

.time-display.warning {
    animation: pulse-red 1s infinite;
    background: #cc0000;
}

.time-display.critical {
    animation: flash-red 0.5s infinite;
    background: #ff0000;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 5px #ff4444; }
    50% { box-shadow: 0 0 20px #ff4444, 0 0 30px #ff4444; }
    100% { box-shadow: 0 0 5px #ff4444; }
}

@keyframes flash-red {
    0% { background: #ff0000; }
    50% { background: #ff6666; }
    100% { background: #ff0000; }
}

.story-panel {
    background: #1a1a1a;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid #444;
    line-height: 1.6;
}

.actions-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background: #444;
    color: white;
    border: 2px solid #666;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.action-btn:hover {
    background: #555;
    border-color: #777;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.action-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-btn.hidden {
    display: none;
}

.result-panel {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 1rem;
    min-height: 100px;
    font-size: 14px;
    line-height: 1.5;
}

.success {
    border-color: #0a0;
    background: rgba(0, 255, 0, 0.1);
}

.failure {
    border-color: #a00;
    background: rgba(255, 0, 0, 0.1);
}

.warning {
    border-color: #fa0;
    background: rgba(255, 170, 0, 0.1);
}

@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
    }
    
    .actions-panel {
        grid-template-columns: 1fr;
    }
}