/* styles.css */

/* License: Public Domain
   Font by: Alex Maracinaru
   https://www.fontspace.com/arowit-font-f30292 */

/* ======================== */
/* ====== VARIABLES ======== */
/* ======================== */
:root {
  --content-width: 850px;       /* Increased from 600px */
  --form-width: 850px;          /* Increased from 320px to widen profile & edit blocks */
  --form-width-sm: 360px;       /* Added for small forms (Login, Register, Reset) */
  
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-laptop: 1024px;
  --breakpoint-desktop: 1280px;
  --breakpoint-wide: 1440px;
}

/* ======================== */
/* ====== RESET & BASE ===== */
/* ======================== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* -------------------- Base -------------------- */
html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  
  font-family: "Coalabeer-5Vlv", sans-serif;
  font-size: 1.2rem;
  scrollbar-gutter: stable;

  /* --- THE BACKGROUND FIX --- */
  background-color: #ddd;
  background-image: url(../assets/bg.webp);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* Locks the image so it doesn't stretch/zoom on long pages */
}

.user-status-area, .admin-section {
    margin-top: 20px;
}

.pro-badge {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    font-size: 1rem;
}

.section-divider {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed rgba(0,0,0,0.1);
    text-align: center;
}


/* ======================== */
/* ====== TYPOGRAPHY ======= */
/* ======================== */
@font-face {
  font-family: "Coalabeer-5Vlv";
  src: url("../fonts/Coalabeer-5Vlv.eot");
  src: url("../fonts/Coalabeer-5Vlv.eot?#iefix") format("embedded-opentype"),
       url("../fonts/Coalabeer-5Vlv.woff2") format("woff2"),
       url("../fonts/Coalabeer-5Vlv.woff") format("woff"),
       url("../fonts/Coalabeer-5Vlv.ttf") format("truetype"),
       url("../fonts/Coalabeer-5Vlv.svg#Coalabeer-5Vlv") format("svg");
  font-weight: normal;
  font-style: normal;
}

h1, h2, h3 {
  color: #072239;
  /* Reduced top margin to 0 to pull items up */
  margin: 0 0 10px 0; 
  text-align: center;
  font-size: 1.8rem;
}

p {
  margin: 10px;
  font-size: 1.2rem;
  line-height: 1.5rem;
  text-align: center;
}

label {
  text-align: center;
}


/* ======================== */
/* ======= LAYOUT ========= */
/* ======================== */
/* Ensure main takes remaining space and centers content */
main {
  display: flex;
  flex-direction: column; /* Stack sections vertically */
  width: 100%;
  flex: 1; /* Pushes footer to bottom */
  margin-bottom: 10px;
}

.main-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* This is the "magic" that centers the whole block */
    padding: 10px;
    box-sizing: border-box;
    /* IMPORTANT: Add this to ensure everything inside this container centers */
    display: flex;
    flex-direction: column;
    align-items: center; 
}


/* Section inside main */
section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* Specific auth-section styles */
#auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin: 0;
  width: 100%;
}

/* Header layout */
header {
  width: 100%;
  margin: 0 auto;
  padding-top: 0; /* Ensure no top padding */
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* Change from center to flex-start */
  width: 100%;
  padding-top: 0;
}

#logo {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  margin: 0 auto; /* Keep centered, but remove top margin */
  margin-top: 0;  /* Explicitly remove top margin */
}

/* Center wrapper utility */
.center-wrapper {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Remove all spacing from header containers */
.site-header, .header-top, .logo-container {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0; /* Prevents tiny gaps caused by inline-block spacing */
}

/* Force the logo to have no margins */
#logo {
    display: block; /* Removes baseline gap */
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ======================== */
/* ====== FORMS & AUTH ==== */
/* ======================== */

.auth-forms {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: auto; /* adjust as needed */
  align-items: center;
}

.form-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--form-width);
  text-align: center;
  margin: 0 auto;
}

.form-block h3 {
  margin-bottom: 1rem;
}

.form-block form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

input {
  width: 100%;
  max-width: 250px;
  padding: 0.5rem;
  box-sizing: border-box;
}

/* =================== */
/* Dashboard Layout    */
/* =================== */

/* Center the main dashboard container itself */
main.dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;    /* Horizontal centering for children */
    justify-content: flex-start;
    width: 100%;
    margin: 0 auto;         /* Standard block centering */
}

/* Ensure the summary box stays centered and centers its children */
.collection-summary {
    display: flex;
    flex-direction: column; /* Dashboard default */
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 10px auto !important; /* Forces horizontal centering */
    text-align: center;
}

.collection-summary ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    width: fit-content;
    min-width: 280px;
}

/* Style for each stats group */
.collection-summary li {
    display: block;
    text-align: center;     /* Ensures the text inside the bubble is centered */
    margin: 0.5rem 0;
}

/* Ensure the top themes list behaves exactly the same */
#top-themes-list {
    text-align: center;
}

/* Theme progress section */
.themeProgress {
    width: 100%;
    max-width: 400px;         /* same as ul above */
    margin-top: 0.5rem;
    padding-left: 0;          /* remove default indent */
}

.themeProgress li {
    background-color: #f3f3f3;
    border-left: 4px solid #7ec9e4;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    margin: 0.3rem 0;
}

.dashboard-wrapper {
    width: 100%;
    max-width: 1200px; /* Or your preferred max width */
    margin: 10px auto;    /* This centers the wrapper horizontally */
    flex-grow: 1;
    font-size: 1.2rem;
}

/* Add this to target the lists inside the wrapper */
.dashboard-wrapper ul {
    list-style-type: none; /* Removes the dots */
    padding: 0;            /* Removes default left indentation */
    margin: 10px auto;             /* Removes default vertical spacing */
    text-align: center;
}

/* =============================== */
/* ====== WELCOME SECTION ======== */
/* =============================== */

.welcome-section {
    margin-top: 10px;    /* Space above the greeting */
    margin-bottom: 30px; /* Space below the greeting, before the buttons */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Optional: Removes the default margin on the h2 so our custom spacing is perfectly accurate */
.welcome-section h2 {
    margin: 0;
}

/* Apply this globally to all your page headings to keep them uniform */
.page-controls {
    margin-top: 10px;
    margin-bottom: 10px; /* Use this to create that space you wanted */
    text-align: center;
}

.page-controls h2 {
    margin: 0; /* Keep the title clean */
}

/* ======================================== */
/* ======= THEME DISPLAY CONTAINERS ======= */
/* ======================================== */
#themes-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin: 0 auto;
  margin-top: 0;

}

#themes-container a.cta {
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px; /* spacing between text and SVG */
}

#themes-container label {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

#themes-container input[type="checkbox"] {
  margin-right: 10px;
}

a {
  text-decoration: none;
  cursor: pointer;
  color: black;
}

a:visited {
  color: white;
}

a:hover, a:focus, a:active {
  color: #072239;
}

#loading-message {
  font-weight: bold;
  text-align: center;
  margin: 1em;
  color: #444;
}

/* Style specifically for the theme titles */
.theme-title {
  color: #3bb3e0 !important; /* Force this color regardless of global link rules */
  font-weight: bold;
  text-decoration: none;
}

.theme-title:visited {
  color: #3bb3e0 !important; /* Forces it to stay blue even after clicking */
}

