:root {
  --lime: #a6e22e;
  --lime-2: #6fbf1f;
  --lime-dark: #3f7a12;
  --text: #f2f5f2;
  --text-dim: #9aa4ac;
  --surface: rgba(255,255,255,0.06);
  --surface-2: rgba(255,255,255,0.1);
  --border: rgba(255,255,255,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Global safety net: never let a component's own `display` rule fight the
   hidden attribute — this is the single source of truth for show/hide. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: #05070a;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input { font-family: inherit; }

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px 500px at 20% 0%, rgba(166,226,46,0.14), transparent 60%),
    radial-gradient(600px 500px at 90% 100%, rgba(111,191,31,0.12), transparent 60%),
    #05070a;
}

.stage {
  height: 100dvh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  perspective: 1600px;
}

/* ===== Phone shell ===== */
.phone {
  position: relative;
  width: min(390px, 92vw);
  height: min(844px, 92dvh);
  background: #000;
  border-radius: 56px;
  border: 3px solid #1e2129;
  box-shadow:
    0 0 0 9px #060708,
    0 0 0 11px #2a2e35,
    0 40px 80px -20px rgba(0,0,0,0.85),
    0 0 70px rgba(166,226,46,0.12);
  padding: 12px;
}

.dynamic-island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 30px;
  background: #000;
  border-radius: 20px;
  z-index: 60;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  cursor: pointer;
  backface-visibility: hidden;
}

.phone {
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(.2,.9,.25,1);
  will-change: transform;
}
.phone.dragging { transition: none; }

/* Invisible grab zones along the phone's physical edges — press and drag
   the side of the device itself, like actually picking up a phone. No
   button, just the bezel; a faint glow shows where to grab on hover. */
