:root {
  color-scheme: light;
  --paper: #fbf3e6;
  --paper-deep: #efe0cb;
  --ink: #3b3027;
  --soft: #7d6b5c;
  --blue: #8fb2c4;
  --green: #a9b89b;
  --amber: #d9a85f;
  --rose: #cfa09b;
  --shadow: rgba(59, 48, 39, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(217, 168, 95, 0.22), transparent 30rem),
    radial-gradient(circle at 80% 20%, rgba(143, 178, 196, 0.26), transparent 28rem),
    linear-gradient(180deg, #fff9ef, var(--paper));
}

button {
  font: inherit;
  color: inherit;
}

.shell {
  width: min(960px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.screen {
  display: none;
  animation: settle 420ms ease both;
}

.screen.active { display: block; }

.intro,
.room {
  border: 1px solid rgba(59, 48, 39, 0.14);
  border-radius: 34px;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 24px 70px var(--shadow);
  padding: clamp(24px, 5vw, 52px);
}

.kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--soft);
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 7vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  margin-bottom: 22px;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.045em;
  max-width: 680px;
}

.promise {
  max-width: 620px;
  color: var(--soft);
  font-size: clamp(1.1rem, 2.1vw, 1.35rem);
  line-height: 1.55;
}

#begin,
#again {
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  background: var(--ink);
  color: #fff9ef;
  box-shadow: 0 10px 28px rgba(59, 48, 39, 0.24);
  cursor: pointer;
}

#begin:hover,
#again:hover { transform: translateY(-1px); }

.small {
  color: var(--soft);
  font-size: 0.95rem;
  line-height: 1.45;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.debt-note {
  color: var(--soft);
  margin-bottom: 12px;
}

.settings {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
  color: var(--soft);
  font-size: 0.92rem;
}

.settings button,
#change-routine {
  border: 1px solid rgba(59, 48, 39, 0.14);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
}

.settings button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff9ef;
}

.settings[hidden],
.keepsakes[hidden] {
  display: none;
}

body.dimmed {
  --paper: #eee1d4;
  background: linear-gradient(180deg, #f2e6d7, #e5d7c8);
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition: none !important;
}

.room-scene {
  position: relative;
  min-height: 560px;
  border-radius: 30px;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(239,224,203,0.82)),
    repeating-linear-gradient(90deg, rgba(59,48,39,0.05) 0 1px, transparent 1px 42px);
  border: 1px solid rgba(59, 48, 39, 0.12);
}

.window {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 132px;
  height: 154px;
  border-radius: 46px 46px 18px 18px;
  background: linear-gradient(#dcecf0, #fff3cf);
  border: 10px solid rgba(255,255,255,0.78);
  box-shadow: inset 0 -24px 40px rgba(217,168,95,0.18);
}

.window span {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(217,168,95,0.36);
  transform: translate(-50%, -50%);
}

.object {
  position: absolute;
  width: min(245px, 42vw);
  border: 1px solid rgba(59, 48, 39, 0.14);
  border-radius: 26px;
  padding: 20px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 14px 34px rgba(59, 48, 39, 0.12);
  text-align: left;
  cursor: pointer;
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.object:hover,
.object:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 20px 42px rgba(59, 48, 39, 0.17);
  outline: 3px solid rgba(217,168,95,0.25);
}

.object .icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  margin-bottom: 14px;
  font-size: 1.7rem;
  background: var(--paper-deep);
}

.object strong { display: block; font-size: 1.14rem; margin-bottom: 7px; }
.object em { display: block; color: var(--soft); font-style: normal; line-height: 1.35; }

.cup { left: 28px; bottom: 172px; }
.cup .icon { background: rgba(143,178,196,0.35); }
.cloth { left: 50%; bottom: 220px; transform: translateX(-50%); }
.cloth:hover, .cloth:focus-visible { transform: translateX(-50%) translateY(-4px); }
.cloth .icon { background: rgba(169,184,155,0.36); }
.lamp { right: 34px; bottom: 174px; }
.lamp .icon { background: rgba(217,168,95,0.32); }
.stone { left: 18%; bottom: 28px; }
.stone .icon { background: rgba(207,160,155,0.32); }
.window-card { right: 18%; bottom: 30px; }
.window-card .icon { background: rgba(143,178,196,0.25); }

.room[data-held="water"] .cup,
.room[data-held="cloth"] .cloth,
.room[data-held="lamp"] .lamp,
.room[data-held="stone"] .stone,
.room[data-held="window"] .window-card {
  background: #fffdf8;
  box-shadow: 0 0 0 5px rgba(217,168,95,0.14), 0 24px 60px rgba(59,48,39,0.18);
}

.room[data-held="water"] .cup .icon { animation: breathe 1.6s ease-in-out infinite; }
.room[data-held="cloth"] .cloth .icon { animation: fold 1.6s ease-in-out infinite; }
.room[data-held="lamp"] .lamp .icon { animation: glow 1.6s ease-in-out infinite; }
.room[data-held="stone"] .stone .icon { animation: breathe 1.8s ease-in-out infinite; }
.room[data-held="window"] .window-card .icon { animation: glow 1.8s ease-in-out infinite; }

.result,
.routine {
  margin: 18px 0;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(59, 48, 39, 0.1);
}

.routine h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.routine p:not(.kicker) {
  font-size: 1.14rem;
  line-height: 1.45;
}

.beads {
  display: flex;
  gap: 9px;
  margin: 12px 0 16px;
}

.beads span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(59,48,39,0.14);
}

.beads span.lit {
  background: var(--amber);
  box-shadow: 0 0 18px rgba(217,168,95,0.42);
}

#next-step {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff9ef;
  cursor: pointer;
  margin-right: 8px;
}

.result p:first-child {
  font-size: 1.18rem;
  line-height: 1.45;
  margin-bottom: 8px;
}

.keepsakes {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(59, 48, 39, 0.12);
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(59,48,39,0.12);
  color: var(--soft);
  font-size: 0.9rem;
}

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

@keyframes breathe {
  50% { transform: scale(1.08) rotate(-2deg); }
}

@keyframes fold {
  50% { transform: translateX(4px); }
}

@keyframes glow {
  50% { box-shadow: 0 0 28px rgba(217,168,95,0.68); }
}

@media (max-width: 720px) {
  .room-scene { min-height: 920px; }
  .object { width: calc(100% - 48px); left: 24px; right: 24px; }
  .cup { top: 184px; bottom: auto; }
  .cloth { top: 334px; bottom: auto; transform: none; }
  .cloth:hover, .cloth:focus-visible { transform: translateY(-4px); }
  .lamp { top: 484px; bottom: auto; }
  .stone { top: 634px; bottom: auto; }
  .window-card { top: 784px; bottom: auto; }
  .window { right: 22px; width: 104px; height: 122px; }
}
