/* styles.css */

/* License: Public Domain
   Font by: Alex Maracinaru
   https://www.fontspace.com/arowit-font-f30292 */

/* ======================== */
/* ====== VARIABLES ======== */
/* ======================== */
:root {
  --content-width: 600px;
  --form-width: 320px;
  --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, body {
  min-width: 320px;
  margin: 0;
  padding: 0;
  height: 100vh;
  font-family: "Coalabeer-5Vlv", sans-serif;
  font-size: 18px;
  background: #ddd url(../assets/bg.webp);
  background-size: cover;
  background-position: center;
  background-repeat: repeat;
  overflow: overlay;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  align-items: center; /* Center everything globally */
  text-align: center;
  padding: 0 20px;
  line-height: 1;
}


/* ======================== */
/* ====== 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 {
  margin: 10px 0 10px;
  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 */
  align-items: center;
  width: 100%;
  flex: 1; /* Pushes footer to bottom */
  margin-bottom: 10px;
}


/* 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: 0.5rem;
  margin: 0;
  width: 100%;
}

/* Header layout */
header {
  padding: 0; /* Changed from 0.5rem to 0 */
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;

}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: var(--content-width);
  width: 100%;
}

#logo {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Center wrapper utility */
.center-wrapper {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ======================== */
/* ====== 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;
    gap: 1rem;
    width: 100%;
    max-width: 900px;
    margin: 20px 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; /* For Desktop */
    margin: 0 auto;
    padding: 15px; /* Keeps content off the edge of the S25 screen */
    box-sizing: border-box; /* Crucial: ensures padding doesn't add to the width */
}

/* ============================ */
/* 2. Stats Page Specific Overrides */
/* ============================ */

/* Force the Main area to stack sections vertically */
.stats-main {
    display: flex !important;
    flex-direction: column !important; 
    align-items: center !important;
    width: 100%;
}

/* Force the 3 stat boxes into a horizontal row */
.stats-page .collection-summary {
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 40px;
}

/* Style for the individual boxes on Stats page */
.stats-page .summary-item {
    flex: 0 1 auto;
    text-align: center;
    min-width: 180px;
}

/* Big Blue Numbers */
.stats-page .summary-item .value, 
.username {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3bb3e0;
    margin-top: 5px;
}

/* Keep the Table container centered below */
.stats-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ======================================== */
/* ======= 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;
}

/* =============================== */
/*==========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: 25px;
  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 div {
  margin-top: 20px;    /* Space between the H2 title and buttons */
  margin-bottom: 40px; /* 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 */
}

/* ======================== */
/* ======== INPUT BAR ===== */
/* ======================== */
.input {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  margin-right: 0.5rem;
}


/* ======================== */
/* ======== NAVIGATION ===== */
/* ======================== */
nav .nav-group {
  display: flex;
  justify-content: center; /* Keeps them centered */
  gap: 5px;               /* This creates the space BETWEEN buttons */
  margin-bottom: 10px;     /* This creates space between the two rows */
}

/* Optional: Ensure the bottom row doesn't have extra bottom margin */
nav .nav-group-bottom {
  margin-bottom: 0;
}

/* ======================== */
/* ======== SORTING ===== */
/* ======================== */
.sort-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    font-family: sans-serif;
}

.sort-label {
    font-weight: bold;
    color: #444;
}

.sort-group {
    display: flex;
    background: #e0e0e0; /* Light grey background for the group */
    border-radius: 25px;
    padding: 4px;
}

.sort-btn {
    text-decoration: none;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    color: #000;
}

/* 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;
}

/* ======================== */
/* ======= PAGINATION ====== */
/* ======================== */

.pagination {
  display: flex;
  justify-content: center;
  padding: 20px 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;
}

/* ======================== */
/* ======== LOGOUT ========= */
/* ======================== */

.logout-container {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
}

#logout-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 0.5rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.3s ease;
}

#logout-btn:hover {
  background-color: #c82333;
}

/* ======================== */
/* ======== PROFILE ======== */
/* ======================== */

.profile-container {
  margin: 0.5rem auto;
  max-width: var(--content-width);
  padding: 1rem;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.2;
}

.avatar {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 3px solid #3bb3e0;
  border-radius: 8px;
}

.username {
  color: #3bb3e0;
  font-size: 2rem;
  font-weight: bold;
}

/* ======================== */
/* ======== FOOTER ======== */
/* ======================== */

footer {
  padding: 0.5rem 1rem;        /* reduced horizontal padding */
  text-align: center;
  max-width: var(--content-width);
  margin: 0 auto;
}
footer {
  width: 100%;             /* Occupies full screen width */
  padding: 2rem 0;         /* Vertical breathing room */
  display: flex;           /* Use flex for perfect centering */
  justify-content: center; /* Center horizontally */
  align-items: center;     /* Center vertically */
  clear: both;             /* Ensures it sits below all other content */
}

.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 ======== */
/* ======================== */

/* CRITICAL FIX: Stops the footer from floating and allows stats to move up */
body.stats-page {
  display: block;
  height: auto;
  padding-bottom: 10px;
}

.summary-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* Stacks them on mobile so they stay centered */
    margin: 20px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 180px;
  flex: 1;               /* Makes cards equal width */
}

.stat-card .label {
  font-size: 0.85rem;
  margin-bottom: 5px;
  display: block;
  color: #555;
}

.stat-card .value {
  font-size: 0.85rem;
  font-weight: bold;
  color: #072239;
}

.stats-container {
  padding: 0rem;
  max-width: 800px;
  margin: 0 auto;
}

