@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

:root {
  --background: #f8f4ed;
  --ink: #292a27;
  --muted: #77766e;
  --green: #334d40;
  --pink: #a34d64;
  --card: #fffdf8;
  --border: #e8e0d4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid #9c8060;
  outline-offset: 4px;
}

.app {
  width: min(100% - 36px, 900px);
  margin: 0 auto;
  padding: 32px 0 24px;
}

.header {
  text-align: center;
  margin-bottom: 64px;
}

.brand {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1.5px;
}

.brand span {
  color: var(--pink);
}

.tagline {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.intro {
  text-align: center;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--pink);
}

h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(48px, 9vw, 76px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 20px 0;
}

h1 em {
  color: var(--green);
}

.description {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 14px;
}

.section-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  margin: 54px 0 22px;
}

.categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  text-align: left;
}

.category {
  min-height: 230px;
  padding: 25px;
  border: 1px solid transparent;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.category:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px #30251a12;
}

.life {
  background: #9dfffaf4;
  color: #000000;
}

.ToT {
  background: rgb(226, 218, 254);
  color: #000000;
}

.love {
  background: #ff1524;
  color: #000000;
}

.category-icon {
  font-size: 30px;
  margin-bottom: 22px;
}

.category-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  margin-bottom: 10px;
}

.category-desc {
  font-size: 12px;
  line-height: 1.8;
  opacity: 0.85;
}

.category-action {
  font-size: 11px;
  font-weight: 700;
  margin-top: auto;
  padding-top: 22px;
}

.footer-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 32px;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.game {
  max-width: 580px;
  margin: 0 auto;
}

.back-button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 0;
  font-size: 12px;
}

.deck-heading {
  text-align: center;
  margin: 36px 0 25px;
}

.deck-heading h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  margin: 12px 0;
}

.progress {
  color: var(--muted);
  font-size: 12px;
}

.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  min-height: 310px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  touch-action: pan-y;
  box-shadow: 0 12px 40px #44301b08;
}

.deep-warning {
 position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: #f7e8e9;
  color: #a34d64;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.card-label,
.card-bottom {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
}

.card-decoration {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 75px;
  line-height: 1;
  color: #d5b4a4;
  margin-top: 20px;
}

#questionText {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(23px, 5vw, 32px);
  font-weight: 600;
  line-height: 1.5;
  max-width: 440px;
  margin: 10px 0 30px;
}

.question-translation {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 1rem;
}

.game-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.button {
  padding: 13px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.button-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.button-primary {
  background: var(--green);
  color: white;
  border: 1px solid var(--green);
}

.button:hover {
  filter: brightness(0.95);
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 28px, 420px);
    padding-top: 24px;
  }

  .header {
    margin-bottom: 44px;
  }

  .categories {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category {
    min-height: 190px;
    padding: 22px;
  }

  .category-icon {
    margin-bottom: 12px;
  }

  .category-action {
    padding-top: 16px;
  }

  .section-title {
    margin-top: 40px;
    font-size: 23px;
  }

  .question-card {
    min-height: 290px;
    padding: 24px;
  }

  .game-controls {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}
  }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Theme toggle */
.header {
  position: relative;
}

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 21px;
  cursor: pointer;
}

/* Dark theme */
body[data-theme="dark"] {
  --background: #20231f;
  --ink: #f1eee6;
  --muted: #b0afa5;
  --green: #a9c4ad;
  --pink: #e2a0b0;
  --card: #2b2f2a;
  --border: #454940;
}

body[data-theme="dark"] .life {
  background: #354239;
  color: #dce9dc;
}

body[data-theme="dark"] .love {
  background: #493238;
  color: #f2d9df;
}

body[data-theme="dark"] .ToT {
  background: #443e32;
  color: #f0e4c9;
}

body[data-theme="dark"] .button-primary {
  background: #a9c4ad;
  border-color: #a9c4ad;
  color: #20231f;
}

body[data-theme="dark"] .deep-warning {
  background: #493238;
  color: #f2b8c6;
}

body[data-theme="dark"] .card-decoration {
  color: #806b60;
}

body[data-theme="dark"] .theme-toggle {
  background: var(--card);
  color: var(--ink);
}

/* Afterwords landing page */
.brand {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.5px;
}

.header {
  margin-bottom: 0;
}

.landing-content {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  padding: 30px 0;
}

.landing-tagline {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin: 0;
}

.landing-tagline em {
  color: var(--green);
  font-weight: 500;
}

.start-button {
  min-width: 220px;
  padding: 16px 26px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 4px;
}

.category-selection .section-title {
  margin-top: 20px;
}

.home-button {
  display: block;
  margin: 0 0 20px;
}

.copyright {
  position: fixed;
  bottom: 16px;
  left: 20px;
  margin: 0;
  font-size: 12px;
  opacity: 0.65;
}

@media (max-width: 560px) {
  .landing-content {
    min-height: 60vh;
    gap: 28px;
  }

  .brand {
    font-size: 32px;
  }

  .landing-tagline {
    font-size: clamp(30px, 8vw, 40px);
  }
}
