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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f1eb;
    color: #333;
    padding: 20px;
}

#game-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid #dcd1b9;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

header {
    padding: 20px;
    background: #4a3c31;
    color: #f4f1eb;
    border-bottom: 2px solid #dcd1b9;
    border-radius: 6px 6px 0 0;
    position: relative; /* Needed for the back button */
}

header h1 {
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
}

#header-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap; /* Allow wrapping */
}

#game-badge-display, #current-warrant-display, #game-info {
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.9;
    margin: 2px 10px 2px 0; /* Add spacing */
}

#game-badge-display #game-badge-name, #current-warrant-display span {
    font-weight: bold;
    color: #f0e9d6;
}

#current-warrant-display span {
    color: #ffc107; /* Make warrant stand out */
}

#game-info {
    text-align: right; 
    flex-grow: 1; /* Make it take remaining space */
}

#main-content {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
}

#location-display {
    flex: 2;
    padding: 20px;
    border-right: 1px solid #eee;
    min-width: 300px;
}

#location-image {
    width: 100%;
    height: 150px;
    background: #eee;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-bottom: 15px;
}

#location-description {
    font-size: 0.95em;
    line-height: 1.5;
}

#action-panel {
    flex: 3;
    padding: 20px;
    min-width: 300px;
}

#action-panel h3 {
    border-bottom: 2px solid #f0e9d6;
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-family: 'Times New Roman', Times, serif;
}

.action-btn, #travel-options button {
    display: inline-block;
    padding: 8px 12px;
    margin: 5px;
    border: 1px solid #c9b89a;
    background: #fdfaf2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.action-btn:hover, #travel-options button:hover {
    background: #f0e9d6;
}

#clue-display {
    margin-top: 20px;
}

#clue-list {
    list-style: none;
    padding-left: 10px;
}

#clue-list li {
    background: #fdfaf2;
    border: 1px solid #f0e9d6;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-style: italic;
}

/* NEW: Suspect Clue List */
#suspect-clue-display {
    margin-top: 20px;
}

#suspect-clue-list {
    list-style: disc; /* Use discs for clues */
    padding-left: 30px; /* Indent list */
}

#suspect-clue-list li {
    background: #fff8e1; /* Light yellow background */
    border: 1px solid #ffeecb;
    color: #6f4f00;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-style: italic;
}


#travel-options {
    margin-top: 20px;
}

/* NEW: Warrant Button Style */
#warrant-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    font-size: 1.1em;
    font-family: 'Times New Roman', Times, serif;
    background: #a13d3d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#warrant-btn:hover {
    background: #8a3434;
}


footer {
    padding: 15px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    border-radius: 0 0 6px 6px;
    min-height: 40px;
}

#game-message {
    font-weight: bold;
    line-height: 1.4;
}

.msg-win {
    color: #2a7a2a; /* Green */
}
.msg-lose {
    color: #a13d3d; /* Red */
}

.promotion-message {
    color: #2a7a2a; 
    display: block;
    margin-top: 10px;
    font-size: 1.1em;
    animation: fadeIn 1s;
}

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


/* --- Case Selection Screen --- */
.hidden {
    display: none !important;
}

#case-selection {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border: 2px solid #dcd1b9;
    border-radius: 8px;
}

#badge-display {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 20px;
    margin-top: 10px;
    color: #4a3c31;
}

#badge-display #badge-name {
    font-weight: bold;
    font-style: italic;
    color: #a13d3d; 
}


#case-list button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    font-size: 1.1em;
    font-family: 'Times New Roman', Times, serif;
    background: #fdfaf2;
    border: 1px solid #c9b89a;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

#case-list button:hover {
    background: #f0e9d6;
}

#back-to-cases {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 0.8em;
    background: #f4f1eb;
    color: #4a3c31;
    border: 1px solid #dcd1b9;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
}
#back-to-cases:hover {
    background: #fff;
}
/* --- Case Briefing Screen --- */
#case-briefing {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border: 2px solid #dcd1b9;
    border-radius: 8px;
}

#case-briefing h2 {
    font-family: 'Times New Roman', Times, serif;
    color: #4a3c31;
    border-bottom: 2px solid #f0e9d6;
    padding-bottom: 10px;
}

#briefing-details {
    margin: 15px 0;
    background: #fdfaf2;
    border: 1px solid #f0e9d6;
    padding: 10px;
    border-radius: 4px;
}
#briefing-details p {
    margin: 5px 0;
}

#briefing-description {
    margin: 15px 0;
    line-height: 1.6;
    font-style: italic;
}

#briefing-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#start-case-btn {
    padding: 12px 20px;
    font-size: 1.1em;
    font-family: 'Times New Roman', Times, serif;
    background: #4a3c31;
    color: #f4f1eb;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#start-case-btn:hover {
    background: #6a5546;
}

.back-btn {
    font-size: 0.9em;
    background: none;
    border: none;
    color: #4a3c31;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px;
}
.back-btn:hover {
    color: #a13d3d;
}

/* Tweak for in-game back button */
#back-to-cases {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.8em;
    background: #f4f1eb;
    color: #4a3c31;
    border: 1px solid #dcd1b9;
    padding: 5px 8px;
    border-radius: 4px;
    text-decoration: none;
}
#back-to-cases:hover {
    background: #fff;
    color: #a13d3d;
}
#location-image img {
    width: 100%;
    height: 150px; /* Matches the container height */
    object-fit: cover; /* This prevents stretching! */
    border-radius: 4px;
}
/* --- How to Play Button --- */
#how-to-play-btn {
    background: none;
    border: 1px solid #c9b89a;
    color: #4a3c31;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
#how-to-play-btn:hover {
    background: #fdfaf2;
}

/* --- Modal Styles (for How to Play & Warrant) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-height: 90vh; /* Make modal scrollable if content is tall */
    overflow-y: auto;
}

.modal-content h2 {
    font-family: 'Times New Roman', Times, serif;
    color: #4a3c31;
    border-bottom: 2px solid #f0e9d6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.modal-content li {
    background: #fdfaf2;
    border: 1px solid #f0e9d6;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: #333;
}

/* --- NEW: Warrant Modal Specifics --- */
#warrant-clue-list h3 {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1em;
    color: #4a3c31;
    margin-bottom: 10px;
}

#warrant-clue-list ul {
    list-style: disc;
    padding-left: 20px;
}
#warrant-clue-list li {
    font-style: italic;
    background: #fff8e1;
    border-color: #ffeecb;
}

#suspect-list {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}
#suspect-list h3 {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1em;
    color: #4a3c31;
    margin-bottom: 10px;
}
.suspect-profile {
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.suspect-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.suspect-profile-header h4 {
    margin: 0;
    color: #a13d3d;
}
.suspect-profile-header button {
    padding: 5px 10px;
    font-size: 0.9em;
    background: #2a7a2a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.suspect-profile-header button:hover {
    background: #1e591e;
}
.suspect-profile ul {
    padding-left: 20px;
    font-size: 0.9em;
    color: #555;
    margin-top: 10px;
}
.suspect-profile li {
    background: none;
    border: none;
    padding: 2px 0;
    list-style: circle;
}