body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: rgba(251, 177, 3, 0.8); 
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #1b3322; 
    margin: 0;
    padding: 10px;
    
    /* Changed from flex to block layout so elements stack vertically instead of stretching horizontally */
    display: block; 
}

#layout-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 760px; 
    width: 100%;
    
    /* Added these two lines to handle the centering since body isn't doing it anymore */
    margin: 0 auto; 
}

#game-pane {
    width: 100%;
}

.logo-container {
    width: 100%;
    max-width: 75%;
    margin: 0 auto;
    padding: 5px 0;
}

.main-logo {
    width: 100%;
    height: auto;
    display: block;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 1); /* Added shadow */
}

#difficulty-badge-container {
    margin-bottom: 15px;
    margin-top: 15px;
    width: 100%;
}

.progress-tracker-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.prog-tag {
    background-color: #fdfbf7;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 1px;
    padding: 8px 4px;
    border-radius: 6px;
    border: 2px solid #579554;
    text-transform: uppercase;
    text-align: center;
    opacity: 0.65; 
    transition: all 0.25s ease;

}

.prog-tag.active-challenge {
    opacity: 1 !important;
    transform: scale(1.02); 
	box-shadow: 0 2px 5px rgba(0, 0, 0, 1); /* Updated shadow */
}

.prog-tag.stage-easy { color: #407a44; border-color: #407a44; }
.prog-tag.stage-medium { color: #b59810; border-color: #b59810; }
.prog-tag.stage-hard { color: #b82525; border-color: #b82525; }

.prog-tag.can-inspect {
    cursor: pointer;
}
.prog-tag.can-inspect:hover {
    opacity: 0.8;
}

#target-country-container {
    background: linear-gradient(135deg, #1b3322 0%, #112215 100%);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(27, 51, 34, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-center-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    color: #fdfbf7; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h2 .flag-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

/* Circular Frame System around the Information Button */
#info-trigger-btn {
    background: transparent;
    border: 2px solid #a3c6a3; /* Light matching theme green line */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.info-icon-text {
    font-family: 'Georgia', serif;
    font-size: 1.15rem;
    font-weight: bold;
    font-style: italic;
    color: #a3c6a3; 
    line-height: 1;
    margin-bottom: 2px; /* Precision text centering tweak */
}

#info-trigger-btn:hover {
    border-color: #fdfbf7;
    transform: translateY(-50%) scale(1.08);
}

#info-trigger-btn:hover .info-icon-text {
    color: #fdfbf7; 
}

#minimal-status-bar {
    margin-top: 6px;
    font-size: 0.88rem;
    color: #a3c6a3;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#minimal-status-bar strong {
    color: #fdfbf7;
    font-weight: 700;
}

.status-divider {
    color: #2d5a27;
    font-size: 1rem;
}

.grid-header, .guess-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2.5fr 1fr 1fr 1fr !important;
    gap: 4px;
    text-align: center;
    align-items: stretch;
    margin-bottom: 5px;
}

.grid-header div {
    background-color: #ffffff;
    font-weight: 700 !important;
    font-size: 0.55rem !important;
    color: #000000;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 4px;
    margin-bottom: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 1);
}

.tile {
    background-color: #fdfbf7;
    font-weight: bold;
    font-size: 0.78rem;
    border-radius: 4px;
    color: #103462;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    padding: 4px 2px;
    text-align: center;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 1); /* Added shadow */
}

/* --- UPDATE THESE BLOCKS IN style.css --- */

.correct {
    /* Soft Sage Green */
    background-color: rgba(46, 117, 89, 0.9) !important;
    color: #ffffff;
}

.partial {
    /* Muted Mustard Yellow */
    background-color: rgba(212, 160, 23, 0.9) !important;
    color: #ffffff; 
}

.incorrect {
    /* Faded Terracotta Red */
    background-color: rgba(186, 68, 68, 0.9) !important;
    color: #ffffff;
}

/* Update these blocks in style.css */
#roster-pane {
    background-color: #ffffff; /* Changed from #fdfbf7 */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,1);
    width: 100%;
    box-sizing: border-box;
}



#roster-pane h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #000000; /* Changed from Shadow Blue to crisp black */
    font-weight: 700;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.roster-columns-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: start;
}

.pos-column {
    background: #ffffff; /* Changed from #fdfbf7 */
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.column-header {
    background-color: #eef2f5; /* Clean, slightly darker gray-shadow version of white */
    color: #000000; /* Black header text for high-contrast legibility */
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    padding: 4px 0;
    border-radius: 4px;
    margin-bottom: 6px;
}

.column-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: auto;
}

