/* ==========================================================================
   comino.club - Main Stylesheet (style.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL VARIABLES & BASE STYLES
   - Color themes, typography, and core page alignment.
   -------------------------------------------------------------------------- */
:root {
    --white: #ffffff;
    --blue-dark: #3670b3;
    --blue-med: #4192d9;
    --blue-light: #9de7f2;
    --blue-highlight: #b4edf7;
    --pink-dark: #ba41d9;
    --pink-med: #de73e5;
    --pink-light: #ed9df2;
    --grey-dark: #333333;
    --grey-med: #4a5568;
    --grey-light: #718096;
    --grey-highlight: #dae7f2;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--pink-light);
    color: var(--grey-dark);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base Form Control & Button Reset */
input,
button,
.btn-link {
    padding: 12px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid var(--grey-highlight);
    box-sizing: border-box;
}

button,
.btn-link {
    background-color: var(--blue-med);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

button:hover,
.btn-link:hover {
    opacity: 0.9;
}

button:disabled {
    background-color: var(--grey-highlight);
    cursor: not-allowed;
}

/* Footer Links Fix (Overrides default browser :visited purple color) */
footer a,
footer a:visited {
    color: inherit !important;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   2. HEADER BANNER & NAVIGATION PANEL
   - Top banner bar, menu overlays, and slide-out side drawer navigation.
   -------------------------------------------------------------------------- */
.banner {
    position: relative;
    width: 100%;
    background-color: var(--blue-med);
    color: white;
    padding: 12px 0;
    margin-bottom: 20px;
    min-height: 40px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.banner h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 1.5px;
}

/* Center the banner logo link wrapper */
.banner-logo-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-decoration: none;
}

.banner-logo {
    display: block;
    object-fit: contain;
    /* Forces sharp, unblurred edges for pixel art */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    /* Fallback support for older WebKit browsers */
}

/* Pink Brand Highlight for ".club" in Banner & Side Panel */
.banner h1 .brand-club,
.panel-club {
    color: var(--pink-light);
}

/* Banner Toggle Buttons */
.banner .menu-toggle {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
}

.banner .help-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
    line-height: 1;
}

/* Banner Right Action Group Container */
.banner .banner-actions {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    /* <--- Controls the gap between icons */
}

/* Banner Action Buttons */
.banner .help-toggle,
.banner .auth-toggle {
    position: static;
    transform: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
    line-height: 1;
    color: inherit;
}

.banner .help-toggle,
.banner .auth-toggle,
.banner .menu-toggle {
    /* Always force emojis/icons to bright white */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.banner .help-toggle:hover,
.banner .auth-toggle:hover,
.banner .menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
    line-height: 1;
}

#countdownClock {
    color: var(--pink-dark) !important;
}

