:root {
  --ink: #15132b;
  --paper: #f8dc68;
  --panel: #ffffff;
  --red: #e63b43;
  --yellow: #ffd447;
  --blue: #3d76d1;
  --green: #5eb65d;
  --line: #15132b;
  --soft-paper: #fffdf4;
  --muted: #706d7d;
  --sidebar: #17152e;
  --sidebar-soft: #24213f;
  --sidebar-text: #f8f7ff;
  --shadow: 7px 7px 0 var(--line);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Pixelify Sans", monospace;
  background:
    radial-gradient(
      circle,
      rgba(255, 212, 71, 0.25) 3px,
      transparent 3.5px
    ) 0 0 / 30px 30px,
    radial-gradient(
      circle,
      rgba(255, 212, 71, 0.25) 3px,
      transparent 3.5px
    ) 15px 15px / 30px 30px,
    linear-gradient(135deg, #17152e, #e63b43);
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  min-height: 44px;
  font: inherit;
}

button {
  color: #fff;
  cursor: pointer;
  text-transform: uppercase;
  background: var(--green);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.5;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.15s ease;
}

button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--yellow);
}

button:active:not(:disabled) {
  box-shadow: none;
  transform: translate(4px, 4px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.is-loading::after {
  content: " ...";
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: var(--soft-paper);
  border: 3px solid var(--line);
  border-radius: 0;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.camera-button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  width: 250px;
  padding: 24px 18px;
  color: var(--sidebar-text);
  background:
    linear-gradient(180deg, #17152e 0%, #211e3c 100%);
  border-right: 4px solid var(--line);
  box-shadow: 6px 0 0 rgba(0, 0, 0, 0.22);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 26px;
}

.brand-mark,
.sidebar-avatar,
.topbar-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Press Start 2P", monospace;
}

.brand-mark {
  width: 48px;
  height: 48px;
  font-size: 10px;
}

.sidebar-brand strong {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-brand span {
  display: block;
  margin-top: 5px;
  color: #aaa7bd;
  font-size: 9px;
  font-weight: 700;
}

.sidebar-section-label {
  margin: 8px 10px;
  color: #858197;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-nav-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: #c7c4d3;
  text-align: left;
  text-transform: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: "Pixelify Sans", monospace;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-nav-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--line);
}

.sidebar-nav-button.active {
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  font-size: 18px;
}

.sidebar-divider {
  height: 2px;
  margin: 20px 8px;
  background: #403b5e;
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--sidebar-soft);
  border: 2px solid #45405f;
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  font-size: 7px;
}

.sidebar-account-info {
  min-width: 0;
}

.sidebar-account-info strong,
.sidebar-account-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-info strong {
  font-size: 14px;
}

.sidebar-account-info span {
  margin-top: 3px;
  color: #aaa7bd;
  font-size: 11px;
}

.sidebar-sign-out {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: var(--red);
}

.sidebar-settings {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.sidebar-settings a {
  color: #aaa7bd;
  font-size: 11px;
}

.sidebar-settings a:hover {
  color: var(--yellow);
}

/* =========================================
   APPLICATION SHELL
========================================= */

.app-shell {
  min-height: 100vh;
  margin-left: 250px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(248, 220, 104, 0.97);
  border-bottom: 4px solid var(--line);
  box-shadow: 0 5px 0 var(--red);
}

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  display: grid;
  gap: 5px;
}

.topbar-kicker,
.panel-label {
  color: var(--red);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  line-height: 1.5;
}

.topbar-title strong {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(300px, 28vw);
}

.global-search span {
  position: absolute;
  left: 12px;
  z-index: 1;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
}

.global-search input {
  min-height: 46px;
  padding-left: 38px;
  background: #fff;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 230px;
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  font-size: 7px;
}

.topbar-user strong,
.topbar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user strong {
  font-size: 13px;
}

.topbar-user span {
  margin-top: 2px;
  color: #625f70;
  font-size: 11px;
}

.topbar-auth-button {
  min-height: 42px;
  padding: 8px 12px;
}

.sign-out-top {
  background: var(--red);
}

.mobile-brand,
.mobile-menu-button,
.sidebar-overlay {
  display: none;
}

/* =========================================
   MAIN DASHBOARD
========================================= */

.dashboard-main {
  width: min(1450px, calc(100% - 60px));
  margin: 36px auto 50px;
}

.view {
  position: relative;
}

.dashboard-view {
  padding: 0;
}

.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

#home-heading {
  margin: 0;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(22px, 4vw, 38px);
  line-height: 1.45;
  text-shadow: 5px 5px 0 var(--ink);
}

