:root {
  --cream: #FFF8F0;
  --rose: #C94F6D;
  --rose-light: #F4A7B9;
  --rose-mid: #E86A85;
  --lavender: #9B7EB8;
  --lavender-light: #D4C5E8;
  --lavender-mid: #B89DD4;
  --charcoal: #3D2C2C;
  --muted: #9B8585;
  --white: #FFFFFF;
  --shadow-rose: 0 4px 24px rgba(201, 79, 109, 0.13);
  --shadow-rose-hover: 0 8px 36px rgba(201, 79, 109, 0.24);
  --shadow-lav: 0 4px 24px rgba(155, 126, 184, 0.13);
}

/* ─── Lock screen ─── */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.lock-screen.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-content {
  text-align: center;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 340px;
}

.lock-screen .lock-logo {
  margin-bottom: 1.25rem;
}

.lock-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.5;
  font-style: italic;
}

.pin-wrapper {
  position: relative;
  display: inline-block;
  cursor: text;
}

.pin-boxes {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
}

.pin-box {
  width: 56px;
  height: 64px;
  border: 2.5px solid var(--rose-light);
  border-radius: 14px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--rose);
  font-weight: 800;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(201, 79, 109, 0.07);
}

.pin-box.filled {
  border-color: var(--rose);
  box-shadow: 0 4px 14px rgba(201, 79, 109, 0.18);
}

#pinInput {
  position: absolute;
  opacity: 0;
  top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: text;
  font-size: 16px; /* prevents iOS zoom */
}

.lock-error {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--rose);
  min-height: 1.4em;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.pin-boxes.shake {
  animation: pinShake 0.4s ease;
}

/* ─── Reset ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--cream);
  color: var(--charcoal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Floating hearts background ─── */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hearts-bg span {
  position: absolute;
  bottom: -10%;
  opacity: 0;
  animation: floatUp linear infinite;
}

.hearts-bg span:nth-child(1)  { left: 5%;  font-size: 1.1rem; animation-duration: 13s; animation-delay: 0s; }
.hearts-bg span:nth-child(2)  { left: 15%; font-size: 1.7rem; animation-duration: 16s; animation-delay: 2s; }
.hearts-bg span:nth-child(3)  { left: 28%; font-size: 0.9rem; animation-duration: 11s; animation-delay: 5s; }
.hearts-bg span:nth-child(4)  { left: 40%; font-size: 2rem;   animation-duration: 19s; animation-delay: 1s; }
.hearts-bg span:nth-child(5)  { left: 53%; font-size: 1.3rem; animation-duration: 14s; animation-delay: 7s; }
.hearts-bg span:nth-child(6)  { left: 63%; font-size: 1.6rem; animation-duration: 17s; animation-delay: 3s; }
.hearts-bg span:nth-child(7)  { left: 72%; font-size: 1rem;   animation-duration: 10s; animation-delay: 6s; }
.hearts-bg span:nth-child(8)  { left: 82%; font-size: 1.8rem; animation-duration: 15s; animation-delay: 4s; }
.hearts-bg span:nth-child(9)  { left: 91%; font-size: 1.4rem; animation-duration: 18s; animation-delay: 2s; }
.hearts-bg span:nth-child(10) { left: 47%; font-size: 1.6rem; animation-duration: 12s; animation-delay: 9s; }

@keyframes floatUp {
  0%   { transform: translateY(0)      rotate(-8deg);  opacity: 0; }
  8%   { opacity: 0.18; }
  92%  { opacity: 0.18; }
  100% { transform: translateY(-110vh) rotate(8deg);   opacity: 0; }
}

/* ─── Layout ─── */
main {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

/* ─── Header ─── */
.site-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-wrap {
  margin-bottom: 1rem;
}

.logo {
  font-family: 'Pacifico', cursive;
  font-size: clamp(2.6rem, 10vw, 3.4rem);
  color: var(--rose);
  text-shadow: 2px 3px 0 var(--rose-light);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.logo-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  font-style: italic;
}

.special-greeting {
  display: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--lavender);
  line-height: 1.65;
  margin-top: 0.75rem;
}

/* ─── Photo ─── */
.photo-frame {
  margin: 1.1rem auto 0;
  width: fit-content;
  background: var(--white);
  padding: 0.6rem 0.6rem 1.8rem;
  border-radius: 4px;
  box-shadow: 0 6px 28px rgba(61, 44, 44, 0.16), 0 2px 8px rgba(61, 44, 44, 0.08);
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-frame:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 10px 36px rgba(61, 44, 44, 0.2);
}

.hero-photo {
  display: block;
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  object-fit: cover;
  border-radius: 2px;
}

/* ─── Cards ─── */
.card {
  background: var(--white);
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.husby-card {
  box-shadow: var(--shadow-rose);
  border-top: 4px solid var(--rose);
}

.winnie-card {
  box-shadow: var(--shadow-lav);
  border-top: 4px solid var(--lavender);
}

.card-title {
  font-family: 'Pacifico', cursive;
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.husby-card .card-title { color: var(--rose); }
.winnie-card .card-title { color: var(--lavender); }

.card-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ─── Buttons ─── */
.spin-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.husby-btn {
  background: linear-gradient(135deg, var(--rose), var(--rose-mid));
  color: white;
  box-shadow: 0 4px 18px rgba(201, 79, 109, 0.38);
}

.winnie-btn {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-mid));
  color: white;
  box-shadow: 0 4px 18px rgba(155, 126, 184, 0.38);
}

.spin-btn:hover  { transform: translateY(-2px); }
.spin-btn:active { transform: scale(0.97); }

.spin-btn.bounce {
  animation: btnBounce 0.38s ease;
}

@keyframes btnBounce {
  0%   { transform: scale(1); }
  25%  { transform: scale(0.94); }
  60%  { transform: scale(1.05); }
  80%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* ─── Results ─── */
.results {
  margin-top: 1.25rem;
}

.results.hidden {
  display: none;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  margin-bottom: 0.5rem;
  background: var(--cream);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.result-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-emoji {
  font-size: 1.35rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.result-text {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--charcoal);
}

.result-value {
  font-weight: 800;
  font-size: 0.95rem;
  text-align: right;
  max-width: 55%;
  word-break: break-word;
}

.husby-card .result-value { color: var(--rose); }
.winnie-card .result-value { color: var(--lavender); }

.chore-item {
  background: #FFF0F4;
  border: 1.5px solid var(--rose-light);
}

.chore-item .result-value {
  font-size: 0.88rem;
}

/* ─── Again button ─── */
.again-btn {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.65rem;
  background: transparent;
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.husby-again {
  border: 2px solid var(--rose-light);
  color: var(--rose);
}

.winnie-again {
  border: 2px solid var(--lavender-light);
  color: var(--lavender);
}

.again-btn:hover  { background: var(--cream); }
.again-btn:active { transform: scale(0.97); }

/* ─── Footer ─── */
.site-footer {
  text-align: center;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Responsive fine-tuning ─── */
@media (max-width: 360px) {
  .logo { font-size: 2.4rem; }
  .card { padding: 1.4rem 1.1rem; }
  .result-value { max-width: 50%; font-size: 0.85rem; }
}