/* Side Navigation Drawer */
.side-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    max-height: 100vh;
    /* 1. Limits height to the screen height */
    max-height: 100dvh;
    /* 2. Supports dynamic mobile/browser toolbar heights */
    overflow-y: auto;
    /* 3. Adds vertical scrolling when content overflows */
    -webkit-overflow-scrolling: touch;
    /* 4. Smooth scrolling for touch/iOS screens */
    background-color: var(--blue-dark);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    box-sizing: border-box;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    left: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.panel-title {
    margin: 0;
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

.menu-section-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 20px 0 10px 0;
    font-weight: bold;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-link {
    color: white;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s, transform 0.1s;
}

.menu-link:hover {
    background-color: var(--pink-dark);
    transform: translateX(5px);
}

button.menu-link {
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
}

.menu-overlay.show {
    display: block;
}

/* Base Toggle Button (Light Mode) */
.theme-toggle-btn {
    background-color: var(--blue-light);
    color: var(--grey-dark);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

/* Hover state */
.theme-toggle-btn:hover {
    background-color: var(--blue-highlight);
}

/* Highlight active link based on the body's data-page attribute */
body[data-page="home"] [data-link="home"],
body[data-page="country-chaser"] [data-link="country-chaser"],
body[data-page="passport-pursuit"] [data-link="passport-pursuit"],
body[data-page="data-diver"] [data-link="data-diver"],
body[data-page="mystats"] [data-link="mystats"],
body[data-page="about"] [data-link="about"],
body[data-page="support"] [data-link="support"] {
    background-color: var(--pink-dark);
}

/* --------------------------------------------------------------------------
   3. GAME CONTAINER & PLAY AREA
   - Primary game card container, header displays, clue boxes, and search inputs.
   -------------------------------------------------------------------------- */
.container {
    max-width: 500px;
    width: 100%;
    background: var(--blue-light);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--white);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.date-display {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--grey-dark);
    background: rgba(255, 255, 255, 0.4);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Clue Display Zones */
.active-clue-zone,
.history-clue-zone {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.history-clue-zone {
    margin-top: 15px;
    border-top: 2px dashed rgba(255, 255, 255, 0.5);
    padding-top: 15px;
}

.clue-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.clue-group h3 {
    margin: 10px 0 8px 0;
    color: var(--grey-med);
    font-size: 1.1rem;
}

.clue-box {
    background: var(--white);
    border: 1px solid var(--grey-highlight);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
}

.clue-box img {
    max-height: 150px;
    max-width: 100%;
    object-fit: contain;
}

/* Styling for the clue image key/legend */
.clue-image-key {
    display: block;
    margin-top: 8px;
    /* Adds top margin to separate key from image above */
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: var(--grey-med);
    opacity: 0.85;
}

/* Restrain clue image wrapper and image sizes */
.clue-image-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    /* Stacks image on top, label below */
    justify-content: center;
    align-items: center;
    /* Keeps both centered */
    overflow: hidden;
    margin: 10px 0;
}

.clue-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.image-credits {
    font-size: 0.85rem;
    opacity: 0.85;
}


/* Game Controls & Predictive Search */
.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    width: 100%;
}

.controls #countryInput,
.controls #submitBtn,
.controls #hintBtn {
    width: 100%;
    display: block;
}

.hint-btn {
    background-color: var(--blue-med);
}

.dropdown-container {
    position: relative;
    width: 100%;
    display: flex;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--grey-highlight);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    color: var(--grey-dark);
    transition: background-color 0.1s ease;
}

.dropdown-item:hover {
    background-color: var(--blue-med);
    color: white;
}

.result-message {
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    display: none;
    margin-bottom: 12px;
}

.card-action-zone {
    display: none;
    width: 100%;
    margin-top: 10px;
}


/* --------------------------------------------------------------------------
   4. MODALS (ENDGAME & HELP GUIDES)
   - Pop-up cards for game results, share buttons, and rules guides.
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Shown state (triggered by auth.js) */
.modal-overlay.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.modal-card {
    position: relative;
    background: white;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-card {
    transform: scale(1);
}

.modal-close-corner {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--grey-light);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-corner:hover {
    color: var(--grey-dark);
}

.modal-status-box {
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 20px;
    margin-top: 10px;
}

/* Modal Action Button Variants */
.modal-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.play-more-btn {
    background-color: var(--pink-med);
}

.back-game-btn {
    background-color: var(--grey-light);
}

.share-btn {
    background-color: var(--grey-dark);
}

.view-result-btn {
    background-color: var(--blue-med);
}


/* --------------------------------------------------------------------------
   5. STATISTICS COMPONENTS & DISTRIBUTION GRAPHS
   - Grid cards, numerical metrics, distribution bars, and tables (`mystats.html`).
   -------------------------------------------------------------------------- */
.stats-summary {
    background: var(--grey-highlight);
    border: 1px solid var(--white);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.stats-summary h4 {
    margin: 0 0 12px 0;
    text-align: center;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--grey-highlight);
    padding-bottom: 6px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    background-color: white;
}

.stats-row.streak-highlight {
    border-top: 1px dashed var(--grey-highlight);
    margin-top: 10px;
    padding-top: 8px;
    font-weight: bold;
}

.stats-val {
    font-weight: bold;
    color: var(--blue-med);
}

/* Stats Mini-Grids */
.summary-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.summary-4-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}

