/* Game container */
body {
    font-family: 'Georgia', serif;
    background-color: #f4e9d7;
    color: #4a3520;
    margin: 0;
    padding: 20px;
}

/* Guide and walkthrough styles */
.guide-container, .walkthrough-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border: 2px solid #b89068;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.section {
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 20px;
}

.event {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.event h3 {
    color: #8b5a2b;
    margin-top: 0;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}

.choice {
    background-color: #e9f7ef;
    padding: 10px 15px;
    margin: 10px 0;
    border-left: 4px solid #2ecc71;
    border-radius: 4px;
}

.avoid {
    background-color: #f9ebeb;
    padding: 10px 15px;
    margin: 10px 0;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
}

.note {
    background-color: #fff3cd;
    border-left: 4px solid #ffeeba;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.strategy {
    background-color: #e3f2fd;
    border-left: 4px solid #90caf9;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.nav-links a {
    background-color: #8b5a2b;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.nav-links a:hover {
    background-color: #6d462a;
}

h1, h2, h3 {
    color: #8B4513;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    color: #8B4513;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f4e9d7;
}

.back-link {
    margin-top: 30px;
    display: block;
    text-align: center;
    background-color: #8b5a2b;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.back-link:hover {
    background-color: #6d462a;
}

/* Mobile optimizations for guides and walkthroughs */
@media (max-width: 768px) {
    .guide-container, .walkthrough-container {
        padding: 15px;
    }
    
    .section {
        padding-bottom: 15px;
    }
    
    .event, .choice, .avoid, .note, .strategy {
        padding: 12px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .guide-container, .walkthrough-container {
        padding: 10px;
        border-width: 1px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .event, .choice, .avoid, .note, .strategy {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .back-link {
        width: 80%;
    }
    
    table {
        font-size: 12px;
    }
}

#game-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border: 2px solid #b89068;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    #game-container {
        padding: 10px;
        border-radius: 8px;
    }
}

/* Game screens */
.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
}

/* Title screen */
#title-screen h1 {
    text-align: center;
    color: #8b5a2b;
    font-size: 36px;
    margin-bottom: 10px;
}

#title-image {
    text-align: center;
    margin-bottom: 20px;
}

#title-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #b89068;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

@media (max-width: 480px) {
    #title-screen h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .intro {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .help-buttons {
        margin-bottom: 15px;
    }
}

.intro {
    text-align: center;
    font-style: italic;
    margin-bottom: 30px;
}

.help-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.help-btn {
    display: inline-block;
    margin: 0 10px;
    padding: 5px 15px;
    background-color: #f4e9d7;
    border: 1px solid #b89068;
    border-radius: 5px;
    color: #8b5a2b;
    text-decoration: none;
    font-weight: bold;
}

.help-btn:hover {
    background-color: #e6d5b8;
}

/* Start options */
.start-options, .player-setup {
    text-align: center;
    margin-top: 20px;
}

.hidden {
    display: none;
}

.choice-btn {
    background-color: #8b5a2b;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.choice-btn:hover {
    background-color: #6d462a;
}

@media (max-width: 480px) {
    .choice-btn {
        padding: 12px 15px;
        font-size: 16px;
        margin: 8px 4px;
    }
    
    #play-again {
        padding: 15px 25px;
        font-size: 18px;
        width: 80%;
    }
    
    .help-btn {
        display: block;
        margin: 10px auto;
        padding: 10px 20px;
    }
}

#player-name {
    padding: 8px;
    margin-right: 10px;
    border: 1px solid #b89068;
    border-radius: 5px;
    width: 200px;
}

/* Status bar */
.status-bar {
    display: table;
    width: 100%;
    background-color: #f4e9d7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-collapse: collapse;
}

.status-item {
    display: table-cell;
    padding: 8px;
    text-align: center;
    border-right: 1px solid #b89068;
}

.status-item:last-child {
    border-right: none;
}

/* Mobile responsive status bar */
@media (max-width: 768px) {
    .status-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .status-item {
        display: flex;
        flex-direction: column;
        padding: 5px 10px;
        border-right: none;
        border-bottom: 1px solid #b89068;
        min-width: 25%;
        margin-bottom: 5px;
    }
    
    .status-item:last-child {
        border-bottom: 1px solid #b89068;
    }
}

@media (max-width: 480px) {
    .status-item {
        min-width: 50%;
    }
}

