/* ==========================================================================
   Hanita Portfolio — Wimpy's World Tabletop Interface (Catppuccin Mocha/Latte)
   ========================================================================== */

:root {
  /* Catppuccin Mocha (Dark Default) */
  --crust: #11111b;
  --mantle: #181825;
  --base: #1e1e2e;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --control-border: #6c7086;

  --surface-elevated: rgba(30, 30, 46, 0.96);
  --sheet-surface: rgba(30, 30, 46, 0.98);
  --inset-row-bg: rgba(17, 17, 27, 0.56);
  --header-scrim: rgba(17, 17, 27, 0.74);
  --footer-scrim: rgba(17, 17, 27, 0.62);
  --switch-bg: rgba(24, 24, 37, 0.88);
  --backdrop-bg: rgba(17, 17, 27, 0.8);
  --inner-frame: rgba(205, 214, 244, 0.08);
  --deck-lattice: rgba(205, 214, 244, 0.06);

  --text: #cdd6f4;
  --subtext: #bac2de;
  --muted-text: #a6adc8;

  --mauve: #cba6f7;
  --lavender: #b4befe;
  --blue: #89b4fa;
  --sapphire: #74c7ec;
  --teal: #94e2d5;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --peach: #fab387;
  --red: #f38ba8;
  --pink: #f5c2e7;
  --rosewater: #f5e0dc;
  --flamingo: #f2cdcd;

  --accent-text: #cba6f7;
  --link-text: #89b4fa;
  --fresh-text: #a6e3a1;
  --warn-text: #f9e2af;
  --info-text: #74c7ec;
  --danger-text: #f38ba8;
  --heart-color: #f5c2e7;

  --btn-active-bg: #cba6f7;
  --btn-active-fg: #11111b;
  --aurora: linear-gradient(90deg, var(--mauve) 0%, var(--blue) 52%, var(--teal) 100%);

  --scrabble-bg: #f4e6c8;
  --scrabble-border: #d4bc8b;
  --scrabble-shadow: #9b8151;
  --scrabble-fg: #2b2218;

  --card-shadow: 0 14px 32px rgba(0, 0, 0, 0.36);
  --card-hover-shadow: 0 24px 48px rgba(0, 0, 0, 0.52);
  --modal-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);

  --radius-card: 16px;
  --radius-sheet: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --container-max: 1320px;

  --font-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --sheen-blend: screen;
  --sheen-alpha: 0.14;
}

:root[data-theme="latte"] {
  --crust: #dce0e8;
  --mantle: #e6e9ef;
  --base: #eff1f5;
  --surface0: #ccd0da;
  --surface1: #bcc0cc;
  --surface2: #acb0be;
  --control-border: #7c7f93;

  --surface-elevated: rgba(239, 241, 245, 0.96);
  --sheet-surface: rgba(239, 241, 245, 0.98);
  --inset-row-bg: rgba(204, 208, 218, 0.56);
  --header-scrim: rgba(220, 224, 232, 0.82);
  --footer-scrim: rgba(220, 224, 232, 0.72);
  --switch-bg: rgba(230, 233, 239, 0.92);
  --backdrop-bg: rgba(76, 79, 105, 0.56);
  --inner-frame: rgba(76, 79, 105, 0.08);
  --deck-lattice: rgba(76, 79, 105, 0.075);

  --text: #4c4f69;
  --subtext: #5c5f77;
  --muted-text: #6c6f85;

  --mauve: #8839ef;
  --lavender: #7287fd;
  --blue: #1e66f5;
  --sapphire: #209fb5;
  --teal: #179299;
  --green: #40a02b;
  --yellow: #df8e1d;
  --peach: #fe640b;
  --red: #d20f39;
  --pink: #ea76cb;
  --rosewater: #dc8a78;
  --flamingo: #dd7878;

  --accent-text: #8839ef;
  --link-text: #1752c8;
  --fresh-text: #2a6f1d;
  --warn-text: #8f5900;
  --info-text: #0e6c7d;
  --danger-text: #b80d32;
  --heart-color: #d20f39;

  --btn-active-bg: #8839ef;
  --btn-active-fg: #eff1f5;

  --scrabble-bg: #fbf4e4;
  --scrabble-border: #d9c59d;
  --scrabble-shadow: #b59d72;
  --scrabble-fg: #3b3022;

  --card-shadow: 0 12px 26px rgba(76, 79, 105, 0.14);
  --card-hover-shadow: 0 22px 42px rgba(76, 79, 105, 0.22);
  --modal-shadow: 0 28px 64px rgba(76, 79, 105, 0.3);

  --sheen-blend: soft-light;
  --sheen-alpha: 0.34;
}