.theme-title:hover {
  color: #072239 !important; /* Your signature dark blue hover */
}

/* Wrapper for each letter section */
.theme-group {
    display: flex;
    flex-direction: row; /* Forces items to sit side-by-side */
    align-items: flex-start; /* Aligns the letter and buttons at the top */
    justify-content: flex-start; 
    gap: 20px; /* Creates a strict 20px gap between the letter and the buttons */
    margin-bottom: 2rem;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px; /* Adds a safety buffer so it doesn't touch the edge of the screen */
    box-sizing: border-box; /* Ensures padding doesn't break the 100% width */
}

/* The floating letter on the left side */
.theme-letter {
    position: static; /* Removes absolute positioning so it takes up real space */
    font-size: 3rem;
    color: #ff00ff;
    width: 50px; /* Gives the letter a dedicated, fixed width */
    flex-shrink: 0; /* Prevents the letter column from squishing on tiny screens */
    text-align: center;
    line-height: 1; /* Helps keep the top of the letter aligned with the first button */
}

/* The container holding the stack of theme buttons */
.theme-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns the buttons cleanly to the left next to the letter */
    gap: 15px;
    width: 100%; /* Allows the buttons to take up the remaining space */
}

/* =============================== */
/*==========DO NOT TOUCH ==========*/
/* =============================== */
/* =============================== */
/* =========FLOW BUTTONS========== */
/* =============================== */
/* From Uiverse.io by alexmaracinaru */ 
.cta {
  position: relative;
  margin: auto;
  padding: 5px 5px;
  transition: all 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;

}

.cta:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  border-radius: 50px;
  background: #b1dae7;
  width: 50px;
  height: 50px;
  transition: all 0.3s ease;
}

.cta span {
  position: relative;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: #234567;
}

.cta svg {
  position: relative;
  top: 0;
  margin-left: 10px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: #234567;
  stroke-width: 2;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.cta:hover:before {
  width: 100%;
  background: #b1dae7;
}

.cta:hover svg {
  transform: translateX(0);
}

.cta:active {
  transform: scale(0.95);
}


/* =============================== */
/*==========DO NOT TOUCH ==========*/
/* =============================== */
/* =============================== */
/* ========== BUTTONS ============ */
/* =============================== */
.button {
  background-color: #3bb3e0;
  font-family: "Coalabeer-5Vlv", sans-serif;
  font-size: 1.25rem;
  text-decoration: none;
  color: #fff;
  box-shadow: inset 0px 1px 0px #7fd2f1, 0px 6px 0px #156785;
  border-radius: 10px;
  display: inline-block;
  width: 140px;
  height: 36px;
  line-height: 36px;
  border: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.button:active {
  top: 7px;
  box-shadow: inset 0px 1px 0px #7fd2f1, inset 0px -1px 0px #156785;
  color: #072239;
  background: #3bb3e0;
}

.button::before {
  background-color: #072239;
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  left: -2px;
  top: 5px;
  z-index: -1;
  border-radius: 10px;
  box-shadow: 0px 1px 0px #fff;
}

.button:active::before {
  top: -2px;
}

.button:hover {
  background-color: #34a5cf; /* slightly darker shade */
  color: #072239;           /* match the link hover */
}

/* Specific Gold/Yellow style for the Best Value button */
.button-gold {
  background-color: #ffc107;
  color: #000;
  /* Top light highlight and bottom 3D shadow */
  box-shadow: inset 0px 1px 0px #ffe082, 0px 6px 0px #b28905;
}

.button-gold:hover {
  background-color: #ffca28; /* Slightly brighter on hover */
  color: #000;
}

.button-gold:active {
  background-color: #ffc107;
  /* Pressed state shadow */
  box-shadow: inset 0px 1px 0px #ffe082, inset 0px -1px 0px #b28905;
}

/* The dark background/outline for the gold button */
.button-gold::before {
  background-color: #333; /* Darker outline to make the gold pop */
}

/* This targets the div containing the buttons inside page-controls */
.page-controls > .button-row {
  margin-top: 10px;    /* Space between the H2 title and buttons */
  margin-bottom: 10px; /* Space between the buttons and the themes list */
  display: flex;       /* Optional: allows for easy spacing between buttons */
  gap: 15px;           /* Adds a consistent 15px gap between the two buttons */
  justify-content: center; /* Keeps buttons centered if that's your layout */
  flex-wrap: wrap;     /* Ensures they stack nicely on mobile screens */
}

/* Specific Green style for the Whatsapp button */
.button-green {
  background-color: #25D366;
  color: #fff;
  /* Top light highlight (Vibrant Mint) and bottom 3D shadow (Dark Teal) */
  box-shadow: inset 0px 1px 0px #70f7a2, 0px 6px 0px #075E54;
}

.button-green:hover {
  background-color: #3de07a; /* Made this slightly brighter so it actually reacts when hovered */
  color: #000;
}

.button-green:active {
  background-color: #25D366;
  /* FIXED: Replaced the leftover gold colors with your correct green and teal shadows */
  box-shadow: inset 0px 1px 0px #70f7a2, inset 0px -1px 0px #075E54;
}

/* The dark background/outline for the green button */
.button-green::before {
  background-color: #072239; /* Matched to your site's dark blue outline instead of #333 */
}

/* ======================== */
/* ======== INPUT BAR ===== */
/* ======================== */
.input {
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  margin-right: 0.5rem;
}


/* ======================== */
/* ======== NAVIGATION ===== */
/* ======================== */
nav {
  width: 100%;
  max-width: 800px; /* Increased from 600px to comfortably fit 4 buttons */
  margin: 0 auto;
}

.dashboard-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  width: 100%;
  margin-bottom: 30px;
}

/* Ensure all buttons stretch to fill their grid cells identically */
.dashboard-nav-grid .button {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  height: 100%;
}

.dashboard-nav-grid .start-here-wrapper {
  width: 100%;
  margin: 0;
}

/* Tablet & Mobile Breakpoint: Shrink to 2 columns */
@media (max-width: 768px) {
  .dashboard-nav-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================== */
/* ===== START HERE POINTER ====== */
/* =============================== */

/* Keeps the button and the pointer bound together in the grid */
.start-here-wrapper {
    position: relative;
    display: inline-block;
}

/* The styling for the floating text box */
.start-here-pointer {
    position: absolute;
    top: -40px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #F504CC; 
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.2rem;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 100;
    pointer-events: none; /* Ensures users can still click the button underneath */
    
    /* Triggers the float animation */
    animation: float-bounce 1.5s infinite ease-in-out;
}

/* The little triangle pointing down at the button */
.start-here-pointer::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #F504CC transparent transparent transparent;
}

/* The up-and-down floating animation */
@keyframes float-bounce {
    0%, 100% {
        top: -40px;
    }
    50% {
        top: -30px; /* Moves it down 10px */
    }
}

/* =============================== */
/* ===== FUN BEGIN POINTER ======= */
/* =============================== */

/* 1. The row container aligns its children */


/* 2. Make the wrapper act like a flexible container that mimics a button */
.fun-begin-wrapper {
    position: relative;
    display: inline-block;
}

/* 3. Ensure the anchor inside the wrapper looks exactly like the one outside */
.fun-begin-wrapper .button {
    margin: 0; /* Remove any accidental margins */
}

.fun-begin-pointer {
    position: absolute;
    top: 0; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #F504CC; 
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.2rem;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 100;
    pointer-events: none; 
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    animation: float-bounce 1.5s infinite ease-in-out;
}

.fun-begin-pointer.show-pointer {
    opacity: 1;
    visibility: visible;
}

.fun-begin-pointer::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #F504CC transparent transparent transparent;
}

