/* Hide WA elements until defined to prevent FOUC */
wa-dialog:not(:defined),
wa-button:not(:defined),
wa-switch:not(:defined),
wa-rating:not(:defined),
wa-radio-group:not(:defined),
wa-tab-group:not(:defined),
wa-icon-button:not(:defined) {
  visibility: hidden;
}

/* Suppress iOS Safari autofill contacts icon */
input::-webkit-contacts-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

:root {
  --pack-bg:    #2952ff;
  --pack-dark:  #1a3acc;
  --pack-faint: rgba(255,255,255,0.15);
  --surface:    #ffffff;
  --text:       #12213a;
  --text-mid:   #5a6478;
  --text-light: #9aa0ae;
  --correct:    #52b788;
  --error:      #ff6b6b;

  /* Type scale */
  --text-xs:   0.65rem;
  --text-sm:   0.75rem;
  --text-base: 0.875rem;
  --text-md:   1rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;

  /* Map our tokens → WA tokens */
  --wa-font-sans: 'proxima-soft', sans-serif;
  --wa-font-serif: 'bogart', serif;
  --wa-color-brand-50: var(--pack-bg);
  --wa-color-brand-40: var(--pack-dark);
  --wa-color-brand-60: color-mix(in srgb, var(--pack-bg) 80%, white);
  --wa-color-brand-70: color-mix(in srgb, var(--pack-bg) 60%, white);
  --wa-color-brand-80: color-mix(in srgb, var(--pack-bg) 40%, white);
  --wa-color-brand-90: color-mix(in srgb, var(--pack-bg) 20%, white);
  --wa-color-brand-95: color-mix(in srgb, var(--pack-bg) 10%, white);
  --wa-color-neutral-1000: var(--text);
  --wa-color-neutral-600: var(--text-mid);
  --wa-color-neutral-400: var(--text-light);
  --wa-color-success-600: var(--correct);
  --wa-color-danger-600: var(--error);
  --wa-border-radius-medium: 8px;
  --wa-focus-ring-width: 2px;
  --wa-focus-ring-offset: 2px;
  --wa-color-focus: rgba(255,255,255,0.5);
}
[data-theme="timeless"] {
  --wa-font-sans: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --wa-font-serif: 'Zilla Slab', Georgia, serif;
  --wa-color-neutral-1000: #121212;
  --wa-color-focus: rgba(18,18,18,0.4);
  --wa-border-radius-medium: 4px;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: hidden;
}

body {
  font-family: 'proxima-soft', sans-serif;
  background: var(--pack-bg);
  min-height: 100vh;
  color: var(--text);
  transition: background 0.4s;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* ── Header ── */
header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 10;
  isolation: isolate;
}

.header-left {
  display: flex;
  align-items: center;
}

