/* ═══════════════════════════════════════
   PORTFOLIO OS — style.css
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --phone-w: 375px; --phone-h: 780px; --screen-r: 44px;
  --accent: #00d2ff; --accent2: #a78bfa;
  --text: #ffffff; --muted: rgba(255,255,255,0.5);
  --glass: rgba(255,255,255,0.07); --gb: rgba(255,255,255,0.1);
  --card: rgba(255,255,255,0.06);
}
html, body { width:100%; height:100%; font-family:'Space Grotesk',system-ui,sans-serif; background:#060610; color:var(--text); overflow:hidden; user-select:none; }

/* ── SCENE ── */
.scene { width:100vw; height:100vh; display:flex; align-items:center; justify-content:center; background: radial-gradient(ellipse at 15% 50%,#1a053388,transparent 55%), radial-gradient(ellipse at 85% 20%,#001f3f88,transparent 55%), radial-gradient(ellipse at 50% 85%,#0d1b0f88,transparent 55%), #060610; }

/* ── PHONE ── */
.phone { position:relative; width:var(--phone-w); height:var(--phone-h); background:linear-gradient(160deg,#252530 0%,#111118 50%,#1e1e28 100%); border-radius:52px; box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 0 2px #060610, 0 0 0 4px rgba(255,255,255,0.04), 0 40px 100px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.08); animation:floatPhone 7s ease-in-out infinite; }
@keyframes floatPhone { 0%,100%{transform:translateY(0) rotate(-0.5deg)} 50%{transform:translateY(-14px) rotate(0.5deg)} }
.side-btn { position:absolute; background:linear-gradient(to right,#1a1a24,#252530); border-radius:3px; }
.btn-power  { right:-3px; top:160px; width:3px; height:70px; }
.btn-vol-up { left:-3px;  top:130px; width:3px; height:45px; }
.btn-vol-dn { left:-3px;  top:185px; width:3px; height:45px; }

/* ── SCREEN ── */
.screen { position:absolute; inset:10px; border-radius:var(--screen-r); overflow:hidden; background:#000; }
.wallpaper-canvas { position:absolute; inset:0; width:100%; height:100%; z-index:0; }

/* ── DYNAMIC ISLAND ── */
.dynamic-island { position:absolute; top:12px; left:50%; transform:translateX(-50%); width:120px; height:34px; background:#000; border-radius:20px; z-index:100; display:flex; align-items:center; justify-content:center; }
.dynamic-island.notify { animation:diNotify 1.6s cubic-bezier(0.34,1.4,0.64,1) forwards; }
@keyframes diNotify { 0%{width:120px;height:34px;border-radius:20px} 30%{width:220px;height:52px;border-radius:28px} 70%{width:220px;height:52px;border-radius:28px} 100%{width:120px;height:34px;border-radius:20px} }
.di-camera { width:10px; height:10px; background:#1a1a1a; border-radius:50%; box-shadow:inset 0 0 3px rgba(100,200,255,0.2); }

/* ── STATUS BAR ── */
.status-bar { position:absolute; top:0; left:0; right:0; height:50px; display:flex; align-items:flex-end; justify-content:space-between; padding:0 28px 8px; z-index:50; }
.sb-time { font-family:'Space Mono',monospace; font-size:15px; font-weight:700; }
.sb-right { display:flex; gap:7px; font-size:13px; align-items:center; }

/* ── LOCK SCREEN ── */
.lock-info { position:absolute; inset:0; z-index:80; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; cursor:pointer; transition:opacity .5s,transform .5s; }
.lock-info.unlocked { opacity:0; transform:translateY(-40px); pointer-events:none; }
.lock-day  { font-size:16px; color:var(--muted); letter-spacing:3px; text-transform:uppercase; }
.lock-time { font-family:'Space Mono',monospace; font-size:72px; font-weight:700; line-height:1; margin:4px 0; }
.lock-hint { font-size:13px; color:var(--muted); margin-top:14px; }
.lock-swipe-arrow { margin-top:6px; display:flex; flex-direction:column; align-items:center; color:var(--muted); animation:bounce 1.6s infinite; }
.lock-swipe-arrow i { font-size:13px; opacity:.6; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }

/* ── HOME ── */
.home { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:space-between; padding:66px 18px 18px; z-index:30; opacity:0; pointer-events:none; transition:opacity .5s,transform .4s; }
.home.visible { opacity:1; pointer-events:all; }
.home.dimmed  { opacity:.25; transform:scale(0.93); pointer-events:none; }

/* ── APP GRID ── */
.app-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px 8px; padding:8px 2px; }
.app-icon { display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; position:relative; transition:transform .15s; }
.app-icon:active { transform:scale(0.86); }
.app-icon span { font-size:10px; font-weight:500; color:#fff; text-shadow:0 1px 6px rgba(0,0,0,.7); text-align:center; }
.badge { position:absolute; top:-4px; right:-4px; width:18px; height:18px; background:#ff3b30; border-radius:50%; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid rgba(0,0,0,.5); z-index:2; }

/* ── ICON WRAPS ── */
.icon-wrap { width:60px; height:60px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-size:26px; color:#fff; position:relative; box-shadow:0 6px 20px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.2); transition:transform .2s,box-shadow .2s; }
.icon-wrap:hover { transform:scale(1.08); box-shadow:0 10px 30px rgba(0,0,0,.5); }
.icon-wrap.sm { width:52px; height:52px; font-size:22px; border-radius:14px; }

.grad-blue     { background:linear-gradient(135deg,#007AFF,#0052CC); }
.grad-green    { background:linear-gradient(135deg,#34C759,#1E8C38); }
.grad-orange   { background:linear-gradient(135deg,#FF9500,#CC7000); }
.grad-indigo   { background:linear-gradient(135deg,#5856D6,#3634A3); }
.grad-rose     { background:linear-gradient(135deg,#FF2D55,#D60033); }
.grad-cyan     { background:linear-gradient(135deg,#00D2FF,#007AFF); }
.grad-dark     { background:linear-gradient(135deg,#30303A,#1a1a24); }
.grad-linkedin { background:linear-gradient(135deg,#0077B5,#005582); }
.grad-game     { background:linear-gradient(135deg,#FF6B6B,#FF8E53,#FFC107); }
/* ── NEW ICON GRADIENTS ── */
.grad-pubdev   { background:linear-gradient(135deg,#00b4d8,#0077b6); }
.grad-medium   { background:linear-gradient(135deg,#12a085,#1a1a1a); }
.grad-personal { background:linear-gradient(135deg,#FC4A1A,#F7B733); }

/* ── DOCK ── */
.dock { display:flex; justify-content:center; margin-bottom:4px; }
.dock-pill { background:rgba(255,255,255,0.12); backdrop-filter:blur(24px) saturate(1.5); border:1px solid rgba(255,255,255,0.14); border-radius:28px; padding:13px 16px; display:flex; gap:14px; box-shadow:0 8px 32px rgba(0,0,0,.4); }
.dock-item span { display:none; }

/* ── APP SCREEN ── */
.app-screen { position:absolute; inset:0; z-index:60; background:#0d0d18; display:flex; flex-direction:column; transform:translateY(100%); transition:transform .45s cubic-bezier(0.34,1.02,0.64,1); border-radius:var(--screen-r); overflow:hidden; }
.app-screen.open { transform:translateY(0); }
.app-bar { height:54px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; background:rgba(13,13,24,0.96); backdrop-filter:blur(20px); border-bottom:1px solid var(--gb); flex-shrink:0; }
.back-btn { background:none; border:none; color:var(--accent); font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; display:flex; align-items:center; gap:4px; transition:opacity .2s; }
.back-btn:hover { opacity:.7; }
.app-bar-title { font-size:17px; font-weight:600; background:linear-gradient(90deg,var(--accent),var(--accent2)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.app-body { flex:1; overflow-y:auto; scroll-behavior:smooth; }
.app-body::-webkit-scrollbar { width:2px; }
.app-body::-webkit-scrollbar-thumb { background:var(--gb); border-radius:2px; }
.home-indicator { width:134px; height:5px; background:rgba(255,255,255,.25); border-radius:3px; margin:8px auto 10px; cursor:pointer; flex-shrink:0; }

/* ── TOAST ── */
.toast { position:fixed; top:-120px; left:50%; transform:translateX(-50%); z-index:9999; background:rgba(22,22,32,0.97); backdrop-filter:blur(24px); border:1px solid rgba(255,255,255,0.1); border-radius:22px; padding:13px 18px; min-width:300px; max-width:360px; display:flex; align-items:center; gap:13px; box-shadow:0 20px 60px rgba(0,0,0,.7); transition:top .5s cubic-bezier(0.34,1.3,0.64,1); }
.toast.show { top:20px; }
.toast-icon { width:40px; height:40px; border-radius:10px; background:linear-gradient(135deg,#FF2D55,#FF9500); display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.toast-body { flex:1; }
.toast-title { display:block; font-size:13px; font-weight:600; }
.toast-sub   { display:block; font-size:11px; color:var(--muted); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.toast-time  { font-size:11px; color:var(--muted); }

/* ════════ ABOUT ════════ */
.tpl-about { padding:0 0 30px; }
.profile-hero { background:linear-gradient(160deg,#1a1030,#0e1a2e); padding:28px 20px 22px; display:flex; flex-direction:column; align-items:center; gap:13px; text-align:center; border-bottom:1px solid var(--gb); }
.avatar-ring { width:90px; height:90px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); padding:3px; animation:spinRing 6s linear infinite; }
@keyframes spinRing { to { filter:hue-rotate(360deg); } }
.avatar { width:100%; height:100%; border-radius:50%; background:#0d0d18; display:flex; align-items:center; justify-content:center; font-family:'Space Mono',monospace; font-size:26px; font-weight:700; color:var(--accent); }
.profile-info h1 { font-size:22px; font-weight:700; }
.badge-role { display:inline-block; background:linear-gradient(135deg,#007AFF18,#a78bfa18); border:1px solid rgba(167,139,250,.3); color:var(--accent2); font-size:12px; font-weight:600; padding:4px 12px; border-radius:20px; margin:6px 0; }
.profile-sub { font-size:12px; color:var(--muted); }
.stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--gb); border-bottom:1px solid var(--gb); }
.stat-box { display:flex; flex-direction:column; align-items:center; padding:14px 4px; background:#0d0d18; gap:4px; }
.stat-val { font-family:'Space Mono',monospace; font-size:18px; font-weight:700; color:var(--accent); }
.stat-lbl { font-size:9px; color:var(--muted); text-align:center; }
.card-section { margin:14px; background:var(--card); border:1px solid var(--gb); border-radius:16px; padding:14px; }
.section-label { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:10px; display:flex; align-items:center; gap:8px; }
.section-label i { color:var(--accent); }
.bio-text { font-size:13px; line-height:1.7; color:rgba(255,255,255,.72); margin-bottom:9px; }
.bio-text:last-child { margin-bottom:0; }
.bio-text strong { color:#fff; }
.timeline { display:flex; flex-direction:column; gap:14px; }
.timeline-item { display:flex; gap:12px; }
.tl-dot { width:10px; height:10px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:4px; box-shadow:0 0 8px var(--accent); }
.tl-body { display:flex; flex-direction:column; gap:3px; }
.tl-title { font-size:14px; font-weight:600; }
.tl-sub, .tl-sub-inst { font-size:11px; color:var(--accent); }
.tl-sub-inst { color:var(--muted); }
.tl-body p { font-size:12px; color:var(--muted); line-height:1.6; }

/* ════════ PROJECTS ════════ */
.tpl-projects { padding:14px 13px 30px; }
.page-title { font-size:22px; font-weight:700; margin-bottom:14px; background:linear-gradient(90deg,#fff 60%,var(--muted)); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.projects-list { display:flex; flex-direction:column; gap:10px; }
.project-card { background:var(--card); border:1px solid var(--gb); border-radius:16px; overflow:hidden; cursor:pointer; transition:border-color .3s,background .3s; }
.project-card.open { border-color:rgba(0,210,255,.3); background:rgba(0,210,255,.04); }
.project-header { display:flex; align-items:center; gap:12px; padding:13px; }
.proj-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.proj-meta { flex:1; }
.proj-meta h3 { font-size:13px; font-weight:600; }
.proj-tag { font-size:10px; color:var(--accent); }
.proj-arrow { font-size:12px; color:var(--muted); transition:transform .3s; }
.project-card.open .proj-arrow { transform:rotate(180deg); }
.project-body { display:none; padding:0 13px 13px; border-top:1px solid var(--gb); }
.project-card.open .project-body { display:block; }
.project-body p { font-size:12px; color:var(--muted); line-height:1.6; padding-top:10px; margin-bottom:9px; }
.proj-tags { display:flex; flex-wrap:wrap; gap:6px; }
.proj-tags span { font-size:10px; padding:4px 10px; background:rgba(255,255,255,.06); border:1px solid var(--gb); border-radius:20px; color:var(--muted); }

/* ════════ SKILLS ════════ */
.tpl-skills { padding:14px 13px 30px; }
.skill-section { margin-bottom:16px; }
.skill-label { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:9px; display:flex; align-items:center; gap:7px; }
.skill-chips { display:flex; flex-wrap:wrap; gap:6px; }
.skill-chips span { font-size:11px; padding:5px 11px; background:var(--card); border:1px solid var(--gb); border-radius:20px; color:rgba(255,255,255,.7); transition:all .2s; }
.skill-chips span:hover { background:rgba(0,210,255,.1); border-color:rgba(0,210,255,.4); color:var(--accent); }
.skill-bars { margin-top:8px; }
.skill-bar-item { margin-bottom:13px; }
.sb-label { display:flex; justify-content:space-between; font-size:12px; margin-bottom:6px; color:rgba(255,255,255,.7); }
.sb-track { height:6px; background:rgba(255,255,255,.08); border-radius:3px; overflow:hidden; }
.sb-fill  { height:100%; border-radius:3px; width:0; transition:width 1.2s cubic-bezier(.4,0,.2,1); }

/* ════════ RESUME ════════ */
.tpl-resume { padding:0 0 30px; }
.resume-header { background:linear-gradient(135deg,#0f0c29,#302b63,#24243e); padding:26px 18px; display:flex; align-items:center; gap:15px; border-bottom:1px solid var(--gb); }
.res-avatar { width:60px; height:60px; border-radius:16px; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-family:'Space Mono',monospace; font-size:20px; font-weight:700; flex-shrink:0; }
.resume-header h1 { font-size:18px; font-weight:700; }
.resume-header p { font-size:12px; color:var(--accent); margin-top:3px; }
.res-section { margin:14px 14px 0; }
.res-sec-title { font-size:11px; font-weight:600; color:var(--accent); text-transform:uppercase; letter-spacing:1.5px; display:flex; align-items:center; gap:8px; margin-bottom:9px; padding-bottom:7px; border-bottom:1px solid var(--gb); }
.res-text { font-size:12px; line-height:1.7; color:rgba(255,255,255,.62); }
.res-job { margin-bottom:13px; }
.res-job-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:5px; }
.res-job-head strong { font-size:13px; }
.res-job-head span { font-size:11px; color:var(--muted); }
.res-proj-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.res-proj-item { font-size:11px; color:var(--muted); display:flex; align-items:center; gap:5px; }
.res-proj-item i { color:var(--accent); font-size:10px; }
.skill-chips.tight span { padding:4px 9px; font-size:10px; }
.dl-btn { display:flex; align-items:center; justify-content:center; gap:8px; width:calc(100% - 28px); margin:20px 14px 14px; padding:14px; border-radius:14px; background:linear-gradient(135deg,var(--accent),var(--accent2)); border:none; color:#000; font-size:14px; font-weight:700; cursor:pointer; font-family:inherit; transition:opacity .2s,transform .2s; }
.dl-btn:hover { opacity:.9; transform:scale(1.02); }

/* ════════ CONTACT ════════ */
.tpl-contact { padding:14px 13px 30px; }
.contact-sub { font-size:13px; color:var(--muted); margin-bottom:16px; line-height:1.6; }
.contact-cards { display:flex; flex-direction:column; gap:9px; margin-bottom:18px; }
.contact-chip { display:flex; align-items:center; gap:12px; background:var(--card); border:1px solid var(--gb); border-radius:14px; padding:12px 14px; text-decoration:none; color:var(--text); transition:border-color .2s,background .2s; }
.contact-chip:hover { border-color:rgba(0,210,255,.3); background:rgba(0,210,255,.04); }
.cc-icon { width:38px; height:38px; border-radius:10px; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.cc-body { flex:1; display:flex; flex-direction:column; gap:2px; }
.cc-label { font-size:10px; color:var(--muted); }
.cc-val   { font-size:12px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cc-arrow { font-size:12px; color:var(--muted); }
.compose-box { background:var(--card); border:1px solid var(--gb); border-radius:18px; overflow:hidden; }
.compose-header { display:flex; align-items:center; justify-content:space-between; padding:13px 14px; border-bottom:1px solid var(--gb); }
.compose-header-left { display:flex; align-items:center; gap:10px; }
.compose-avatar { width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-family:'Space Mono',monospace; font-size:13px; font-weight:700; color:#000; flex-shrink:0; }
.compose-to-name { font-size:13px; font-weight:600; }
.compose-to-sub  { font-size:10px; color:var(--muted); }
.compose-status  { display:flex; align-items:center; gap:5px; font-size:11px; color:#34C759; }
.compose-dot { width:7px; height:7px; border-radius:50%; background:#34C759; box-shadow:0 0 6px #34C759; animation:pulseDot 2s infinite; }
@keyframes pulseDot { 0%,100%{opacity:1} 50%{opacity:.4} }
.compose-fields { padding:10px 0; }
.compose-field-wrap { margin-bottom:2px; }
.compose-field { display:flex; align-items:center; gap:10px; padding:11px 14px; border-bottom:1px solid var(--gb); transition:background .2s; }
.compose-field:focus-within { background:rgba(0,210,255,.04); }
.compose-field.field-error { background:rgba(255,45,85,.05); }
.compose-field.field-error .cf-icon { color:#ff2d55; }
.cf-icon { font-size:13px; color:var(--muted); flex-shrink:0; width:16px; }
.compose-field input, .compose-field textarea { flex:1; background:none; border:none; outline:none; color:var(--text); font-family:inherit; font-size:13px; }
.compose-field input::placeholder, .compose-field textarea::placeholder { color:var(--muted); }
.compose-field textarea { resize:none; height:90px; }
.field-err { font-size:11px; color:#ff2d55; max-height:0; overflow:hidden; opacity:0; padding:0 16px; transition:max-height .25s ease, opacity .25s ease, padding .25s ease; display:flex; align-items:center; gap:6px; }
.field-err.show { max-height:40px; opacity:1; padding:6px 16px 4px; }
.field-err::before { content:'\f071'; font-family:'Font Awesome 6 Free'; font-weight:900; font-size:10px; flex-shrink:0; }
.compose-send-btn { display:flex; align-items:center; justify-content:center; gap:8px; width:calc(100% - 28px); margin:12px 14px; padding:14px; border-radius:14px; background:linear-gradient(135deg,#007AFF,var(--accent2)); border:none; color:#fff; font-size:14px; font-weight:600; cursor:pointer; font-family:inherit; transition:opacity .2s,transform .2s; box-shadow:0 4px 20px rgba(0,122,255,0.35); }
.compose-send-btn:hover { opacity:.9; transform:scale(1.02); }
.compose-send-btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.compose-send-btn.success { background:linear-gradient(135deg,#34C759,#1E8C38); box-shadow:0 4px 20px rgba(52,199,89,0.35); }
.compose-note { text-align:center; font-size:10px; color:var(--muted); padding:0 14px 14px; display:flex; align-items:center; justify-content:center; gap:5px; }
.compose-note i { color:var(--accent); }

/* ════════ CHAT ════════ */
.tpl-chat { display:flex; flex-direction:column; height:100%; }
.chat-header-area { display:flex; align-items:center; gap:12px; padding:13px 16px; background:rgba(13,13,24,.9); border-bottom:1px solid var(--gb); flex-shrink:0; }
.chat-avatar-wrap { position:relative; }
.chat-ai-avatar { width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-size:20px; }
.chat-status-dot { position:absolute; bottom:0; right:0; width:12px; height:12px; border-radius:50%; background:#34C759; border:2px solid #0d0d18; }
.chat-agent-name { font-size:15px; font-weight:600; }
.chat-agent-sub  { font-size:11px; color:var(--muted); }
.chat-key-btn { margin-left:auto; background:var(--card); border:1px solid var(--gb); color:var(--muted); width:34px; height:34px; border-radius:10px; cursor:pointer; font-size:13px; transition:all .2s; }
.chat-key-btn:hover { color:var(--accent); border-color:var(--accent); }
.chat-messages { flex:1; overflow-y:auto; padding:13px 12px; display:flex; flex-direction:column; gap:11px; scroll-behavior:smooth; }
.chat-messages::-webkit-scrollbar { width:2px; }
.chat-messages::-webkit-scrollbar-thumb { background:var(--gb); }
.chat-bubble { max-width:82%; display:flex; flex-direction:column; gap:4px; animation:popIn .3s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn { from{opacity:0;transform:scale(.85) translateY(8px)} to{opacity:1;transform:scale(1) translateY(0)} }
.chat-bubble.bot  { align-self:flex-start; }
.chat-bubble.user { align-self:flex-end; }
.bubble-text { padding:11px 14px; border-radius:18px; font-size:13px; line-height:1.6; }
.chat-bubble.bot  .bubble-text { background:var(--card); border:1px solid var(--gb); border-bottom-left-radius:6px; }
.chat-bubble.user .bubble-text { background:linear-gradient(135deg,#007AFF,#5856D6); border-bottom-right-radius:6px; }
.bubble-time { font-size:10px; color:var(--muted); padding:0 4px; }
.chat-bubble.user .bubble-time { text-align:right; }
.typing-dots { display:flex; gap:5px; padding:13px 16px; background:var(--card); border:1px solid var(--gb); border-radius:18px; border-bottom-left-radius:6px; }
.typing-dots span { width:7px; height:7px; border-radius:50%; background:var(--muted); animation:typingAnim 1.2s infinite; }
.typing-dots span:nth-child(2){animation-delay:.2s} .typing-dots span:nth-child(3){animation-delay:.4s}
@keyframes typingAnim { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-6px);opacity:1} }
.chat-quick-replies { display:flex; gap:6px; padding:8px 12px; overflow-x:auto; flex-shrink:0; }
.chat-quick-replies::-webkit-scrollbar { display:none; }
.chat-quick-replies button { white-space:nowrap; font-size:11px; padding:7px 13px; background:var(--card); border:1px solid var(--gb); border-radius:20px; color:rgba(255,255,255,.7); cursor:pointer; font-family:inherit; transition:all .2s; flex-shrink:0; }
.chat-quick-replies button:hover { background:rgba(0,210,255,.1); border-color:var(--accent); color:var(--accent); }
.chat-input-row { display:flex; gap:8px; padding:10px 12px; background:rgba(13,13,24,.96); border-top:1px solid var(--gb); flex-shrink:0; }
#chat-input { flex:1; background:var(--card); border:1px solid var(--gb); border-radius:24px; padding:11px 16px; color:#fff; font-family:inherit; font-size:13px; outline:none; transition:border-color .2s; }
#chat-input:focus { border-color:rgba(0,210,255,.4); }
.chat-send-btn { width:42px; height:42px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); border:none; color:#000; font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:transform .2s; }
.chat-send-btn:hover { transform:scale(1.1); }

/* ════════ REDIRECT ════════ */
.tpl-link-redirect { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; text-align:center; min-height:300px; gap:14px; }
.redirect-icon { width:80px; height:80px; border-radius:24px; display:flex; align-items:center; justify-content:center; font-size:36px; margin-bottom:6px; }
.tpl-link-redirect h2 { font-size:22px; font-weight:700; }
.tpl-link-redirect p { font-size:13px; color:var(--muted); line-height:1.6; max-width:260px; }
.ext-link-btn { display:flex; align-items:center; gap:8px; padding:13px 26px; border-radius:14px; background:var(--card); border:1px solid var(--gb); color:#fff; text-decoration:none; font-weight:600; font-size:14px; transition:all .2s; margin-top:8px; }
.ext-link-btn:hover { background:rgba(0,210,255,.1); border-color:var(--accent); color:var(--accent); }

/* ════════ GAME ════════ */
.tpl-game { width:100%; height:100%; display:flex; flex-direction:column; background:#07070f; position:relative; }
#game-container { flex:1; width:100%; overflow:hidden; position:relative; }

/* ════════ PACKAGES ════════ */
.tpl-packages { padding:14px 13px 30px; }
.pkg-page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; gap:8px; }
.pkg-verified-badge { display:flex; align-items:center; gap:5px; font-size:10px; color:#00d2ff; background:rgba(0,210,255,.1); border:1px solid rgba(0,210,255,.2); padding:4px 10px; border-radius:20px; }
.pkg-card { background:var(--card); border:1px solid var(--gb); border-radius:18px; overflow:hidden; margin-bottom:14px; }
.pkg-hero { display:flex; align-items:center; gap:14px; padding:18px 16px; }
.pkg-hero-icon { width:52px; height:52px; background:rgba(0,0,0,.25); border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:24px; color:#fff; flex-shrink:0; }
.pkg-hero-info { flex:1; }
.pkg-name { font-family:'Space Mono',monospace; font-size:15px; font-weight:700; color:#fff; margin-bottom:7px; }
.pkg-meta-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pkg-badge { font-size:10px; font-weight:700; background:rgba(0,0,0,.3); color:#fff; padding:3px 8px; border-radius:8px; font-family:'Space Mono',monospace; }
.pkg-likes { display:flex; align-items:center; gap:4px; font-size:11px; color:#ffd200; font-weight:600; }
.pkg-likes i { font-size:10px; }
.pkg-platform { font-size:10px; color:rgba(255,255,255,.55); }
.pkg-body { padding:0 16px 18px; }
.pkg-desc { font-size:13px; color:rgba(255,255,255,.7); line-height:1.6; margin:14px 0; }
.pkg-install-block { background:rgba(0,0,0,.35); border:1px solid rgba(0,210,255,.15); border-radius:12px; overflow:hidden; margin-bottom:16px; }
.pkg-install-label { font-size:10px; color:var(--accent); padding:8px 12px 4px; font-weight:600; letter-spacing:.5px; display:flex; align-items:center; gap:6px; }
.pkg-install-code { display:flex; align-items:center; justify-content:space-between; padding:8px 12px 10px; cursor:pointer; transition:background .2s; }
.pkg-install-code:hover { background:rgba(0,210,255,.06); }
.pkg-install-code.copied { background:rgba(52,199,89,.1); }
.pkg-install-code code { font-family:'Space Mono',monospace; font-size:11px; color:#a8ff78; word-break:break-all; }
.copy-hint { font-size:13px; color:var(--muted); flex-shrink:0; margin-left:8px; transition:color .2s; }
.pkg-install-code:hover .copy-hint, .pkg-install-code.copied .copy-hint { color:var(--accent); }
.pkg-section-title { font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:9px; display:flex; align-items:center; gap:7px; }
.pkg-features { list-style:none; display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.pkg-features li { font-size:12px; color:rgba(255,255,255,.65); line-height:1.5; padding-left:16px; position:relative; }
.pkg-features li::before { content:'▸'; position:absolute; left:0; color:var(--accent); font-size:10px; top:1px; }
.pkg-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; }
.pkg-tags span { font-size:10px; padding:4px 10px; background:rgba(255,255,255,.06); border:1px solid var(--gb); border-radius:20px; color:var(--muted); }
.pkg-actions { display:flex; gap:9px; }
.pkg-btn { display:flex; align-items:center; gap:6px; padding:10px 16px; border-radius:12px; font-size:12px; font-weight:600; font-family:inherit; text-decoration:none; cursor:pointer; transition:all .2s; border:none; }
.pkg-btn-primary { background:linear-gradient(135deg,#00b4d8,#0077b6); color:#fff; flex:1; justify-content:center; }
.pkg-btn-primary:hover { opacity:.85; transform:scale(1.02); }
.pkg-btn-ghost { background:var(--card); border:1px solid var(--gb); color:var(--muted); }
.pkg-btn-ghost:hover { border-color:rgba(0,210,255,.3); color:var(--accent); }
@keyframes likePop { from{transform:scale(.5);opacity:0} to{transform:scale(1);opacity:1} }

/* ════════ ARTICLES ════════ */
.tpl-articles { padding:14px 13px 30px; }
.articles-sub { font-size:13px; color:var(--muted); margin-bottom:16px; line-height:1.6; margin-top:-6px; }
.articles-list { display:flex; flex-direction:column; gap:14px; }
.article-card { display:block; text-decoration:none; color:var(--text); background:var(--card); border:1px solid var(--gb); border-radius:18px; overflow:hidden; transition:border-color .3s,transform .2s; }
.article-card:hover { border-color:rgba(0,210,255,.3); transform:translateY(-2px); }
.article-card-top { position:relative; height:90px; display:flex; align-items:center; justify-content:center; }
.article-platform-badge { position:absolute; top:10px; left:12px; display:flex; align-items:center; gap:5px; font-size:11px; font-weight:600; background:rgba(0,0,0,.4); backdrop-filter:blur(8px); padding:4px 10px; border-radius:20px; color:#fff; }
.article-icon-bg { font-size:36px; color:rgba(255,255,255,.3); }
.article-card-body { padding:14px; }
.article-title { font-size:15px; font-weight:700; line-height:1.4; margin-bottom:4px; }
.article-subtitle { font-size:12px; color:var(--accent); margin-bottom:8px; }
.article-desc { font-size:12px; color:rgba(255,255,255,.6); line-height:1.6; margin-bottom:11px; }
.article-tags { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:12px; }
.article-tags span { font-size:10px; padding:3px 9px; background:rgba(255,255,255,.06); border:1px solid var(--gb); border-radius:20px; color:var(--muted); }
.article-read-link { font-size:12px; font-weight:600; color:var(--accent); display:flex; align-items:center; gap:5px; }
.article-read-link i { font-size:10px; transition:transform .2s; }
.article-card:hover .article-read-link i { transform:translateX(3px); }

/* ════════ PERSONAL PROJECTS ════════ */
.tpl-personal { padding:14px 13px 30px; }
.pp-list { display:flex; flex-direction:column; gap:12px; }
.pp-card { background:var(--card); border:1px solid var(--gb); border-radius:18px; overflow:hidden; cursor:pointer; transition:border-color .3s,background .3s; }
.pp-card.open { border-color:rgba(0,210,255,.25); background:rgba(0,210,255,.03); }
.pp-header { display:flex; align-items:center; gap:11px; padding:14px; }
.pp-icon { width:46px; height:46px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:22px; color:#fff; flex-shrink:0; }
.pp-meta { flex:1; }
.pp-meta h3 { font-size:13px; font-weight:700; margin-bottom:3px; }
.pp-tag { font-size:10px; color:var(--accent); }
.pp-status-badge { font-size:9px; font-weight:700; padding:4px 9px; border-radius:20px; border:1px solid; white-space:nowrap; flex-shrink:0; }
.pp-body { display:none; padding:0 14px 14px; border-top:1px solid var(--gb); }
.pp-card.open .pp-body { display:block; }
.pp-desc { font-size:12px; color:rgba(255,255,255,.65); line-height:1.6; padding-top:12px; margin-bottom:10px; }
.pp-why { font-size:11px; color:rgba(255,255,255,.5); background:rgba(255,255,255,.04); border-left:2px solid var(--accent2); padding:8px 10px; border-radius:0 8px 8px 0; margin-bottom:10px; line-height:1.5; display:flex; gap:7px; align-items:flex-start; }
.pp-why i { color:var(--accent2); flex-shrink:0; margin-top:1px; }
.pp-highlights { list-style:none; display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.pp-highlights li { font-size:12px; color:rgba(255,255,255,.62); line-height:1.5; display:flex; align-items:flex-start; gap:7px; }
.pp-highlights li i { color:var(--accent); font-size:10px; margin-top:2px; flex-shrink:0; }
.pp-actions { display:flex; gap:9px; margin-top:12px; }
.pp-btn { display:flex; align-items:center; gap:7px; padding:10px 18px; border-radius:12px; font-size:12px; font-weight:600; font-family:inherit; text-decoration:none; cursor:pointer; transition:all .2s; }
.pp-btn-primary { background:linear-gradient(135deg,#34C759,#1E8C38); color:#fff; }
.pp-btn-primary:hover { opacity:.85; transform:scale(1.02); }

/* ════════ RESPONSIVE ════════ */
@media (max-width:480px) {
  :root { --phone-w:100vw; --phone-h:100dvh; --screen-r:0px; }
  html, body { overflow:hidden; height:100%; height:100dvh; }
  .scene { width:100vw; height:100dvh; align-items:flex-start; justify-content:flex-start; background:#000; padding:0; margin:0; }
  .phone { border-radius:0; animation:none; box-shadow:none; width:100vw; height:100dvh; position:fixed; top:0; left:0; inset:0; }
  .screen { border-radius:0; inset:0; }
  .app-screen { border-radius:0; }
  .side-btn { display:none; }
  .toast { top:-120px; left:12px; right:12px; transform:none; min-width:unset; max-width:unset; width:auto; }
  .toast.show { top:12px; }
}
@media (min-width:481px) and (max-width:900px) {
  :root { --phone-w:360px; --phone-h:720px; }
}