.roster-item {
    padding: 6px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); /* Very subtle dark divider line */
    font-size: 0.75rem; 
    cursor: pointer;
    color: #000000; /* Changed from Shadow Blue to crisp black */
    font-weight: 600;
    text-align: center;
    transition: background-color 0.15s ease, padding-left 0.15s ease;
    flex-shrink: 0; 
    white-space: normal;
    word-break: break-word;
}

/* Update this block in style.css */
.roster-item:hover {
    background-color: #f0f4f8; /* Muted, crisp gray tint for a clean look on hover */
    padding-left: 6px;
}
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(20, 35, 23, 0.6); 
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}

.modal-content {
    /* Changed to rgba color to make the popup panel subtly translucent (96% solid) */
    background-color: rgba(253, 251, 247, 1); 
    padding: 25px; 
    border-radius: 10px;
    border: 2px solid #2d5a27; 
    max-width: 90%; 
    width: 380px; 
    text-align: center;
    color: #1b3322;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    backdrop-filter: blur(2px); /* Optional: Softly blurs the board text behind it for excellent legibility */
}

.standard-overlay {
    text-align: left;
}

.standard-overlay h3, .standard-overlay h4 {
    margin-top: 0;
    color: #2d5a27;
}

.modal-info-list {
    padding-left: 15px;
}

.modal-info-list li {
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    font-weight: bold;
    font-size: 0.7rem;
    border-radius: 3px;
    margin-right: 4px;
    text-transform: uppercase;
}

.modal-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.modal-buttons button { border: none; padding: 11px; font-size: 0.95rem; border-radius: 5px; cursor: pointer; font-weight: bold; }

.btn-share { background-color: #2d5a27; color: white; }
.btn-primary { background-color: #407a44; color: white; }
.btn-secondary { background-color: #e6eee6; color: #1b3322; border: 1px solid #a3c6a3; }

.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background-color: #407a44; color: white; padding: 12px 24px;
    border-radius: 20px; font-weight: bold; z-index: 2000; font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease;
}

.hidden { display: none !important; }

/* Update this block in style.css */
.placeholder-row .tile {
    background-color: #ffffff !important; /* Changed from #f4ebcf to pure white */
    opacity: 0.7;
    color: transparent !important;
    min-height: 42px;
}

@media (max-width: 768px) {
    .tile { font-size: 0.7rem; min-height: 46px; }
    .grid-header div { font-size: 0.68rem; }
    .logo-container { max-width: 75%; }
    header h2 { font-size: 1.3rem; }
    header h2 .flag-emoji { font-size: 1.8rem; }
    #info-trigger-btn { right: 8px; }
    .roster-columns-wrapper { gap: 6px; }
    .roster-item { font-size: 0.68rem; padding: 5px 2px; }
}

/* Style for already selected roster items */
.roster-item.disabled-roster-item {
    background-color: #d1d5db !important; /* Soft grey background */
    color: #9ca3af !important;            /* Faded grey text */
    text-decoration: line-through;         /* Strike through name */
    cursor: not-allowed;                   /* Changes mouse cursor */
    opacity: 0.6;
}

/* Animated Up/Down indicators for partial tiles */
.anim-arrow-up {
    display: inline-block;
    animation: bounceUp 0.8s infinite alternate;
    color: #ffffff;            /* Changes the text color to solid white */
    font-weight: 900;          /* Makes the arrow character extra thick */
    text-shadow: 0px 1px 2px rgba(0,0,0,0.4); /* Adds a subtle drop shadow so it pops cleanly against yellow */
}

.anim-arrow-down {
    display: inline-block;
    animation: bounceDown 0.8s infinite alternate;
    color: #ffffff;            /* Changes the text color to solid white */
    font-weight: 900;          /* Makes the arrow character extra thick */
    text-shadow: 0px 1px 2px rgba(0,0,0,0.4); /* Adds a subtle drop shadow so it pops cleanly against yellow */
}

@keyframes bounceUp {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); } /* Slightly increased distance for a cleaner movement */
}

@keyframes bounceDown {
    from { transform: translateY(0); }
    to { transform: translateY(4px); }  /* Slightly increased distance for a cleaner movement */
}

/* --- Help Box Staggered Fade-in Animations --- */

/* Base class applied to the elements we want to animate */
.help-fade-row {
    opacity: 0;
    animation: helpFadeInUp 0.4s ease forwards;
}

/* Define the specific transition delay for each item */
.help-delay-0 { animation-delay: 0.1s; }
.help-delay-1 { animation-delay: 0.7s; } /* Appears 0.6s after the header */
.help-delay-2 { animation-delay: 1.5s; } /* Appears 0.8s after row 1 */
.help-delay-3 { animation-delay: 2.3s; } /* Appears 0.8s after row 2 */
.help-delay-4 { animation-delay: 3.0s; } /* Appears 0.7s after row 3 */

@keyframes helpFadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}