.site-title {
  font-family: 'bogart', serif;
  font-size: var(--text-lg);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  top: 1.5px;
}
.site-title:hover { color: #fff; }
.beta-tag {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #ffd644;
  color: #333;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  margin-left: 0.4rem;
}
.beta-tag:hover {
  background: #f0c030;
}
.site-logo {
  font-size: var(--text-xl);
  position: relative;
  top: -2px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-date {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.header-date:hover {
  color: rgba(255,255,255,0.85);
}
wa-button.header-nav::part(base) {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s;
}
wa-button.header-nav::part(base):hover {
  color: #fff;
}
wa-button.header-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

.header-pack {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--pack-faint);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.header-actions { display: flex; gap: 0.1rem; }

wa-button.icon-btn::part(base) {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
wa-button.icon-btn::part(base):hover { background: var(--pack-faint); color: #fff; }

/* ── Main ── */
main {
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  min-height: calc(100vh - 56px - 4.5rem);
}

/* ── Card ── */
.card-scene {
  width: 100%; max-width: 420px; perspective: 1200px; margin-bottom: 8px; position: relative; z-index: 6;
  transition: transform 0.2s ease;
}
.card-scene:hover {
  transform: scale(1.02);
}
.card-scene:hover .card-face {
  box-shadow:
    0 8px 0 color-mix(in srgb, var(--pack-bg) 28%, white),
    0 6px 20px rgba(0,0,0,0.12);
}

.card-flipper {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-flipper.celebrate {
  transition: none !important;
}
.card-flipper.celebrate-from-front {
  animation: celebrateFromFront 2.4s ease-in-out forwards;
}
.card-flipper.celebrate-from-back {
  animation: celebrateFromBack 2.4s ease-in-out forwards;
}

@keyframes celebrateFromFront {
  0%   { transform: rotateY(0deg); animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  78%  { transform: rotateY(1282.5deg); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100% { transform: rotateY(1260deg); }
}
@keyframes celebrateFromBack {
  0%   { transform: rotateY(180deg); animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  78%  { transform: rotateY(1642.5deg); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100% { transform: rotateY(1620deg); }
}

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--pack-bg) 28%, white);
  transition: box-shadow 0.6s ease;
  position: relative;
  cursor: pointer;
  /* Force GPU layer for each face so backface-visibility works reliably */
  transform: translateZ(1px);
}


/* Front */
.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 2rem;
}

.icon-row {
  display: grid;
  grid-template-columns: repeat(2, auto);
  align-items: center;
  justify-items: center;
  justify-content: center;
  gap: 3rem;
}

/* Center orphaned last icon when odd count */
.icon-row .puzzle-icon:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.puzzle-icon {
  font-size: clamp(3rem, 10vw, 4rem);
  line-height: 1;
  user-select: none;
  color: var(--text);
  min-width: 1em;
  text-align: center;
}

.icon-divider {
  width: 40%;
  border: none;
  border-top: 2px solid rgba(0,0,0,0.1);
  margin: 0.5rem 0;
}

/* Back */
.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(1px);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* ── Card back hearts (mirror) ── */
.card-back-hearts {
  display: flex;
  gap: 0;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 1.5rem;
}
.card-back-hearts .strike-heart {
  color: var(--pack-dark);
  cursor: pointer;
  font-size: var(--text-xl);
  padding-left: 0.125em;
  padding-right: 0.125em;
  transition: none;
}
.card-back-hearts:hover .strike-heart {
  color: var(--pack-bg);
}
.card-back-hearts .strike-heart.used {
  color: var(--text-light);
}
/* ── Hint panels (stacked) ── */
.hint-panels {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hint-panel-prompt {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  order: 99;
  margin-top: 1rem;
}

.hint-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 1.25rem;
  background: none;
  border: 2px solid color-mix(in srgb, var(--pack-bg) 20%, white);
  border-radius: 10px;
  width: 85%;
}
.hint-panel.revealed {
  display: flex;
  animation: hintFadeIn 0.5s ease forwards;
}
@keyframes hintFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hint-panel-label {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: color-mix(in srgb, var(--pack-bg) 50%, transparent);
  margin-bottom: 0.25rem;
}

.hint-panel-text {
  font-family: 'bogart', serif;
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--text);
}
.swap-hint-icon {
  font-size: 1em;
  vertical-align: -0.1em;
  margin-right: 0.1em;
}

/* Wrapper for pre-rendered solved state on front face during nav flip */
.card-back-solved-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Solved state on card back */
.solved-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}


.solved-answer {
  font-family: 'bogart', serif;
  font-size: clamp(1.8rem, 7vw, 2.75rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0;
}

.solved-flavor {
  font-size: var(--text-md);
  color: var(--pack-dark);
  font-weight: 500;
  max-width: 300px;
  line-height: 1.5;
  margin-top: 1.5rem;
  transition: color 0.4s;
}


/* ── Puzzle nav (prev/next) ── */
.puzzle-nav::part(base) {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: var(--text-base);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.puzzle-nav::part(base):hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.puzzle-nav::part(base):active {
  transform: scale(0.95);
}
.puzzle-nav-spacer {
  width: 36px;
  height: 36px;
}

/* ── Answer section ── */
.answer-section, .finished-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  transition: opacity 0.35s ease;
}

.answer-section {
  gap: 1rem;
}

.answer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
  transition: opacity 0.35s ease;
}


.solve-quip {
  font-family: 'bogart', serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.solved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--pack-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  animation: fadeIn 0.3s ease;
  position: relative;
  z-index: 6;
}

.badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
}

.badge-action {
  background: none;
  border: none;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  white-space: nowrap;
}
.badge-action:hover {
  color: #fff;
}

.answer-input {
  flex: 1;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  height: 48px;
  padding: 0 1.25rem;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
  caret-color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.answer-input::placeholder { color: rgba(255,255,255,0.28); }
.answer-input:focus {
  border-color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.2);
}
.answer-input.wrong {
  border-color: #fff;
  background: rgba(255,255,255,0.25);
  animation: shake 0.35s ease;
}
/* Hide search input cancel button */
.answer-input::-webkit-search-cancel-button { display: none; }
.answer-input::-webkit-search-decoration { display: none; }

.near-miss-nudge {
  display: none;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-align: center;
  margin-top: 0.5rem;
}

.check-btn {
  flex-shrink: 0;
}
.check-btn::part(base) {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: var(--pack-bg);
  font-size: var(--text-lg);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.2s, color 0.2s;
}
.check-btn::part(base):hover { background: var(--pack-dark); color: #fff; transform: scale(1.05); }
.check-btn::part(base):active { transform: scale(0.95); }


/* ── Status row (pack tag | feedback | strike dots) ── */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
}

.status-tags {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  border: 2px solid rgba(255,255,255,0.85);
  background: var(--pack-bg);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.hint-btn:hover {
  border-color: #fff;
  color: #fff;
  transform: scale(1.05);
}
.hint-btn-dots {
  display: inline-flex;
  gap: 0.2em;
}
.hint-dot {
  font-size: 0.6em;
}

wa-button.type-tag::part(base) {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  min-height: auto;
  border-radius: 100px;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
wa-button.type-tag#typeTag::part(base) {
  color: var(--pack-dark);
  background: rgba(255,255,255,0.85);
  border: none;
}
wa-button.type-tag#typeTag::part(base):hover {
  background: #fff;
  color: var(--pack-dark);
  transform: scale(1.05);
}

wa-button.category-tag::part(base) {
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.12);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
wa-button.category-tag::part(base):hover {
  transform: scale(1.05);
}

@keyframes tagReveal {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.category-revealed {
  animation: tagReveal 0.3s ease forwards;
}

/* ── Strike hearts ── */


/* wa-rating hearts styling */
.hearts-rating {
  --symbol-color: rgba(255,255,255,0.65);
  --symbol-color-active: rgba(255,255,255,0.65);
  --symbol-spacing: 0.1rem;
}
/* Card back hearts */
.card-back-hearts .hearts-rating {
  --symbol-color: var(--pack-dark);
  --symbol-color-active: var(--pack-dark);
  --symbol-spacing: 0.15rem;
  font-size: var(--text-xl);
}



/* ── Modals (wa-dialog) ── */
wa-dialog {
  --spacing: 1rem;
  --width: 480px;
}
wa-dialog::part(dialog) {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
}
wa-dialog::part(title) {
  font-family: 'bogart', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}
wa-dialog::part(header) {
  padding: 1rem 1rem 1rem 1.5rem;
}
wa-dialog::part(close-button__base) {
  color: var(--text-light);
}
wa-dialog::part(body) {
  padding: 0 1.5rem 1.5rem;
}

[data-theme="timeless"] wa-dialog::part(dialog) {
  border-radius: 8px;
  border: none;
  background: #fff;
}
[data-theme="timeless"] wa-dialog::part(title) {
  font-family: 'Zilla Slab', Georgia, serif;
  color: #121212;
}
[data-theme="timeless"] wa-dialog::part(close-button__base) {
  color: #121212;
}

/* wa-dialog per-modal width overrides */
wa-dialog#modal-settings { --width: 360px; }
wa-dialog#modal-stats { --width: 360px; }
wa-dialog#modal-victory { --width: 360px; }
wa-dialog#modal-puzzletype { --width: 360px; }
wa-dialog#modal-beta { --width: 360px; }
wa-dialog#modal-archive .archive-card {
  --wa-form-control-height: auto;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}
wa-dialog#modal-archive .archive-hearts {
  font-size: var(--text-xs);
  --symbol-spacing: 0;
}
wa-dialog#modal-archive .archive-day {
  font-family: 'bogart', serif;
  font-size: var(--text-lg);
  font-weight: 700;
}

.modal-body {
  font-size: var(--text-base);
  color: var(--text-mid);
  line-height: 1.6;
}

/* Victory Modal */
#modal-victory .victory-answer {
  font-family: 'bogart', serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

#modal-victory .stat-row {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

#modal-victory .hearts-rating {
  --symbol-color: var(--pack-bg);
  --symbol-color-active: var(--pack-bg);
}