#home-heading span {
  color: var(--yellow);
}

.welcome-copy {
  max-width: 590px;
  margin: 14px 0 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}

.primary-action,
.secondary-action,
.small-action {
  width: auto;
  white-space: nowrap;
}

.primary-action {
  min-height: 52px;
  padding: 12px 17px;
  background: var(--green);
}

.primary-action span {
  font-size: 17px;
}

.secondary-action {
  background: var(--blue);
}

.small-action {
  min-height: 42px;
  font-size: 8px;
}

/* =========================================
   DASHBOARD STATS
========================================= */

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 22px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 100px;
  padding: 17px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #fff;
  border: 3px solid var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  box-shadow: 3px 3px 0 var(--line);
}

.stat-total .stat-icon {
  background: var(--blue);
}

.stat-owned .stat-icon {
  background: var(--green);
}

.stat-reading .stat-icon {
  background: var(--red);
}

.stat-wishlist .stat-icon {
  color: var(--ink);
  background: var(--yellow);
}

.stat-card span:not(.stat-icon) {
  display: block;
  color: #6e6a78;
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font-family: "Press Start 2P", monospace;
  font-size: 21px;
}

/* =========================================
   FEATURE / CONTINUE
========================================= */

.dashboard-feature-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 20px;
  margin-bottom: 30px;
}

.featured-panel,
.continue-panel,
.dashboard-section,
.founder-panel,
.member-counter {
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.featured-panel,
.continue-panel {
  min-height: 360px;
  padding: 22px;
}

.panel-label {
  display: block;
  margin-bottom: 7px;
}

.featured-content {
  height: 285px;
}

.featured-empty {
  display: grid;
  height: 100%;
  place-items: center;
  align-content: center;
  text-align: center;
  background:
    radial-gradient(
      circle,
      rgba(21, 19, 43, 0.09) 2px,
      transparent 2.5px
    ) 0 0 / 20px 20px,
    var(--soft-paper);
  border: 3px dashed var(--line);
}

.empty-icon {
  display: grid;
  width: 55px;
  height: 55px;
  margin-bottom: 13px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
}

.featured-empty h2,
.section-heading h2,
.founder-panel h2 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.featured-empty p {
  max-width: 370px;
  margin: 8px 0 18px;
  color: #676374;
  font-weight: 700;
}

.featured-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  height: 100%;
  padding: 14px;
  background: var(--soft-paper);
  border: 3px solid var(--line);
}

.featured-item img,
.featured-cover-placeholder {
  width: 100%;
  height: 255px;
  object-fit: cover;
  border: 3px solid var(--line);
}

.featured-cover-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
}

.featured-details {
  align-self: center;
}

.featured-details h3 {
  margin: 5px 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
  line-height: 1.7;
}

.featured-details p {
  margin: 6px 0;
  color: #666273;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.section-heading h2 {
  color: var(--ink);
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.text-action {
  min-height: auto;
  padding: 5px;
  color: var(--blue);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: "Pixelify Sans", monospace;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.text-action:hover {
  color: var(--red);
  background: transparent;
  box-shadow: none;
}

/* =========================================
   MINI COMIC LIST
========================================= */

.mini-comic-list {
  display: grid;
  gap: 11px;
}

.mini-comic {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 11px;
  align-items: center;
  padding: 8px;
  background: var(--soft-paper);
  border: 3px solid var(--line);
}

.mini-comic img,
.mini-cover-placeholder {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border: 2px solid var(--line);
}

.mini-cover-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.mini-comic h3 {
  margin: 0 0 5px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1.5;
}

.mini-comic p {
  margin: 0;
  color: #706d7d;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-empty {
  padding: 24px;
  color: #777384;
  background: var(--soft-paper);
  border: 3px dashed #8a8794;
  font-weight: 700;
  text-align: center;
}

/* =========================================
   DASHBOARD SECTIONS
========================================= */

.dashboard-section {
  padding: 22px;
  margin-bottom: 24px;
}

.dashboard-comic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.dashboard-comic {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  background: var(--soft-paper);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  transition: transform 0.15s ease;
}

.dashboard-comic:hover {
  transform: translateY(-3px);
}

.dashboard-comic img,
.dashboard-cover-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 3px solid var(--line);
}

.dashboard-cover-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}