/* ==========================================================================
   Base & Swirling Tabletop Background
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background-color: #101114;
  background-image:
    radial-gradient(920px 520px at 14% -6%, rgba(42, 46, 55, 0.52), transparent 68%),
    radial-gradient(840px 480px at 88% 12%, rgba(32, 35, 42, 0.46), transparent 66%),
    radial-gradient(760px 440px at 50% 96%, rgba(23, 25, 30, 0.42), transparent 70%);
  overflow-x: clip;
  position: relative;
}

:root[data-theme="latte"] body {
  background-color: #e4e6ea;
  background-image:
    radial-gradient(920px 520px at 14% -6%, rgba(197, 202, 212, 0.56), transparent 68%),
    radial-gradient(840px 480px at 88% 12%, rgba(207, 211, 219, 0.48), transparent 66%),
    radial-gradient(760px 440px at 50% 96%, rgba(218, 221, 227, 0.44), transparent 70%);
}

.bg-swirl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.site-header,
.deck-dock,
.site-main,
.site-footer {
  position: relative;
  z-index: 2;
}

a {
  color: var(--link-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

button,
input,
textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--mauve);
  outline-offset: 2px;
}

/* Accent Mapping (high specificity so card accents override default --card-accent) */
[data-accent="mauve"], .play-card[data-accent="mauve"] { --card-accent: var(--mauve); }
[data-accent="lavender"], .play-card[data-accent="lavender"] { --card-accent: var(--lavender); }
[data-accent="blue"], .play-card[data-accent="blue"] { --card-accent: var(--blue); }
[data-accent="sapphire"], .play-card[data-accent="sapphire"] { --card-accent: var(--sapphire); }
[data-accent="teal"], .play-card[data-accent="teal"] { --card-accent: var(--teal); }
[data-accent="green"], .play-card[data-accent="green"] { --card-accent: var(--green); }
[data-accent="yellow"], .play-card[data-accent="yellow"] { --card-accent: var(--yellow); }
[data-accent="peach"], .play-card[data-accent="peach"] { --card-accent: var(--peach); }
[data-accent="pink"], .play-card[data-accent="pink"] { --card-accent: var(--pink); }
[data-accent="rosewater"], .play-card[data-accent="rosewater"] { --card-accent: var(--rosewater); }
[data-accent="flamingo"], .play-card[data-accent="flamingo"] { --card-accent: var(--flamingo); }
[data-accent="red"], .play-card[data-accent="red"] { --card-accent: var(--red); }

/* ==========================================================================
   Sticky Frosted Top Header (Exact Wimpy's World Style)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-scrim);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--mauve) 24%,
    var(--blue) 52%,
    var(--teal) 78%,
    transparent 100%
  );
  opacity: 0.82;
  pointer-events: none;
}

.header-inner {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-title {
  color: var(--text);
  font-size: clamp(1.12rem, 1.8vw, 1.42rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
}

.site-title:hover {
  color: var(--mauve);
  text-decoration: none;
}

.site-subtitle {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--subtext);
}

.header-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 196px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--control-border);
  background: var(--switch-bg);
  color: var(--muted-text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.header-search:focus-within {
  border-color: var(--mauve);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mauve) 22%, transparent);
}

.header-search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  opacity: 0.8;
}

.header-search input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.2;
  outline: none;
}

.header-search input::placeholder {
  color: var(--muted-text);
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 2px;
  gap: 2px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--control-border);
  background: var(--switch-bg);
}

.theme-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn[aria-pressed="true"] {
  background: var(--btn-active-bg);
  color: var(--btn-active-fg);
}

.theme-btn svg {
  width: 15px;
  height: 15px;
}

.sfx-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--surface1);
  background: var(--switch-bg);
  color: var(--subtext);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.sfx-toggle:hover {
  border-color: var(--mauve);
  color: var(--text);
}

.sfx-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--teal) 70%, transparent);
  color: var(--teal);
}

.sfx-toggle svg {
  width: 16px;
  height: 16px;
}

.header-admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--control-border);
  background: var(--switch-bg);
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.header-admin-pill:hover {
  border-color: var(--mauve);
  color: var(--text);
  text-decoration: none;
}

.header-admin-pill.is-active {
  border-color: color-mix(in srgb, var(--green) 70%, transparent);
  color: var(--fresh-text);
}

/* ==========================================================================
   5-Deck Playing-Card Navigation Dock
   ========================================================================== */

