:root {
  --w: 390px;
  --h: 844px;
  --rose: #e07a8a;
  --rose-deep: #c45c6e;
  --gold: #d4a24a;
  --ink: #4a3340;
  --muted: #8a6b76;
  --paper: #fff7f2;
  --tile: #fffdfb;
  --shadow: 0 10px 28px rgba(90, 40, 55, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #2a1c24;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.shell {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.stage {
  width: var(--w);
  height: var(--h);
  transform-origin: center center;
}

.phone {
  position: relative;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  border-radius: 36px;
  background:
    radial-gradient(120% 70% at 50% -10%, #ffe4dc 0%, transparent 55%),
    linear-gradient(180deg, #f7c4c0 0%, #f8d5c8 22%, #f6e6d8 48%, #e8d4e0 100%);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  padding: 26px 12px 10px;
}

.notch {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 118px;
  height: 22px;
  transform: translateX(-50%);
  background: #1b1216;
  border-radius: 14px;
  z-index: 5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff, #ffd9df);
  color: var(--rose-deep);
  box-shadow: 0 2px 0 rgba(196, 92, 110, 0.18);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.scores {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.scores strong {
  color: var(--ink);
  font-size: 14px;
}

.scene {
  position: relative;
  height: 132px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 -18px 0 rgba(255, 247, 236, 0.55), 0 4px 0 rgba(196, 92, 110, 0.08);
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #8fb7e8 0%, #f7c9c0 42%, #ffe7c8 72%, #f4d7b0 100%);
}

.sea {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 38px;
  height: 36px;
  background: linear-gradient(180deg, #6aa7c4, #4e8eae);
  clip-path: polygon(0 40%, 8% 20%, 18% 45%, 30% 18%, 44% 42%, 58% 16%, 72% 40%, 86% 20%, 100% 38%, 100% 100%, 0 100%);
}

.balcony {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  background: linear-gradient(180deg, #f6e6d2, #e8d0b4);
}

.rail {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 36px;
  height: 16px;
  border-top: 3px solid rgba(255, 255, 255, 0.85);
  border-left: 3px solid rgba(255, 255, 255, 0.55);
  border-right: 3px solid rgba(255, 255, 255, 0.55);
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.7) 18px 21px);
}

.pier {
  position: absolute;
  right: 8px;
  bottom: 40px;
  width: 72px;
  height: 46px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #5d6f88, #3d4c5e);
  opacity: 0.38;
  filter: grayscale(0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
  transition: 0.5s ease;
}

.pier.unlocked {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 16px rgba(255, 220, 140, 0.65);
}

.pier-lamp {
  color: #ffe7a3;
  font-size: 12px;
  margin-bottom: 2px;
}

.pier-label {
  font-size: 8px;
  color: #f3e6c8;
  letter-spacing: 0.08em;
}

.deco {
  position: absolute;
  font-size: 22px;
  filter: drop-shadow(0 2px 0 rgba(80, 40, 40, 0.15));
  animation: pop-in 0.45s ease;
}

.deco-vase { left: 42px; bottom: 18px; }
.deco-letter { left: 88px; bottom: 20px; font-size: 18px; }
.deco-cat { right: 92px; bottom: 16px; }

.deco-lights {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 10px;
  display: flex;
  justify-content: space-between;
  animation: pop-in 0.45s ease;
}

.deco-lights i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffe38a;
  box-shadow: 0 0 8px #ffd36a;
}

.deco-lights i:nth-child(odd) { background: #ffb3c4; box-shadow: 0 0 8px #ff8aa3; }

.scene-caption {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 10px;
  color: #4a3a48;
  background: rgba(255, 255, 255, 0.55);
  padding: 3px 8px;
  border-radius: 999px;
}

.wish {
  margin: 8px 0 6px;
  min-height: 52px;
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.86);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  box-shadow: 0 2px 0 rgba(196, 92, 110, 0.1);
}

.wish.ready {
  outline: 2px solid var(--rose);
  animation: pulse 1.2s ease infinite;
}

.wish-tag {
  font-size: 10px;
  color: #fff;
  background: var(--rose);
  border-radius: 8px;
  padding: 4px 6px;
}

.wish-body { flex: 1; min-width: 0; }
.wish-title { font-size: 13px; font-weight: 650; }
.wish-hint { font-size: 10px; color: var(--muted); margin-top: 2px; }
.wish-need { font-size: 22px; }

.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

.board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 5px;
  aspect-ratio: 6 / 7;
  max-height: 100%;
}

.cell {
  position: relative;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.cell.drop {
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 2px rgba(224, 122, 138, 0.55);
}

.tile {
  position: absolute;
  inset: 2px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--tile);
  box-shadow: 0 3px 0 rgba(90, 40, 55, 0.1);
  transition: transform 0.12s ease;
}

.tile.flower { background: linear-gradient(180deg, #fff6f7, #ffd9e2); }
.tile.letter { background: linear-gradient(180deg, #fffaf0, #f3e0b5); }
.tile.accessory { background: linear-gradient(180deg, #f7f1ff, #e0d2ff); }
.tile.gen { background: linear-gradient(180deg, #fff, #ffe29a); }

.tile .emoji { font-size: 20px; line-height: 1; }
.tile .name { font-size: 8px; margin-top: 2px; color: var(--muted); letter-spacing: 0.02em; }

.cell.selected .tile,
.tile.selected {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--rose), 0 4px 0 rgba(90, 40, 55, 0.12);
}

.tile.hint { animation: hint 0.9s ease infinite; }
.tile.pop { animation: pop-in 0.28s ease; }
.tile.ghost {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 40;
  width: 52px;
  height: 52px;
  opacity: 0.92;
}

.tile.dim { opacity: 0.35; }

.dock { margin-top: 6px; }

.gen-btn,
.again,
.cta {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.gen-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 250, 246, 0.9);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 2px 0 rgba(196, 92, 110, 0.1);
}

.gen-btn:disabled { opacity: 0.55; }
.gen-ico { font-size: 22px; }
.gen-btn strong { display: block; font-size: 13px; }
.gen-btn small { color: var(--muted); font-size: 10px; }

.petals {
  margin-left: auto;
  display: flex;
  gap: 3px;
}

.petals i {
  width: 10px;
  height: 10px;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-30deg);
  background: #f1c3cb;
}

.petals i.on {
  background: var(--rose);
  box-shadow: 0 0 6px rgba(224, 122, 138, 0.6);
}

.footer {
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.again {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f08a98, var(--rose-deep));
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.12em;
  box-shadow: 0 3px 0 #9d3f52;
}

.again:active { transform: translateY(2px); box-shadow: 0 1px 0 #9d3f52; }

.home-bar {
  width: 118px;
  height: 4px;
  border-radius: 4px;
  background: rgba(74, 51, 64, 0.28);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  background: rgba(42, 28, 36, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 999px;
  z-index: 45;
  pointer-events: none;
  white-space: nowrap;
}

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 18; }

.float-score {
  position: absolute;
  font-size: 14px;
  font-weight: 700;
  color: var(--rose-deep);
  animation: float-up 0.8s ease forwards;
  text-shadow: 0 1px 0 #fff;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(28, 16, 22, 0.42);
  z-index: 50;
  padding: 24px;
  border-radius: 36px;
}

.overlay.show,
.overlay:not([hidden]).show { display: grid; }

.overlay[hidden] { display: none !important; }

.card {
  width: min(330px, 100%);
  background: var(--paper);
  border-radius: 24px;
  padding: 22px 20px 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--rose-deep);
}

.title-card h2,
.area-card h2 {
  margin: 0;
  font-size: 28px;
}

.sub {
  margin: 4px 0 14px;
  color: var(--muted);
}

.title-card ul {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink);
}

.cta {
  width: 100%;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f08a98, var(--rose-deep));
  color: #fff;
  font-size: 16px;
  box-shadow: 0 3px 0 #9d3f52;
}

.cta.slim { height: 40px; }

.who {
  display: inline-block;
  background: #f4a6b5;
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}

.who.xing { background: #b8a4e0; }

.story-card p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.7;
}

.tease {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}

@keyframes pop-in {
  from { transform: scale(0.72); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 4px rgba(224, 122, 138, 0.2); }
}

@keyframes hint {
  50% { transform: scale(1.08); }
}

@keyframes float-up {
  to { transform: translate(-50%, -28px); opacity: 0; }
}