#modal-victory .victory-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.victory-share-btn {
  background: var(--pack-bg);
  border: none;
  color: #fff;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.victory-share-btn:hover {
  opacity: 0.9;
}

.victory-share-btn:active {
  transform: scale(0.95);
}

.victory-hearts {
  font-size: 1.5rem;
  text-align: center;
  min-height: 1.5rem;
}

.puzzletype-example {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(0,0,0,0.04);
  border-radius: 12px;
  text-align: center;
}
.puzzletype-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: var(--text-2xl);
  color: var(--text);
  margin-bottom: 0.75rem;
}
.puzzletype-answer {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.03em;
}
.howto-type {
  margin-top: 1.75rem;
}
.howto-type-title {
  font-family: 'bogart', serif;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.howto-type-desc {
  font-size: var(--text-base);
  color: var(--text-mid);
  line-height: 1.6;
}
.howto-type .puzzletype-example {
  margin-top: 0.75rem;
}

/* ── Archive ── */
.modal-archive {
  max-width: 460px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.archive-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 2px solid color-mix(in srgb, var(--card-theme) 28%, white);
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  font-family: inherit;
}
.archive-card:hover:not(:disabled) {
  background: color-mix(in srgb, var(--card-theme) 8%, white);
  transform: scale(1.03);
}
.archive-card:active:not(:disabled) {
  transform: scale(0.97);
}
.archive-card[data-state="solved"]:hover:not(:disabled),
.archive-card[data-state="lost"]:hover:not(:disabled) {
  filter: brightness(0.85);
}

.archive-day {
  font-family: 'bogart', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.archive-month {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
  white-space: nowrap;
}

.archive-hearts {
  margin-bottom: 0.2rem;
  --symbol-color: var(--card-theme);
  --symbol-color-active: var(--card-theme);
  --symbol-spacing: 0;
}
.archive-hearts.placeholder {
  --symbol-color: var(--card-theme);
  --symbol-color-active: var(--card-theme);
  opacity: 0.35;
}
.archive-card[data-state="unsolved"] .archive-month { color: var(--card-theme); opacity: 0.6; }

/* Archive card states */
.archive-card[data-state="solved"] {
  color: #fff;
}
.archive-card[data-state="solved"] .archive-day { color: #fff; }
.archive-card[data-state="solved"] .archive-month { color: rgba(255,255,255,0.8); }
.archive-card[data-state="solved"] .archive-hearts {
  --symbol-color: #fff;
  --symbol-color-active: #fff;
}

.archive-card[data-state="lost"] {
  color: #fff;
}
.archive-card[data-state="lost"] .archive-day { color: #fff; }
.archive-card[data-state="lost"] .archive-month { color: rgba(255,255,255,0.7); }
.archive-card[data-state="lost"] .archive-hearts {
  --symbol-color: #fff;
  --symbol-color-active: #fff;
}

.archive-card[data-state="future"] {
  border-style: dashed;
  border-color: rgba(0,0,0,0.15);
  cursor: not-allowed;
}
.archive-card[data-state="future"] .archive-hearts.placeholder {
  color: var(--text);
  opacity: 0.2;
}
.archive-card[data-state="future"] .archive-month {
  color: var(--text-light);
  opacity: 0.5;
}

/* Currently viewing */
.archive-card.archive-active {
  outline: 2px solid var(--card-theme);
  outline-offset: 2px;
}

/* ── Archive tab toggle ── */
.archive-tab-toggle {
  display: flex;
  background: rgba(0,0,0,0.06);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 1rem;
}
.archive-tab-btn {
  flex: 1;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.archive-tab-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── By Type view ── */
.type-section {
  margin-bottom: 1.5rem;
}
.type-section-header {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

.category-box {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding-bottom: 100%;
  white-space: normal;
  border-radius: 12px;
  border: none;
  background: var(--box-color);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  font-family: inherit;
  text-align: left;
}
.category-box-inner {
  position: absolute;
  inset: 0.75rem;
}
.category-box:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}
.category-box:active {
  transform: scale(0.97);
}
.category-box.locked {
  background: rgba(0,0,0,0.08);
  cursor: default;
  pointer-events: none;
}
.category-box-type {
  display: block;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.2rem;
}
.category-box.locked .category-box-type {
  display: none;
}
.category-box-name {
  display: block;
  font-family: 'bogart', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.category-box.locked .category-box-name {
  color: rgba(0,0,0,0.3);
}
.category-count {
  position: absolute;
  bottom: 0;
  left: 0;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}
.category-box.locked .category-count {
  color: rgba(0,0,0,0.3);
  font-style: italic;
}

/* ── Archive filter chip ── */
.archive-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 11.2px 4px 14px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--chip-color) 12%, white);
  color: var(--chip-color);
  margin-bottom: 0.75rem;
}
.archive-filter-x {
  background: none;
  border: none;
  font-size: var(--text-sm);
  color: var(--chip-color);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}
.archive-filter-x:hover { opacity: 1; }
.archive-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-light);
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  padding: 2rem 0;
}

/* ── Puzzle type browse button ── */
.puzzletype-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin: 1rem 0;
}
.puzzletype-browse-btn {
  width: 100%;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.6rem 1rem;
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 100px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.puzzletype-browse-btn:hover {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.35);
}