/* =============================== */
/* ===== Theme Instructions ======= */
/* =============================== */

.theme-instruction-wrapper {
    display: flex;
    justify-content: center;
    margin: 15px 0 25px 0;
}

.theme-pointer {
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.2rem;
    color: #ff00ff; /* Neon Pink */
    padding: 10px 20px;
    border-radius: 20px;
    border: 2px solid #ff00ff;
    box-shadow: 0 4px 0 #000;
    animation: pulse 2s infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ======================== */
/* ======== SORTING ===== */
/* ======================== */
.sort-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.sort-label {
    font-size: 1.2rem;
}

.sort-group {
    display: flex;
    background: #e0e0e0; /* Light grey background for the group */
    border-radius: 25px;
    padding: 4px;
}

.sort-btn {
    text-decoration: none;
    color: #000000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    font-family: inherit;    /* Forces it to use your custom Coalabeer font */
    border: none;            /* Removes default browser button borders */
    background: transparent; /* Matches the old link background */
    cursor: pointer;         /* Gives you the finger-pointer icon on hover */
}

a.sort-btn {
    color: #000000;
}

.sort-btn:hover {
    color: #555;
}

/* This styles the currently selected sorting method */
.sort-btn.active {
    background-color: #3bb3e0; /* Matches your main theme blue */
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* ======================================== */
/* =======THEME SELECTION CONTAINERS ====== */
/* ======================================== */
/* Container that wraps all themes */
#theme-selection-form {
  display: flex;
  flex-direction: column;
  align-items: center; /* center children horizontally */
  gap: 0.5px;
  padding: 5px;
}

/* Each individual theme row */
.theme-container {
  display: flex;
  justify-content: center; /* center horizontally */
}

/* Make label contents horizontal */
.theme-container label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Style checkbox */
.theme-container input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* Container holding search and checkboxes */
.filter-row-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 1000px; /* Adjust max width as needed */
  margin: 0 auto;
  padding: 10px;
}

/* Search input wrapper */
.filter-search-container {
  width: 100%;
  max-width: 500px;
}

.filter-search-container input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Checkbox alignment container */
.checkbox-group {
  display: flex;
  flex-wrap: wrap; /* Allows stacking on mobile */
  justify-content: center;
  align-items: center;
  gap: 1rem 2rem; /* Vertical gap, Horizontal gap */
  width: 100%;
}

/* Individual label styling */
.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem; /* Slightly smaller for better mobile fit */
  cursor: pointer;
  white-space: normal; /* Permits natural wrapping if text is long */
}

.checkbox-group input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0; /* Prevents checkbox from shrinking on narrow screens */
  cursor: pointer;
}

/* Desktop optimization */
@media (min-width: 768px) {
  .checkbox-group label {
    font-size: 1.05rem;
  }
}

/* ======================== */
/* ======= PAGINATION ====== */
/* ======================== */

.pagination {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  font-family: "Coalabeer-5Vlv", sans-serif;
  flex-wrap: wrap;
}

.pagination button {
  font-family: inherit;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #ccc;
  background-color: #f5f5f5;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination .active {
  background-color: #3bb3e0;
  color: white;
}

.pagination button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
  background-color: #d6d6d6;
}

.pagination button:focus {
  outline: 2px solid #3bb3e0;
  outline-offset: 2px;
}

.pagination .ellipsis {
  padding: 0 6px;
  user-select: none;
  pointer-events: none;
}

/* ======================== */
/* ====== TROPHY ROOM ====== */
/* ======================== */

/* 1. Default (Small Screens / Mobile): 1 Column, stacked underneath each other */
.trophy-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
    padding: 10px;
}

.trophy-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 15px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trophy-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.trophy-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0px 4px 6px rgba(245, 4, 204, 0.3)); 
}

.trophy-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #072239;
    margin-bottom: 8px;
    line-height: 1.2;
}

.trophy-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.3;
}

.empty-trophies {
    grid-column: 1 / -1;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 40px 20px;
    border-radius: 12px;
    border: 1px dashed #aaa;
}

/* --- Trophy Card Equip Enhancements --- */
.trophy-card {
    /* Ensures the equip button always pushes to the bottom of the card */
    justify-content: space-between; 
}

/* Fix alignment for Trophy Room buttons */
.trophy-action {
    display: flex;
    justify-content: center;
    width: 100%;
}

.trophy-action form {
    width: 100% !important; /* Overrides the mobile 90% global form width */
    display: flex;
    justify-content: center;
    margin: 0 !important;
}

