/* ミステリーハウス - 追加スタイル */
body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #000;
    color: #0f0;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

h1 {
    text-align: center;
    text-shadow: 0 0 5px #0f0;
    margin-bottom: 30px;
}

#game-container {
    border: 1px solid #0f0;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 400px;
    max-height: 60vh;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

#input-container {
    display: flex;
    margin-bottom: 20px;
}

#command-input {
    flex-grow: 1;
    background-color: #000;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    transition: all 0.3s ease;
}

#command-input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#submit-button {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin-left: 10px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    transition: all 0.3s ease;
}

#submit-button:hover {
    background-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

#help-container {
    border: 1px solid #0f0;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
    transition: all 0.3s ease;
}

#help-toggle {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    width: 100%;
}

#help-toggle:hover {
    background-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.ascii-art {
    line-height: 1.2;
    margin-bottom: 20px;
    font-family: monospace;
}

.control-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.control-buttons button {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    transition: all 0.3s ease;
}

.control-buttons button:hover {
    background-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.direction-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.direction-buttons button {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    transition: all 0.3s ease;
}

.direction-buttons button:hover {
    background-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
}

.empty-cell {
    visibility: hidden;
}

.title-screen {
    text-align: center;
    padding: 40px 20px;
}

.title-screen h1 {
    font-size: 2.5em;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #0f0;
}

.title-screen .ascii-title {
    margin-bottom: 40px;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.title-buttons button {
    background-color: #0f0;
    color: #000;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.title-buttons button:hover {
    background-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

.loading-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-text {
    color: #0f0;
    font-size: 1.5em;
    text-shadow: 0 0 5px #0f0;
}

.hidden {
    display: none;
}

.inventory-panel {
    border: 1px solid #0f0;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.inventory-panel h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inventory-item {
    border: 1px solid #0f0;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.game-footer {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8em;
    color: #0a0;
}

/* モバイル向けスタイル */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    #game-container {
        padding: 10px;
        min-height: 300px;
        max-height: 50vh;
    }
    
    #command-input, #submit-button {
        font-size: 14px;
    }
    
    .control-buttons, .direction-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .direction-buttons button, .control-buttons button {
        padding: 12px 5px;
        font-size: 0.9em;
    }
}

/* アニメーション */
@keyframes glow {
    0% { text-shadow: 0 0 5px #0f0; }
    50% { text-shadow: 0 0 20px #0f0, 0 0 30px #0f0; }
    100% { text-shadow: 0 0 5px #0f0; }
}

.glow-effect {
    animation: glow 2s infinite;
}

/* ダークモード/ライトモードの切り替え */
.light-mode {
    background-color: #f0f0f0;
    color: #006600;
}

.light-mode #game-container,
.light-mode #command-input,
.light-mode #help-container,
.light-mode .inventory-panel,
.light-mode .inventory-item {
    background-color: #ffffff;
    border-color: #006600;
    color: #006600;
}

.light-mode #submit-button,
.light-mode #help-toggle,
.light-mode .control-buttons button,
.light-mode .direction-buttons button,
.light-mode .title-buttons button {
    background-color: #006600;
    color: #ffffff;
}

.light-mode #submit-button:hover,
.light-mode #help-toggle:hover,
.light-mode .control-buttons button:hover,
.light-mode .direction-buttons button:hover,
.light-mode .title-buttons button:hover {
    background-color: #008800;
}

#theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #0f0;
    cursor: pointer;
    font-size: 1.2em;
}

.light-mode #theme-toggle {
    color: #006600;
}