/* ── Settings ── */
.settings-reset-btn {
  width: 100%;
}
.settings-reset-btn::part(base) {
  width: 100%;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 10px;
  border-width: 2px;
}

/* Timeless: pill shape, system font, darker red */
[data-theme="timeless"] .settings-reset-btn::part(base) {
  font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  border-radius: 100px;
  border-width: 2px;
  --wa-color-danger-600: #121212;
  border-color: #121212;
  color: #121212;
}

.stat-row { display: flex; justify-content: space-around; margin-top: 1rem; padding-bottom: 1rem; }
.stat-item { text-align: center; }
.stat-num {
  font-family: 'bogart', serif;
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-lbl {
  font-size: var(--text-xs);
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* ── Icon fall celebration ── */
.icon-fall-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5; /* behind modals (100), above header (10) but behind card interaction */
  overflow: hidden;
}

.icon-fall-particle {
  position: absolute;
  top: -40px;
  color: rgba(255,255,255,0.5);
  animation: iconFall linear forwards;
  will-change: transform;
}

@keyframes iconFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(calc(100vh + 60px)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@media (max-width: 540px) {
  main { padding: 1.5rem 1rem 2rem; }
  .header-center { display: none; }
  .icon-row { gap: 1.5rem; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* ── Accessibility ── */
:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Settings toggle ── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
  border-bottom: none;
}
.settings-row:last-of-type {
  margin-bottom: 1.5rem;
}
.settings-label {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
wa-switch {
  --wa-color-primary-600: var(--pack-bg);
}
wa-switch::part(control) {
  border: 2px solid rgba(0,0,0,0.2);
}
wa-switch[checked]::part(control) {
  border: none;
}

/* ── Countdown timer ── */
.countdown-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}
.countdown-label {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  line-height: 1;
}
.countdown-time {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
/* ── Colophon button ── */
.colophon-btn {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--pack-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  z-index: 50;
}
.colophon-btn:hover {
  filter: brightness(0.85);
  transform: scale(1.1);
}

/* Colophon tabs */
.colophon-tabs {
  margin-top: 0.5rem;
}
.colophon-tabs wa-tab::part(base) {
  font-size: var(--text-md);
  margin-bottom: -2px;
}
.colophon-panel {
  font-size: var(--text-base);
  color: var(--text-mid);
  line-height: 1.6;
  padding-top: 0.75rem;
}
.colophon-heading {
  font-family: 'bogart', serif;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.colophon-panel p {
  margin: 0 0 0.75rem;
}
.colophon-panel p:last-child {
  margin-bottom: 0;
}
.colophon-panel a {
  color: var(--pack-bg);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.colophon-panel a:hover {
  color: var(--pack-dark);
}

/* ── Bug report button ── */
.bug-report {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #ffd644;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 50;
}
.bug-report:hover {
  background: #f0c030;
  color: #111;
  transform: scale(1.1);
}
.bug-report::before {
  content: 'Beta Feedback';
  position: absolute;
  right: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 0.4rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.bug-report:hover::before {
  opacity: 1;
}

/* ── Beta modal ── */
.beta-list {
  text-align: left;
  margin: 0.75rem 0;
  padding-left: 1.25rem;
}
.beta-list li {
  margin-bottom: 0.35rem;
}
.beta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}
.beta-email-btn::part(base) {
  background: #ffd644;
  color: #333;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  border: none;
  width: 100%;
}
.beta-email-btn::part(base):hover {
  background: #f0c030;
}
.beta-puzzle-btn::part(base) {
  background: var(--pack-bg);
  color: #fff;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  border: none;
  width: 100%;
}
.beta-puzzle-btn::part(base):hover {
  background: var(--pack-dark);
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.03em;
}

/* ── Reduced motion ── */
body.reduced-motion,
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* ── Submit Form (modal) ── */
.submit-intro {
  color: var(--text-mid);
  font-size: var(--text-base);
  margin-bottom: 1.5rem;
}
.submit-label {
  display: block;
  font-size: var(--text-md);
  font-weight: 500;
  color: rgb(27, 29, 38);
  margin-bottom: 0.375rem;
}
.submit-field {
  margin-bottom: 1.25rem;
}
.submit-input {
  width: 100%;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-md);
  color: var(--text);
  background: #fff;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.submit-input:focus {
  border-color: var(--pack-bg);
}
.submit-input::placeholder {
  color: var(--text-light);
}
.submit-input.submit-invalid {
  border-color: var(--error) !important;
}
#modal-submit wa-radio::part(control) {
  border-width: 2px;
}
.submit-type-info {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 0.1rem;
  margin-right: 1rem;
  font-size: var(--text-base);
  vertical-align: baseline;
}
.submit-type-info:hover {
  color: var(--text);
}

/* Puzzle type radios */
#modal-submit wa-radio-group::part(form-control-label) {
  font-size: var(--text-md);
  font-weight: 500;
  color: rgb(27, 29, 38);
}
#modal-submit wa-radio::part(label) {
  font-family: 'proxima-soft', sans-serif;
  font-size: var(--text-md);
}

/* Icon grid (row-based builder) */
.icon-grid-builder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  max-width: 300px;
  margin: 0 auto;
}
.submit-icon-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  position: relative;
}
.icon-row-cells {
  display: flex;
  gap: 6px;
}
.icon-row-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 6px;
}
.icon-row-action {
  background: none;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  width: 1.5rem;
  height: 1.5rem;
  font-size: var(--text-xs);
  color: rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  padding: 0;
}
.icon-row-action:hover {
  color: rgba(0,0,0,0.6);
  border-color: rgba(0,0,0,0.3);
}
.icon-row-action:disabled {
  opacity: 0.3;
  cursor: default;
}
.icon-cell {
  position: relative;
  width: 90px;
  height: 90px;
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
}
.icon-cell:hover {
  border-color: rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.04);
}
.icon-cell-plus {
  font-size: var(--text-xl);
  color: rgba(0,0,0,0.2);
  transition: color 0.15s;
}
.icon-cell:hover .icon-cell-plus {
  color: rgba(0,0,0,0.4);
}
.icon-cell.filled {
  border-style: solid;
  border-color: rgba(0,0,0,0.15);
  background: #fff;
  cursor: grab;
}
.icon-cell-icon {
  font-size: 2.5rem;
  color: var(--text);
}
.icon-cell.drag-over {
  border-color: var(--pack-bg, rgba(0,0,0,0.4));
  background: rgba(0,0,0,0.06);
}
.icon-cell.dragging {
  opacity: 0.3;
}
.icon-cell-x {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  font-size: var(--text-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
}
.icon-cell:hover .icon-cell-x {
  opacity: 1;
}
.icon-row-remove {
  background: none;
  border: none;
  color: rgba(0,0,0,0.25);
  cursor: pointer;
  font-size: var(--text-sm);
  padding: 0.25rem;
  transition: color 0.15s;
  margin-left: 2px;
}
.icon-row-remove:hover {
  color: rgba(0,0,0,0.6);
}

/* Preview */
.submit-preview {
  margin-top: 0.5rem;
}
.preview-scene {
  max-width: 280px;
  margin: 0.75rem auto 0;
}
.preview-scene .card-front {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-empty {
  color: var(--text-light);
  font-size: var(--text-base);
  text-align: center;
}

.submit-disclaimer {
  font-size: var(--text-sm);
  color: var(--text-light);
  line-height: 1.5;
  margin: 1rem 0 0;
  text-align: center;
}

/* Error */
.submit-error {
  color: var(--error);
  font-size: var(--text-base);
  margin-top: 0.5rem;
  text-align: center;
}

#modal-icon-chooser::part(body) { padding-left: 0; padding-right: 0; padding-bottom: 0; overflow: hidden; background: #F0F1F3; }
#modal-icon-chooser::part(dialog) { height: auto; max-height: 70vh; }

fa-icon-chooser {
  display: block;
  max-width: 100%;
  overflow: hidden;
  --icon-listing-roomy-size: 100px;
  --icon-listing-roomy-gap-x: 0.4rem;
  --icon-listing-roomy-gap-y: 0.75rem;
}

/* Icon chooser — reverted, add back as needed:
  fa-icon-chooser {
    display: block; max-width: 100%; overflow: hidden;
    --fa-navy: #1b1f26; --fa-md-gravy: #888; --fa-yellow: var(--pack-bg);
    --white: #fff; --background-color: #fff;
    --input-border-color: #ccc; --input-border-width: 2px;
    --input-with-icon-color: #888; --input-placeholder-color: #aaa;
    --button-background: var(--pack-bg); --button-color: #fff;
    --button-hover-background: var(--pack-dark); --button-hover-color: #fff;
    --button-font-weight: 600; --button-padding: 0.4rem 1rem;
    --paragraph-margin-bottom: 0.5rem; --paragraph-margin-top: 0.75rem;
    --icon-listing-roomy-gap-x: 0.4rem; --icon-listing-roomy-gap-y: 0.4rem;
    --icon-listing-roomy-size: 100px;
    font-family: 'proxima-soft', system-ui, sans-serif;
  }
  [data-theme="timeless"] fa-icon-chooser {
    --fa-navy: #121212; --input-border-color: #121212;
    --button-background: #121212; --button-color: #fff;
    --button-hover-background: #333; --button-hover-color: #fff;
    font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  }
*/

/* ── Timeless (NYT-style) theme ── */

/* Use Font Awesome Sharp icons instead of Classic */
[data-theme="timeless"] {
  --pack-faint: rgba(0,0,0,0.08);
  --surface: #fff;
  --text: #121212;
  --text-mid: #555555;
  --text-light: #888888;
  --correct: #3a7d44;
  --error: #c0392b;
}

/* Page background: theme color */
[data-theme="timeless"] body { background: var(--pack-bg); }

/* Card content (icons, text) — dark on colored card */
[data-theme="timeless"] .puzzle-icon { color: #121212; }
[data-theme="timeless"] .hint-panel-prompt { color: #121212; }
[data-theme="timeless"] .hint-btn { border-color: #121212; color: #121212; border-radius: 4px; }
[data-theme="timeless"] .hint-btn:hover { border-color: #121212; color: #121212; }
[data-theme="timeless"] .hint-panel-label { color: #121212; }
[data-theme="timeless"] .hint-panel-text { color: #121212; }
[data-theme="timeless"] .hint-panel { border-color: #121212; }
[data-theme="timeless"] .solved-answer { color: #121212; }
[data-theme="timeless"] .solved-flavor { color: #121212; }
[data-theme="timeless"] .card-back-hearts .hearts-rating {
  --symbol-color: #121212;
  --symbol-color-active: #121212;
}

/* Header and footer: dark text on white page */
[data-theme="timeless"] .site-title { color: #121212; text-transform: capitalize; font-size: 1.6rem; }
[data-theme="timeless"] .header-date { color: #121212; }
[data-theme="timeless"] .header-date:hover { color: #121212; }
[data-theme="timeless"] wa-button.header-nav::part(base) { color: #121212; border-radius: 4px; }
[data-theme="timeless"] wa-button.header-nav::part(base):hover { color: #121212; }
[data-theme="timeless"] wa-button.icon-btn::part(base) { color: #121212; border-radius: 4px; }
[data-theme="timeless"] wa-button.icon-btn::part(base):hover { color: #121212; background: rgba(0,0,0,0.06); }
[data-theme="timeless"] footer { color: #121212; }

/* Share results — dark text */
[data-theme="timeless"] .solve-quip { color: #121212; }
[data-theme="timeless"] .victory-answer { color: #121212; }
[data-theme="timeless"] .solved-badge { color: #121212; background: rgba(0,0,0,0.1); }
[data-theme="timeless"] .badge-action { color: #121212; }
[data-theme="timeless"] .badge-action:hover { color: #121212; }
[data-theme="timeless"] .victory-share-btn { background: #121212; color: #fff; }
[data-theme="timeless"] .victory-share-btn:hover { opacity: 0.8; }

/* Prev/next nav buttons */
[data-theme="timeless"] .puzzle-nav::part(base),
[data-theme="timeless"] .puzzle-nav::part(base):hover { background: #121212; color: #fff; }

/* Hearts below card and in victory modal */
[data-theme="timeless"] #strikeHearts .hearts-rating,
[data-theme="timeless"] #modal-victory .hearts-rating {
  --symbol-color: #121212;
  --symbol-color-active: #121212;
}

/* Type tags (Rebus/Story/Cluster): white text on 121212 */
[data-theme="timeless"] wa-button.type-tag#typeTag::part(base) { color: #fff; background: #121212; border: none; }
[data-theme="timeless"] wa-button.type-tag#typeTag::part(base):hover { color: #fff; background: #121212; }
/* Category tags (Movie/Literature/etc): 121212 text on white */
[data-theme="timeless"] wa-button.category-tag::part(base) { color: #121212; background: #fff; border: none; }

/* Typography — serif display, system sans body */
[data-theme="timeless"] .site-title,
[data-theme="timeless"] .solved-answer,
[data-theme="timeless"] .stat-num,
[data-theme="timeless"] .hint-panel-text,
[data-theme="timeless"] .solve-quip,
[data-theme="timeless"] #modal-victory .victory-answer,
[data-theme="timeless"] .howto-type-title,
[data-theme="timeless"] .archive-day {
  font-family: 'Zilla Slab', Georgia, serif;
}
[data-theme="timeless"] wa-dialog#modal-archive .archive-day {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: var(--text-xl);
  font-weight: 700;
}
[data-theme="timeless"] wa-dialog#modal-stats .stat-num,
[data-theme="timeless"] wa-dialog#modal-victory .stat-num {
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #121212;
}

[data-theme="timeless"] body,
[data-theme="timeless"] .header-date,
[data-theme="timeless"] .header-pack,
[data-theme="timeless"] .type-tag,
[data-theme="timeless"] .hint-panel-label,
[data-theme="timeless"] .hint-panel-prompt,
[data-theme="timeless"] .settings-label,
[data-theme="timeless"] .beta-tag,
[data-theme="timeless"] .countdown-label,
[data-theme="timeless"] .countdown-time,
[data-theme="timeless"] .solved-badge,
[data-theme="timeless"] .badge-action,
[data-theme="timeless"] .answer-input,
[data-theme="timeless"] .near-miss-nudge,
[data-theme="timeless"] .archive-month,
[data-theme="timeless"] .stat-lbl,
[data-theme="timeless"] .settings-reset-btn,
[data-theme="timeless"] .victory-share-btn,
[data-theme="timeless"] footer {
  font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}

/* Card — less rounded, subtle shadow */
[data-theme="timeless"] .card-face {
  border-radius: 12px;
  box-shadow: none;
  border: 2px solid #121212;
}
[data-theme="timeless"] .card-scene:hover .card-face {
  box-shadow: none;
}

[data-theme="timeless"] .site-logo { top: 0; }

/* Modals */

/* Inputs, buttons, tags — tighter radii */
[data-theme="timeless"] .answer-input { border-radius: 100px; border: 2px solid #121212; background: transparent; color: #121212; caret-color: #121212; }
[data-theme="timeless"] .answer-input::placeholder { color: #121212; }
[data-theme="timeless"] .answer-input:focus { border-color: #121212; background: transparent; }
[data-theme="timeless"] .check-btn::part(base) { border-radius: 100px; background: #121212; color: #fff; border-color: #121212; }
[data-theme="timeless"] wa-button.type-tag::part(base) { border-radius: 4px; }
[data-theme="timeless"] .header-pack { border-radius: 4px; }
[data-theme="timeless"] .solved-badge { border-radius: 4px; }
[data-theme="timeless"] .hint-panel { border-radius: 6px; }
[data-theme="timeless"] .archive-card { border-radius: 6px; }
[data-theme="timeless"] .archive-tab-btn { font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif; }
[data-theme="timeless"] .category-box { border-radius: 6px; }
[data-theme="timeless"] .category-box-type,
[data-theme="timeless"] .category-count,
[data-theme="timeless"] .type-section-header { font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif; }
[data-theme="timeless"] .category-box-name { font-family: 'Zilla Slab', Georgia, serif; }
[data-theme="timeless"] .puzzletype-browse-btn { font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif; border-radius: 4px; }
[data-theme="timeless"] .archive-filter-chip { font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif; }
[data-theme="timeless"] .howto-card { border-radius: 8px; }

/* Beta tag and bug report */
[data-theme="timeless"] .beta-tag {
  border-radius: 0;
  background: #F9DF6D;
  color: #121212;
  font-size: var(--text-sm);
  padding: 0.2rem 0.5rem;
}
[data-theme="timeless"] .bug-report {
  border-radius: 100px;
}
[data-theme="timeless"] .colophon-btn {
  background: var(--pack-bg);
  color: #fff;
}
[data-theme="timeless"] .colophon-btn:hover {
  filter: brightness(0.85);
}
[data-theme="timeless"] .colophon-heading {
  font-family: 'Zilla Slab', Georgia, serif;
}
[data-theme="timeless"] .colophon-panel a {
  color: #121212;
}
[data-theme="timeless"] .colophon-panel a:hover {
  color: #333;
}
[data-theme="timeless"] .beta-email-btn::part(base),
[data-theme="timeless"] .beta-puzzle-btn::part(base) {
  font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  border-radius: 4px;
}
/* wa-switch Timeless overrides */
[data-theme="timeless"] wa-switch::part(control) {
  border: 2px solid #121212;
  background: transparent;
}
[data-theme="timeless"] wa-switch::part(thumb) {
  border: none;
  background: #121212;
}
[data-theme="timeless"] wa-switch[checked]::part(control) {
  background: #121212;
  border-color: #121212;
}
[data-theme="timeless"] wa-switch[checked]::part(thumb) {
  background: #fff;
}
[data-theme="timeless"] .icon-fall-particle {
  color: rgba(18,18,18,0.5);
}
[data-theme="timeless"] .countdown-label,
[data-theme="timeless"] .countdown-time {
  color: #121212;
}

/* Archive: solved/lost card text */
[data-theme="timeless"] .archive-card[data-state="solved"],
[data-theme="timeless"] .archive-card[data-state="lost"] { color: #121212; }
[data-theme="timeless"] .archive-card[data-state="solved"] .archive-day,
[data-theme="timeless"] .archive-card[data-state="lost"] .archive-day { color: #121212; }
[data-theme="timeless"] .archive-card[data-state="solved"] .archive-month,
[data-theme="timeless"] .archive-card[data-state="lost"] .archive-month { color: rgba(18,18,18,0.6); }
[data-theme="timeless"] .archive-card[data-state="solved"] .archive-hearts,
[data-theme="timeless"] .archive-card[data-state="lost"] .archive-hearts {
  --symbol-color: #121212;
  --symbol-color-active: #121212;
}
/* Category boxes: black text in timeless */
[data-theme="timeless"] .category-box-type { color: rgba(18,18,18,0.6); }
[data-theme="timeless"] .category-box-name { color: #121212; }
[data-theme="timeless"] .category-count { color: rgba(18,18,18,0.6); }
[data-theme="timeless"] .archive-card.archive-active {
  outline-color: #121212;
}
/* Archive: unsolved cards — white with #121212 stroke */
[data-theme="timeless"] .archive-card[data-state="unsolved"] {
  border: 2px solid #121212;
  color: #121212;
}
[data-theme="timeless"] .archive-card[data-state="unsolved"] .archive-month { opacity: 1; }
[data-theme="timeless"] .archive-card[data-state="unsolved"] .archive-hearts {
  --symbol-color: var(--card-theme);
  --symbol-color-active: var(--card-theme);
}
/* Archive: future/next puzzle */
[data-theme="timeless"] .archive-card[data-state="future"] {
  border-color: #121212;
  color: #121212;
}
[data-theme="timeless"] .archive-card[data-state="future"] .archive-month { opacity: 1; }
[data-theme="timeless"] .archive-card[data-state="future"] .archive-hearts.placeholder {
  --symbol-color: #121212;
  --symbol-color-active: #121212;
  opacity: 0.35;
}

/* ── Timeless: Submit Form ── */
[data-theme="timeless"] #modal-submit wa-radio::part(label) {
  font-family: system-ui, -apple-system, 'Helvetica Neue', sans-serif;
}