.deck-dock {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 20px 24px 6px;
  display: flex;
  justify-content: center;
}

.deck-dock-list {
  display: grid;
  grid-template-columns: repeat(5, 104px);
  gap: 22px;
  align-items: stretch;
  justify-content: center;
}

.deck-card {
  --deck-accent: var(--mauve);
  position: relative;
  width: 100%;
  height: 148px;
  border-radius: 13px;
  border: 1.5px solid var(--surface1);
  background-color: var(--surface-elevated);
  background-image:
    repeating-linear-gradient(45deg, var(--deck-lattice) 0 1px, transparent 1px 11px),
    repeating-linear-gradient(-45deg, var(--deck-lattice) 0 1px, transparent 1px 11px);
  color: var(--text);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow:
    0 3px 0 var(--surface0),
    0 6px 0 var(--mantle),
    0 12px 24px rgba(0, 0, 0, 0.34);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
  overflow: hidden;
  user-select: none;
}

.deck-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--deck-accent);
  opacity: 0.92;
}

.deck-card::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 9px;
  border: 1px solid var(--inner-frame);
  pointer-events: none;
}

.deck-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--deck-accent) 75%, var(--surface1));
  box-shadow:
    0 4px 0 var(--surface0),
    0 8px 0 var(--mantle),
    0 18px 32px rgba(0, 0, 0, 0.44);
}

/* Corner diamond pips */
.deck-pip {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--deck-accent);
  transform: rotate(45deg);
  opacity: 0.78;
  pointer-events: none;
}

.deck-pip.tl { top: 11px; left: 11px; }
.deck-pip.tr { top: 11px; right: 11px; }
.deck-pip.bl { bottom: 11px; left: 11px; }
.deck-pip.br { bottom: 11px; right: 11px; }

.deck-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.deck-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--subtext);
  background: var(--inset-row-bg);
  border: 1px solid var(--surface1);
  border-radius: var(--radius-pill);
  padding: 2px 11px;
  min-width: 44px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.deck-dealt-label {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--deck-accent);
  background: color-mix(in srgb, var(--deck-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--deck-accent) 55%, transparent);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

/* Active Dealt Deck Slot (Dashed Empty Table Slot) */
.deck-card.is-active {
  background-image: none;
  background-color: color-mix(in srgb, var(--deck-accent) 8%, var(--mantle));
  border: 1.8px dashed color-mix(in srgb, var(--deck-accent) 85%, transparent);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--deck-accent) 9%, transparent);
  transform: none;
}

.deck-card.is-active::before,
.deck-card.is-active::after,
.deck-card.is-active .deck-pip {
  opacity: 0;
}

.deck-card.is-active .deck-count {
  display: none;
}

.deck-card.is-active .deck-dealt-label {
  display: inline-block;
}

/* Miniature Scrabble Board on About Deck */
.deck-card--about {
  justify-content: space-between;
  padding: 10px 8px 10px;
  background-image: none;
}

.mini-scrabble {
  width: 78px;
  height: 78px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 1.5px;
  padding: 3px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--crust) 88%, var(--surface0));
  border: 1px solid var(--surface1);
  position: relative;
  z-index: 1;
}

