/* 大锤传声筒 · 暮紫暖金派对放映厅 */
.phone-page {
  --ph-bg: #141026;
  --ph-panel: #1d1736;
  --ph-border: rgba(255, 255, 255, 0.13);
  --ph-gold: #fbbf24;
  --ph-pink: #f472b6;
  --ph-ink: #f8fafc;
  --ph-muted: rgba(241, 245, 249, 0.72);
  background: radial-gradient(120% 90% at 50% 0%, #2b1d4e 0%, #151029 68%, #0e0a1c 100%);
  color: var(--ph-ink);
}

.ph-layout {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 6px 12px 10px;
}
.ph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ph-header h1 { margin: 0; font-size: 1.3rem; }
.ph-header h1 span { color: var(--ph-gold); }
.ph-modes { display: flex; gap: 6px; }

.ph-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 122px);
  min-height: 540px;
  max-height: 820px;
  border-radius: 20px;
  border: 1.5px solid rgba(244, 114, 182, 0.34);
  background: linear-gradient(160deg, rgba(31, 23, 56, 0.96) 0%, rgba(18, 14, 34, 0.98) 100%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.54);
  overflow: hidden;
}

.ph-float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}
.ph-float-react {
  position: absolute;
  bottom: 24px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 11, 28, 0.86);
  border: 1px solid rgba(251, 191, 36, 0.48);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  animation: phFloatUp 2.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes phFloatUp {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  15% { opacity: 1; transform: translateY(-16px) scale(1.06); }
  100% { opacity: 0; transform: translateY(-210px) scale(0.95); }
}

/* 顶部条 */
.ph-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(11, 8, 22, 0.72);
  border-bottom: 1px solid var(--ph-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ph-top-left,
.ph-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #f8fafc;
  white-space: nowrap;
}
.ph-pill-mode {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.28), rgba(168, 85, 247, 0.22));
  border-color: rgba(244, 114, 182, 0.5);
  color: #fbcfe8;
}
.ph-pill-code {
  cursor: pointer;
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
  color: #bfdbfe;
}
.ph-pill-step {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}
.ph-pill-variant {
  background: rgba(168, 85, 247, 0.3);
  border-color: #d8b4fe;
  color: #f3e8ff;
}
.ph-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.ph-timer-pill.is-urgent {
  background: rgba(239, 68, 68, 0.32);
  border-color: #f87171;
  color: #fecaca;
}
.ph-mini-btn {
  padding: 4px 10px !important;
  min-height: 28px !important;
  font-size: 0.76rem !important;
  border-radius: 9px !important;
}

/* 主视图容器 */
.ph-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.ph-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-y: auto;
}
.ph-view[hidden] { display: none; }

.ph-card {
  width: min(560px, 100%);
  padding: 20px 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(40, 30, 72, 0.94), rgba(22, 17, 42, 0.96));
  border: 1.5px solid rgba(251, 191, 36, 0.34);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.ph-card h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  color: #fde68a;
}
.ph-sub {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--ph-muted);
  line-height: 1.5;
}
.ph-big-emoji { font-size: 2.8rem; line-height: 1; margin-bottom: 8px; }
.ph-cta-lg { width: 100%; justify-content: center; }

.ph-variant-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.ph-var-btn {
  padding: 9px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.ph-var-btn small { font-size: 0.68rem; font-weight: 500; opacity: 0.72; }
.ph-var-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.28), rgba(251, 191, 36, 0.24));
  border-color: #fde68a;
  color: #fff;
}

.ph-divider { margin: 12px 0; font-size: 0.76rem; color: var(--ph-muted); }
.ph-join-form { display: flex; gap: 8px; }
.ph-join-form input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.ph-code-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px dashed rgba(147, 197, 253, 0.55);
  margin-bottom: 12px;
}
.ph-code-hero strong { font-size: 1.8rem; letter-spacing: 0.2em; color: #fde68a; }
.ph-roster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-bottom: 14px;
}
.ph-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
}
.ph-player-chip.is-done {
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(34, 197, 94, 0.18);
}
.ph-player-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.ph-actions-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-msg { margin: 8px 0 0; min-height: 18px; font-size: 0.78rem; color: #fca5a5; }

/* 同机设置 */
.ph-pass-count-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.84rem;
}
.ph-count-pills { display: flex; gap: 6px; }
.ph-count-pills button {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.ph-count-pills button[aria-pressed="true"] {
  background: #fbbf24;
  color: #1c1005;
  border-color: #fef08a;
}
.ph-pass-names {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.ph-pass-names input {
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.8rem;
}

/* 写题 / 看画猜句 */
.ph-step-kicker {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.22);
  color: #fbcfe8;
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.ph-polaroid {
  background: #fffdf7;
  padding: 8px 8px 10px;
  border-radius: 14px;
  margin: 0 auto 12px;
  max-width: 440px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
}
.ph-polaroid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: #fffdf7;
}
.ph-polaroid-cap {
  display: block;
  margin-top: 6px;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
}
.ph-text-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ph-text-form input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(251, 191, 36, 0.42);
  background: rgba(15, 11, 28, 0.82);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}