/* Highlight the card they are currently wearing */
.trophy-card.is-equipped {
    border: 2px solid #3bb3e0;
    box-shadow: 0 0 15px rgba(59, 179, 224, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

/* ======================================= */
/* ====== TROPHY ROOM RESPONSIVENESS ===== */
/* ======================================= */

/* 2. Tablet / Medium Screens: 2 Columns */
@media (min-width: 500px) {
    .trophy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* 3. Wide Screens (Laptops/Desktops): 3 Columns */
@media (min-width: 800px) {
    .trophy-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Make the images slightly larger on big screens to fill the space */
    .trophy-img {
        width: 100px;
        height: 100px;
    }
}

/* ======================== */
/* ======== FOOTER ======== */
/* ======================== */

footer {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1rem; /* Combined your vertical and horizontal padding preferences */
    display: flex;
    justify-content: center;
    align-items: center;
    clear: both;
    text-align: center;
}

.footer-inner {
  width: 100%;
  max-width: var(--content-width); /* Keeps text from getting too wide */
  text-align: center;              /* Centers the text inside */
  margin: 0 auto;
}

.footer-inner a {
  color: #156785;
  text-decoration: none;
}

.footer-inner a:hover {
  color: #7ec9e4;
}

/* ======================== */
/* ===== STATS TABLE ====== */
/* ======================== */

.stats-table {
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats-table th {
    background-color: #3bb3e0;
    color: white;
    padding: 8px 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #156785;
}

.stats-table td {
    padding: 8px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.stats-table td:first-child {
    word-wrap: break-word;
    font-weight: bold;
}

.stats-table th:nth-child(2),
.stats-table th:nth-child(3),
.stats-table td:nth-child(2),
.stats-table td:nth-child(3) {
    text-align: center;
    width: 40px;
}


/* ======================== */
/* === COLLECTION SUMMARY = */
/* ======================== */

.collection-summary {
    text-align: center;
    margin: 30px 0 20px 0; /* Reduced bottom spacing */
    font-size: 1.2rem;
}

.collection-summary .summary-item {
    margin-bottom: 12px;
    font-weight: 600;
    color: #072239;
}

.value-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
}

.val-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.val-box small {
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.5px;
}

.val-box span {
    font-size: 1rem;
    font-weight: bold;
    color: #072239;
}

/* ======================== */
/* ===== TOP FIGURES ====== */
/* ======================== */

.top-figs-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    max-width: 1000px; 
    margin: 0 auto;    
    box-sizing: border-box;
    
    /* Default for smaller screens (Mobile/Tablets): 
       Lets it naturally flow 2 or 3 wide */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* Force exactly 4 columns on screens wider than 800px (Desktop) */
@media (min-width: 800px) {
    .top-figs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* This specifically prevents the card itself from growing too large */
.fig-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    
    /* Add this: prevents individual cards from growing too wide */
    max-width: 250px; 
    /* Ensures if there is only one, it stays centered in its grid cell */
    margin: 0 auto; 
    width: 100%;
}

.fig-card img {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
}

.fig-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.fig-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    /* FIX: Ensure long strings don't stretch the grid */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.fig-val {
    margin-top: auto;
    font-weight: bold;
    color: #007bff;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

/* ======================== */
/* ===== Avatar Picker ===== */
/* ======================== */

.avatar-grid {
    display: grid;
    /* This forces 3 equal columns */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    margin: 20px 0;
    /* Optional: Limit the width so they don't get too large on big screens */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.avatar-option {
    text-align: center;
    cursor: pointer;
}

.avatar-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avatar-option label {
    display: block;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.avatar-option img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid transparent;
    background: #f8f9fa;
    object-fit: cover;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.avatar-option input:checked + label {
    background: #e6f4ff;
    box-shadow: 0 0 0 3px #a5d8ff;
}

.avatar-option input:checked + label img {
    border-color: #1e90ff;
    transform: scale(1.08);
}

.avatar-option label:hover img {
    transform: scale(1.12);
}

.avatar-option label:active img {
    transform: scale(1.15);
}

.avatar-name {
    margin-top: 8px;
    font-size: 1rem;
    color: #444;
    font-weight: 500;
}

.current-preview {
    text-align: center;
    margin: 30px 0 40px;
}

.current-preview img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid #1e90ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    
    /* This prevents the squishing */
    object-fit: cover; 
    object-position: center; /* Ensures the middle of the image is shown */
}

/* ======================== */
/* ===== Admin Buttons ===== */
/* ======================== */

.step-desc { 
    font-size: 1rem; 
    color: #aaa; 
    margin: 5px 0 20px 5px; 
    line-height: 1.4; 
}

/* ======================================== */
/* ======== WANTED LIST GRID ====== */
/* ======================================== */

.wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px; 
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
    box-sizing: border-box;
}

.wanted-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    height: 100%;       
    max-width: 250px;   
    margin: 0 auto;     
    width: 100%;
}

.wanted-card img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 15px;
    display: block;
}

.wanted-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.wanted-name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.wanted-id {
    font-size: 1rem;
    color: #555;
    word-wrap: break-word;     /* Allows long IDs to wrap */
    overflow-wrap: break-word;
}

.wanted-val {
    margin-top: auto;
    font-weight: bold;
    color: #007bff;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

.wanted-sets {
    margin-top: 8px;
    font-size: 1em;
    color: #666;
}

/* ================================== */
/* === COMPACT LIST VIEW          === */
/* ================================== */
.view-list .wanted-grid { 
    display: block; 
    width: 100%; 
    text-align: left; 
}

.view-list .wanted-card {
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    padding: 12px 10px;
    border: none; 
    border-bottom: 1px solid #ddd; 
    border-radius: 0;
    margin-bottom: 0; 
    background: none; 
    box-shadow: none;
    width: 100%; 
    text-align: left;
    max-width: none;
}

.view-list .wanted-card::before {
    content: ''; 
    display: inline-block; 
    min-width: 22px; 
    height: 22px;
    border: 2px solid #888; 
    border-radius: 4px; 
    margin-right: 15px; 
    background: white;
    flex-shrink: 0; 
}

.view-list .wanted-card img { 
    height: 50px; width: 50px; margin-bottom: 0; margin-right: 15px; 
    flex-shrink: 0; object-fit: contain;
}

.view-list .wanted-info { 
    display: grid; grid-template-columns: 1fr; 
    gap: 5px; 
    width: 100%; 
    align-items: center; 
    justify-items: start; 
    text-align: left;
}

.view-list .wanted-name { 
    margin-bottom: 0; 
    font-weight: bold; 
    text-align: left; 
    width: 100%; 
}

.view-list .wanted-id { 
    text-align: left; 
    width: 100%; 
}

.view-list .wanted-val { 
    margin: 0; 
    padding: 0; 
    border: none; 
    text-align: left; 
    width: 100%; 
}

.view-list .wanted-sets { 
    margin-top: 0 !important; 
    text-align: left; 
    width: 100%;
}

/* ================================== */
/* === TEXT ONLY VIEW (INK SAVER) === */
/* ================================== */
.view-text .wanted-grid { 
    display: block; 
    width: 100%; 
    text-align: left;
}

.view-text .wanted-card {
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    padding: 12px 10px;
    border: none; 
    border-bottom: 1px dashed #ccc; 
    border-radius: 0; 
    background: none; 
    box-shadow: none;
    width: 100%; 
    text-align: left;
    max-width: none;
}

.view-text .wanted-card::before {
    content: ''; 
    display: inline-block; 
    min-width: 20px; 
    height: 20px;
    border: 2px solid #000;
    margin-right: 15px; 
    flex-shrink: 0;
}

.view-text .wanted-card img { 
    display: none; 
} 

.view-text .wanted-info { 
    display: grid; grid-template-columns: 1fr; 
    gap: 5px; 
    width: 100%; 
    align-items: center; justify-items: start; 
    text-align: left;
}

.view-text .wanted-name { 
    margin-bottom: 0; 
    font-weight: bold; 
    text-align: left; 
    width: 100%;
}

.view-text .wanted-id { 
    text-align: left; 
    width: 100%;
}

.view-text .wanted-val { 
    margin: 0; 
    padding: 0; 
    border: none; 
    text-align: left; 
    width: 100%; 
}

.view-text .wanted-sets { 
    margin-top: 0 !important; 
    text-align: left; 
    width: 100%; 
}

/* --- Desktop Enhancements (Wider Layout for Both List Views) --- */
@media (min-width: 768px) {
    .view-list .wanted-info,
    .view-text .wanted-info {
        grid-template-columns: 2fr 1fr 1fr 3fr; 
        gap: 20px;
        justify-items: start;
    }
}

/* ================ */
/* === SET VIEW === */
/* ================ */
.sets-view-section {
    display: none !important;
}
.standard-view-section {
    display: block !important;
}

.view-sets .standard-view-section {
    display: none !important;
}
.view-sets .sets-view-section {
    display: block !important;
}

/* Layout container for each set block */
.wanted-set-group {
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 12px; 
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: row;
    gap: 25px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Left sidebar holding the large set image and info */
.wanted-set-sidebar {
    width: 260px;
    min-width: 260px;
    text-align: center;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    position: sticky;
    top: 20px;
}

.wanted-set-sidebar img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 12px;
    border-radius: 6px;
    background: #fff;
    padding: 5px;
    border: 1px solid #e5e5e5;
}

.wanted-set-sidebar h3 {
    font-size: 1.05rem;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.set-num-badge {
    font-size: 0.9rem;
    font-weight: bold;
    color: #555;
    background: #eef2f7;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.set-missing-count {
    font-size: 1rem;
    color: #b8100b;
}

/* Right side container holding the minifigures grid/list */
.wanted-set-figures {
    flex-grow: 1;
    min-width: 0; /* Forces the flex child to stay inside the parent box */
    width: 100%;  /* Ensures it takes the available space */
}

/* Make sure inner grid spacing looks tight inside the set box */
.view-sets .wanted-set-figures .wanted-grid {
    margin-top: 0;
}

/* Mobile responsive fallback: stack image on top of minifigures on smaller screens */
@media (max-width: 768px) {
    .wanted-set-group {
        flex-direction: column;
    }
    .wanted-set-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
    }
    .wanted-set-sidebar img {
        height: 140px;
    }
}

\/* ========================================================== */
/* === SCOPED STYLING FOR CARDS INSIDE THE SET VIEW       === */
/* ========================================================== */

/* Grid Mode inside Sets */
.view-sets:not(.view-list):not(.view-text) .wanted-set-figures .wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-width: none;
    margin: 0;
}

.view-sets:not(.view-list):not(.view-text) .wanted-set-figures .wanted-card {
    max-width: none;
    padding: 10px;
    height: 100%;
}

.view-sets:not(.view-list):not(.view-text) .wanted-set-figures .wanted-card img {
    max-height: 80px;
    margin-bottom: 8px;
}

.view-sets:not(.view-list):not(.view-text) .wanted-set-figures .wanted-name {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
}

/* Checklist & Text-Only Mode inside Sets (Stack as clean vertical rows) */
.view-sets.view-list .wanted-set-figures .wanted-grid,
.view-sets.view-text .wanted-set-figures .wanted-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: none;
    margin: 0;
}

.view-sets.view-list .wanted-set-figures .wanted-card,
.view-sets.view-text .wanted-set-figures .wanted-card {
    max-width: none;
    width: 100%;
}

/* Fix grid text wrapping for info areas inside set rows */
.view-sets.view-list .wanted-set-figures .wanted-info,
.view-sets.view-text .wanted-set-figures .wanted-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Remove borders and backgrounds from minifig cards inside the set view */
.view-sets .wanted-set-figures .wanted-card {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* ================================== */
/* === A4 PRINT SPECIFIC STYLES   === */
/* ================================== */
@media print {
    @page { size: A4 portrait; margin: 15mm; }
    body { background: white !important; color: black !important; padding: 0 !important; overflow: visible !important; }
    .no-print, header, nav, footer, .controls-wrapper { display: none !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    .wanted-card { page-break-inside: avoid; break-inside: avoid; }
    
    .view-grid .wanted-grid { display: grid; grid-template-columns: repeat(4, 1fr) !important; gap: 10px; }
    .view-grid .wanted-card { border: 1px solid #ccc !important; max-width: none; }
    .view-grid .wanted-card img { max-height: 80px; }
}

/* ======================================== */
/* =========== LEADERBOARD ================ */
/* ======================================== */

.leaderboard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 800px;
}

.leaderboard-nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 15px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
}

.leaderboard-nav a.active {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.leaderboard-container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead tr {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.leaderboard-table th {
    padding: 15px;
    color: #666;
    font-size: 1.2rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Ensure table cells clip overflowing content cleanly */
.leaderboard-table td {
    max-width: 0;
}

/* Restrict and truncate long Holy Grail figure names cleanly */
.lb-subscore.fig-name {
    display: inline-block !important;
    max-width: 180px; /* Limits name length on desktop before adding '...' */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Gives the Score column much more room to breathe and align text properly */
.col-rank { text-align: left; width: 8%; }
.col-user { text-align: left; width: 47%; }
.col-score { text-align: right; width: 45%; }

.leaderboard-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s;
}

.leaderboard-row.is-me {
    background: rgba(255, 243, 205, 0.6);
}

.lb-divider td {
    text-align: center;
    padding: 10px;
    color: #aaa;
    background: rgba(0,0,0,0.02);
}

.lb-rank {
    padding: 10px;
    font-weight: bold;
    color: #888;
    font-size: 1.2rem;
}

.lb-user { padding: 10px; }
.lb-score-cell { padding: 10px; text-align: right; }

.lb-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    object-fit: cover;
    flex-shrink: 0;
}

.lb-user-details {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap; /* Allows badges to drop below name on small screens */
}

.lb-username {
    color: #111;
    font-size: 1.2rem;
    white-space: nowrap;
}

.lb-achieve-badge {
    font-size: 1rem;
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #ffeeba;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    
    /* Moved from inline style */
    display: inline-flex; 
    align-items: center; 
    gap: 4px;
}

.lb-achieve-icon {
    width: 1.5em; 
    height: 1.5em; 
    object-fit: contain;
}

/* Revert from flexbox to standard table-cell to guarantee perfect vertical centering */
.leaderboard-table td:last-child, 
.lb-score-cell {
    display: table-cell !important; 
    vertical-align: middle !important;
    text-align: right;
    padding: 10px;
}

/* Ensure the text blocks stack cleanly on top of each other */
.lb-score {
    display: block;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0; 
}

.lb-subscore {
    display: block;
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 4px;
}

/* ======================================== */
/* ===== LEADERBOARD DROPDOWN LAYOUT ====== */
/* ======================================== */

.leaderboard-nav-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 25px;
    padding: 0 15px;
    box-sizing: border-box;
}

.leaderboard-form {
    display: flex;
    flex-direction: column; /* Stacks the label and the dropdown */
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px; /* Matches your minifigs layout perfectly */
}

.leaderboard-label {
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.5rem;
    color: #072239;
    font-weight: bold;
}

/* ======================================== */
/* == 3D BUTTON DROPDOWN (If not shared) == */
/* ======================================== */
/* Note: If you already have this in your stylesheet, you don't need to paste it again! */

.filter-dropdown {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    box-sizing: border-box;
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.25rem;
    color: #fff;
    background: #3bb3e0;
    border: 2px solid #072239;
    border-radius: 10px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 3px 0 #156785;
    outline: none;
    cursor: pointer;
    text-align: center;
    transition: transform .1s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none; 
}

.filter-dropdown:active {
    transform: translateY(2px);
    box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 1px 0 #156785;
}

.filter-dropdown option {
    background: #072239;
    color: #fff;
    font-family: sans-serif;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px;
}

/* ======================================== */
/* -------- HOLY GRAIL SPECIFIC STYLES ---- */
/* ======================================== */

.lb-grail-container {
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 4px; 
    overflow: hidden;
}

.lb-grail-details {
    display: flex; 
    align-items: baseline; 
    gap: 6px;
}

.grail-val {
    font-size: 1.15rem;
}

.lb-subscore.fig-name {
    margin: 0; 
    color: #444; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%;
}

.lb-subscore.fig-num {
    margin: 0 !important; 
    color: #999; 
    font-size: 0.9rem;
    font-weight: 400;   
}

/* Force all table cells and headers to vertically align to the middle */
.leaderboard-table th,
.leaderboard-table td {
    vertical-align: middle !important;
}

.lb-score.themes { color: #28a745; }
.lb-score.themes span { font-size: 1rem; color: #666; }
.lb-score.value { color: #d69e2e; }
.lb-score.default { color: #007bff; }

/* ======================================== */
/* --- ENHANCED MOBILE RESPONSIVENESS ----- */
/* ======================================== */

@media (max-width: 480px) {
    /* Reset column distributions for tiny screens */
    .col-rank { width: 12%; }
    .col-user { width: 48%; }
    .col-score { width: 40%; }

    /* 2. Prevent table from blowing past its parent container */
    .leaderboard-container {
        width: 100%;
        overflow-x: hidden; /* Prevent horizontal container scrolling */
    }
    
    .leaderboard-table {
        table-layout: fixed; /* Forces columns to honor widths instead of content sizes */
        width: 100%;
    }

    /* 3. Compress padding to maximize horizontal canvas space */
    .leaderboard-table th, 
    .lb-rank, 
    .lb-user, 
    .lb-score-cell {
        padding: 10px 4px;
    }

    .lb-rank {
        font-size: 1rem;
    }

    /* 4. Keep the User block horizontally aligned and crisp */
    .lb-user-info {
        gap: 8px;
        overflow: hidden;
    }

    .lb-avatar {
        width: 34px;
        height: 34px;
        border-width: 1px;
    }

    /* Fix layout alignment: rows wrap naturally, but elements line up evenly */
    .lb-user-details {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        width: 100%;
    }

    .lb-username {
        font-size: 0.85rem;
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 5. Clean up the badges so they fit cleanly beneath or alongside */
  .lb-pro-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .lb-achieve-badge {
    font-size: 0.65rem;
    padding: 2px 6px; /* Added 1px top/bottom padding to give the flexbox room to breathe */
    white-space: nowrap;
    max-width: 110px; /* Restricts badge size so it doesn't clip the score */
    overflow: hidden;
    text-overflow: ellipsis;
    
    /* THE FIX: Restore flexbox to fix the vertical alignment */
    display: inline-flex; 
    align-items: center;  
  }

  /* Prevent the star icon from getting squished by the max-width restriction */
  .lb-achieve-badge .lb-achieve-icon {
    flex-shrink: 0; 
  }

    /* 6. Fix the score column clipping */
    .lb-score-cell {
        vertical-align: middle;
    }

    .lb-score {
        font-size: 0.95rem;
        white-space: nowrap;
    }
    
    /* 2x2 grid for the nav tabs still fits beautifully */
    .leaderboard-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 6px;
    }
    
    .leaderboard-nav a {
        padding: 8px 4px;
        font-size: 0.8rem;
    }
}

/* ======================================== */
/* =============== STATS PAGE ============= */
/* ======================================== */

.stats-section {
    width: 100%;
    margin-bottom: 30px;
}

.stats-section .section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

/* --- 1. Collection Summary Grid --- */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 5px;
    width: 50%;
    margin-bottom: 10px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 5px;
    text-align: center;
}

.summary-card small {
    color: #3bb3e0;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

.summary-card .value {
    font-size: 1.5rem;
    font-weight: bold;
}
.summary-card .value.success { color: #28a745; }
.summary-card .value.primary { color: #007bff; }


/* --- 2. Top Figures Grid --- */
.top-figs-grid {
    display: grid;
    /* Default for mobile/tablets */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

/* Force EXACTLY 4 columns on desktop screens */
@media (min-width: 800px) {
    .top-figs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fig-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.fig-card-top {
    margin-bottom: 8px;
}

.fig-card-top img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
}

.fig-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    min-height: 2.4em;
}

.fig-val {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: #007bff;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    margin-top: auto;
}

/* ==================================== */
/* ========= STATS PAGE STYLES ======== */
/* ==================================== */

/* CRITICAL FIX: Stops the footer from floating and allows stats to move up */
body.stats-page {
    display: block;
    height: auto;
    padding-bottom: 10px;
}

/* Force the Main area to stack sections vertically */
.stats-main {
    display: flex !important;
    flex-direction: column !important; 
    align-items: center !important;
    width: 100%;
}

/* Keep the Table container centered below */
.stats-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Summary Wrappers --- */

/* Force the stat boxes into a horizontal row */
.stats-page .collection-summary {
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 40px;
}

.summary-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* --- Individual Stat Items & Cards --- */

.stats-page .summary-item {
    flex: 0 1 auto;
    text-align: center;
    min-width: 180px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
    flex: 1;
}

/* --- Typography & Values --- */

.stat-card .label {
    font-size: 1rem;
    margin-bottom: 5px;
    display: block;
    color: #555;
}

.stat-card .value {
    font-size: 1rem;
    font-weight: bold;
    color: #072239;
}

/* Big Blue Numbers */
.stats-page .summary-item .value, 
.username {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3bb3e0;
    margin-top: 5px;
}

/* =============================== */
/* ===== THEME CARD PROGRESS ===== */
/* =============================== */
.theme-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    width: 100%;
}

.theme-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.theme-card.empty-themes {
    text-align: center;
    grid-column: 1 / -1;
    padding: 20px;
}

.theme-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.theme-title {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.2;
}

.btn-small {
    padding: 0;
    width: 75px;
    height: 26px;
    line-height: 26px;
    font-size: 1rem;
    background: #6c757d;
    box-shadow: none;
    border-radius: 6px;
    flex-shrink: 0;
    text-align: center;
    color: #fff;
    text-decoration: none;
    display: inline-block;
}

.theme-card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
}

.theme-card-stats .label {
    font-size: 1rem;
    color: #555;
    font-weight: 600;
}

.theme-card-stats .count {
    font-size: 1rem;
    font-weight: bold;
    color: #072239;
}

.theme-card-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.progress-bar-container {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.08);
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    background: #28a745;
    height: 100%;
    border-radius: 5px;
}

.progress-percent {
    font-size: 1rem;
    font-weight: bold;
    color: #28a745;
    min-width: 45px;
    text-align: right;
    flex-shrink: 0;
}

/* ============================== */
/* ==== SEARCH BAR COMPONENTS === */
/* ============================== */

/* The container that holds the search bar */
.filter-row-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 10px;
    margin: 10px auto;   
    width: 100%;
}

/* The wrapper for just the search input */
.filter-search-container {
    width: 100%;         
    max-width: 400px;    
    display: flex;
    justify-content: center; 
}

/* Your actual search bar */
#search-bar {
    width: 100%;         
    height: 40px;
    padding: 0 12px;
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.5rem;
    color: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    background: #156785;
    box-shadow: inset 3px 3px #7fd2f1;
    outline: none;
}

#search-bar::placeholder {
    color: rgba(255,255,255,.8);
}

/* ======================================== */
/* --- STATS PAGE MOBILE RESPONSIVENESS --- */
/* ======================================== */

@media (max-width: 480px) {
    /* Stack the top summary cards into a vertical list on small screens */
    .stats-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Reduce padding slightly to save screen space */
    .summary-card {
        padding: 15px;
    }

    /* Shrink the grid size for the Holy Grail figs so they fit in pairs or triple columns */
    .top-figs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .fig-card {
        padding: 8px;
    }

    /* Prevent theme cards from being too wide and causing horizontal scroll */
    .theme-breakdown-grid {
        grid-template-columns: 1fr;
    }

    /* Ensure text doesn't overflow */
    .theme-title {
        font-size: 1rem;
        word-break: break-word;
    }
}

/* ======================================== */
/* ============== PROFILE PAGE ============ */
/* ======================================== */

/* 1. Parent Wrapper */
.profile-container {
    margin: 0.5rem auto;
    max-width: 850px;
    width: 95%;
    padding: 1rem;
}

/* 2. Main Profile Block */
.profile-block {
    text-align: center;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 3. Profile Header Info */
.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.2;
    margin-top: 10px;
    width: 100%;
}

.avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 3px solid #3bb3e0;
    border-radius: 8px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #156785;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.username {
    color: #3bb3e0;
    font-size: 2rem;
    font-weight: bold;
}

/* ======================================== */
/* ===== EXPANDED FROSTED GLASS CARDS ===== */
/* ======================================== */

/* --- 1. Main Frosted Glass Containers --- */
.profile-details,
.edit-profile-section {
    max-width: 850px;
    width: 100%;
    margin: 20px auto 30px auto;
    background: rgba(255, 255, 255, 0.4);
    padding: 35px 45px;
    border-radius: 18px;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

/* --- 2. Profile Details View (profile.php) --- */
.profile-details p,
.profile-details-extended p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 1.2rem;
    color: #222;
}

.profile-details strong,
.profile-details-extended strong {
    color: #222;
    font-weight: 700;
    font-size: 1.25rem;
}

.collector-bio {
    background: rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 1.15rem;
    color: #fff;
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    line-height: 1.5;
}

/* --- 3. Edit Profile Form View (edit_profile.php) --- */
.edit-profile-section .form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0; 
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.edit-profile-section .form-group label {
    flex: 1;
    padding-right: 10px;
    color: #222;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    text-align: left;
}

.edit-profile-section input[type="text"],
.edit-profile-section input[type="url"],
.edit-profile-section textarea,
.username-input {
    flex: 2;
    max-width: 65%;
    margin: 0; 
    padding: 6px 12px;
    font-family: inherit; 
    color: #222; 
    font-size: 1.6rem;
    border: none; 
    background-color: transparent; 
    box-shadow: none; 
    text-align: right;
    outline: none;
}

.username-input {
    font-size: 1.6rem;
    color: #3bb3e0; 
    font-weight: bold;
    font-family: "Coalabeer-5Vlv", sans-serif;
}

.user-email {
    word-break: break-all;
    text-align: right;
}

/* --- 4. Achievement Badges Grid --- */
.profile-achievements {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 12px;
    margin-bottom: 30px;
    justify-items: start; 
    max-width: 100%;
    width: 100%;
}

.ach-badge {
    background: #2d1b4e;
    color: #fff;
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid #f504cc;
    font-size: 1rem; 
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    width: 100%; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-align: left; 
}

.ach-badge:hover {
    background: #f504cc;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 4, 204, 0.4);
}

.badge {
    font-size: 1rem;
    font-weight: bold;
    display: inline-block;
    margin-right: 5px;
}

.disp-badge {
    display: inline-flex; 
    align-items: center;
    gap: 6px; 
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.badge-icon {
    width: 1.5em;  
    height: 1.5em;
    object-fit: contain;
}

.btn-danger {
    background-color: #d9534f;
    border-color: #d43f3a;
}
.btn-danger:hover {
    background-color: #c9302c;
}

.profile-actions {
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

/* --- 5. Avatar Section & Picker --- */
.avatar-edit-section {
    max-width: 850px;
    width: 100%;
    margin: 0 auto 40px auto;
    text-align: center;
}

.avatar-preview-container {
    margin-bottom: 20px;
}

.preview-img {
    width: 120px; 
    height: 120px; 
    display: block; 
    margin: 10px auto; 
    border-radius: 50%; 
    border: 3px solid #156785;
}

.avatar-label {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin: 20px 0;
    width: 100%;
}

.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avatar-option label {
    cursor: pointer;
    width: 100%;
    padding: 5px; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-option img {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    border: 3px solid transparent; 
    background: #f8f9fa;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.avatar-option input[type="radio"]:checked + label img {
    border-color: #156785;
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.avatar-option input[type="radio"]:checked + label {
    background: transparent;
    box-shadow: none;
}

.avatar-option label:hover img {
    transform: scale(1.1);
}

.avatar-name {
    margin-top: 12px;
    font-size: 1rem;
    color: #444;
    font-weight: 500;
}

.form-actions {
    margin-top: 30px;
    margin-bottom: 30px;
    display: flex; 
    gap: 10px; 
    justify-content: center;
}

.cancel-btn {
    background-color: #6c757d !important; 
    color: white !important; 
    text-decoration: none;
}

/* ======================================== */
/* ===== MEDIA QUERIES (Responsiveness) === */
/* ======================================== */

@media (max-width: 480px) {
    .profile-block { 
        padding: 15px 10px; 
    }
    
    .profile-details,
    .edit-profile-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 20px 15px;
    }

    .edit-profile-section .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .edit-profile-section .form-group label {
        padding-right: 0;
        margin-bottom: 8px;
    }

    .edit-profile-section input[type="text"],
    .edit-profile-section input[type="url"],
    .edit-profile-section textarea,
    .username-input {
        max-width: 100%;
        text-align: left;
    }
    
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 20px;
    }

    .avatar-option img {
        width: 100%;
        height: auto;
    }

    .form-actions { 
        flex-direction: column; 
    }
    
    .form-actions .button { 
        width: 100%; 
    }
}

/* ============================ */
/* ==== Theme Preview Page ==== */
/* ============================ */

/* Main layout overrides */
#public-price-guide,
.theme-preview-controls {
    width: 100%;
    max-width: 100%;
}

.theme-preview-nav {
    margin-bottom: 5px;
}

.theme-preview-h3 {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Safely override the margins just for the Preview Page */
.collection-summary.public-stats {
    margin: 10px auto !important; /* Adjust the 40px to change the top/bottom spacing outside the box */
}

.public-stats .summary-grid {
    margin: 10px 0; /* Adjust this to change the spacing inside/around the actual numbers */
}

/* Upscaled Stats Styles for public preview */
.public-stats .stat-card .value {
    font-size: 3rem !important; /* Makes the numbers significantly larger */
    font-weight: bold;
    color: #3bb3e0; /* Matches your brand blue numbers */
    display: block;
}

.public-stats .stat-card .label {
    font-size: 1.5rem !important; /* Keeps the label text cleanly readable */
    color: #555;
}

/* Fig Card Specifics */
.fig-id {
    font-size: 1rem;
    color: #555;
    margin-bottom: 5px;
}

.teaser-note {
    text-align: center;
    font-size: 1.3rem;
    margin-top: 20px;
    color: #555;
}

/* Auth Section tweaks */
#auth-section .auth-teaser {
    margin-bottom: 20px;
}

.auth-btn-wide {
    padding: 0 30px;
}

/* ======================================== */
/* ====== SYSTEM ANNOUNCEMENTS ============ */
/* ======================================== */

/* 1. Top Banner */
.sys-banner {
    background-color: #ffc107; /* Matches your gold button */
    color: #000;
    width: 100%;
    padding: 12px 40px 12px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.2), inset 0px 1px 0px #ffe082;
    z-index: 1000;
    font-size: 1.2rem;
    border-bottom: 3px solid #b28905; /* 3D bottom edge */
}

.sys-banner-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.5rem;
    color: #072239;
    cursor: pointer;
    font-weight: bold;
}

.sys-banner-close:hover {
    color: #d32f2f;
}

/* 2. Modal / Pop-up */
.sys-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 34, 57, 0.85); /* Your dark blue, slightly transparent */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.sys-modal-content {
    background-color: #ddd; /* Matches your body background fallback */
    border: 4px solid #3bb3e0; /* Your primary button blue */
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.5);
}

.sys-modal-content h2 {
    color: #F504CC; /* Magenta from your pointers */
    margin-bottom: 15px;
    font-size: 2rem;
}

.sys-modal-content p {
    color: #072239;
    margin-bottom: 25px;
}

/* ======================== */
/* ===== MEDIA QUERIES ===== */
/* ======================== */
/* --- Extra Small Screens (Mobile S - Up to 375px) --- */
@media (max-width: 375px) {
    h1, h2, h3 {
        font-size: 1.4rem; 
    }

    p {
        font-size: 1rem;
        line-height: 1.3rem;
    }

    #logo {
        max-width: 90%;
    }

    .form-block {
        padding: 0 10px;
    }
}