.ms-cell {
  border-radius: 1.5px;
  background: rgba(69, 71, 90, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.44rem;
  font-weight: 700;
  line-height: 1;
}

.ms-cell.tw { background: rgba(243, 139, 168, 0.42); }
.ms-cell.dw { background: rgba(250, 179, 135, 0.38); }
.ms-cell.tl { background: rgba(137, 180, 250, 0.42); }
.ms-cell.dl { background: rgba(148, 226, 213, 0.38); }

.ms-cell.tile {
  background: var(--scrabble-bg);
  color: var(--scrabble-fg);
  box-shadow: 0 1px 0 var(--scrabble-shadow);
}

.deck-card--about.is-active .mini-scrabble {
  opacity: 0.85;
}

/* ==========================================================================
   Main Tabletop Container & Flash Banners
   ========================================================================== */

.site-main {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 18px 24px 56px;
  flex: 1 0 auto;
}

.flash-list {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1.5px solid var(--surface1);
  background: var(--surface-elevated);
  box-shadow: var(--card-shadow);
}

.flash-success {
  border-color: color-mix(in srgb, var(--green) 65%, transparent);
  color: var(--fresh-text);
}

.flash-error {
  border-color: color-mix(in srgb, var(--red) 65%, transparent);
  color: var(--danger-text);
}

.is-hidden {
  display: none !important;
}

/* ==========================================================================
   About Me Tabletop Spread (Profile Photo Card + Bio Sheet + Scrabble Tiles)
   ========================================================================== */

.about-spread {
  width: 100%;
  margin: 8px auto 34px;
}

.about-spread-grid {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 28px;
  align-items: stretch;
}

.about-portrait-card {
  width: 100%;
  min-height: 318px;
  --card-accent: var(--rosewater);
  --tilt: -1.4deg;
  --stagger: 0px;
  justify-content: space-between;
  text-align: center;
}

.about-card-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: auto 0;
  padding: 6px 0;
}

.about-avatar-wrap {
  width: 114px;
  height: 114px;
  border-radius: 50%;
  padding: 3px;
  background: var(--aurora);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.about-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--mantle);
}

.about-card-name {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.25;
}

.about-click-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid color-mix(in srgb, var(--rosewater) 72%, var(--surface1));
  background: color-mix(in srgb, var(--rosewater) 10%, transparent);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.about-portrait-card:hover .about-click-pill {
  background: var(--btn-active-bg);
  border-color: var(--btn-active-bg);
  color: var(--btn-active-fg);
}

/* Right Bio Sheet Card */
.about-bio-sheet {
  position: relative;
  background: var(--surface-elevated);
  border: 1.5px solid var(--surface1);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  overflow: hidden;
}

.about-bio-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--aurora);
  opacity: 0.9;
}

.about-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.about-sheet-location {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about-bio-heading {
  margin: 0;
  font-size: clamp(1.24rem, 2.2vw, 1.52rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.25;
}

.about-bio-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--subtext);
}

.about-bio-copy p {
  margin: 0;
}

.about-bio-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--inner-frame);
}

.about-stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mono-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--inset-row-bg);
  border: 1px solid var(--surface0);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--subtext);
}

.mono-chip strong {
  color: var(--fresh-text);
  font-weight: 600;
}

.about-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Scrabble Welcome Ribbon (shown prominently in About deck mode) */
.scrabble-banner {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.scrabble-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.scrabble-space {
  width: 12px;
}

.scrabble-tile {
  position: relative;
  width: 34px;
  height: 36px;
  border-radius: 6px;
  background: var(--scrabble-bg);
  border: 1px solid var(--scrabble-border);
  box-shadow: 0 3px 0 var(--scrabble-shadow), 0 6px 14px rgba(0, 0, 0, 0.28);
  color: var(--scrabble-fg);
  font-weight: 700;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease;
}

.scrabble-tile:hover {
  transform: translateY(-4px) rotate(-3deg);
}

.scrabble-tile sub {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 600;
  opacity: 0.78;
}

/* ==========================================================================
   Playing-Card Table Grid (Exact Wimpy's World /blog/ Card Anatomy)
   ========================================================================== */

.cards-section {
  margin-bottom: 32px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 26px 24px;
  align-items: stretch;
}

@keyframes card-float {
  0%, 100% {
    transform: translateY(var(--stagger, 0px)) rotate(var(--tilt, 0deg));
  }
  50% {
    transform: translateY(calc(var(--stagger, 0px) - 4px)) rotate(calc(var(--tilt, 0deg) + 0.35deg));
  }
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(-28px) scale(0.94) rotate(0deg);
  }
  to {
    opacity: 1;
    transform: translateY(var(--stagger, 0px)) scale(1) rotate(var(--tilt, 0deg));
  }
}

