/* ============================================================
   mobile.css — WASTELAND LIVE · 观众手机端 (竖屏 + 横屏全屏)
   reuses palette + sprites + scene backdrops from game.css /
   assets-lib.css; adds amber survival-glow chrome.
   loaded LAST so it overrides the desktop html/body rules.
   ============================================================ */

html, body { width: 100%; height: 100%; overflow: hidden; background: #050409;
  font-family: var(--body); -webkit-font-smoothing: antialiased; }

/* device stage — letterbox the phone on a dark backdrop */
.m-stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 700px at 50% -10%, #1a1330, #050409 72%); overflow: hidden; }

.device { position: relative; width: 375px; height: 812px; transform-origin: center center;
  background: #07050f; overflow: hidden; border-radius: 44px;
  box-shadow: 0 0 0 11px #15131c, 0 0 0 13px #2a2738, 0 40px 120px rgba(0,0,0,.7); }
.device.landscape { width: 812px; height: 375px; border-radius: 40px; }
/* notch */
.device .notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 150px; height: 26px; background: #15131c; border-radius: 0 0 18px 18px; z-index: 90; }
.device.landscape .notch { top: 50%; left: auto; right: 0; width: 26px; height: 130px;
  border-radius: 18px 0 0 18px; transform: translateY(-50%); }
.screen { position: absolute; inset: 0; overflow: hidden; border-radius: 44px; }

/* status row (faux iOS) */
.ios-bar { position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 26px 0;
  font-size: 12px; color: #e9e6fb; font-weight: 600; pointer-events: none; }
.ios-bar .r { display: flex; gap: 5px; align-items: center; font-size: 11px; }

/* shared accent */
:root { --amber: #ffb13d; --amber-deep: #c77a14; --ember: #ff7a2d; }

/* ============================================================
   PAGE 1 — COVER
   ============================================================ */
.pg { position: absolute; inset: 0; }
.cover { background: linear-gradient(180deg, #2a1c2e 0%, #3a2620 32%, #1a1220 60%, #0a0812 100%);
  overflow: hidden; display: flex; flex-direction: column; align-items: center; }
/* hazy sun */
.cover .sun { position: absolute; top: 110px; left: 50%; transform: translateX(-50%);
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,177,61,.55), rgba(255,122,45,.15) 60%, transparent 72%);
  filter: blur(2px); animation: sunPulse 6s ease-in-out infinite; }
@keyframes sunPulse { 50% { opacity: .7; transform: translateX(-50%) scale(1.06); } }
/* drifting embers */
.cover .embers i { position: absolute; width: 3px; height: 3px; background: var(--amber);
  border-radius: 50%; box-shadow: 0 0 6px var(--amber); opacity: .7;
  animation: ember linear infinite; }
@keyframes ember { 0% { transform: translateY(0) translateX(0); opacity: 0; }
  20% { opacity: .8; } 100% { transform: translateY(-340px) translateX(20px); opacity: 0; } }
/* ruined skyline silhouette */
.cover .skyline { position: absolute; left: 0; right: 0; bottom: 168px; height: 230px;
  display: flex; align-items: flex-end; gap: 5px; padding: 0 8px; }
.cover .skyline span { flex: 1; background: linear-gradient(180deg, #160f1c, #0a0710);
  border-top: 2px solid rgba(255,177,61,.12); position: relative; }
.cover .skyline span.broken { clip-path: polygon(0 0,62% 0,72% 14%,86% 5%,100% 18%,100% 100%,0 100%); }
.cover .skyline i { position: absolute; width: 4px; height: 6px; background: rgba(255,177,61,.5); }
.cover .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 170px;
  background: linear-gradient(180deg, #0a0710, #050409); }
.cover .ground::before { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,177,61,.05) 0 1px, transparent 1px 34px); }

.cover .c-top { position: relative; z-index: 5; margin-top: 300px; text-align: center; padding: 0 30px; }
.cover .kicker { font-family: var(--pixel); font-size: 9px; letter-spacing: 3px; color: var(--amber);
  opacity: .85; margin-bottom: 18px; }
.cover .title { font-family: var(--pixel); font-size: 30px; line-height: 1.32; color: #fff;
  text-shadow: 0 0 18px rgba(255,177,61,.5), 0 2px 0 #7a3b10; letter-spacing: 1px; }
.cover .title .l2 { color: var(--amber); display: block; margin-top: 8px; }
.cover .subtitle { margin-top: 22px; font-size: 14px; color: #cfc8e0; line-height: 1.7;
  letter-spacing: .5px; }
.cover .live-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  font-size: 11px; color: #ffd9b0; background: rgba(255,122,45,.14); border: 1px solid rgba(255,177,61,.4);
  padding: 5px 12px; border-radius: 999px; }
.cover .live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red); animation: livedot 1.3s steps(2) infinite; }
@keyframes livedot { 50% { opacity: .4; } }