.summary-card {
    background-color: var(--blue-light);
    padding: 8px 4px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary-card h4 {
    margin: 0 0 4px 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.6);
    font-weight: bold;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--p);
}

/* Pop-Up Modal 4-Grid Helper */
.modal-4-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.modal-4-grid .summary-card {
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.modal-4-grid .summary-card h4 {
    font-size: 0.65rem;
    margin-bottom: 2px;
    text-align: center;
}

.modal-4-grid .summary-value {
    font-size: 1rem;
    text-align: center;
}

.summary-card.streak-card {
    border: 2px dashed var(--pink-dark);
    background-color: rgba(0, 0, 0, 0.1);
}

.summary-card.streak-card .summary-value {
    color: var(--pink-dark);
}

/* Horizontal Score Distribution Graph */
.distribution-wrapper {
    margin-top: 20px;
    text-align: left;
}

.dist-title {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--grey-dark);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.graph-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

.graph-label {
    width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
    color: var(--grey-dark);
}

.graph-container {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.graph-bar {
    background-color: var(--blue-med);
    height: 100%;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.1, 1, 0.1, 1);
    border-radius: 4px;
}

.graph-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--grey-dark);
    z-index: 2;
}

/* Detailed Stats Data Tables */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    margin-bottom: 5px;
}

.stats-table .stats-row td {
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

.stats-table .stats-row td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    text-align: left;
}

.stats-table .stats-row td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: right;
    color: var(--blue-med);
    font-weight: 900;
}


/* --------------------------------------------------------------------------
   6. HOMEPAGE COMPONENTS (index.html)
   - Game card grids, badges, skill tags, and images.
   -------------------------------------------------------------------------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.game-card {
    background-color: var(--blue-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--grey-dark);
    border: 3px solid transparent;
    transition: transform 0.2s ease;
    box-shadow: 0.2s ease;
    background-color: 0.2s ease;
}

.game-card.active:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: var(--blue-highlight);
}

.game-card.coming-soon {
    opacity: 0.85;
    background-color: var(--white);
    cursor: not-allowed;
}

.game-card.coming-soon .game-image-wrapper {
    background-color: var(--white);
    color: var(--grey-dark);
}

.game-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    background-color: var(--blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-image-wrapper img,
.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.game-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    /* <--- Forces card titles, descriptions & tags to left align */
}

.game-info ul {
    text-align: left;
    padding-left: 20px;
    /* <--- Gives bullet lists clean spacing */
    margin: 8px 0;
}

.game-title {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    font-weight: bold;
}

.game-description,
.game-description-list {
    font-size: 0.88rem;
    opacity: 0.85;
    margin: 8px 0 4px 0;
    line-height: 1.35;
}

