:root {
  --rose-900: #4a1025;
  --rose-700: #7a1f3d;
  --rose-500: #cf406b;
  --rose-400: #e85b83;
  --pink-200: #ffd8e5;
  --pink-100: #ffedf3;
  --cream: #fff8fb;
  --ink: #3b2030;
  --success: #2f9e44;
  --present: #e4b63f;
  --absent: #8d8d9b;
  --shadow: 0 10px 30px rgba(64, 19, 37, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, #fff4f8, #ffe0ea);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 189, 208, 0.45), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(255, 138, 166, 0.22), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255, 168, 194, 0.28), transparent 45%);
  pointer-events: none;
  z-index: 0;
  animation: bgShift 16s linear infinite alternate;
}

@keyframes bgShift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-10px);
  }
}

.site-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 248, 251, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(193, 92, 130, 0.15);
}

.brand {
  color: var(--rose-900);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-text {
  font-weight: 700;
  color: var(--rose-700);
  font-size: 0.95rem;
  min-width: 34px;
  text-align: right;
}

.task-track {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rose-700);
  background: #ffdce8;
  border: 1px solid rgba(141, 43, 80, 0.25);
  transition: 0.25s ease;
}

.task-dot.done {
  background: #d5f6df;
  border-color: rgba(47, 158, 68, 0.35);
  color: #1d6c2e;
}

.task-dot.active {
  background: #ffc8da;
  box-shadow: 0 0 0 4px rgba(230, 100, 148, 0.18);
  transform: translateY(-1px);
}

.page {
  width: 100%;
  flex: 1;
  padding: 20px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-final {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
}

.card {
  width: min(820px, 100%);
  background: rgba(255, 252, 253, 0.9);
  border: 1px solid rgba(176, 72, 112, 0.16);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose-500);
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--rose-900);
  margin-bottom: 10px;
}

.subtitle {
  margin-bottom: 16px;
  color: #6b3d4f;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.task-dot:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(207, 64, 107, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-500), var(--rose-700));
  box-shadow: 0 8px 20px rgba(171, 39, 91, 0.3);
}

.btn-secondary {
  color: var(--rose-900);
  background: #ffe3ee;
  border: 1px solid rgba(153, 43, 82, 0.22);
  text-decoration: none;
  display: inline-block;
}

.btn-ghost {
  color: var(--rose-700);
  background: transparent;
  border: 1px dashed rgba(153, 43, 82, 0.35);
}

.status {
  min-height: 24px;
  margin: 10px 0 8px;
  font-weight: 600;
  color: #6f3450;
}

.hidden {
  display: none !important;
}

.greeting-card {
  text-align: center;
  max-width: 620px;
}

.greeting-card > * {
  animation: fadeUp 0.7s ease both;
}

.greeting-title {
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
}

.greeting-line {
  color: #6b3f52;
  margin: 0 auto 12px;
  max-width: 48ch;
}

.heart-cluster {
  margin: 14px 0 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
  color: var(--rose-400);
  font-size: 1.6rem;
}

.heart-cluster span {
  animation: pulse 1.5s ease-in-out infinite;
}

.heart-cluster span:nth-child(2) {
  animation-delay: 0.2s;
}

.heart-cluster span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.2);
  }
}

.task-card {
  max-width: 760px;
}

.wordle-board {
  display: grid;
  gap: 8px;
  margin: 12px auto 10px;
  width: min(100%, 330px);
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.wordle-tile {
  aspect-ratio: 1 / 1;
  border: 2px solid #f0bfd0;
  background: #fff;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #5b2a3f;
  text-transform: uppercase;
  transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease;
}

.wordle-row.active .wordle-tile {
  border-color: #de6f94;
}

.wordle-tile.correct {
  background: var(--success);
  border-color: #24853a;
  color: #fff;
}

.wordle-tile.present {
  background: var(--present);
  border-color: #c29a2e;
  color: #fff;
}

.wordle-tile.absent {
  background: var(--absent);
  border-color: #7e7e8c;
  color: #fff;
}

.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-3px);
  }
}

