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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

h1 {
    color: #ffd700;
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 5px;
}

.subtitle {
    color: #aaa;
    font-size: 1rem;
    font-style: italic;
}

.game-info {
    margin-bottom: 20px;
}

.info-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid #555;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.stat {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat .label {
    color: #aaa;
    font-size: 0.9rem;
}

.stat .value {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.game-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    margin-bottom: 20px;
}

.game-board {
    display: grid;
    gap: 4px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid #444;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    aspect-ratio: 1;
    max-height: 600px;
}

.cell {
    position: relative;
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.2s;
    cursor: default;
}

.cell-icon {
    font-size: 1.5rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.cell:hover .cell-icon {
    transform: scale(1.1);
}

.cell.road {
    background: #3a3a4e;
}

.cell.wall {
    background: linear-gradient(135deg, #555 0%, #666 100%);
    border-color: #777;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.cell.evidence {
    background: linear-gradient(135deg, #2d4a2d 0%, #3a5c3a 100%);
    border-color: #4a7c59;
    box-shadow: 0 0 15px rgba(74, 124, 89, 0.6);
    animation: evidencePulse 2s infinite;
}

.cell.evidence-collected {
    background: linear-gradient(135deg, #1a2a1a 0%, #2a3a2a 100%);
    border-color: #3a5a39;
    opacity: 0.5;
    animation: none;
}

@keyframes evidencePulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(74, 124, 89, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(74, 124, 89, 0.9);
    }
}

.cell.hint {
    background: linear-gradient(135deg, #3a3a1e 0%, #4a4a2e 100%);
    border-color: #7a7a3e;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    animation: hintPulse 2s infinite;
}

.cell.hint-discovered {
    background: linear-gradient(135deg, #2a2a1e 0%, #3a3a2e 100%);
    border-color: #5a5a2e;
    opacity: 0.6;
    animation: none;
}

@keyframes hintPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    }
}

.cell.culprit {
    background: linear-gradient(135deg, #4a1e1e 0%, #6a2e2e 100%);
    border-color: #7a3e3e;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    animation: culpritPulse 1s infinite;
}

@keyframes culpritPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
        transform: scale(1.02);
    }
}

.cell.start {
    background: linear-gradient(135deg, #1e3a4a 0%, #2e4a5a 100%);
    border-color: #3e6a7a;
    box-shadow: 0 0 10px rgba(62, 106, 122, 0.5);
}

.player {
    position: absolute;
    font-size: 2.5rem;
    animation: playerFloat 1s infinite ease-in-out;
    z-index: 10;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9));
}

@keyframes playerFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.05);
    }
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.panel-section {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.panel-section h3 {
    color: #ffd700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 2px solid #555;
    padding-bottom: 8px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.evidence-list, .clue-list {
    max-height: 200px;
    overflow-y: auto;
}

.evidence-item, .clue-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #4a7c59;
    transition: all 0.3s;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.evidence-item:hover, .clue-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.clue-item {
    border-left-color: #7a7a3e;
}

.evidence-icon, .clue-icon {
    font-size: 1.5rem;
}

.evidence-details, .clue-text {
    flex: 1;
}

.evidence-name {
    font-weight: bold;
    color: #ffd700;
    font-size: 0.9rem;
}

.evidence-desc {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2px;
}

.clue-text {
    color: #ddd;
    font-size: 0.85rem;
}

.empty-message {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.suspect-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suspect {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border-left: 3px solid #666;
    transition: all 0.3s;
}

.suspect:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(3px);
}

.suspect.culprit {
    border-left-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.suspect-name {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
}

.suspect-info {
    font-size: 0.85rem;
    color: #aaa;
}

.deduce-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
}

.deduce-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.deduce-btn:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.deduce-btn.pulse {
    animation: buttonPulse 1.5s infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(255, 215, 0, 0.7);
    }
}

.controls {
    text-align: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid #555;
}

.controls p {
    color: #aaa;
    margin-bottom: 10px;
}

.control-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #555 0%, #666 100%);
    color: #fff;
    border: 1px solid #777;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    background: linear-gradient(135deg, #666 0%, #777 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #ffd700;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.modal-content h2.success {
    color: #4af;
}

.modal-content h2.error {
    color: #f44;
}

.modal-content h2.deduction {
    color: #fa4;
}

.modal-content h2.info {
    color: #4af;
}

.modal-body {
    margin-bottom: 20px;
    line-height: 1.6;
}

.suspect-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.suspect-btn {
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.suspect-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-btn {
    padding: 12px 35px;
    background: #ffd700;
    color: #1a1a2e;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
}

.modal-btn:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

.modal-btn.primary {
    background: linear-gradient(135deg, #4af 0%, #6bf 100%);
    color: #fff;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #6bf 0%, #8df 100%);
}

.modal-btn.secondary {
    background: linear-gradient(135deg, #666 0%, #777 100%);
    color: #fff;
}

.modal-btn.secondary:hover {
    background: linear-gradient(135deg, #777 0%, #888 100%);
}

.success {
    color: #4af;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
}

.error {
    color: #f44;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
}

.warning {
    color: #fa4;
    font-weight: bold;
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.hint-text {
    color: #aaa;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
}

.score-details {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #444;
}

.score-details p {
    margin: 5px 0;
    text-align: center;
}

.total-score {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 10px !important;
}

.penalty {
    color: #f88;
}

.final-message {
    text-align: center;
    font-size: 1.1rem;
    color: #ffd700;
    margin-top: 15px;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
    }

    .game-board {
        max-height: 500px;
    }

    .side-panel {
        max-height: none;
    }

    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .info-panel {
        flex-wrap: wrap;
        gap: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .game-board {
        max-height: 400px;
    }
}

/* スクロールバーのスタイリング */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}
