body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: white;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease-in-out;
    z-index: 1;
}

#nav-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #3498db;
    display: flex;
    align-items: center;
    gap: 10px;
}

#character-sprite {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 85%;
    z-index: 2;
    pointer-events: none;
}

#active-character {
    height: 100%;
}

#ui-container {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 5;
}

#dialogue-box {
    width: 85%;
    max-width: 800px;
    background: rgba(15, 15, 25, 0.95);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 25px;
}

.choice-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(52, 152, 219, 0.1);
    color: white;
    border: 1px solid #3498db;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.choice-button:hover {
    background: #3498db;
}

/* RE-THINK STYLE */
.rethink-style {
    border-left: 6px solid #e74c3c !important;
    background: rgba(231, 76, 60, 0.15) !important;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.2);
    }
}

/* RESOURCES PAGE OVERLAY */
#resources-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.98);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 40px 0;
}

.resources-content {
    width: 90%;
    max-width: 800px;
}

.hidden {
    display: none !important;
}

.resource-category {
    margin-top: 30px;
}

.resource-category h2 {
    color: #3498db;
    font-size: 1.4rem;
    border-left: 4px solid #3498db;
    padding-left: 10px;
}

.resource-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    transition: 0.3s;
}

.resource-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.resource-card a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.resource-card p {
    margin: 5px 0 0;
    color: #ccc;
    font-size: 0.95rem;
}

/* START SCREEN STYLES */
#start-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #0a0a0f; z-index: 300; display: flex;
    justify-content: center; align-items: center; text-align: center;
}

.start-content {
    background: rgba(15, 15, 25, 0.95); padding: 40px;
    border: 2px solid #3498db; border-radius: 12px; max-width: 400px;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.2);
}

#player-name-input {
    width: 100%; padding: 12px; margin: 20px 0;
    background: rgba(255, 255, 255, 0.1); border: 1px solid #3498db;
    color: white; border-radius: 6px; font-size: 1.1rem; box-sizing: border-box;
}

#player-name-input:focus {
    outline: none; background: rgba(255, 255, 255, 0.15);
}

/* START SCREEN FOOTER & CREDITS STYLES */
.start-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid rgba(52, 152, 219, 0.3);
    padding: 20px 40px;
    box-sizing: border-box;
    font-size: 0.85rem;
    color: #bdc3c7;
    line-height: 1.5;
    
    /* Side-by-side layout */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center; /* Keeps the whole block centered on screen */
    gap: 40px; /* Your requested gap */
    z-index: 301;
}

.um-logo {
    max-width: 160px;
    height: auto;
    padding: 6px 12px;
    border-radius: 6px;
    flex-shrink: 0; /* Prevents the logo from squishing on small screens */
}

.footer-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.collab-text, .authors {
    margin: 4px 0;
}

.start-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.start-footer a:hover {
    text-decoration: underline;
    color: #2ecc71; 
}

/* REFLECTION SCREEN STYLES */
#reflection-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #0a0a0f; z-index: 400; display: flex;
    justify-content: center; align-items: flex-start; overflow-y: auto; padding: 40px 20px;
}

.reflection-container {
    background: rgba(15, 15, 25, 0.95); padding: 40px;
    border: 2px solid #3498db; border-radius: 12px; max-width: 800px; width: 100%;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.2); color: white;
}

.reflection-questions {
    margin: 20px 0; padding-left: 20px; line-height: 1.6;
}

.reflection-questions li {
    margin-bottom: 10px; color: #ecf0f1;
}

#reflection-text {
    width: 100%; height: 250px; padding: 15px; margin: 20px 0;
    background: rgba(255, 255, 255, 0.05); border: 1px solid #3498db;
    color: white; border-radius: 6px; font-size: 1rem; box-sizing: border-box;
    font-family: inherit; resize: vertical;
}

.reflection-actions {
    display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; border-top: 1px solid #333; padding-top: 20px;
}

.pdf-btn {
    border: 2px solid #e74c3c !important; 
    background: rgba(231, 76, 60, 0.1) !important;
}

/* Print utility class (used by JS during PDF generation) */
.pdf-print-text {
    white-space: pre-wrap; margin-top: 20px; padding: 15px; 
    background: #fff; color: #000; border: 1px solid #ccc;
}

/* PDF EXPORT OVERRIDE (Forces black text on white background for the PDF) */
.pdf-export-mode {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding: 30px !important;
}

.pdf-export-mode h1,
.pdf-export-mode h2,
.pdf-export-mode p,
.pdf-export-mode ul,
.pdf-export-mode li,
.pdf-export-mode strong {
    color: #000000 !important;
}

/* --- Character Overview Grid --- */
.co-title {
    margin-bottom: 10px !important;
}

.co-sub-title {
    margin-top: 0;
    margin-bottom: 30px !important;
}

.character-grid {
    display: grid;
    /* This creates 3 equal columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.character-card {
    text-align: center;
    padding: 10px;
    background: rgb(253 253 253 / 10%);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.character-card img {
    width: 120px;
    height: 120px;
    /* Makes the image a perfect circle */
    border-radius: 50%;
    /* Adds the requested blue border */
    border: 2px solid #3498db;
    object-fit: cover;
    margin: 0 auto 15px auto;
    display: block;
}

.character-card h3 {
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 1.1em;
}

.character-card p {
    font-size: 0.9em;
    color: rgb(255 255 255 / 80%);
    line-height: 1.4;
}

/* Make it responsive for mobile phones (stacks into a single column) */
@media (max-width: 768px) {
    .character-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Character Overview Screen Layout --- */
#character-overview-screen {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: #0a0a0f; 
    z-index: 350; /* Sits right above the start screen */
    display: flex; /* Will be triggered by JS */
    justify-content: center; 
    align-items: center; 
    overflow-y: auto; 
    padding: 40px 20px;
    box-sizing: border-box;
}

.start-container {
    background: rgba(15, 15, 25, 0.95); 
    padding: 40px;
    border: 2px solid #3498db; 
    border-radius: 12px; 
    max-width: 1200px; 
    width: 100%;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.2); 
    color: white; 
    margin: auto;
}