/* base.css — Threads-like dark phone UI shared by every screen. Screens add their own css files. */
:root {
  --bg: #101010; --bg2: #181818; --bg3: #232323; --line: #2c2c2c; --text: #f3f5f7; --muted: #8a8a8a;
  --flame: #ff5a1f; --flame2: #ffb020; --red: #ff3040; --blue: #0095f6; --green: #2fd27a; --pink: #ff4fa3;
  --font: "Helvetica Neue", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Hiragino Sans", Arial, sans-serif;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--font); color: var(--text); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
textarea, input { user-select: text; -webkit-user-select: text; font-family: var(--font); }
#app { position: fixed; inset: 0; background: var(--bg); overflow: hidden; }
#app.shaking { animation: shake 0.38s ease-out; }
@keyframes shake { 0%,100% { transform: none; } 15% { transform: translate(calc(var(--shake) * -1), 2px); } 30% { transform: translate(var(--shake), -2px); } 45% { transform: translate(calc(var(--shake) * -0.6), 1px); } 60% { transform: translate(calc(var(--shake) * 0.5), 0); } 80% { transform: translate(-1px, 1px); } }

/* fake phone status bar (second-hand phone: 12% battery) */
#statusbar { position: absolute; left: 0; right: 0; top: 0; height: 24px; display: flex; align-items: center; gap: 10px; padding: 0 70px 0 16px; font-size: 12px; font-weight: 700; color: #ddd; z-index: 30; pointer-events: none; }
#statusbar .sb-net { margin-left: auto; opacity: .8; }
#statusbar .sb-bat { color: #ff5b5b; }

/* HUD strip under the status bar (play screens only); right 64px stays free for the pause button */
#hud { position: absolute; left: 0; right: 0; top: 24px; height: 48px; display: flex; align-items: center; gap: 6px; padding: 0 64px 0 10px; z-index: 25; background: linear-gradient(#101010 70%, rgba(16,16,16,0)); }
#hud .hud-me { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
#hud .hud-me img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #333; border: 2px solid #444; }
#hud .hud-me div { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#hud .hud-me b { font-size: 14px; white-space: nowrap; }
#hud .hud-me small { font-size: 11px; color: var(--flame2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
#hud .hud-stat { display: flex; align-items: center; gap: 2px; background: var(--bg3); border-radius: 999px; padding: 4px 7px; font-size: 13px; white-space: nowrap; }
#hud .hud-stat i { font-style: normal; font-size: 12px; }
#hud .hud-stat b { font-size: 14px; font-variant-numeric: tabular-nums; }
#hud .hud-stat.low { background: #4a1414; color: #ffb3b3; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
img.ring0 { border-color: #555 !important; } img.ring1 { border-color: var(--flame) !important; } img.ring2 { border-color: var(--pink) !important; }
img.ring3 { border-color: var(--blue) !important; } img.ring4 { border-color: #ffd34d !important; } img.ring5 { border-color: var(--green) !important; }
img.soft { filter: saturate(1.25) brightness(1.08) contrast(.9) blur(.3px); }

#screens { position: absolute; left: 0; right: 0; top: 24px; bottom: 0; }
#screens.with-hud { top: 72px; }
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen.enter { animation: scrIn .28s cubic-bezier(.2,1.3,.4,1); }
@keyframes scrIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* shared building blocks */
.btn { appearance: none; border: 0; font: inherit; font-weight: 700; font-size: 16px; min-height: 46px; padding: 10px 18px; border-radius: 12px; cursor: pointer;
  background: var(--text); color: #000; transition: transform .1s, filter .15s, box-shadow .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.94); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid #3a3a3a; }
.btn.flame { background: linear-gradient(135deg, var(--flame2), var(--flame) 55%, var(--red)); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); box-shadow: 0 4px 18px rgba(255,90,31,.35); }
.btn.small { min-height: 44px; font-size: 14px; padding: 8px 12px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.kfocus { outline: 3px solid var(--blue) !important; outline-offset: 2px; transform: scale(1.03); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--bg3); font-size: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #333; flex: none; }
.verified::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; background: url(../assets/icon-verified.webp) center/contain no-repeat; }
.scr-pad { padding: 12px 14px 40px; }
.h1 { font-size: 22px; font-weight: 800; margin: 6px 0 10px; }
.thermo { height: 8px; border-radius: 4px; background: #2a2a2a; overflow: hidden; }
.thermo > i { display: block; height: 100%; background: linear-gradient(90deg, #3aa0ff, #ffd34d 45%, var(--flame) 75%, var(--red)); }

/* push notification banner (Vivian's coaching, voice subtitles) */
#notif { position: absolute; left: 10px; right: 64px; top: 28px; z-index: 60; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 18px;
  background: rgba(40,40,44,.94); backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.5); transform: translateY(-140%); pointer-events: none; }
#notif.in { animation: notifIn .38s cubic-bezier(.2,1.4,.4,1) forwards; }
#notif.out { animation: notifOut .3s ease-in forwards; }
@keyframes notifIn { from { transform: translateY(-140%); } to { transform: none; } }
@keyframes notifOut { from { transform: none; } to { transform: translateY(-140%); } }
#notif-cv { width: 46px; height: 46px; border-radius: 50%; flex: none; background: #333; display: none; }
#notif.vivian #notif-cv { display: block; }
#notif .notif-body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; min-width: 0; }
#notif b { font-size: 13px; color: #ffb6dc; }
#toast { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 61; background: #f3f5f7; color: #000; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; pointer-events: none; max-width: 80%; text-align: center; }
#toast.show { animation: toastIn .25s cubic-bezier(.2,1.5,.4,1); }
@keyframes toastIn { from { transform: translate(-50%, -10px) scale(.8); opacity: 0; } }

#cracks, #fxcv { position: absolute; left: 0; top: 0; pointer-events: none; }
#cracks { z-index: 40; }
#fxcv { z-index: 50; }
body[data-skin="pink"] #app { box-shadow: inset 0 0 0 4px #ff9ccc; }
body[data-skin="flagship"] #app { box-shadow: inset 0 0 0 3px #8a8f99; }
