:root {
  --cream: #fff3ea;
  --paper: #ffe7d6;
  --ink: #4a3340;
  --mute: #8a6d78;
  --pink: #ff7b8a;
  --pink-deep: #ee5d72;
  --blue: #6eb5ff;
  --blue-deep: #4b91e8;
  --gold: #f0b429;
  --card: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 40px rgba(90, 46, 62, 0.12);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

#app, .screen {
  position: relative;
  width: 100%;
  height: 100%;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
}

.hidden {
  display: none !important;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  z-index: 0;
}

.b1 {
  width: 220px;
  height: 220px;
  background: #ffd0d6;
  top: -60px;
  right: -40px;
}

.b2 {
  width: 180px;
  height: 180px;
  background: #cfe4ff;
  bottom: 40px;
  left: -50px;
}

.home-art, h1, .tag, .field, .btn, .or, .join-row, .hint,
.eyebrow, .code, .pair, .status, .count, .sync, .line, .pair-names, .stats {
  position: relative;
  z-index: 1;
}

.home-art {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.float-heart {
  width: 54px;
  height: 48px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(-45deg);
  animation: bob 2.4s ease-in-out infinite;
}

.float-heart:before,
.float-heart:after {
  content: "";
  position: absolute;
  width: 54px;
  height: 48px;
  border-radius: inherit;
  background: inherit;
}

.float-heart:before { top: -24px; left: 0; }
.float-heart:after { left: 24px; top: 0; }

.float-heart.pink { background: var(--pink); }
.float-heart.blue { background: var(--blue); animation-delay: -1.1s; }

.float-line {
  width: 46px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--blue));
}

@keyframes bob {
  50% { transform: rotate(-45deg) translateY(-7px); }
}

h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 8px;
}

h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.tag, .hint, .status, .line, .stats, .or, .eyebrow {
  color: var(--mute);
}

.tag {
  margin: 8px 0 28px;
  font-size: 15px;
}

.field {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 13px;
  color: var(--mute);
}

input {
  height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  outline: none;
}

.btn {
  height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 0 22px;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.btn.primary {
  width: min(360px, 100%);
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--mute);
}

.or {
  margin: 18px 0 10px;
  font-size: 13px;
}

.join-row {
  display: flex;
  gap: 10px;
  width: min(360px, 100%);
}

.join-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-weight: 700;
}

.hint {
  min-height: 24px;
  margin-top: 14px;
  color: var(--pink-deep);
  font-size: 13px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 4px;
  font-size: 13px;
}

.code {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: 12px;
  margin: 8px 0 4px;
}

.pair {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 18px;
}

.seat {
  width: 120px;
  background: var(--card);
  border-radius: 20px;
  padding: 18px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}

.seat strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
}

.seat-line {
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: var(--gold);
}

.mini-heart {
  width: 22px;
  height: 20px;
  margin: 0 auto;
  border-radius: 50%;
  transform: rotate(-45deg);
  position: relative;
}

.mini-heart.pink { background: var(--pink); }
.mini-heart.blue { background: var(--blue); }

.status {
  margin: 0;
}

.count {
  margin-top: 24px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  background: var(--pink);
  box-shadow: var(--shadow);
}

.game-screen {
  padding: 0;
  background: #1d2433;
}

#cv {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#hud-you {
  font-size: 12px;
  opacity: 0.95;
}

.hud-btn {
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.pick-panel {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  width: min(300px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  z-index: 5;
  color: var(--ink);
  text-align: center;
}

.pick-panel p {
  margin: 0 0 10px;
  font-weight: 700;
}

.start-level {
  margin-top: 18px;
}

.hint.soft {
  color: var(--mute);
}

.seat.mine {
  outline: 2px solid var(--pink);
}

.seat.mine.blue-seat {
  outline-color: var(--blue);
}

#hud-level {
  display: block;
  font-weight: 800;
  font-size: 18px;
}

#hud-hint {
  display: block;
  opacity: 0.85;
  font-size: 12px;
  margin-top: 2px;
}

.banner, .toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  pointer-events: none;
}

.banner { top: 22%; }
.toast { bottom: 132px; }

.pads {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
}

.pad {
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  backdrop-filter: blur(8px);
}

.pad.jump {
  width: 88px;
  background: rgba(255, 123, 138, 0.88);
}

.pad:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.34);
}

.sync {
  font-size: 72px;
  font-weight: 800;
  margin: 6px 0 0;
  color: var(--pink-deep);
}

.line {
  font-size: 22px;
  color: var(--ink);
  margin: 4px 0 10px;
}

.pair-names {
  margin: 0;
  font-size: 18px;
}

.stats {
  margin: 8px 0 28px;
}

@media (min-width: 720px) {
  .pads { display: none; }
}