.phone-edge {
  position: absolute;
  top: 6%;
  bottom: 6%;
  width: 26px;
  cursor: grab;
  touch-action: none;
  z-index: 300;
  border-radius: 30px;
  background: linear-gradient(180deg, transparent, rgba(166,226,46,0.08), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.phone-edge-left { left: -13px; }
.phone-edge-right { right: -13px; }
.phone-edge:hover,
.phone-edge.grabbing { opacity: 1; }
.phone-edge.grabbing { cursor: grabbing; }

.rotate-hint {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 10px;
  flex-shrink: 0;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(166,226,46,0.16), transparent 60%),
    linear-gradient(180deg, #0c1f0a 0%, #060a06 55%, #04140a 100%);
  backface-visibility: hidden;
}

/* ===== Phone back (revealed by flipping the device over) ===== */
.phone-back {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border-radius: 42px;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  overflow: hidden;
  background:
    linear-gradient(200deg, rgba(255,255,255,0.22), rgba(255,255,255,0) 32%),
    linear-gradient(165deg, #a3e858 0%, #6fbf1f 45%, #2c630c 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.25);
}
.phone-back::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 27%;
  height: 1px;
  background: rgba(0,0,0,0.22);
}

.cam-bump {
  position: absolute;
  top: 42px;
  left: 26px;
  width: 118px;
  height: 118px;
  border-radius: 30px;
  background: linear-gradient(155deg, rgba(0,0,0,0.4), rgba(0,0,0,0.18));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 8px 16px rgba(0,0,0,0.35);
}
.lens {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #4a4a4a, #0a0a0a 72%);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.3), inset 0 0 8px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lens-glass {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(140,195,255,0.6), rgba(10,10,15,0.92) 70%);
}
.lens-1 { top: 12px; left: 12px; }
.lens-2 { top: 12px; right: 12px; }
.lens-3 { bottom: 12px; left: 12px; }
.flash-dot {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d6, #d9c98a);
}
.lidar-dot {
  position: absolute;
  bottom: 16px;
  right: 40px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #111;
  box-shadow: inset 0 0 4px rgba(255,255,255,0.18);
}

.back-branding {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.back-logo {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}
.back-wordmark {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(10,25,6,0.85);
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.back-model {
  position: absolute;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(10,25,6,0.6);
}

/* ===== Screens ===== */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 10px;
}

.app-screen {
  background: linear-gradient(180deg, #0a140a 0%, #050805 100%);
  color: var(--text);
  animation: slideIn 0.32s cubic-bezier(.2,.9,.25,1);
}

/* Light mode re-themes app content (Settings, Wallet, Chain, chats, etc.)
   Home/lock stay on their dark wallpaper look, same as a phone's lock
   screen background not following the system light/dark switch. */
.light-mode .app-screen {
  --text: #16240d;
  --text-dim: #5a655e;
  --surface: rgba(10,30,10,0.05);
  --surface-2: rgba(10,30,10,0.09);
  --border: rgba(10,30,10,0.14);
  --lime: #4f8a12;
  background: linear-gradient(180deg, #f5f9f0 0%, #e7f0de 100%);
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  padding-top: 6px;
  flex-shrink: 0;
}
.status-icons { display: flex; gap: 5px; font-size: 0.72rem; }
.status-icons.airplane { filter: grayscale(1) opacity(0.5); }

/* ===== Lock screen ===== */
.lock-screen {
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.lock-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10vh;
}
.lock-time { font-size: 4.2rem; font-weight: 700; letter-spacing: -0.03em; }
.lock-date { font-size: 0.95rem; color: var(--text-dim); margin-top: 4px; text-transform: capitalize; }

.lock-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lock-logo { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 20px rgba(166,226,46,0.5)); }
.lock-hint p { color: var(--text-dim); font-size: 0.85rem; }

.swipe-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  color: var(--text-dim);
  font-size: 0.72rem;
  animation: pulseUp 2s ease-in-out infinite;
}
.swipe-bar { width: 130px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.5); }
@keyframes pulseUp { 0%,100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(-6px); opacity: 1; } }

/* ===== Home screen ===== */
.home-screen { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.os-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px auto 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(166,226,46,0.12);
  border: 1px solid rgba(166,226,46,0.3);
  font-size: 0.68rem;
  color: var(--lime);
  flex-shrink: 0;
}
.os-badge img { width: 14px; height: 14px; object-fit: contain; }

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.widget:active { transform: scale(0.97); }
.widget-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; margin-bottom: 4px; }
.widget-name { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.eth-mark { width: 13px; height: 13px; color: #b9c3cf; flex-shrink: 0; }
.ticker-price { color: var(--lime); font-weight: 700; }
.widget-chart { width: 100%; height: 34px; margin: 4px 0; }
.widget-chart polyline { fill: none; stroke: var(--lime); stroke-width: 2; }
.widget-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.widget-change { font-size: 0.72rem; }
.widget-change.up { color: var(--lime); }
.widget-source {
  font-size: 0.66rem;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.25);
  transition: color 0.15s ease;
}
.widget-source:active { color: var(--lime); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 10px;
  margin-top: 18px;
  flex: 1;
  align-content: start;
}
.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 0.62rem;
  color: #dfe8df;
  text-decoration: none;
}
.app-icon {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 23.5%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow:
    0 3px 8px rgba(0,0,0,0.45),
    inset 0 1px 1px rgba(255,255,255,0.35),
    inset 0 -6px 10px rgba(0,0,0,0.18);
  transition: transform 0.12s ease;
  overflow: hidden;
}
.app-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0) 42%);
  pointer-events: none;
}
.app-icon .glyph {
  width: 56%;
  height: 56%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}
.app:active .app-icon, .app-icon.small:active { transform: scale(0.9); }
.app-icon.small { width: 48px; height: 48px; }

