
:root {
    --bg-color: #f4f7f6;
    --main-purple: #6a11cb;
    --light-purple: #ede7f6;
    --deep-purple: #4a0072;
    --text-color: #333;
    --white-color: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background: linear-gradient(120deg, #f3e5f5, #e1f5fe);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: var(--main-purple);
    font-weight: bold;
    font-size: 2.5rem;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 20px;
    width: 100%;
    height: 85vh; /* Set a fixed height for the container */
}

.column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Common Box Styles - MODIFIED */
.status-box, .score-box, .bingo-board, .letter-box, .mission-list-box {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    display: flex; /* Enable flexbox for internal content management */
    flex-direction: column; /* Stack content vertically */
    flex-grow: 1; /* Allow boxes to fill the available space in the column */
    min-height: 0; /* Prevents flex items from overflowing their container */
}

h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--main-purple);
    border-bottom: 2px solid var(--light-purple);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}

/* NEW RULE: Make lists within status boxes scrollable */
.status-box ul {
    overflow-y: auto; /* Add vertical scroll if content overflows */
    flex-grow: 1; /* Allow list to fill space */
}

li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    align-items: center; /* Align items vertically */
}

/* Column 1: Status & Buttons */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn {
    display: block;
    text-align: center;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: var(--main-purple);
    color: var(--white-color);
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--deep-purple);
}

/* Column 2: Score & Bingo */
.score-box p {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: var(--main-purple);
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    aspect-ratio: 1 / 1; /* Maintain square shape */
}

.bingo-card {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--light-purple);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    padding: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.bingo-card.completed {
    background-color: var(--deep-purple);
    color: var(--white-color);
    font-weight: bold;
}

/* Column 3: Letters & Mission List */
.letter-box p {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: var(--main-purple);
}

/* MODIFIED */
.mission-list-box ul {
    column-count: 2;
    column-gap: 20px;
    overflow-y: auto; /* Add vertical scroll if content overflows */
    flex-grow: 1; /* Allow the list to expand within the box */
}

.mission-list-box li {
    font-size: 0.9rem;
    padding: 8px 0; /* Increased padding */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start; /* Align to the start */
}

.mission-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    margin-top: 4px; /* Space between name and bar */
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background-color: var(--light-purple);
    border-radius: 6px;
    overflow: hidden;
    margin-right: 8px; /* Space between bar and text */
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--main-purple), var(--deep-purple));
    width: 0%; /* Default width */
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.mission-achievement-text {
    font-weight: bold;
    color: var(--deep-purple);
    min-width: 30px; /* Ensure space for text */
}