/* --- Mobile / Small Screens (Up to 480px) --- */
@media (max-width: 480px) {
    #logo {
        max-width: 80%;
    }

    /* Dashboard Navigation */
    .dashboard-nav-grid {
        justify-items: center;
        padding: 0 10px;
    }

    .dashboard-nav-grid .button, 
    .start-here-wrapper {
        width: 100%;
        max-width: 140px; 
        margin-bottom: 0;
    }

    .start-here-wrapper .button {
        width: 100%;
    }

    /* Profile Cards & Frosted Glass Containers */
    .profile-block { 
        padding: 15px 10px; 
    }

    .profile-details,
    .edit-profile-section {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 20px 15px;
    }

    .edit-profile-section .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .edit-profile-section .form-group label {
        padding-right: 0;
        margin-bottom: 8px;
    }

    .edit-profile-section input[type="text"],
    .edit-profile-section input[type="url"],
    .edit-profile-section textarea,
    .username-input {
        max-width: 100%;
        text-align: left;
    }

    /* Avatar Grid (Flexible 3-Column Layout) */
    .avatar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-top: 20px;
    }

    .avatar-option img {
        width: 100%;
        max-width: 70px;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .current-preview img {
        width: 100px;
        height: 100px;
    }

    /* Buttons & Actions */
    .form-actions { 
        flex-direction: column; 
    }
    
    .form-actions .button { 
        width: 100%; 
    }

    /* Miscellaneous Controls */
    #theme-selection-form {
        padding: 0.5rem;
    }

    .theme-container label {
        font-size: 1rem;
    }

    .logout-container {
        top: 5px;
        right: 5px;
    }

    #logout-btn {
        font-size: 0.75rem;
        padding: 5px;
    }

    .summary-cards {
        flex-direction: column;
    }

    .minifig {
        max-width: 100%;
        margin: 5px 0;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination button {
        padding: 6px 10px;
    }
}