.play-card {
  --card-accent: var(--mauve);
  --tilt: 0deg;
  --stagger: 0px;
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 50%;

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 318px;
  padding: 15px 15px 14px;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--surface1);
  background: var(--surface-elevated);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  animation: card-float 6.2s ease-in-out var(--float-delay, 0s) infinite;
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.16s ease;
}

/* Organic alternating tabletop tilt & stagger like Wimpy's World */
.card-grid .play-card:nth-child(5n + 1) { --tilt: -1.35deg; --stagger: 2px;  --float-delay: 0s; }
.card-grid .play-card:nth-child(5n + 2) { --tilt: 0.95deg;  --stagger: -5px; --float-delay: -1.3s; }
.card-grid .play-card:nth-child(5n + 3) { --tilt: -0.75deg; --stagger: 4px;  --float-delay: -2.6s; }
.card-grid .play-card:nth-child(5n + 4) { --tilt: 1.45deg;  --stagger: -3px; --float-delay: -3.9s; }
.card-grid .play-card:nth-child(5n + 5) { --tilt: -1.1deg;  --stagger: 3px;  --float-delay: -5.1s; }

.play-card.is-dealing {
  animation: card-deal 0.36s cubic-bezier(0.22, 1, 0.36, 1) var(--deal-delay, 0ms) both;
}

/* 2px Top Aurora Highlight Bar */
.play-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--aurora);
  opacity: 0.85;
  pointer-events: none;
}

/* Satin Catch-Light Sheen on Hover */
.play-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--mx) var(--my),
    rgba(255, 255, 255, var(--sheen-alpha)),
    transparent 70%
  );
  mix-blend-mode: var(--sheen-blend);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.play-card:hover {
  animation-play-state: paused;
  z-index: 6;
  text-decoration: none;
  border-color: color-mix(in srgb, var(--card-accent) 75%, var(--surface1));
  box-shadow: var(--card-hover-shadow);
  transform: perspective(900px) translateY(-7px) scale(1.02) rotateX(var(--rx)) rotateY(var(--ry));
}

.play-card:hover::after {
  opacity: 1;
}

/* Card Header Row: colored dot + category + optional pill */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-cat-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.card-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--card-accent) 65%, transparent);
  flex: 0 0 7px;
}

.card-cat {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--subtext);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-handle {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted-text);
  white-space: nowrap;
}

.card-status-pill {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--green) 60%, transparent);
  color: var(--fresh-text);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  white-space: nowrap;
}

/* Centerpiece Colored Outline Icon + 4-Point Sparkles */
.card-icon-stage {
  position: relative;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 10px;
}

.card-icon {
  width: 38px;
  height: 38px;
  color: var(--card-accent);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--card-accent) 32%, transparent));
  transition: transform 0.22s ease;
}

.play-card:hover .card-icon {
  transform: scale(1.08);
}

.card-sparkle {
  position: absolute;
  color: var(--card-accent);
  opacity: 0.45;
  pointer-events: none;
  font-size: 0.68rem;
  line-height: 1;
}

.card-sparkle.s1 { top: 8px; left: 26%; font-size: 0.65rem; }
.card-sparkle.s2 { top: 14px; right: 24%; font-size: 0.55rem; opacity: 0.36; }
.card-sparkle.s3 { bottom: 6px; left: 32%; font-size: 0.5rem; opacity: 0.34; }
.card-sparkle.s4 { bottom: 10px; right: 28%; font-size: 0.72rem; opacity: 0.48; }

.play-card:hover .card-sparkle {
  opacity: 0.85;
}

/* Title & Excerpt */
.card-title {
  margin: 0 0 6px;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.28;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  margin: 0 0 14px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--subtext);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link cards: larger centered icon + title, clean Wimpy Links layout */
.play-card--link .card-icon-stage {
  height: 112px;
  margin: 14px 0 10px;
}