.cover .c-btm { position: absolute; bottom: 64px; left: 0; right: 0; z-index: 6; padding: 0 28px; text-align: center; }
.btn-glow { width: 100%; padding: 16px; border: none; border-radius: 14px; cursor: pointer;
  font-family: var(--body); font-size: 17px; font-weight: 700; color: #2a1500;
  background: linear-gradient(180deg, #ffd27a, var(--amber)); letter-spacing: 2px;
  box-shadow: 0 0 28px rgba(255,177,61,.45), 0 6px 0 var(--amber-deep);
  animation: btnGlow 2.2s ease-in-out infinite; }
.btn-glow:active { transform: translateY(4px); box-shadow: 0 0 20px rgba(255,177,61,.4), 0 2px 0 var(--amber-deep); }
@keyframes btnGlow { 50% { box-shadow: 0 0 42px rgba(255,177,61,.7), 0 6px 0 var(--amber-deep); } }
.cover .hint { margin-top: 16px; font-size: 11px; color: #8a8298; letter-spacing: 1px; }

/* ============================================================
   PAGE 2 — IDENTITY
   ============================================================ */
.identity { background: linear-gradient(180deg, #14101f, #0a0812);
  display: flex; flex-direction: column; padding: 64px 26px 30px; }
.identity .id-h { font-family: var(--pixel); font-size: 15px; color: var(--amber);
  text-align: center; letter-spacing: 1px; text-shadow: 0 0 14px rgba(255,177,61,.4); }
.identity .id-sub { text-align: center; font-size: 12px; color: #8a8298; margin-top: 12px; line-height: 1.6; }
.identity .id-label { font-size: 12px; color: #cfc8e0; margin: 30px 0 14px; letter-spacing: 1px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.avatar-cell { aspect-ratio: 1; background: #1a1530; border: 2px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 30px; cursor: pointer;
  position: relative; transition: transform .1s; }
.avatar-cell:active { transform: scale(.94); }
.avatar-cell.sel { border-color: var(--amber); background: rgba(255,177,61,.12);
  box-shadow: 0 0 18px rgba(255,177,61,.4); }
.avatar-cell.sel::after { content: "✓"; position: absolute; top: -7px; right: -7px; width: 20px; height: 20px;
  background: var(--amber); color: #2a1500; border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.id-input { margin-top: 14px; width: 100%; padding: 14px 16px; border-radius: 12px;
  background: #0c0a1c; border: 2px solid var(--line); color: #fff; font-size: 15px; font-family: var(--body); }
.id-input::placeholder { color: #6c6794; }
.id-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 14px rgba(255,177,61,.3); }
.id-note { margin-top: 16px; font-size: 11px; color: #8a8298; line-height: 1.6;
  background: rgba(255,122,45,.08); border-left: 3px solid var(--ember); padding: 10px 12px; border-radius: 0 8px 8px 0; }
.id-note b { color: var(--amber); }
.identity .id-foot { margin-top: auto; padding-top: 22px; }

/* ============================================================
   PAGE 3 — PORTRAIT LIVE ROOM
   ============================================================ */
.room { background: #07050f; display: flex; flex-direction: column; }

/* top info bar */
.room-top { position: relative; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 38px 14px 12px; }
.streamer-chip { display: flex; align-items: center; gap: 9px; background: rgba(20,16,32,.7);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 5px; }
.streamer-chip .av { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--ember), var(--amber)); display: flex; align-items: center;
  justify-content: center; font-size: 18px; box-shadow: 0 0 10px rgba(255,177,61,.5); }
.streamer-chip .nm { font-size: 13px; color: #fff; display: flex; align-items: center; gap: 6px; }
.streamer-chip .live { font-family: var(--pixel); font-size: 7px; background: var(--red); color: #fff;
  padding: 2px 5px; border-radius: 3px; letter-spacing: 1px; animation: livedot 1.4s steps(2) infinite; }
.streamer-chip .watch { font-size: 10px; color: #9a95c4; margin-top: 2px; }
.streamer-chip .watch b { color: var(--amber); }
.like-chip { margin-left: auto; display: flex; align-items: center; gap: 6px; background: rgba(20,16,32,.7);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 13px; color: #fff; }
.like-chip .heart { color: var(--magenta); font-size: 14px; animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.25); } 28% { transform: scale(1); } }

/* countdown bar */
.cd-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 25;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 0; font-size: 12px; color: #ffd9b0;
  background: linear-gradient(180deg, rgba(8,6,16,.85) 0%, transparent 100%);
  pointer-events: none; }
.cd-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.cd-dot.pulse { background: var(--amber); box-shadow: 0 0 8px var(--amber);
  animation: livedot 1s steps(2) infinite; }
.cd-dot.deciding { background: var(--cyan, #35e0d0); box-shadow: 0 0 8px var(--cyan, #35e0d0); }
.cd-label { font-size: 11px; letter-spacing: 1px; }
.cd-time { font-family: var(--pixel); font-size: 13px; color: #fff;
  min-width: 28px; text-align: center; }

/* 16:9 game feed, centered with letterbox */
.feed-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; min-height: 0; }
.feed-wrap::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,177,61,.018) 0 2px, transparent 2px 5px); }
.feed-wrap::after { content: "◾ 直播信号 · LIVE FEED"; position: absolute; top: 12px; left: 50%;
  transform: translateX(-50%); font-size: 9px; letter-spacing: 2px; color: #4a4458; pointer-events: none; }
html[data-lang="en"] .feed-wrap::after { content: "◾ LIVE SIGNAL · ON AIR"; }
.feed { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000;
  border-top: 1px solid #1a1730; border-bottom: 1px solid #1a1730; }
.feed-scene { position: absolute; top: 50%; left: 50%; transform-origin: center;
  width: 1344px; height: 970px; }
.feed-scaler { position: absolute; top: 0; left: 0; transform-origin: top left; }

/* mini HUD echo (day + stats) — matches streamer */
.feed-hud { position: absolute; top: 8px; left: 8px; z-index: 14; display: flex; align-items: center; gap: 8px;
  background: rgba(8,6,16,.74); border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; }
.feed-hud .day { font-family: var(--pixel); font-size: 8px; color: var(--cyan); }
.feed-hud .pips { display: flex; gap: 3px; }
.feed-hud .pip { width: 18px; height: 5px; border-radius: 2px; background: #2a2548; }
.feed-hud .pip.hp { background: var(--hp); } .feed-hud .pip.hu { background: var(--hunger); }
.feed-hud .pip.sa { background: var(--sanity); } .feed-hud .pip.su { background: var(--supply); }

/* fullscreen toggle */
.fs-btn { position: absolute; top: 8px; right: 8px; z-index: 16; width: 34px; height: 34px;
  background: rgba(8,6,16,.74); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--amber); font-size: 16px; }
.fs-btn:active { transform: scale(.92); }

/* comment waterfall overlay (left, bottom-up) */
.cmt-overlay { position: absolute; left: 8px; bottom: 8px; z-index: 12; width: 64%;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; pointer-events: auto;
  max-height: 86%; overflow: hidden;
  transition: opacity 0.3s; }
.cmt-overlay .m-cmt { flex-shrink: 0; }
/* Fade comments when story overlay is showing */
.cmt-overlay.story-active { opacity: 0.3; pointer-events: none; }
.cmt-overlay.land { width: 42%; }
.cmt-overlay.portrait { left: 10px; right: 30%; bottom: 6px; top: auto; width: auto;
  max-height: 40%; z-index: 15; overflow: hidden; }
.cmt-overlay.portrait .m-cmt { flex-shrink: 0; }
.m-cmt { background: rgba(8,6,16,.35); border: 1px solid rgba(255,177,61,.10); border-radius: 12px;
  padding: 6px 10px; font-size: 12px; line-height: 1.4; max-width: 100%;
  animation: cmtRise .4s ease-out; }
@keyframes cmtRise { from { opacity: 0; transform: translateY(12px); } }
.m-cmt.fading { animation: cmtFade .8s ease-out forwards; }
@keyframes cmtFade { to { opacity: 0; transform: translateY(-6px); } }
.m-cmt .u { color: var(--amber); font-weight: 600; }
.m-cmt .t { color: #f0ecff; }
.m-cmt.mine { border-color: var(--amber); background: rgba(255,122,45,.18); }
.m-cmt.adopted { border-color: var(--gold); background: rgba(255,207,63,.18);
  box-shadow: 0 0 14px rgba(255,207,63,.3); }
.m-cmt.adopted .u::before { content: "✨ "; }
.m-cmt .adopt { display: block; margin-top: 3px; font-size: 10px; color: var(--gold); }
.m-cmt.sys { border-color: var(--cyan); background: rgba(53,224,208,.12); text-align: center; }
.m-cmt.sys .t { color: var(--cyan); }

/* bottom input */
.room-input { position: relative; z-index: 30; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, #07050f 22%); display: flex; align-items: center; gap: 10px;
  transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.room-input .box { flex: 1; display: flex; align-items: center; background: #15101f;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 11px 16px; gap: 8px; }
.room-input .box.hot { border-color: var(--amber); box-shadow: 0 0 16px rgba(255,177,61,.35); }
.room-input .box input { flex: 1; background: none; border: none; outline: none; color: #fff;
  font-size: 14px; font-family: var(--body); }
.room-input .box input::placeholder { color: #6c6794; }
.room-input .box .ghost { flex: 1; color: #6c6794; font-size: 14px; }
.room-input .send { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(180deg, #ffd27a, var(--amber)); color: #2a1500; font-size: 18px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 14px rgba(255,177,61,.4); }
.room-input .send:active { transform: scale(.9); }
.room-input .send:disabled { background: #2a2738; color: #6c6794; box-shadow: none; }
.send-quota { position: absolute; top: -8px; right: 64px; font-size: 10px; color: var(--amber);
  background: rgba(8,6,16,.9); border: 1px solid rgba(255,177,61,.3); border-radius: 999px; padding: 2px 8px; }

/* faux keyboard */
.keyboard { position: absolute; left: 0; right: 0; bottom: 0; z-index: 25; height: 270px;
  background: #1c1c20; border-top: 1px solid #000; transform: translateY(100%);
  transition: transform .28s cubic-bezier(.2,.8,.2,1); padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); }
.keyboard.up { transform: translateY(0); }
.kb-row { display: flex; gap: 5px; justify-content: center; margin-bottom: 8px; padding: 0 3px; }
.kb-key { flex: 1; height: 40px; background: #3a3a40; border-radius: 6px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 1px 0 #000;
  max-width: 34px; }
.kb-key.wide { max-width: none; flex: 1.6; }
.kb-key.space { max-width: none; flex: 5; }
.kb-key.send { background: var(--amber); color: #2a1500; flex: 1.6; max-width: none; font-weight: 700; }

/* ============================================================
   PAGE 4 — LANDSCAPE FULLSCREEN (device rotated)
   ============================================================ */
.fs-room { position: absolute; inset: 0; background: #000; }
.fs-room .feed-scene { width: 1344px; height: 970px; }
/* fullscreen countdown */
.fs-cd { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 6px; background: rgba(8,6,16,.7);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  font-size: 12px; color: #ffd9b0; pointer-events: none; }

.fs-exit { position: absolute; top: 14px; right: 16px; z-index: 30; width: 38px; height: 38px;
  background: rgba(8,6,16,.7); border: 1px solid var(--line); border-radius: 9px; color: var(--amber);
  font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fs-room .cmt-overlay { left: 16px; bottom: 60px; width: 36%; max-height: 50%; overflow: hidden; }
.fs-room .cmt-overlay .m-cmt { flex-shrink: 0; }
.fs-room .m-cmt { border-radius: 16px; }
.fs-input { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 30;
  width: 52%; display: flex; align-items: center; gap: 8px; background: rgba(8,6,16,.6);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; backdrop-filter: blur(3px); }
.fs-input input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 13px; font-family: var(--body); }
.fs-input input::placeholder { color: #8a8298; }
.fs-input .send { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(180deg, #ffd27a, var(--amber)); color: #2a1500; font-size: 15px; }
.fs-top { position: absolute; top: 14px; left: 16px; z-index: 30; display: flex; align-items: center; gap: 8px;
  background: rgba(8,6,16,.4); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 4px 12px 4px 4px;
  opacity: 0.7; }
.fs-top .av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--ember), var(--amber));
  display: flex; align-items: center; justify-content: center; font-size: 13px; }
.fs-top .nm { font-size: 11px; color: #fff; }
.fs-top .watch { font-size: 10px; color: var(--amber); }

/* rotate hint */
.rotate-hint { position: absolute; inset: 0; z-index: 60; background: rgba(5,4,9,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: #cfc8e0; font-size: 13px; animation: cmtRise .3s; }
.rotate-hint .ic { font-size: 44px; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 0%,100% { transform: rotate(0); } 50% { transform: rotate(90deg); } }

/* ============================================================
   SYNC BUBBLE — unified "creative adopted" notification
   ============================================================ */
.sync-bubble { background: rgba(8,6,16,.5); border: 1px solid rgba(255,207,63,.14);
  border-radius: 12px; padding: 8px 11px; max-width: 94%; backdrop-filter: blur(2px);
  animation: cmtRise .4s ease-out; font-size: 12px; line-height: 1.5; }
.sync-bubble .sb-spark { color: var(--gold); }
.sync-bubble .sb-user { color: var(--gold); font-weight: 700; }
.sync-bubble .sb-verb { color: var(--txt-dim); }
.sync-bubble .sb-type { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; padding: 1px 7px;
  border-radius: 999px; margin: 0 4px; vertical-align: middle; }
.sync-bubble .sb-type.event { background: rgba(53,224,208,.16); color: var(--cyan); border: 1px solid var(--cyan); }
.sync-bubble .sb-type.character { background: rgba(255,77,141,.16); color: var(--magenta); border: 1px solid var(--magenta); }
.sync-bubble .sb-type.item { background: rgba(255,168,61,.16); color: var(--orange); border: 1px solid var(--orange); }
.sync-bubble .sb-type.location { background: rgba(139,92,246,.16); color: var(--purple); border: 1px solid var(--purple); }
.sync-bubble .sb-name { color: #fff; font-weight: 600; }

/* fullscreen hint — centered below game feed */
.fs-hint { flex: 0 0 auto; align-self: center; margin: 10px 0 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--amber); background: rgba(255,177,61,.1); border: 1px solid rgba(255,177,61,.3);
  border-radius: 999px; padding: 5px 15px; backdrop-filter: blur(2px); animation: hintPulse 2s ease-in-out infinite;
  z-index: 20; cursor: pointer; font-family: var(--body); position: relative; }
@keyframes hintPulse { 50% { background: rgba(255,177,61,.2); border-color: rgba(255,177,61,.55); } }
.fs-hint:active { transform: scale(.95); }

/* tap-to-fade page transition */
.pg { animation: pgIn .35s ease-out; }
@keyframes pgIn { from { opacity: 0; } }