.dashboard-comic h3 {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1.6;
}

.dashboard-comic p {
  margin: 0;
  color: #706d7d;
  font-size: 12px;
  font-weight: 700;
}

/* =========================================
   FOUNDER / MEMBER
========================================= */

.founder-panel {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: center;
  padding: 18px;
  margin-bottom: 22px;
}

.founder-panel img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.founder-panel p {
  max-width: 700px;
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.member-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  margin-bottom: 25px;
  text-align: center;
}

.member-counter strong {
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
}

/* =========================================
   ADD / COLLECTION PAGES
========================================= */

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  padding: 22px;
  margin-bottom: 20px;
  color: #fff;
  background: var(--sidebar);
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.page-heading h2 {
  display: block;
  width: fit-content;
  margin: 6px 0 5px;
  padding: 7px 9px;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
}

.page-heading p {
  margin: 10px 0 0;
  color: #cbc8d4;
  font-weight: 600;
}

.page-heading .panel-label {
  color: var(--yellow);
}

.add-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(400px, 1.2fr);
  gap: 20px;
  align-items: start;
}

.form-area,
.recent-area {
  padding: 23px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

#comic-form,
#edit-form,
#auth-form,
#reset-password-form {
  display: grid;
  gap: 11px;
}

label {
  margin-top: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-action {
  margin-top: 5px;
}

.blue-action {
  background: var(--blue);
}

.green-action {
  background: var(--green);
}

.camera-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px;
  color: #fff;
  cursor: pointer;
  background: var(--red);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}

.camera-button:hover {
  color: var(--ink);
  background: var(--yellow);
}

.camera-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 16px;
  background: #fff;
  border: 3px solid var(--line);
}

.camera-icon::before {
  position: absolute;
  top: -7px;
  left: 4px;
  width: 9px;
  height: 4px;
  content: "";
  background: #fff;
  border: 3px solid var(--line);
  border-bottom: 0;
}

.camera-icon::after {
  position: absolute;
  top: 2px;
  left: 6px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--blue);
  border: 2px solid var(--line);
  border-radius: 50%;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

#cover-message,
#edit-cover-message,
#auth-message,
#reset-password-message,
#edit-message {
  min-height: 24px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.cover-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cover-option {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--blue);
}

.cover-option img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 3px solid var(--line);
}

.collection-controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  margin-bottom: 20px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.control-group {
  display: grid;
  gap: 7px;
}

.control-group label {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
}

.export-button {
  min-height: 47px;
  background: var(--blue);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.comic-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  transition: transform 0.15s ease;
}

.comic-card:hover {
  transform: translateY(-3px);
}

.comic-card img,
.cover-placeholder,
.edit-cover-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 3px solid var(--line);
}

.cover-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
}

.comic-card h3,
.comic-card p {
  margin: 0;
}

.comic-card h3 {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.6;
}

.comic-card > p:not(.status-badge) {
  color: #706d7d;
  font-size: 12px;
  font-weight: 700;
}

.notes {
  font-style: italic;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 4px;
}

.edit-button {
  background: var(--blue);
}

.delete-button {
  background: var(--red);
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  margin: 0;
  padding: 5px 7px;
  color: #fff !important;
  border: 2px solid var(--line);
  font-size: 9px !important;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-owned {
  background: var(--green);
}

.status-reading {
  background: var(--blue);
}

.status-wishlist {
  color: var(--ink) !important;
  background: var(--yellow);
}

.status-read {
  background: var(--red);
}

#empty-message,
#filter-empty-message,
#recent-empty-message {
  padding: 18px;
  background: #fff;
  border: 3px dashed var(--line);
  font-weight: 700;
}

.edit-cover-preview {
  max-width: 180px;
}

.edit-cover-preview:empty {
  display: none;
}

/* =========================================
   ACCOUNT PAGE
========================================= */

.account-page {
  display: grid;
  gap: 20px;
}

.account-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 25px;
  color: #fff;
  background: var(--sidebar);
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.account-avatar-large {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
}

.account-hero h2 {
  margin: 5px 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 18px;
  line-height: 1.6;
}

.account-hero p {
  margin: 4px 0;
  color: #c9c6d5;
  font-weight: 700;
}

.account-status {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--green);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  text-transform: uppercase;
}