.play-card--link .card-icon {
  width: 50px;
  height: 50px;
}

.play-card--link .card-title {
  text-align: center;
  font-size: 1.14rem;
  margin-bottom: 6px;
}

.play-card--link .card-summary {
  text-align: center;
  -webkit-line-clamp: 2;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

/* Bottom Monospace Stat Rows (Exact READ TIME / PUBLISHED look) */
.card-meta-rows {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--inset-row-bg);
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.2;
}

.card-meta-key {
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.card-meta-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-val.is-accent {
  color: var(--card-accent);
}

.empty-search-state {
  text-align: center;
  padding: 36px 20px;
  border-radius: var(--radius-card);
  border: 1.8px dashed var(--surface1);
  background: color-mix(in srgb, var(--mantle) 70%, transparent);
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* ==========================================================================
   Wimpy-Style Bottom Filter / Pagination Bar
   ========================================================================== */

.table-controls-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 26px 0 38px;
}

.deck-filter-pills {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.deck-pill {
  min-width: 38px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--surface1);
  background: var(--surface-elevated);
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.14s ease;
}

.deck-pill:hover {
  border-color: var(--mauve);
  color: var(--text);
  transform: translateY(-1px);
}

.deck-pill.is-active {
  background: var(--btn-active-bg);
  border-color: var(--btn-active-bg);
  color: var(--btn-active-fg);
}

.table-shortcut-pill {
  grid-column: 3;
  justify-self: end;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--peach) 70%, transparent);
  background: color-mix(in srgb, var(--peach) 14%, var(--surface-elevated));
  color: var(--peach);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.table-shortcut-pill:hover {
  transform: translateY(-2px);
  background: var(--peach);
  color: var(--crust);
  text-decoration: none;
}

.table-shortcut-pill svg {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   Comments Section (Matched to hanita.pythonanywhere.com in Catppuccin UI)
   ========================================================================== */

.comments-section {
  width: 100%;
  margin: 0 auto 32px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface0);
}

.section-heading-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(1.14rem, 2vw, 1.36rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.section-count-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--peach);
  background: color-mix(in srgb, var(--peach) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--peach) 50%, transparent);
  padding: 3px 11px;
  border-radius: var(--radius-pill);
}

.comments-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.comment-card {
  position: relative;
  background: var(--surface-elevated);
  border: 1.5px solid var(--surface1);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.comment-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--peach), var(--pink), var(--mauve));
  opacity: 0.85;
}

.comment-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-author-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-author {
  font-weight: 700;
  color: var(--text);
  font-size: 0.96rem;
}

.comment-subject-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--mauve) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mauve) 42%, transparent);
  color: var(--accent-text);
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-text);
}

.comment-body {
  margin: 0;
  color: var(--subtext);
  font-size: 0.92rem;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-empty-slot {
  padding: 24px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-card);
  border: 1.8px dashed color-mix(in srgb, var(--peach) 60%, var(--surface1));
  background: color-mix(in srgb, var(--peach) 6%, var(--mantle));
  text-align: center;
  color: var(--subtext);
  font-size: 0.92rem;
}

.comment-form-card,
.admin-card {
  position: relative;
  background: var(--surface-elevated);
  border: 1.5px solid var(--surface1);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.comment-form-card::before,
.admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--aurora);
}

.comment-form-card h3,
.admin-card h3 {
  margin: 0 0 14px;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
}