/* Respect reduced motion setting */
@media (prefers-reduced-motion: reduce) {
    .avatar-option img {
        transition: none;
        transform: none !important;
    }
}

/* Tablet Breakpoint: Shrink to 2 columns and prevent extreme stretching */
@media (max-width: 768px) {
  .dashboard-nav-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-items: center; 
    max-width: 480px;      /* Restricts the grid width to pull columns together */
    margin: 0 auto 30px;   /* Centers the entire grid on the page */
  }
  
  /* Cap the button size on tablets so they stay tap-friendly but don't stretch */
  .dashboard-nav-grid .button,
  .dashboard-nav-grid .start-here-wrapper {
    max-width: 220px; 
    width: 100%;
  }
}

/* Laptop and up */
@media (min-width: 1024px) {
  body {
    font-size: 17px;
    padding: 0 2rem 2rem 2rem;
  }

  nav {
    max-width: 1024px;
  }

/* Scale logo up for standard laptops */
  #logo {
    max-width: 600px;
  }
  
  /* --- NEW RULES FOR LAPTOP --- */
  
  /* Widen the main content areas so text doesn't wrap awkwardly */
  section, 
  .center-wrapper {
    max-width: 700px; 
  }

  /* Give the welcome text more room to stretch out */
  p {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Make the form area slightly wider so it looks proportional */
  .form-block {
    max-width: 450px; 
  }
  
  /* Make the input fields slightly wider to match the new form width */
  input {
    max-width: 300px;
  }
}