.icon-mee { background: linear-gradient(180deg, #bdea5c, #7fc22a); }
.icon-chain { background: linear-gradient(180deg, #3a4451, #1c2026); }
.icon-wallet { background: linear-gradient(180deg, #f3d968, #c9a11f); }
.icon-swap { background: linear-gradient(180deg, #63dcec, #1f95a8); }
.icon-msg { background: linear-gradient(180deg, #5cea8f, #1f9e50); }
.icon-news { background: linear-gradient(180deg, #f08f5c, #a2461f); }
.icon-cam { background: linear-gradient(180deg, #6b7580, #33383e); }
.icon-games { background: linear-gradient(180deg, #ea5cb8, #a1206f); }
.icon-settings { background: linear-gradient(180deg, #7b828d, #363a40); }
.icon-agent { background: linear-gradient(180deg, #b98cf5, #6b3fd6); }
.icon-x { background: linear-gradient(180deg, #3a3a3a, #050505); }
.icon-pons { background: #eef2ea; }
.icon-about { background: linear-gradient(180deg, #ffd76a, #d99b1f); }
.icon-phone { background: linear-gradient(180deg, #86e85c, #269e3f); }
.icon-rewards { background: linear-gradient(180deg, #ffd76a, #d99b1f); }
.app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.dock {
  margin-top: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 26px;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.home-indicator {
  width: 120px;
  height: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 999px;
  margin: 10px auto 2px;
  flex-shrink: 0;
}

/* ===== App screens ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 14px;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.back-btn {
  color: var(--lime);
  font-weight: 600;
  font-size: 0.9rem;
}

.app-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
  scrollbar-width: none;
}
.app-body::-webkit-scrollbar { display: none; }

/* Memecoin app */
.price-block { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; }
.price-symbol { color: var(--text-dim); font-size: 0.8rem; }
.price-big { font-size: 2.1rem; font-weight: 800; }
.price-change.up { color: var(--lime); font-size: 0.85rem; }
.price-change.down { color: #e2604a; font-size: 0.85rem; }

.big-chart { width: 100%; height: 110px; }
.big-chart polyline { fill: none; stroke: var(--lime); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(166,226,46,0.5)); }

.timeframes { display: flex; justify-content: space-between; gap: 6px; }
.tf {
  flex: 1;
  padding: 7px 0;
  border-radius: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface);
}
.tf.active { background: rgba(166,226,46,0.16); color: var(--lime); font-weight: 700; }

.mee-actions { display: flex; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.96); }
.btn.wide { flex: 1; }
.btn-primary { background: linear-gradient(135deg, var(--lime), var(--lime-2)); color: #06210a; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }

.stat-list { display: flex; flex-direction: column; gap: 2px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.stat-row span { color: var(--text-dim); }

/* RH Chain app */
.chain-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
}
.chain-pulse {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(166,226,46,0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(166,226,46,0.6); }
  70% { box-shadow: 0 0 0 14px rgba(166,226,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(166,226,46,0); }
}
.chain-hero h3 { margin-top: 6px; }
.chain-hero p { color: var(--text-dim); font-size: 0.82rem; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.stat-tile strong { display: block; font-size: 1.3rem; color: var(--lime); margin-bottom: 2px; }
.stat-tile span { font-size: 0.72rem; color: var(--text-dim); }

/* Wallet app */
.wallet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(166,226,46,0.16), rgba(111,191,31,0.06));
  border: 1px solid rgba(166,226,46,0.25);
  border-radius: 22px;
  padding: 26px 16px;
}
.wallet-logo { width: 36px; height: 36px; margin-bottom: 4px; }
.wallet-balance { font-size: 1.5rem; font-weight: 800; }
.wallet-usd { color: var(--text-dim); font-size: 0.8rem; }

.wallet-address {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.82rem;
  cursor: pointer;
}
.copy-hint { color: var(--text-dim); font-size: 0.7rem; }

.tx-list { display: flex; flex-direction: column; gap: 2px; }
.tx-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.tx-row span { color: var(--text-dim); }
.up { color: var(--lime); }
.down { color: #e2604a; }

/* Swap app */
.swap-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
}
.swap-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 8px; }
.swap-token { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-gray { background: #8a93a0; }
.dot-lime { background: var(--lime); }
.swap-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  outline: none;
}
.swap-divider {
  align-self: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -8px auto;
  cursor: pointer;
  color: var(--lime);
}
.swap-note { text-align: center; color: var(--text-dim); font-size: 0.72rem; }

/* Community app */
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
}
.chat-bubble strong { display: block; font-size: 0.68rem; color: var(--text-dim); margin-bottom: 3px; }
.chat-bubble.left { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.chat-bubble.right { align-self: flex-end; background: rgba(166,226,46,0.18); border: 1px solid rgba(166,226,46,0.3); }
.app-body:has(.chat-bubble) { flex-direction: column; }

.chat-input {
  margin-top: auto;
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
}
.chat-input input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  outline: none;
  font-size: 0.85rem;
}
.chat-input button {
  width: 40px;
  border-radius: 12px;
  background: var(--lime);
  color: #06210a;
  font-weight: 700;
}

/* News app */
.news-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.news-tag {
  display: inline-block;
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.news-item h4 { font-size: 0.92rem; margin-bottom: 6px; }
.news-item p { color: var(--text-dim); font-size: 0.8rem; }

/* Settings app */
.settings-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}
.settings-profile img { width: 44px; height: 44px; }
.settings-profile div { display: flex; flex-direction: column; }
.settings-profile span { color: var(--text-dim); font-size: 0.75rem; }

.settings-list { display: flex; flex-direction: column; }
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.slider::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--lime); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.version-tag { text-align: center; color: var(--text-dim); font-size: 0.7rem; margin-top: auto; }

.notepad {
  background: #fdf6d8;
  color: #3a3220;
  border-radius: 14px;
  padding: 18px 18px 22px;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive, sans-serif;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(0,0,0,0.05);
  background-image: repeating-linear-gradient(180deg, transparent, transparent 27px, rgba(0,0,0,0.06) 28px);
}
.notepad h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #6b4b12;
}
.notepad p { margin: 0 0 10px; font-size: 0.85rem; line-height: 1.5; }
.notepad ul { margin: 0 0 10px; padding-left: 20px; }
.notepad li { font-size: 0.85rem; line-height: 1.6; }
.notepad strong { color: #7a3f0a; }

.coming-soon {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.coming-soon-icon { font-size: 2.6rem; }
.coming-soon h3 { color: var(--text-dim); font-size: 1rem; font-weight: 700; }

/* ===== Phone / Calls ===== */
.contact-list { display: flex; flex-direction: column; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
}
.contact-row:active { background: var(--surface-2); }
.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}
.contact-row span { flex: 1; font-size: 0.9rem; font-weight: 600; }
.call-glyph { width: 20px; height: 20px; color: var(--lime); flex-shrink: 0; }

.call-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 60px 24px 50px;
  background: linear-gradient(180deg, #1c2b18, #05100a);
}
.call-info { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 40px; }
.call-avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
  box-shadow: 0 0 0 6px rgba(166,226,46,0.12);
  animation: callPulse 1.6s ease-in-out infinite;
}
.call-info h2 { font-size: 1.3rem; }
.call-info p { color: var(--text-dim); font-size: 0.95rem; }
.call-info p.connected { color: var(--lime); }
.call-actions { display: flex; justify-content: center; }
.call-btn.hangup {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2604a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(135deg);
  box-shadow: 0 6px 18px rgba(226,96,74,0.4);
}
.call-btn.hangup svg { width: 26px; height: 26px; }
.call-btn.hangup:active { transform: rotate(135deg) scale(0.9); }

@keyframes callPulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(166,226,46,0.12); }
  50% { box-shadow: 0 0 0 12px rgba(166,226,46,0.05); }
}

/* ===== Games hub ===== */
.game-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: left;
  transition: transform 0.12s ease, background 0.15s ease;
}
.game-card:active { transform: scale(0.97); background: var(--surface-2); }
.game-emoji {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(166,226,46,0.14);
}
.game-info { display: flex; flex-direction: column; gap: 3px; }
.game-info strong { font-size: 0.9rem; }
.game-info span { font-size: 0.72rem; color: var(--text-dim); }

/* Flappy Frog / Snake / Tetris */
.game-screen { padding: 0; }
.game-screen .app-header { padding: 12px 20px 8px; flex-shrink: 0; }
.game-live-score {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--lime);
  min-width: 30px;
  text-align: right;
}
#flappyCanvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  touch-action: none;
}

/* Snake and Tetris play edge-to-edge: the canvas fills the whole screen
   and the header/controls float on top of it instead of squeezing it. */
#snakeCanvas, #tetrisCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.game-screen[data-screen="snake"] .app-header,
.game-screen[data-screen="tetris"] .app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 12px 20px 26px;
  background: linear-gradient(180deg, rgba(4,10,4,0.85) 30%, rgba(4,10,4,0) 100%);
}

/* Snake D-pad */
.dpad {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 46px 46px 46px;
  grid-template-rows: 40px 40px;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 26px 0 16px;
  background: linear-gradient(0deg, rgba(4,10,4,0.85) 30%, rgba(4,10,4,0) 100%);
}
.dpad-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--lime);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.15s ease;
}
.dpad-btn:active { background: var(--surface-2); transform: scale(0.9); }
.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 2; }

/* Tetris controls */
.tetris-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  padding: 26px 18px 16px;
  background: linear-gradient(0deg, rgba(4,10,4,0.85) 30%, rgba(4,10,4,0) 100%);
}
.tet-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--lime);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 0;
  transition: transform 0.1s ease, background 0.15s ease;
}
.tet-btn:active { background: var(--surface-2); transform: scale(0.93); }
.tet-down { flex: 1.4; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(4,10,4,0.78);
  backdrop-filter: blur(4px);
}
.game-overlay h3 { font-size: 1.3rem; }
.game-overlay p { color: var(--text-dim); font-size: 0.82rem; line-height: 1.5; }
.game-score-badge { font-size: 1rem; font-weight: 700; color: var(--lime); }

/* Memecoin Clicker */
.clicker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex: 1;
  justify-content: center;
}
.clicker-coins { font-size: 1.6rem; font-weight: 800; }
.clicker-coins span { color: var(--lime); }
.clicker-btn {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  font-size: 4rem;
  background: radial-gradient(circle at 34% 28%, #ddfa9d, var(--lime) 55%, var(--lime-2) 100%);
  box-shadow: 0 14px 30px rgba(166,226,46,0.35), inset 0 -8px 16px rgba(0,0,0,0.22);
  transition: transform 0.08s ease;
}
.clicker-btn:active { transform: scale(0.9); }
.clicker-rate { color: var(--text-dim); font-size: 0.8rem; }
.clicker-upgrade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.clicker-upgrade strong { display: block; font-size: 0.85rem; }
.clicker-upgrade span { color: var(--text-dim); font-size: 0.72rem; }
.clicker-upgrade button {
  background: rgba(166,226,46,0.16);
  color: var(--lime);
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.76rem;
  flex-shrink: 0;
}
.clicker-upgrade button:disabled { opacity: 0.35; }

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10141b;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Control Center ===== */
.control-center {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(14,18,14,0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  border-top: none;
  padding: 14px 20px 20px;
  transform: translateY(-105%);
  transition: transform 0.32s cubic-bezier(.2,.9,.25,1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.control-center.open { transform: translateY(0); }

.cc-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.3);
  align-self: center;
  margin-bottom: 4px;
}

.cc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cc-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.62rem;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.cc-toggle:active { transform: scale(0.94); }
.cc-icon { font-size: 1.15rem; }
.cc-toggle.active {
  background: rgba(166,226,46,0.18);
  border-color: rgba(166,226,46,0.35);
  color: var(--lime);
}

.cc-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px 14px;
}
.cc-slider-icon { font-size: 0.95rem; }
.cc-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--lime);
}

.cc-shortcut {
  background: rgba(166,226,46,0.12);
  border: 1px solid rgba(166,226,46,0.28);
  color: var(--lime);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 12px;
  border-radius: 14px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; background: rgba(0,0,0,0.001); }

.flash-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash-overlay.flashing { animation: flashPulse 0.4s ease; }
@keyframes flashPulse { 0% { opacity: 0; } 30% { opacity: 0.9; } 100% { opacity: 0; } }
.flash-overlay.torch-on { opacity: 0.85; transition: opacity 0.2s ease; }

/* ===== Camera app ===== */
.camera-screen {
  padding: 0;
  background: #000;
  align-items: stretch;
  justify-content: flex-end;
}
#cameraVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
}
.camera-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0 30px;
}
.camera-fallback span { font-size: 2.4rem; }

.camera-frame-overlay {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0.9;
}
.camera-watermark { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(0,0,0,0.6)); }
.camera-watermark-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  letter-spacing: 0.03em;
}

.camera-controls {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px 20px;
}
.cam-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.1rem;
  backdrop-filter: blur(6px);
}
.shutter-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 0 2px #fff;
  transition: transform 0.1s ease;
}
.shutter-btn:active { transform: scale(0.88); }

.camera-hint {
  position: relative;
  z-index: 6;
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.66rem;
  padding-bottom: 14px;
}

/* ===== Live price flash + coin particles ===== */
.flash-up { animation: flashGreen 0.7s ease; }
.flash-down { animation: flashRed 0.7s ease; }
@keyframes flashGreen {
  0% { color: #fff; text-shadow: 0 0 14px rgba(166,226,46,0.95); transform: scale(1.04); }
  100% { color: var(--lime); text-shadow: none; transform: scale(1); }
}
@keyframes flashRed {
  0% { color: #fff; text-shadow: 0 0 14px rgba(226,96,74,0.95); transform: scale(1.04); }
  100% { color: #e2604a; text-shadow: none; transform: scale(1); }
}
.price-big, .ticker-price { display: inline-block; }

.big-chart polyline, .widget-chart polyline { transition: points 0.5s ease; }

.coin-particle {
  position: fixed;
  pointer-events: none;
  font-size: 1.15rem;
  z-index: 600;
  animation: coinPop 1s ease-out forwards;
}
@keyframes coinPop {
  0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), -80px) scale(1) rotate(200deg); opacity: 0; }
}

/* ===== Chain stats: staggered pop + block pulse ===== */
.stat-tile {
  animation: tilePop 0.42s cubic-bezier(.2,.9,.25,1) backwards;
}
.stat-tile:nth-child(1) { animation-delay: 0.02s; }
.stat-tile:nth-child(2) { animation-delay: 0.09s; }
.stat-tile:nth-child(3) { animation-delay: 0.16s; }
.stat-tile:nth-child(4) { animation-delay: 0.23s; }
@keyframes tilePop {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.block-pulse { animation: blockPulse 0.6s ease; }
@keyframes blockPulse {
  0% { text-shadow: 0 0 14px rgba(166,226,46,0.9); }
  100% { text-shadow: none; }
}
.chain-pulse { transition: transform 0.15s ease; }

/* News: staggered entrance */
.news-item { animation: newsIn 0.4s cubic-bezier(.2,.9,.25,1) backwards; }
.news-item:nth-child(1) { animation-delay: 0.02s; }
.news-item:nth-child(2) { animation-delay: 0.1s; }
.news-item:nth-child(3) { animation-delay: 0.18s; }
@keyframes newsIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Wallet copy feedback ===== */
.copy-hint.copied { color: var(--lime); font-weight: 700; animation: copyPop 0.35s ease; }
@keyframes copyPop { 0% { transform: scale(0.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.wallet-address.copied { border-color: rgba(166,226,46,0.4); background: rgba(166,226,46,0.08); }

/* ===== Swap flip ===== */
.swap-divider { transition: transform 0.4s cubic-bezier(.3,1.4,.4,1); }
.swap-divider.flipped { transform: rotate(180deg); }
.swap-box { transition: transform 0.15s ease; }
.swap-box.pop { animation: swapPop 0.32s ease; }
@keyframes swapPop { 0% { transform: scale(0.97); opacity: 0.6; } 100% { transform: scale(1); opacity: 1; } }

/* ===== Community + Agent chat ===== */
.community-body, .agent-body { gap: 14px; }
.agent-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-messages .chat-bubble { animation: bubbleIn 0.3s cubic-bezier(.2,.9,.25,1) backwards; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.typing-bubble {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: bubbleIn 0.3s cubic-bezier(.2,.9,.25,1);
}
.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.1s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Agent intro + avatar */
.agent-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 4px 10px 2px;
  flex-shrink: 0;
}
.agent-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.agent-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), #6b3fd6, var(--lime));
  animation: agentSpin 3.2s linear infinite;
  opacity: 0.9;
}
.agent-avatar-ring::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #0a140a;
}
@keyframes agentSpin { to { transform: rotate(360deg); } }
.agent-avatar-glyph {
  position: relative;
  width: 32px;
  height: 32px;
  color: var(--lime);
  z-index: 1;
  filter: drop-shadow(0 0 6px rgba(166,226,46,0.6));
}
.agent-avatar.thinking .agent-avatar-ring { animation-duration: 0.9s; }
.agent-intro strong { font-size: 1rem; }
.agent-intro span { font-size: 0.76rem; color: var(--text-dim); max-width: 260px; line-height: 1.4; }

.agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--lime);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.15s ease;
}
.chip:active { transform: scale(0.94); background: var(--surface-2); }
.agent-chips {
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
}
.agent-chips.hidden-chips { max-height: 0; opacity: 0; margin: 0; }

@media (max-width: 420px) {
  .stage { padding: 0; }
  .phone { border-radius: 0; border: none; box-shadow: none; width: 100vw; height: 100dvh; }
  .phone-screen { border-radius: 0; }
}