/* ==========================================================================
   Buttons & Forms
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--btn-active-bg);
  color: var(--btn-active-fg);
  border-color: var(--btn-active-bg);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--inset-row-bg);
  color: var(--text);
  border-color: var(--surface1);
}

.btn-secondary:hover {
  border-color: var(--mauve);
  color: var(--accent-text);
}

.btn-danger {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--danger-text);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--red) 24%, transparent);
}

.btn-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.78rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-grid .form-field {
  margin-bottom: 0;
}

.form-field.full-width {
  grid-column: 1 / -1;
}

label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--subtext);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--surface1);
  background: var(--inset-row-bg);
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.5;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--mauve);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mauve) 20%, transparent);
}

.form-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.comment-admin-bar {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--surface1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-inline-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.comment-inline-edit input[type="text"] {
  flex: 1 1 200px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.86rem;
}

.admin-section {
  width: 100%;
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* ==========================================================================
   3D Flip-Card Detail Modal (Exact Wimpy's World Modal)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-backdrop::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--backdrop-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@keyframes flip-card-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(0.4deg); }
}

.flip-float-wrap {
  position: relative;
  z-index: 1;
  width: min(560px, 92vw);
  max-height: 88dvh;
  display: flex;
  animation: flip-card-float 5.6s ease-in-out infinite;
}

.flip-float-wrap:hover {
  animation-play-state: paused;
}

.flip-scene {
  width: 100%;
  perspective: 1400px;
  display: flex;
}

.flip-card {
  width: 100%;
  transform: rotateY(-16deg) scale(0.94);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
}

.modal-backdrop.is-open .flip-card {
  transform: rotateY(0deg) scale(1);
}

.flip-face-back {
  position: relative;
  width: 100%;
  max-height: 88dvh;
  background: var(--base);
  border: 2px solid var(--surface1);
  border-radius: var(--radius-sheet);
  box-shadow: var(--modal-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.flip-face-back::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--aurora);
  z-index: 2;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--surface1);
  background: var(--switch-bg);
  color: var(--subtext);
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.modal-close-btn:hover {
  border-color: var(--mauve);
  color: var(--text);
  transform: scale(1.06);
}

.modal-scroll {
  padding: 26px 26px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 36px;
}

.modal-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--mauve);
  flex: 0 0 56px;
}

.modal-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--card-accent, var(--mauve)) 14%, var(--mantle));
  border: 1.5px solid color-mix(in srgb, var(--card-accent, var(--mauve)) 48%, transparent);
  color: var(--card-accent, var(--mauve));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
}

.modal-icon-badge svg {
  width: 24px;
  height: 24px;
}

.modal-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.modal-title {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.24;
  color: var(--text);
}

.bio-copy {
  display: flex;
  flex-direction: column;
  gap: 0.78rem;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--subtext);
}

.bio-copy p {
  margin: 0;
}

.bio-explainer {
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--surface1);
  background: color-mix(in srgb, var(--surface0) 68%, transparent);
}

.bio-explainer-title {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-text);
}

.bio-explainer p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--subtext);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--inset-row-bg);
  border: 1px solid var(--surface1);
  color: var(--subtext);
}

.modal-highlights {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--subtext);
  font-size: 0.9rem;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--inner-frame);
}

/* ==========================================================================
   Frosted 3-Column Monospace Footer (Exact Wimpy's World Footer)
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, transparent 0%, var(--footer-scrim) 34%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.footer-rule {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-rule-line {
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--mauve), var(--blue), transparent);
  opacity: 0.65;
}

.footer-rule-line.is-right {
  background: linear-gradient(90deg, transparent, var(--blue), var(--teal), transparent);
}

.footer-rule-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mauve);
  box-shadow: 0 0 10px var(--mauve);
}

.footer-bar {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 14px 24px 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--subtext);
}

.footer-left {
  justify-self: start;
}

.footer-center {
  justify-self: center;
  text-align: center;
}

.footer-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bar a {
  color: var(--subtext);
  transition: color 0.15s ease;
}

.footer-bar a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.footer-heart {
  color: var(--heart-color);
}

/* ==========================================================================
   Standalone Auth & Edit Pages (/login, /projects/<id>/edit)
   ========================================================================== */

.narrow-main {
  width: min(540px, 100%);
  margin: 0 auto;
  padding: 44px 20px 60px;
  flex: 1 0 auto;
}

.medium-main {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 36px 20px 60px;
  flex: 1 0 auto;
}

/* ==========================================================================
   Responsive Breakpoints — All iPads (Mini, Air, Pro) & All Phones
   ========================================================================== */

/* Laptop / iPad Pro 12.9" Landscape (1024px – 1259px) */
@media (max-width: 1259px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 20px;
  }

  .deck-dock-list {
    grid-template-columns: repeat(5, 96px);
    gap: 16px;
  }

  .deck-card {
    height: 138px;
  }
}