/* Desktop and up (1280px) */
@media (min-width: 1280px) {
  body {
    font-size: 1.2rem;
    padding: 0 2.5rem 2.5rem 2.5rem;
  }

  nav {
    max-width: 1280px;
  }

  /* --- SMOOTH TRANSITION SCALING --- */
  
  /* Middle-ground logo size */
  #logo {
    max-width: 675px; 
  }

  /* Intermediate width for main containers */
  section, 
  .center-wrapper {
    max-width: 800px; 
  }

  /* Step up the paragraph width */
  p {
    max-width: 725px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Middle-ground form block */
  .form-block {
    max-width: 475px; 
  }
  
  /* Slightly wider inputs */
  input {
    max-width: 325px;
  }
}

/* Wide screens and up */
@media (min-width: 1440px) {
  body {
    font-size: 1.2rem;
    padding: 0 3rem 3rem 3rem;
  }

  /* --- NEW RULES FOR LARGE LAPTOP (1440px) --- */

  /* Scale logo up even more for large wide screens */
  #logo {
    max-width: 750px;
  }

  /* Widen the main containers even further */
  section, 
  .center-wrapper {
    max-width: 900px; 
  }

  /* Give the paragraph text more breathing room */
  p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Scale up the form block */
  .form-block {
    max-width: 850px; 
  }
  
  /* Make the input fields wider to match the massive screen */
  input {
    max-width: 350px;
    padding: 0.75rem; /* Slightly taller inputs for easier clicking on large screens */
  }

  /* Make the buttons slightly wider to match the inputs */
  .button {
    width: 160px; 
  }
}

/* ======================================== */
/* ===== 4K & ULTRA-WIDE SCREENS ========== */
/* ======================================== */
@media (min-width: 2560px) {
  /* Increase the base font size so ALL text scales up automatically */
  body {
    font-size: 1.2rem; 
    padding: 0 4rem 4rem 4rem;
  }

  /* Scale the logo to be a true centerpiece */
  #logo {
    max-width: 1100px; 
  }

  /* Widen the main content areas massively */
  section, 
  .center-wrapper {
    max-width: 1600px; 
  }

  /* Let the paragraphs stretch to avoid awkward tall text blocks */
  p {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
  }

  /* Scale up the form container */
  .form-block {
    max-width: 800px; 
  }
  
  /* Make the input fields chunky and clickable */
  input {
    max-width: 850px;
    padding: 1rem; 
    font-size: 1.5rem; /* Larger text inside the inputs */
  }

  .form-block form {
    gap: 1.5rem; /* More space between inputs and buttons */
  }

  /* Scale up the primary buttons */
  .button {
    width: 220px; 
    height: 50px;
    line-height: 50px;
    font-size: 1.6rem;
    border-radius: 14px; /* Slightly rounder to match the larger size */
  }
}