.stats-table {

  border-collapse: separate; /* Allows for rounded corners */
  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; /* Matches your sky blue buttons */
    color: white;
    padding: 8px 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #156785; /* Adds a slightly darker blue line for definition */
}

.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;
}

/* Keep the numeric columns as narrow as possible */
.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; 
}

.progress-bar {
  background: #eee;
  width: 60px;
  height: 10px;
  border-radius: 8px;
  overflow: hidden;
  margin-right: 5px;
  margin: 4px auto 0 auto;
  display: inline-block;
  vertical-align: middle;
}

.progress-container {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Keeps the percentage and bar tucked right */
  white-space: nowrap;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.15) 75%, 
        transparent 75%, 
        transparent
    ), #3bb3e0;
    background-size: 20px 20px; /* This creates a subtle diagonal stripe */
}

/* The gold override for completed themes */
.progress-fill.is-complete {
    background: linear-gradient(90deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, 
    #aa771c) !important;
    box-shadow: 0 0 8px rgba(191, 149, 63, 0.6); /* Adds a subtle glow */
}

.collection-summary {
    text-align: center;
    margin: 30px 0 50px 0;
    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; /* Space between Used and New */
    margin-top: 5px;
}

.val-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.val-box small {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.5px;
}

.val-box span {
    font-size: 1rem;
    font-weight: bold;
    color: #072239;
}

/********************/
/*****STATS*********/
/********************/
.top-figs-grid {
    display: grid;
    /* This forces 5 columns on desktop */
    grid-template-columns: repeat(5, 1fr); 
    gap: 15px;
    align-items: stretch; /* Crucial: Makes all cards in a row the same height */
}

.fig-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes the price to the bottom */
    text-align: center;
}

/* Fix the image area so it doesn't push the text down unevenly */
.fig-card img {
    height: 100px; /* Lock the image height */
    width: auto;
    object-fit: contain;
    margin-bottom: 15px;
}

/* Force the text block to have a fixed height so it doesn't grow the card */
.fig-info {
    flex-grow: 1; /* Allows this to fill the space */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.fig-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;
    /* Keep name to 3 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fig-val {
    margin-top: auto; /* This acts like a spring, pushing the price to the very bottom */
    font-weight: bold;
    color: #007bff;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

/* ======================== */
/* ===== Avatar Picker ===== */
/* ======================== */

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.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: 0.9rem;
    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);
}

/* ======================== */
/* ===== Ad slots ===== */
/* ======================== */

.ad-slot {
    margin: 5px auto;
    text-align: center;
    padding: 5px 0;
}

.ad-label {
    font-size: 9px;
    color: #bbb;
    text-transform: uppercase;
    margin: 0 0 2px 0;
    letter-spacing: 0.5px;
}

/* ======================== */
/* ===== MEDIA QUERIES ===== */
/* ======================== */

/* Mobile adjustments */
@media (max-width: 480px) {
    .avatar-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 16px;
    }
    .avatar-option img {
        width: 80px;
        height: 80px;
    }
    .current-preview img {
        width: 120px;
        height: 120px;
        border-width: 5px;
    }


/* Respect reduced motion setting */
@media (prefers-reduced-motion: reduce) {
    .avatar-option img {
        transition: none;
        transform: none !important;
    }


/* Tablet and up */
@media (min-width: var(--breakpoint-tablet)) {
  body {
    font-size: 16px;
    padding: 1.5rem;
  }

  nav {
    flex-direction: row;
    max-width: var(--breakpoint-tablet);
  }

  h1, h2, h3 {
    font-size: 2rem;
  }

  p {
    font-size: 1.2rem;
    line-height: 1.2rem;
  }
}



/* Laptop and up */
@media (min-width: var(--breakpoint-laptop)) {
  body {
    font-size: 17px;
    padding: 2rem;
  }

  nav {
    max-width: var(--breakpoint-laptop);
  }
}

/* Desktop and up */
@media (min-width: var(--breakpoint-desktop)) {
  body {
    font-size: 18px;
    padding: 2.5rem;
  }

  nav {
    max-width: var(--breakpoint-desktop);
  }
}

/* Wide screens and up */
@media (min-width: var(--breakpoint-wide)) {
  body {
    font-size: 19px;
    max-width: var(--breakpoint-wide);
    margin: auto;
    padding: 3rem;
  }

  nav {
    max-width: var(--breakpoint-wide);
  }
}

/* Mobile-specific overrides below 480px */
@media (max-width: var(--breakpoint-mobile)) {
  #logo {
    max-width: 80%;
  }
  
  nav .nav-group {
    display: flex;
    flex-wrap: wrap;    /* Allows them to stack if 45% + 45% + gap > 100% */
    gap: 15px;          /* This creates space between the left/right buttons */
    justify-content: center;
    margin-bottom: 15px; /* This creates space between the TOP and BOTTOM row */
  }

  /* Ensure the buttons don't physically touch if they stack */
  .button {
    margin-bottom: 10px; 
  }

  .profile-content,
  .profile-header,
  .profile-info {
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
  }

  #theme-selection-form {
    padding: 0.5rem;
  }

  .theme-container label {
    font-size: 0.95rem;
  }

  .logout-container {
    top: 5px;
    right: 5px;
  }

  #logout-btn {
    font-size: 0.75rem;
    padding: 5px;
  }

  form {
    width: 90%;
  }

  .summary-cards {
    flex-direction: column;
  }

  .minifig {
    max-width: 100%;
    margin: 5px 0;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .pagination button {
    padding: 6px 10px;
  }
  
  .avatar-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 16px;
    }
    .avatar-option img {
        width: 80px;
        height: 80px;
    }
    .current-preview img {
        width: 120px;
        height: 120px;
        border-width: 5px;
    }
}

