.emo-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #fff8f4, #fff1ea);
}
.emo-nav {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 4px 12px 0;
}
.emo-nav a { color: #5c4036; font-size: 28px; text-decoration: none; line-height: 1; }
.emo-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.emo-who img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 6px 8px rgba(180, 90, 50, 0.16));
}
.emo-who strong { display: block; font-size: 15px; }
.emo-who small { color: #b08978; font-size: 11px; }
.emo-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #ff7a45;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.emo-left i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  font-style: normal;
  line-height: 18px;
}
.emo-log { flex: 1; min-height: 0; overflow: auto; padding: 8px 14px 12px; }
.emo-row { display: flex; margin-top: 10px; }
.emo-row.is-user { justify-content: flex-end; }
.emo-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(196, 112, 76, 0.06);
}
.emo-row.is-user .emo-bubble { background: #ff7a45; color: #fff; }
.emo-bubble.is-typing {
  background: #fff6ec;
  color: #9a7b68;
  animation: emoTyping 1.2s ease-in-out infinite;
}
@keyframes emoTyping {
  0%, 100% { opacity: .62; }
  50% { opacity: 1; }
}
.emo-meta { margin: 0 0 8px; padding: 0; list-style: none; }
.emo-meta li { display: flex; gap: 8px; margin-top: 4px; }
.emo-meta b { flex: 0 0 3em; color: #c56a45; font-weight: 700; }
.emo-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.emo-chips button, .emo-go, .plan, .emo-send {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}
.emo-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.emo-options button {
  min-height: 72px;
  padding: 12px 10px;
  border: 1px solid #f0d2c2;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fff, #fff6f1);
  color: #6a3b28;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 8px 16px rgba(196, 112, 76, 0.08);
}
.emo-options.is-stack { grid-template-columns: 1fr; }
.emo-options.is-stack button { text-align: left; }
.emo-bar { display: flex; gap: 8px; padding: 8px 12px 18px; }
.emo-bar input {
  flex: 1;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #f3d3c4;
  border-radius: 12px;
  font: inherit;
}
.emo-send { padding: 0 14px; background: #ff7a45; color: #fff; font-weight: 700; }

.draw-page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(120% 40% at 50% 0%, #fff 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #fff8f3, #ffe8dc);
}
.draw-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 4px;
}
.draw-page .emo-nav { min-height: 52px; }
.draw-page .emo-who img { width: 48px; height: 48px; }
.pick-bar, .rel-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px;
}
.rel-bar { padding-top: 8px; }
.pick-bar button, .rel-bar button, .draw-random {
  flex: 1;
  min-height: 36px;
  border: 1px solid #f0d2c2;
  border-radius: 999px;
  background: #fff;
  color: #8a6a5c;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.pick-bar button.is-on, .rel-bar button.is-on {
  border-color: #ff7a45;
  background: #ff7a45;
  color: #fff;
}
.draw-random { margin: 0 16px 8px; background: #fff6f1; color: #e07a45; }
.slot {
  width: auto;
  height: min(210px, 100%);
  aspect-ratio: 3 / 4;
  max-width: 72%;
  box-sizing: border-box;
  border-radius: 22px;
  border: 1.5px dashed #e3b093;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,244,236,0.92));
  box-shadow: inset 0 0 0 6px rgba(255,255,255,0.5);
  display: grid;
  place-items: center;
  color: #c9a08e;
  font-size: 13px;
  text-align: center;
  padding: 12px;
}
.slot.is-over { border-color: #ff7a45; background: #fff; }
.slot.has-card { border: 0; background: transparent; padding: 0; box-shadow: none; }
.draw-hint {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin: 0 20px 8px;
  color: #8a6a5c;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}
.deck {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 176px;
  height: 176px;
  min-height: 0;
  margin: 0 12px 18px;
  padding: 12px 8px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(243, 199, 176, 0.8);
}
.playing {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 118px;
  margin: 0 -24px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 8px 14px rgba(160, 70, 36, 0.14);
  transform: rotate(var(--tilt));
  touch-action: none;
  cursor: grab;
}
.playing.is-dragging { z-index: 40; }
.deck.is-pick {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 12px 14px;
}
.deck.is-pick .playing {
  flex: 0 0 108px;
  width: 108px;
  height: 146px;
  margin: 0;
  transform: none;
  touch-action: pan-x;
}
.deck.is-pick .card-front strong { margin-top: 42px; font-size: 22px; }
.playing.is-open .card-inner { transform: rotateY(180deg); }
.playing.is-placed {
  width: 100%;
  height: 100%;
  margin: 0;
  box-shadow: 0 14px 28px rgba(160, 70, 36, 0.2);
  cursor: default;
}
.card-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.45s ease; }
.playing.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  backface-visibility: hidden;
  overflow: hidden;
}
.card-back {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,0.28), transparent 36%),
    linear-gradient(165deg, #ffc2a2, #f07848 58%, #e25b32);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), inset 0 0 0 8px rgba(255,122,69,0.25);
}
.card-back::after {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.12);
}
.card-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 8px 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 247, 240, 0.9), transparent 58%),
    linear-gradient(180deg, #fff 0%, #fff8f3 100%);
  transform: rotateY(180deg);
  text-align: center;
  box-shadow:
    inset 0 0 0 1.5px #efc3ab,
    inset 0 0 0 5px #fff,
    inset 0 0 0 6.5px #f4d4c4;
}
.card-front::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 34px;
  background: linear-gradient(180deg, #ffc7a4, #ff9a68);
}
.playing[data-tone="消极"] .card-front::before { background: linear-gradient(180deg, #f3b4b4, #e07d7d); }
.playing[data-tone="中性"] .card-front::before { background: linear-gradient(180deg, #f3ddb0, #e2c07a); }
.card-mark {
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  color: #fff;
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.card-front strong {
  max-width: 100%;
  margin-top: 28px;
  color: #5c3318;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}
.card-front small {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff1e8;
  color: #c56a45;
  font-size: 11px;
  line-height: 1.3;
}
.playing[data-tone="消极"] .card-front small { background: #fdeeee; color: #b45454; }
.playing[data-tone="中性"] .card-front small { background: #f8f1e4; color: #8a6230; }
.playing.is-scene .card-front small {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-radius: 10px;
  white-space: normal;
}
.playing.is-placed .card-front {
  justify-content: center;
  overflow: auto;
  padding: 28px 18px;
}
.playing.is-placed .card-front { justify-content: center; padding-bottom: 28px; }
.playing.is-placed .card-front::before { height: 52px; }
.playing.is-placed .card-mark { top: 16px; font-size: 16px; }
.playing.is-placed .card-front strong { margin-top: 36px; font-size: 40px; }
.playing.is-placed .card-front small { margin-top: 4px; padding: 4px 10px; font-size: 14px; }
.emo-go {
  margin: 8px 16px 18px;
  background: #ff7a45;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.emo-go small { display: block; font-size: 11px; font-weight: 500; opacity: 0.9; }
.emo-go:disabled { background: #eadfd8; color: #9a887e; }

.sheet-mask {
  position: absolute;
  inset: 0;
  z-index: 28;
  background: rgba(48, 28, 18, 0.46);
}
.sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 29;
  max-height: 92%;
  overflow: auto;
  padding: 18px 14px 20px;
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -12px 40px rgba(80, 40, 20, 0.18);
}
.sheet-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f6f1ee;
  color: #8a6a5c;
  font-size: 18px;
  cursor: pointer;
}
.sheet-title {
  margin: 0;
  text-align: center;
  font-size: 18px;
}
.sheet-title em {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff1ea;
  color: #e07a45;
  font-style: normal;
  font-size: 11px;
}
.sheet-remain { margin: 6px 0 0; text-align: center; color: #8a6a5c; font-size: 13px; }
.sheet-banner {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff4ec, #fff);
  color: #9a4e32;
  font-size: 13px;
  text-align: center;
}
.sheet-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  text-align: center;
}
.sheet-perks li { color: #8a6a5c; font-size: 11px; line-height: 1.35; }
.sheet-perks b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 4px;
  border-radius: 12px;
  background: #fff1ea;
  color: #e07a45;
  font-size: 14px;
}
.plan-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan {
  position: relative;
  min-height: 108px;
  padding: 16px 4px 8px;
  border: 1px solid #f0ddd4;
  border-radius: 14px;
  background: #fff;
  color: #5c3b30;
  text-align: center;
}
.plan-badge {
  position: absolute;
  top: -8px;
  left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ff7a45;
  color: #fff;
  font-size: 10px;
}
.plan.is-on { border-color: #ff7a45; background: #fff6f1; box-shadow: 0 0 0 1px #ff7a45; }
.plan b { display: block; font-size: 20px; }
.plan small { display: block; margin-top: 2px; color: #b08978; font-size: 10px; }
.plan strong { display: block; margin-top: 6px; color: #e07a45; font-size: 16px; }
.plan s { color: #c8b2a8; font-size: 11px; font-weight: 400; }
.sheet-sub, .sheet-pay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #f0ddd4;
  border-radius: 14px;
  background: #fff;
  color: #5c3b30;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.sheet-sub.is-on, .sheet-pay.is-on { border-color: #ff7a45; }
.sheet-sub span, .sheet-pay span { display: block; }
.sheet-sub small, .sheet-pay small { color: #8a6a5c; font-size: 12px; }
.sheet-radio {
  width: 18px;
  height: 18px;
  border: 1.5px solid #e0c8bc;
  border-radius: 50%;
  flex-shrink: 0;
}
.is-on .sheet-radio { border-color: #ff7a45; box-shadow: inset 0 0 0 5px #ff7a45; }
.sheet .pay {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9366, #ff7a45);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(255, 122, 69, 0.28);
}
.sheet .pay:disabled { background: #eadfd8; color: #9a887e; box-shadow: none; }
.sheet .legal { margin: 8px 0 0; color: #a08b82; font-size: 11px; text-align: center; line-height: 1.5; }
.suit-bar[hidden] { display: none !important; }
.suit-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 4px;
}
.suit {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.suit-xi { background: #ff7a3c; }
.suit-nu { background: #e2543c; }
.suit-ai { background: #4f7ea8; }
.suit-ju { background: #7d62b5; }
.suit.is-on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(92, 51, 24, 0.35); }
.fan-row {
  position: relative;
  display: block;
  margin: 0 0 8px;
}
.deck.fan {
  position: relative;
  display: block;
  width: 100%;
  height: 236px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.deck.fan .playing {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 132px;
  height: 186px;
  margin: 0 0 0 -66px;
  transform-origin: 50% 92%;
  transition: transform 0.28s ease;
}
.deck.fan.is-scatter .playing,
.deck.fan.is-turning .playing,
.playing.is-lifting { transition: none !important; margin: 0 !important; }
.phone-frame.is-raising,
.draw-page.is-raising,
.deck.fan.is-raising { overflow: visible !important; }
.deck.fan.is-visible .card-inner { transform: rotateY(180deg); }
.deck.fan .card-front {
  padding: 18px 6px 10px;
  gap: 6px;
  justify-content: flex-start;
}
.deck.fan .card-front strong {
  width: 108px;
  font-size: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck.fan .playing .card-front small { display: none; }
.deck.fan .playing.is-center .card-front small,
.deck.fan .playing.is-scene .card-front small { display: block; }
.deck.fan .playing.is-center .card-front strong { font-size: 16px; }
.deck.fan .card-front small { font-size: 10px; padding: 2px 6px; }
.playing[data-suit="喜"] .card-back { background: linear-gradient(165deg, #ffc48a, #ff7a3c 58%, #f06a2a); }
.playing[data-suit="怒"] .card-back { background: linear-gradient(165deg, #ffb0a4, #e2543c 58%, #c73d2e); }
.playing[data-suit="哀"] .card-back { background: linear-gradient(165deg, #b7d0e6, #4f7ea8 60%, #3d6890); }
.playing[data-suit="惧"] .card-back { background: linear-gradient(165deg, #d9cef0, #7d62b5 60%, #65489a); }
.playing[data-suit="亲子"] .card-back { background: linear-gradient(165deg, #ffc48a, #ff7a3c 58%, #f06a2a); }
.playing[data-suit="夫妻"] .card-back { background: linear-gradient(165deg, #f3c1d8, #d36b92 60%, #b85278); }
.playing.is-placed {
  position: relative;
  left: auto;
  top: auto;
  margin: 0;
}
.eye {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid #f0d2c2;
  border-radius: 50%;
  background: #fff;
  color: #c56a45;
  cursor: pointer;
}
.eye svg { width: 22px; height: 22px; }
.eye:not(.is-on)::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 21px;
  height: 2px;
  border-radius: 2px;
  background: #c56a45;
  transform: rotate(-28deg);
}
@media (prefers-reduced-motion: reduce) {
  .card-inner, .deck.fan .playing { transition: none; }
}