.ph-text-form input:focus {
  outline: 2px solid #f472b6;
  border-color: transparent;
}

/* 作画视图 */
.ph-draw-view {
  justify-content: space-between;
  align-items: stretch;
  padding: 8px 12px 10px;
  gap: 8px;
  overflow: hidden;
}
.ph-prompt-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.2), rgba(251, 191, 36, 0.2));
  border: 1px solid rgba(251, 191, 36, 0.42);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.ph-prompt-label { font-size: 0.78rem; color: #fbcfe8; font-weight: 700; }
.ph-prompt-text { font-size: 1rem; color: #fef08a; font-weight: 900; }

.ph-easel {
  container-type: size;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 8, 22, 0.45);
  padding: 6px;
  overflow: hidden;
}
.ph-canvas {
  width: min(100cqw, calc(100cqh * 1.6));
  height: min(100cqh, calc(100cqw / 1.6));
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #a1622d, 0 12px 28px rgba(0, 0, 0, 0.45);
  touch-action: none;
  cursor: crosshair;
  background: #fffdf7;
}

.ph-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 14px;
  background: rgba(11, 8, 22, 0.76);
  border: 1px solid var(--ph-border);
}
.ph-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
}
.ph-swatch[aria-pressed="true"] {
  transform: scale(1.18);
  border-color: #fff;
  box-shadow: 0 0 0 2.5px #fbbf24;
}
.ph-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.ph-tool-group,
.ph-size-group,
.ph-ops-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.ph-tool-btn {
  padding: 4px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.ph-tool-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-color: #f9a8d4;
}
.ph-tool-btn.is-hammer[aria-pressed="true"] {
  background: linear-gradient(135deg, #9333ea, #f59e0b);
  border-color: #fde68a;
}
.ph-tool-btn.is-submit {
  background: linear-gradient(135deg, #22c55e, #15803d);
  border-color: #86efac;
  color: #fff;
}
.ph-size-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ph-size-dot[aria-pressed="true"] {
  background: rgba(251, 191, 36, 0.28);
  border-color: #fbbf24;
}
.ph-size-dot i { display: block; border-radius: 50%; background: #fff; }

/* 🎬 全场爆笑放映厅 */
.ph-reveal-view {
  align-items: stretch;
  justify-content: space-between;
  padding: 8px 12px 10px;
  gap: 8px;
  overflow: hidden;
}
.ph-reveal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.ph-book-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.ph-book-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ph-book-tab[aria-pressed="true"] {
  background: linear-gradient(135deg, #f472b6, #a855f7);
  border-color: #fbcfe8;
  color: #fff;
}
.ph-book-tab img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.ph-reveal-tools { display: flex; gap: 6px; flex-wrap: wrap; }

.ph-comic-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px;
}
.ph-comic-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: phPopIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.ph-comic-item.is-text {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(168, 85, 247, 0.18));
  border-color: rgba(147, 197, 253, 0.42);
}
.ph-comic-item.is-draw {
  background: rgba(255, 251, 240, 0.08);
  border-color: rgba(251, 191, 36, 0.42);
}
@keyframes phPopIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ph-comic-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  color: #fde68a;
  font-weight: 800;
}
.ph-comic-meta img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ph-comic-quote {
  font-size: 1.06rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.45;
}
.ph-comic-art {
  width: 100%;
  border-radius: 11px;
  background: #fffdf7;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
}

.ph-reveal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--ph-border);
}
.ph-react-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.ph-react-bar button {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.ph-react-bar button:hover { background: rgba(244, 114, 182, 0.3); }
.ph-reveal-end-btns { display: flex; align-items: center; gap: 8px; }

/* 移动端自适应 */
@media (max-width: 780px) {
  .ph-layout { padding: 2px 6px 4px; }
  .ph-stage {
    height: calc(100dvh - 114px);
    min-height: 500px;
    border-radius: 14px;
  }
  .ph-top-bar { padding: 5px 8px; gap: 5px; }
  .ph-pill { font-size: 0.68rem; padding: 2px 7px; }
  .ph-card { padding: 14px 14px; }
  .ph-draw-view { padding: 5px 7px 7px; gap: 5px; }
  .ph-prompt-text { font-size: 0.88rem; }
  .ph-toolbar { padding: 6px 8px; gap: 5px; }
  .ph-palette { gap: 3px; justify-content: space-between; flex-wrap: nowrap; }
  .ph-swatch { width: 18px; height: 18px; flex-shrink: 0; }
  .ph-tool-btn { padding: 3px 7px; font-size: 0.7rem; }
  .ph-variant-row { grid-template-columns: 1fr; }
}