.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.account-card {
  padding: 22px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.account-card.full-width {
  grid-column: 1 / -1;
}

.account-card h3 {
  display: inline-block;
  margin: 0 0 18px;
  padding: 7px 9px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.5;
}

.account-detail-list {
  display: grid;
  gap: 12px;
}

.account-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px;
  background: var(--soft-paper);
  border: 3px solid var(--line);
}

.account-detail span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.account-detail strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.account-stat {
  padding: 14px 10px;
  text-align: center;
  background: var(--soft-paper);
  border: 3px solid var(--line);
}

.account-stat strong {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 16px;
}

.account-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-action-blue {
  background: var(--blue);
}

.account-action-red {
  background: var(--red);
}

.account-action-green {
  background: var(--green);
}

.account-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

/* =========================================
   SETTINGS PAGE
========================================= */

.settings-page {
  display: grid;
  gap: 20px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

.settings-menu,
.settings-content {
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.settings-menu {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.settings-menu-button {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  text-transform: none;
  background: var(--soft-paper);
  border: 3px solid var(--line);
  box-shadow: none;
  font-family: "Pixelify Sans", monospace;
  font-size: 15px;
  font-weight: 700;
}

.settings-menu-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--line);
}

.settings-menu-button.active {
  color: #fff;
  background: var(--blue);
  box-shadow: 3px 3px 0 var(--line);
}

.settings-content {
  padding: 25px;
}

.settings-section {
  padding-bottom: 25px;
  margin-bottom: 25px;
  border-bottom: 3px dashed #aaa7b5;
}

.settings-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 7px;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.settings-section > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 2px solid #dedbe4;
}

.setting-row:first-of-type {
  border-top: 0;
}

.setting-info {
  min-width: 0;
}

.setting-info strong {
  display: block;
  font-size: 16px;
}

.setting-info span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.setting-control {
  flex: 0 0 auto;
}

.setting-select {
  min-width: 180px;
  width: auto;
}

.setting-button {
  min-height: 42px;
  padding: 9px 12px;
  background: var(--blue);
}

.setting-button.red {
  background: var(--red);
}

.setting-button.green {
  background: var(--green);
}

.setting-button.yellow {
  color: var(--ink);
  background: var(--yellow);
}

.danger-zone {
  padding: 18px;
  background: #fff1f1;
  border: 3px solid var(--red);
}

.danger-zone h3 {
  color: var(--red);
}

.danger-zone p {
  margin: 0 0 15px;
  color: #6f4b4d;
  font-weight: 700;
  line-height: 1.6;
}

/* =========================================
   TOGGLE
========================================= */

.setting-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px;
  height: 32px;
  padding: 0;
  background: #aaa7b5;
  border: 3px solid var(--line);
  box-shadow: 3px 3px 0 var(--line);
}

.setting-toggle::after {
  width: 20px;
  height: 20px;
  margin-left: 3px;
  content: "";
  background: #fff;
  border: 2px solid var(--line);
  transition: transform 0.15s ease;
}

.setting-toggle.is-on {
  background: var(--green);
}

.setting-toggle.is-on::after {
  transform: translateX(24px);
}

/* =========================================
   DIALOGS
========================================= */

dialog {
  width: min(540px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 25px;
  overflow-y: auto;
  color: var(--ink);
  background: #fff;
  border: 4px solid var(--line);
  border-radius: 0;
  box-shadow: 8px 8px 0 var(--line);
}

dialog::backdrop {
  background: rgba(21, 19, 43, 0.78);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 5px;
}

.dialog-heading h2 {
  display: inline-block;
  margin: 5px 0 10px;
  padding: 7px;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  background: var(--red);
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-field button {
  background: var(--blue);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-button {
  background: var(--blue);
}

/* =========================================
   DELETE ACCOUNT
========================================= */

.delete-account-button {
  border: 3px solid var(--line);
  border-radius: 0;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  line-height: 1.5;
  padding: 10px 12px;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--line);
}

.delete-account-button:hover {
  background: var(--yellow);
  color: var(--ink);
}

.delete-account-dialog {
  width: min(520px, calc(100% - 32px));
  border: 4px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--line);
  padding: 28px;
}

.delete-account-dialog h2 {
  margin: 0 0 18px;
}

.delete-account-dialog p {
  font-weight: 700;
  line-height: 1.6;
}

.delete-account-dialog label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.delete-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.delete-account-actions button {
  flex: 1 1 180px;
}

#delete-account-message {
  min-height: 1.6em;
  color: var(--red);
}

