/* ダンジョン・ディテクティブ - スタイルシート v4 */

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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #ffa726;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(255, 167, 38, 0.3);
}

h1 {
    text-align: center;
    color: #ffa726;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 167, 38, 0.5);
}

.subtitle {
    text-align: center;
    color: #90caf9;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-style: italic;
}

.status-bar {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 167, 38, 0.1);
    border-radius: 8px;
    border: 1px solid #ffa726;
}

.status-item {
    text-align: center;
}

.status-label {
    color: #ffa726;
    font-size: 0.9em;
    font-weight: bold;
}

.status-value {
    color: #e0e0e0;
    font-size: 1.3em;
    margin-top: 5px;
}

.game-area {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.canvas-container {
    position: relative;
    flex: 1;
}

#gameCanvas {
    display: block;
    background: #263238;
    border: 2px solid #455a64;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.damage-popup {
    position: absolute;
    pointer-events: none;
    font-size: 24px;
    font-weight: bold;
    color: #ef5350;
    text-shadow: 0 0 5px #000, 0 0 10px #ef5350;
    opacity: 0;
    transition: all 0.5s ease-out;
}

.damage-popup.show {
    opacity: 1;
    transform: translateY(-30px);
}

.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.minimap-container,
.inventory-container,
.ranking-container {
    background: rgba(255, 167, 38, 0.05);
    border: 1px solid #ffa726;
    border-radius: 8px;
    padding: 15px;
}

.minimap-container h3,
.inventory-container h3,
.ranking-container h3 {
    color: #ffa726;
    font-size: 0.9em;
    margin-bottom: 10px;
    text-align: center;
}

#minimap {
    display: block;
    margin: 0 auto;
    background: #263238;
    border: 1px solid #455a64;
    border-radius: 5px;
}

#inventory {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-slot {
    background: rgba(144, 202, 249, 0.1);
    border: 1px solid #90caf9;
    border-radius: 5px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-slot:hover {
    background: rgba(144, 202, 249, 0.2);
    transform: translateX(3px);
}

.item-slot.empty {
    opacity: 0.3;
    cursor: default;
}

.item-slot.empty:hover {
    transform: none;
}

.item-icon {
    font-size: 20px;
    width: 25px;
    text-align: center;
}

.item-info {
    flex: 1;
}

.item-name {
    color: #90caf9;
    font-size: 0.85em;
    font-weight: bold;
}

.item-key {
    color: #ffd54f;
    font-size: 0.75em;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 8px;
    background: rgba(144, 202, 249, 0.05);
    border-radius: 4px;
    font-size: 0.85em;
}

.ranking-rank {
    color: #ffd54f;
    font-weight: bold;
}

.ranking-score {
    color: #e0e0e0;
}

.controls {
    text-align: center;
    padding: 15px;
    background: rgba(144, 202, 249, 0.1);
    border-radius: 8px;
    border: 1px solid #90caf9;
}

.controls h3 {
    color: #90caf9;
    margin-bottom: 10px;
}

.controls p {
    margin: 5px 0;
    color: #e0e0e0;
}

button {
    display: block;
    margin: 20px auto;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    color: #1a1a2e;
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 167, 38, 0.4);
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(255, 167, 38, 0.6);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a2e;
    border: 3px solid #ffa726;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #ffa726;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.suspects {
    margin-top: 20px;
}

.suspect {
    background: rgba(144, 202, 249, 0.1);
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suspect:hover {
    background: rgba(144, 202, 249, 0.2);
    transform: translateX(5px);
}

.suspect h3 {
    color: #90caf9;
    margin-bottom: 5px;
}

.clue-list {
    margin-top: 15px;
    margin-bottom: 20px;
}

.clue-list h3 {
    color: #ffd54f;
    margin-bottom: 10px;
}

.clue-item {
    background: rgba(255, 213, 79, 0.1);
    border-left: 3px solid #ffd54f;
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
    color: #e0e0e0;
}

.score-display {
    background: rgba(255, 167, 38, 0.1);
    border: 1px solid #ffa726;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.2em;
}

.score-display div {
    margin: 10px 0;
}

#resultMessage {
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0;
    line-height: 1.6;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .game-area {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .minimap-container,
    .inventory-container,
    .ranking-container {
        flex: 1;
        min-width: 200px;
    }
}