.wordle-keyboard {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
  margin-inline: auto;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.kb-key {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 4px;
  border: 0;
  border-radius: 8px;
  background: #ffd9e8;
  color: #4a1025;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  font-size: 0.9rem;
  white-space: nowrap;
}

.kb-key.wide {
  flex: 1.6 1 0;
  min-width: 0;
}

.kb-key[data-key="ENTER"] {
  font-size: 0.74rem;
  letter-spacing: 0.01em;
}

.kb-key.correct {
  background: var(--success);
  color: #fff;
}

.kb-key.present {
  background: var(--present);
  color: #fff;
}

.kb-key.absent {
  background: var(--absent);
  color: #fff;
}

.hint-wrap {
  margin: 8px 0;
}

.hint-text {
  margin-top: 6px;
  color: #754153;
}

.ttt-board {
  width: min(330px, 95vw);
  margin: 14px auto 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ttt-cell {
  aspect-ratio: 1 / 1;
  border: 2px solid #f0bfd0;
  border-radius: 12px;
  background: #fff7fa;
  color: var(--rose-900);
  font-size: 2.1rem;
  font-weight: 800;
  cursor: pointer;
}

.ttt-cell.x {
  color: #c02a5d;
}

.ttt-cell.o {
  color: #5d4cc8;
}

.simon-card {
  text-align: center;
}

.simon-board {
  margin: 14px auto;
  width: min(320px, 86vw);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.simon-pad {
  border: 0;
  border-radius: 14px;
  height: 110px;
  cursor: pointer;
  opacity: 0.95;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
  box-shadow: inset 0 -8px rgba(0, 0, 0, 0.12);
}

.simon-pad:active {
  transform: scale(0.98);
}

.pad-0 {
  background: #67c57f;
}

.pad-1 {
  background: #f16d83;
}

.pad-2 {
  background: #f8c85d;
}

.pad-3 {
  background: #5a9df7;
}

.simon-pad.lit {
  filter: brightness(1.2);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.45), 0 0 25px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px);
}

.final-hero {
  text-align: center;
}

.final-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.final-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.info-card h2 {
  margin-bottom: 8px;
  color: var(--rose-700);
}

.info-card p {
  line-height: 1.5;
}

.activity-photo {
  margin: 0 0 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(176, 72, 112, 0.22);
  background: #fff;
}

.activity-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.info-list {
  margin: 8px 0 0 18px;
  padding: 0;
  line-height: 1.45;
}

.info-list li + li {
  margin-top: 4px;
}

.tiny-note {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #7a4b5d;
}

.site-footer {
  text-align: center;
  padding: 10px 12px 18px;
}

.reset-link {
  font-size: 0.85rem;
  color: #7f3e56;
  text-decoration: none;
  border-bottom: 1px dotted rgba(127, 62, 86, 0.6);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(51, 16, 31, 0.56);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 30;
}

.modal-card {
  width: min(420px, 100%);
  background: #fff8fb;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
  border: 1px solid rgba(153, 43, 82, 0.25);
}

.bg-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  left: var(--x);
  bottom: -12%;
  font-size: var(--size);
  color: rgba(216, 71, 126, 0.28);
  animation: floatHeart var(--duration) linear infinite;
  animation-delay: var(--delay);
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translateY(-115vh) translateX(16px) rotate(16deg);
    opacity: 0;
  }
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  to {
    transform: translateY(108vh) rotate(680deg);
    opacity: 0.95;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 0.95rem;
  }

  .progress-wrap {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .progress-text {
    min-width: 0;
    font-size: 0.9rem;
  }

  .page {
    padding: 16px 10px 22px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .wordle-board {
    width: min(100%, 300px);
  }

  .wordle-tile {
    font-size: 1.1rem;
  }

  .ttt-board,
  .simon-board {
    width: min(300px, 100%);
  }

  .simon-pad {
    height: 96px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 0.92rem;
  }
}

@media (max-width: 380px) {
  .task-dot {
    width: 20px;
    height: 20px;
    font-size: 0.72rem;
  }

  .progress-text {
    font-size: 0.84rem;
  }

  .kb-row {
    gap: 4px;
  }

  .kb-key {
    padding: 9px 2px;
    font-size: 0.78rem;
  }

  .kb-key[data-key="ENTER"] {
    font-size: 0.62rem;
  }

  .kb-key.wide {
    flex: 1.75 1 0;
  }
}

@media (min-width: 760px) {
  .site-header {
    padding: 16px 24px;
  }

  .card {
    padding: 28px;
  }

  .final-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ttt-cell {
    font-size: 2.4rem;
  }
}