/* =========================================
   FOOTER
========================================= */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: min(900px, calc(100% - 30px));
  margin: 0 auto 35px;
}

.site-footer a {
  color: #fff;
  font-weight: 700;
  text-underline-offset: 4px;
}

/* =========================================
   HIDDEN OLD RADIO NAV
========================================= */

.comic-radio-group {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* =========================================
   LOADING SCREEN
========================================= */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  background: var(--yellow);
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.loading-screen.is-active {
  opacity: 1;
}

.loading-label {
  position: absolute;
  top: calc(50% + 60px);
  right: 0;
  left: 0;
  margin: 0;
  color: var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  text-align: center;
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -50px;
  animation: speeder 0.4s linear infinite;
}

.loader > span {
  position: absolute;
  top: -19px;
  left: 60px;
  width: 35px;
  height: 5px;
  background: var(--line);
  border-radius: 2px 10px 1px 0;
}

.base span {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-right: 100px solid var(--line);
  border-bottom: 6px solid transparent;
}

.base span::before {
  position: absolute;
  top: -16px;
  right: -110px;
  width: 22px;
  height: 22px;
  content: "";
  background: var(--line);
  border-radius: 50%;
}

.base span::after {
  position: absolute;
  top: -16px;
  right: -98px;
  width: 0;
  height: 0;
  content: "";
  border-top: 0 solid transparent;
  border-right: 55px solid var(--line);
  border-bottom: 16px solid transparent;
}

.face {
  position: absolute;
  top: -15px;
  right: -125px;
  width: 20px;
  height: 12px;
  background: var(--line);
  border-radius: 20px 20px 0 0;
  transform: rotate(-40deg);
}

.face::after {
  position: absolute;
  top: 7px;
  right: 4px;
  width: 12px;
  height: 12px;
  content: "";
  background: var(--line);
  border-radius: 0 0 0 2px;
  transform: rotate(40deg);
  transform-origin: 50% 50%;
}

.loader > span > span:nth-child(1),
.loader > span > span:nth-child(2),
.loader > span > span:nth-child(3),
.loader > span > span:nth-child(4) {
  position: absolute;
  width: 30px;
  height: 1px;
  background: var(--line);
  animation: fazer1 0.2s linear infinite;
}

.loader > span > span:nth-child(2) {
  top: 3px;
  animation: fazer2 0.4s linear infinite;
}

.loader > span > span:nth-child(3) {
  top: 1px;
  animation: fazer3 0.4s linear infinite;
  animation-delay: -1s;
}

.loader > span > span:nth-child(4) {
  top: 4px;
  animation: fazer4 1s linear infinite;
  animation-delay: -1s;
}

@keyframes fazer1 {
  0% {
    left: 0;
  }

  100% {
    left: -80px;
    opacity: 0;
  }
}

@keyframes fazer2 {
  0% {
    left: 0;
  }

  100% {
    left: -100px;
    opacity: 0;
  }
}

@keyframes fazer3 {
  0% {
    left: 0;
  }

  100% {
    left: -50px;
    opacity: 0;
  }
}

@keyframes fazer4 {
  0% {
    left: 0;
  }

  100% {
    left: -150px;
    opacity: 0;
  }
}

@keyframes speeder {
  0% {
    transform: translate(2px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -3px) rotate(-1deg);
  }

  20% {
    transform: translate(-2px, 0) rotate(1deg);
  }

  30% {
    transform: translate(1px, 2px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, 3px) rotate(-1deg);
  }

  60% {
    transform: translate(-1px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }

  80% {
    transform: translate(-2px, -1px) rotate(1deg);
  }

  90% {
    transform: translate(2px, 1px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

.longfazers {
  position: absolute;
  width: 100%;
  height: 100%;
}

.longfazers span {
  position: absolute;
  width: 20%;
  height: 2px;
  background: var(--line);
}

.longfazers span:nth-child(1) {
  top: 20%;
  animation: lf 0.6s linear infinite;
  animation-delay: -5s;
}

.longfazers span:nth-child(2) {
  top: 40%;
  animation: lf 0.8s linear infinite;
  animation-delay: -1s;
}

.longfazers span:nth-child(3) {
  top: 60%;
  animation: lf3 0.6s linear infinite;
}

.longfazers span:nth-child(4) {
  top: 80%;
  animation: lf3 0.5s linear infinite;
  animation-delay: -3s;
}

@keyframes lf {
  0% {
    left: 200%;
  }

  100% {
    left: -200%;
    opacity: 0;
  }
}

@keyframes lf3 {
  0% {
    left: 200%;
  }

  100% {
    left: -100%;
    opacity: 0;
  }
}

/* =========================================
   MOBILE MENU
========================================= */

.mobile-menu-button {
  display: none;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1150px) {
  .topbar-actions {
    gap: 8px;
  }

  .topbar-user {
    display: none;
  }

  .global-search {
    width: min(280px, 35vw);
  }

  .dashboard-comic-grid,
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collection-controls {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .export-button {
    grid-column: span 1;
  }

  .settings-layout {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .app-shell {
    margin-left: 0;
  }

  .mobile-menu-button {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    display: grid;
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 9px;
    place-items: center;
    background: var(--red);
  }

  .mobile-menu-button span {
    display: block;
    width: 24px;
    height: 3px;
    margin: 2px 0;
    background: #fff;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 850;
    display: block;
    background: rgba(21, 19, 43, 0.7);
  }

  .topbar {
    padding-left: 78px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: "Press Start 2P", monospace;
    font-size: 10px;
  }

  .mobile-brand span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: var(--red);
    border: 2px solid var(--line);
    font-size: 7px;
  }

  .topbar-title {
    display: none;
  }

  .dashboard-feature-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-comic-grid,
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .add-layout {
    grid-template-columns: 1fr;
  }

  .account-hero {
    grid-template-columns: auto 1fr;
  }

  .account-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .dashboard-main {
    width: min(100% - 24px, 650px);
    margin-top: 25px;
  }

  .topbar {
    min-height: 70px;
    padding: 10px 12px 10px 72px;
  }

  .global-search {
    width: 42px;
  }

  .global-search input {
    width: 42px;
    padding: 0;
    font-size: 0;
    cursor: pointer;
  }

  .global-search span {
    left: 9px;
  }

  .topbar-auth-button {
    font-size: 7px;
  }

  .welcome-row {
    display: grid;
    align-items: start;
  }

  .welcome-copy {
    font-size: 16px;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .featured-item {
    grid-template-columns: 120px 1fr;
  }

  .featured-item img,
  .featured-cover-placeholder {
    height: 190px;
  }

  .dashboard-comic-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-controls {
    grid-template-columns: 1fr 1fr;
  }

  .control-search {
    grid-column: 1 / -1;
  }

  .export-button {
    grid-column: 1 / -1;
  }

  .founder-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .founder-panel img {
    margin: auto;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .account-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .account-avatar-large {
    margin: auto;
  }

  .account-status {
    grid-column: auto;
    justify-self: center;
  }

  .account-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .setting-control,
  .setting-select {
    width: 100%;
  }

  .settings-menu {
    grid-template-columns: 1fr;
  }

  .settings-content {
    padding: 17px;
  }
}

@media (max-width: 480px) {
  .dashboard-main {
    width: calc(100% - 16px);
    margin-top: 18px;
  }

  #home-heading {
    font-size: 20px;
  }

  .dashboard-stats {
    gap: 9px;
  }

  .stat-card {
    min-height: 86px;
    padding: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 9px;
  }

  .stat-card span:not(.stat-icon) {
    font-size: 11px;
  }

  .stat-card strong {
    font-size: 14px;
  }

  .featured-panel,
  .continue-panel,
  .dashboard-section,
  .form-area,
  .recent-area,
  .account-card {
    padding: 14px;
  }

  .featured-item {
    grid-template-columns: 90px 1fr;
    gap: 12px;
    padding: 8px;
  }

  .featured-item img,
  .featured-cover-placeholder {
    height: 150px;
  }

  .featured-details h3 {
    font-size: 10px;
  }

  .featured-details p {
    font-size: 12px;
  }

  .dashboard-comic-grid,
  .card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .comic-card,
  .dashboard-comic {
    padding: 7px;
  }

  .comic-card h3,
  .dashboard-comic h3 {
    font-size: 7px;
  }

  .collection-controls,
  .auth-actions {
    grid-template-columns: 1fr;
  }

  .collection-controls {
    padding: 12px;
  }

  .cover-suggestion-grid {
    grid-template-columns: 1fr 1fr;
  }

  .member-counter {
    flex-direction: column;
    gap: 5px;
  }

  .site-footer {
    flex-direction: column;
    align-items: center;
  }

  .account-stat-grid {
    gap: 7px;
  }

  .account-stat {
    padding: 11px 7px;
  }

  .account-stat strong {
    font-size: 12px;
  }

  .account-stat span {
    font-size: 9px;
  }

  .account-detail {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* =========================================
   SIGN-IN / SIGN-UP PAGES
========================================= */

.signin-page,
.signup-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background:
    radial-gradient(
      circle,
      rgba(255, 212, 71, 0.35) 3px,
      transparent 3.5px
    ) 0 0 / 30px 30px,
    radial-gradient(
      circle,
      rgba(255, 212, 71, 0.35) 3px,
      transparent 3.5px
    ) 15px 15px / 30px 30px,
    var(--paper);
}

.signin-container,
.signup-container {
  width: 100%;
  max-width: 460px;
  padding: 24px;
}

.signin-card,
.signup-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  padding: 30px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: 8px 8px 0 var(--line);
}

.signin-card::before,
.signup-card::before {
  position: absolute;
  top: -12px;
  left: 22px;
  width: 90px;
  height: 12px;
  content: "";
  background: var(--yellow);
  border: 3px solid var(--line);
}

.signin-brand,
.signup-brand {
  display: inline-block;
  width: fit-content;
  padding: 8px 12px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
}

.signin-brand:hover,
.signup-brand:hover {
  color: var(--ink);
  background: var(--yellow);
}

.signin-header h1,
.signup-header h1 {
  display: inline-block;
  margin: 0 0 14px;
  padding: 8px 10px;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 15px;
  line-height: 1.6;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--ink);
}

.signin-header p,
.signup-header p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.form-group {
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.6;
}

.form-group input {
  height: 48px;
  background: var(--soft-paper);
  box-shadow: 4px 4px 0 var(--line);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: auto;
  min-height: 32px;
  padding: 5px 8px;
  background: var(--blue);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  font-size: 7px;
  transform: translateY(-50%);
}

.signin-options {
  display: flex;
  justify-content: flex-end;
}

.signin-options a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.signin-submit,
.signup-submit {
  width: 100%;
  min-height: 52px;
  background: var(--green);
}

.signin-message,
.signup-message {
  min-height: 24px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.signin-divider,
.signup-divider {
  position: relative;
  text-align: center;
}

.signin-divider::before,
.signup-divider::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--line);
}

.signin-divider span,
.signup-divider span {
  position: relative;
  z-index: 1;
  padding: 0 10px;
  background: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.create-account,
.signup-signin {
  display: block;
  width: 100%;
  padding: 12px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.signup-signin {
  background: var(--red);
}

.create-account:hover,
.signup-signin:hover {
  color: var(--ink);
  background: var(--yellow);
}

.back-to-home {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
}

/* =========================================
   SMALL MOBILE AUTH
========================================= */

@media (max-width: 480px) {
  .signin-container,
  .signup-container {
    padding: 16px;
  }

  .signin-card,
  .signup-card {
    padding: 22px;
  }

  .signin-header h1,
  .signup-header h1 {
    font-size: 12px;
  }
}

/* =========================================================
   ACCOUNT PAGE
   ========================================================= */

.account-view,
.settings-view {
  width: 100%;
}

.page-heading-row {
  margin-bottom: 28px;
}

.page-heading-row h1 {
  margin: 6px 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.35;
  color: var(--ink);
}

.page-heading-copy {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.account-layout,
.settings-layout {
  display: grid;
  gap: 20px;
  width: 100%;
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
}

.account-hero-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 1.35rem;
  color: var(--ink);
}

.account-hero-info {
  min-width: 0;
}

.account-hero-info h2 {
  margin: 8px 0 6px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.account-hero-info p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 10px;
  background: var(--soft-paper);
  border: 2px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid var(--line);
}

.account-status.is-active .account-status-dot {
  background: var(--green);
}

.account-card,
.settings-card {
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  padding: 24px;
}

.account-card-header,
.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.account-card-header h2,
.settings-card-header h2 {
  margin: 7px 0 0;
  font-family: "Press Start 2P", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-stat {
  min-width: 0;
  padding: 18px 14px;
  text-align: center;
  background: var(--soft-paper);
  border: 2px solid var(--line);
}

.account-stat-number {
  display: block;
  margin-bottom: 8px;
  font-family: "Press Start 2P", monospace;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--ink);
}

.account-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-setting-row,
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-top: 2px solid rgba(21, 19, 43, 0.14);
}

.account-setting-row:first-of-type,
.settings-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.account-setting-row:last-of-type,
.settings-row:last-of-type {
  padding-bottom: 0;
}

.account-setting-copy,
.settings-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.account-setting-copy strong,
.settings-copy strong {
  color: var(--ink);
  font-size: 1rem;
}

.account-setting-copy span,
.settings-copy span {
  max-width: 700px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.account-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.15s ease;
}

.account-link-button:hover {
  color: var(--ink);
  background: var(--yellow);
}

.account-link-button:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.account-link-button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
}

.delete-account-action {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border: 2px solid var(--red);
  background: var(--red);
  color: #fff;
  font-family: "Pixelify Sans", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.delete-account-action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

.delete-account-action:active {
  transform: translate(0, 0);
  box-shadow: none;
}

.danger-zone {
  border-color: var(--red);
}

.danger-zone .account-card-header,
.danger-zone .settings-card-header {
  color: var(--red);
}

.danger-zone .panel-label {
  color: var(--red);
}


/* =========================================================
   SETTINGS PAGE
   ========================================================= */

.settings-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-card {
  height: 100%;
}

.settings-card:first-child {
  grid-column: 1 / -1;
}

.settings-select {
  min-width: 150px;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--soft-paper);
  color: var(--ink);
  font-family: "Pixelify Sans", monospace;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-select:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.settings-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.settings-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-track {
  position: relative;
  display: block;
  width: 54px;
  height: 30px;
  background: var(--muted);
  border: 2px solid var(--line);
  transition: background 0.15s ease;
}

.settings-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--panel);
  border: 2px solid var(--line);
  transition: transform 0.15s ease;
}

.settings-toggle input:checked + .settings-toggle-track {
  background: var(--green);
}

.settings-toggle input:checked + .settings-toggle-track .settings-toggle-thumb {
  transform: translateX(24px);
}

.settings-toggle input:focus-visible + .settings-toggle-track {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}


/* =========================================================
   ACCOUNT / SETTINGS RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-card:first-child {
    grid-column: auto;
  }

  .account-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .account-hero {
    align-items: flex-start;
    padding: 20px;
  }

  .account-hero-avatar {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
    font-size: 1rem;
  }

  .account-card,
  .settings-card {
    padding: 20px;
  }

  .account-setting-row,
  .settings-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .account-setting-row .secondary-action,
  .settings-row .secondary-action,
  .account-setting-row .delete-account-action,
  .settings-row .delete-account-action,
  .account-link-button {
    width: 100%;
  }

  .settings-select {
    width: 100%;
  }

  .settings-toggle {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .page-heading-row {
    margin-bottom: 20px;
  }

  .page-heading-row h1 {
    font-size: 1.1rem;
  }

  .page-heading-copy {
    font-size: 0.9rem;
  }

  .account-hero {
    flex-direction: column;
    gap: 18px;
  }

  .account-hero-avatar {
    width: 68px;
    height: 68px;
    flex-basis: 68px;
  }

  .account-card,
  .settings-card {
    padding: 16px;
    box-shadow: 5px 5px 0 var(--line);
  }

  .account-stat-grid {
    gap: 8px;
  }

  .account-stat {
    padding: 14px 8px;
  }

  .account-stat-number {
    font-size: 0.9rem;
  }

  .account-stat-label {
    font-size: 0.7rem;
  }

  .account-card-header h2,
  .settings-card-header h2 {
    font-size: 0.78rem;
  }
}
/* =========================================
   TOASTS
========================================= */

#toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 12px 14px;
  color: #fff;
  background: var(--blue);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  line-height: 1.6;
  animation: toast-in 0.2s ease-out;
}

.toast-error {
  background: var(--red);
}

.toast-success {
  background: var(--green);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* =========================================
   COVER SUGGESTIONS
========================================= */

.cover-suggestion {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 6px;
  color: var(--ink);
  text-transform: none;
  background: var(--soft-paper);
  font-family: "Pixelify Sans", monospace;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.cover-suggestion img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 3px solid var(--line);
}

.cover-suggestion.selected {
  color: #fff;
  background: var(--blue);
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
}

.founder-status-box {
  padding: 18px;
  margin-bottom: 22px;
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: var(--shadow);
}

.founder-status-box h2 {
  margin: 0 0 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  line-height: 1.6;
}

#founder-status-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

#founder-status-form {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

#founder-status-message {
  min-height: 24px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}