.skills-tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.skill-tag {
    background-color: rgba(44, 124, 181, 0.12);
    color: var(--blue-med);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.game-status {
    align-self: flex-start;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-play {
    background-color: var(--pink-dark);
    color: white;
}

.status-soon {
    background-color: var(--grey-highlight);
    color: var(--grey-med);
}

.lock-icon {
    font-size: 3rem;
    opacity: 0.6;
}


/* --------------------------------------------------------------------------
   7. CONTENT PAGES (about.html, support.html, mystats.html)
   - Layout containers, story sections, logo frames, and Ko-fi buttons.
   -------------------------------------------------------------------------- */
.about-section,
.support-section {
    background-color: rgba(255, 255, 255, 0.4);
    border: 3px solid white;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.game-section {
    background-color: rgba(255, 255, 255, 0.4);
    border: 3px solid white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-align: left;
}

/* ADD THIS RULE HERE: */
.game-section+.game-section {
    margin-top: 24px;
}

.section-header,
.section-subheader {
    text-align: center;
    /* <--- Keeps main section headers centered */
}

.section-header {
    margin: 0 0 5px 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--pink-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Header Row with Side Tagline */
.section-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    /* Allows text to drop below on small mobile screens */
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.6);
    padding-bottom: 10px;
}

/* Left-align the section header */
.section-header-row .section-header {
    text-align: left;
    margin: 0;
}

/* Side Tagline Styling */
.section-tagline {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blue-med);
    opacity: 0.9;
    text-align: right;
}

.section-subheader {
    margin: 0 0 30px 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--blue-med);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.story-content,
.support-content {
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: left;
    color: var(--grey-dark);
    background-color: var(--blue-light);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.story-content a,
.about-section a,
.support-content a {
    color: var(--pink-dark);
    font-weight: bold;
    text-decoration: underline;
}

.highlight-text {
    color: var(--pink-dark);
    font-weight: bold;
}

.logo-frame {
    width: 150px;
    height: 150px;
    background-color: white;
    border: 4px solid var(--blue-med);
    border-radius: 24px;
    margin: 0 auto 25px auto;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.game-stats-box {
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.game-title-header {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--grey-dark);
}

.footer-actions {
    text-align: center;
    margin-top: 20px;
}

.reset-btn {
    background: none;
    border: 2px dashed rgba(255, 255, 255, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.reset-btn:hover {
    background-color: var(--pink-med);
    border-color: var(--blue-highlight);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Support Page Call-To-Action Button */
.kofi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--pink-light);
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid white;
}

.kofi-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    filter: brightness(0.9);
}


/* --------------------------------------------------------------------------
   8. MEDIA QUERIES & RESPONSIVE LAYOUT OVERRIDES
   - Container sizing adjustments for mobile and desktop screens.
   -------------------------------------------------------------------------- */
.wide-container {
    max-width: 1100px !important;
}

@media (max-width: 1100px) {
    .wide-container {
        max-width: 95% !important;
    }
}


/* --------------------------------------------------------------------------
   9. ELEMENTAL EXPERT
   - element card rendering options
   -------------------------------------------------------------------------- */

/* --- Element Card Styling --- */
.element-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 15px auto;
}

.element-card {
    width: 150px;
    height: 190px;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.element-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Card Header (Top-Left Atomic Number) */
.element-card .card-header {
    display: flex;
    justify-content: flex-start;
}

.element-card .atomic-number {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.85;
}

/* Card Body (Center Symbol) */
.element-card .card-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.element-card .symbol {
    font-size: 3.2rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    letter-spacing: -1px;
}

/* Card Footer (Bottom Atomic Weight) */
.element-card .card-footer {
    text-align: center;
}

.element-card .atomic-weight {
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0.8;
}

/* Below-Card Metadata Badges */
.element-card-meta {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.meta-badge {
    background: var(--white);
    color: var(--grey-med);
    border: 1px solid var(--grey-highlight);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* --- Block Theme Colors --- */
/* s-block: Red / Coral */
.element-card.block-s-block,
.element-card.block-s {
    background-color: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

/* p-block: Orange / Gold */
.element-card.block-p-block,
.element-card.block-p {
    background-color: #fff7ed;
    border-color: #fb923c;
    color: #9a3412;
}

/* d-block: Transition Metals / Blue-Teal */
.element-card.block-d-block,
.element-card.block-d {
    background-color: #f0fdf4;
    border-color: #4ade80;
    color: #166534;
}

/* f-block: Lanthanides & Actinides / Purple */
.element-card.block-f-block,
.element-card.block-f {
    background-color: #faf5ff;
    border-color: #c084fc;
    color: #6b21a8;
}

/* --- Elemental Expert Container Overrides --- */

/* Allow active clue box to auto-expand for element card & images */
.active-clue-zone .clue-box {
    min-height: 260px;
    height: auto;
    overflow: visible;
}

/* Ensure images within elemental clues don't collapse */
.active-clue-zone .clue-box img {
    max-height: 220px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Default electron color */
.bohr-electron {
    fill: var(--blue-med);
}