.label {
    font-weight: bold;
    margin-right: 5px;
}

.use-kit-btn {
    background-color: #6d462a;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
}

/* Progress bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.progress-bar {
    height: 20px;
    background-color: #f4e9d7;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-filled {
    height: 100%;
    background-color: #8b5a2b;
    width: 0%;
    transition: width 0.5s;
}

.location-markers {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.location-marker {
    width: 30px;
    height: 30px;
    background-color: #f4e9d7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    color: #4a3520;
    cursor: help;
}

.location-marker.visited {
    background-color: #8b5a2b;
    color: white;
}

.location-marker.current {
    background-color: #e63946;
    color: white;
}

@media (max-width: 480px) {
    .location-markers {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .location-marker {
        width: 25px;
        height: 25px;
        font-size: 10px;
        margin: 0 2px;
    }
}

#current-location {
    text-align: center;
    font-weight: bold;
}

/* Custom tooltip */
#custom-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    max-width: none;
    white-space: nowrap;
}

/* Event display */
#event-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #b89068;
    border-radius: 5px;
    padding: 15px;
    background-color: #fff;
}

#event-image {
    text-align: center;
    margin-bottom: 15px;
}

#event-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #b89068;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    max-height: 300px;
}

@media (max-width: 480px) {
    #event-container {
        padding: 10px;
    }
    
    #event-image {
        margin-bottom: 10px;
    }
    
    #event-image img {
        max-height: 200px;
    }
    
    #event-text h2 {
        font-size: 20px;
    }
    
    #event-text p {
        font-size: 14px;
    }
}

#event-text h2 {
    color: #8b5a2b;
    margin-top: 0;
}

.result {
    font-style: italic;
    margin-top: 20px;
    padding: 10px;
    background-color: #f4e9d7;
    border-radius: 5px;
}

#event-choices {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

#event-choices .choice-btn {
    margin: 5px 0;
    text-align: left;
    width: 100%;
}

/* High scores styling */
#high-scores {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background-color: #f5f1e3;
    color: #382412;
    overflow-y: auto;
}

#high-scores.active {
    display: flex;
}

#high-scores h1 {
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#high-scores table {
    width: 90%;
    max-width: 800px;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#high-scores th, #high-scores td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: center;
}

#high-scores th {
    background-color: #5c3c10;
    color: white;
}

#high-scores tr:nth-child(even) {
    background-color: #eae6d9;
}

#high-scores tr:nth-child(odd) {
    background-color: #f5f1e3;
}

#high-scores tr:hover {
    background-color: #e0d9c1;
}

#back-to-title {
    background-color: #8b5a2b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

#back-to-title:hover {
    background-color: #6d462a;
}

#final-score {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f0e9d9;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.high-score-badge {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Game over screen */
#game-over {
    text-align: center;
}

#game-over h1 {
    color: #8b5a2b;
}

#game-over-image {
    margin: 20px auto;
    max-width: 400px;
}

#game-over-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #b89068;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    aspect-ratio: 16 / 10;
    object-fit: contain;
}

#game-stats {
    margin: 20px 0;
    text-align: left;
    display: inline-block;
    padding: 15px;
    border: 1px solid #b89068;
    border-radius: 5px;
    background-color: #f4e9d7;
    width: 80%;
}

/* Styling for the cause of death display */
.death-cause {
    margin-top: 15px;
    padding: 10px;
    background-color: #e63946;
    color: #fff;
    border-radius: 5px;
    font-size: 18px;
    text-align: center;
}

@media (max-width: 480px) {
    #game-over h1 {
        font-size: 24px;
    }
    
    #game-over-image {
        margin: 15px auto;
        max-width: 280px;
    }
    
    #game-stats {
        padding: 10px;
        font-size: 14px;
        width: 90%;
    }
    
    .death-cause {
        font-size: 16px;
        padding: 8px;
    }
    
    #ending-message {
        font-size: 14px;
    }
}

#play-again {
    background-color: #8b5a2b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#play-again:hover {
    background-color: #6d462a;
}

/* Game notification */
.game-notification {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b5a2b;
    border-radius: 5px;
    padding: 10px 20px;
    z-index: 100;
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 90, 43, 0.5);
    animation: fadeIn 0.5s ease;
}

.notification-content {
    text-align: center;
}

.notification-content h3 {
    color: #f4e9d7;
    margin-bottom: 5px;
}

.fade-out {
    animation: fadeOut 1s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