/* iPad Portrait & iPad Air / Mini Landscape (768px – 1023px) */
@media (max-width: 1023px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 18px;
  }

  .admin-section {
    grid-template-columns: 1fr;
  }
}

/* iPad Portrait / Tablet Narrow (<= 860px) */
@media (max-width: 860px) {
  .header-inner {
    padding: 12px 18px;
  }

  .header-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .header-search {
    flex: 1 1 160px;
    max-width: 240px;
    margin-right: auto;
  }

  .about-spread-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .about-portrait-card {
    max-width: 260px;
    min-height: 296px;
    margin: 0 auto;
  }

  .comments-grid {
    grid-template-columns: 1fr;
  }

  .footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 14px 16px 22px;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    justify-self: center;
  }

  .site-main {
    padding: 16px 18px 46px;
  }
}

/* Small Tablets & Large Phones (520px – 767px) */
@media (max-width: 767px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
  }

  .deck-dock {
    padding: 16px 14px 4px;
  }

  .deck-dock-list {
    width: 100%;
    max-width: 500px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .deck-card {
    height: auto;
    aspect-ratio: 5 / 7;
    min-height: 98px;
    padding: 8px 4px;
    gap: 5px;
  }

  .mini-scrabble {
    width: 52px;
    height: 52px;
    padding: 2px;
  }

  .ms-cell {
    font-size: 0.34rem;
  }

  .deck-label {
    font-size: 0.74rem;
  }

  .deck-count,
  .deck-dealt-label {
    font-size: 0.6rem;
    padding: 2px 6px;
    min-width: 0;
  }

  .table-controls-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones (< 560px) */
@media (max-width: 560px) {
  .header-inner {
    padding: 10px 14px;
    gap: 8px 10px;
  }

  .site-subtitle {
    font-size: 0.78rem;
  }

  .header-controls {
    gap: 8px;
  }

  .header-search {
    max-width: none;
    flex: 1 1 100%;
    order: 2;
    height: 40px;
  }

  .header-search input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  textarea {
    font-size: 16px;
  }

  .deck-dock {
    padding: 14px 10px 4px;
  }

  .deck-dock-list {
    gap: 6px;
  }

  .deck-card {
    min-height: 86px;
    border-radius: 10px;
  }

  .deck-pip {
    width: 4px;
    height: 4px;
  }

  .deck-pip.tl { top: 7px; left: 7px; }
  .deck-pip.tr { top: 7px; right: 7px; }
  .deck-pip.bl { bottom: 7px; left: 7px; }
  .deck-pip.br { bottom: 7px; right: 7px; }

  .mini-scrabble {
    width: 42px;
    height: 42px;
  }

  .deck-label {
    font-size: 0.68rem;
  }

  .site-main {
    padding: 14px 14px 40px;
  }

  .about-bio-sheet {
    padding: 18px 16px;
  }

  .scrabble-tile {
    width: 28px;
    height: 30px;
    font-size: 0.82rem;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .flip-float-wrap {
    width: 96vw;
    max-height: 90dvh;
  }

  .modal-scroll {
    padding: 20px 18px;
  }

  .comment-form-card,
  .admin-card {
    padding: 18px 16px;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* Single Centered Playing-Card Column on Phones (< 520px, matching Wimpy's 375x812) */
@media (max-width: 519px) {
  .card-grid {
    grid-template-columns: minmax(0, 320px);
    justify-content: center;
    gap: 18px;
  }

  .play-card {
    min-height: 296px;
  }
}

/* Ultra-narrow screens (<= 380px, e.g. iPhone SE 320px/375px) */
@media (max-width: 380px) {
  .deck-dock {
    padding: 12px 8px 2px;
  }

  .deck-dock-list {
    gap: 5px;
  }

  .deck-label {
    font-size: 0.62rem;
  }

  .deck-dealt-label {
    display: none !important;
  }

  .mini-scrabble {
    width: 36px;
    height: 36px;
  }
}

/* Touch devices: smooth tap without hover tilt jitter */
@media (hover: none) {
  .play-card:hover {
    transform: translateY(-3px);
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .play-card,
  .play-card.is-dealing,
  .flip-float-wrap {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .play-card:hover {
    transform: none !important;
  }
}
