:root {
  --bg: #0a0e17;
  --panel: #131826;
  --accent: #34c759;
  --accent2: #0a84ff;
  --ink: #e8eef5;
  --muted: #7a869a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2540 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #2a1a3a 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.page { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }

/* Header */
.app-header { text-align: center; padding: 28px 0 10px; }
.header-title-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.hdr-emoji { font-size: 40px; }
.hdr-title {
  font-size: clamp(34px, 7vw, 60px); font-weight: 800; margin: 0;
  letter-spacing: -2px;
  background: linear-gradient(90deg,#34c759,#0a84ff,#bf5af2);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hdr-ver { font-size: 0.4em; vertical-align: super; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.hdr-tag { font-family: 'JetBrains Mono', monospace; color: #ffd60a; margin: 6px 0 14px; font-size: 15px; letter-spacing: 1px; text-shadow: 0 0 12px rgba(255,214,10,.4); }
.status-pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill { font-size: 11px; font-family: 'JetBrains Mono', monospace; background: var(--panel); border: 1px solid #24304a; padding: 5px 10px; border-radius: 999px; color: var(--muted); }
.pill.green { color: var(--accent); border-color: rgba(52,199,89,.4); }

.fake-banner {
  margin: 16px 0; text-align: center; font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; color: #000;
  background: repeating-linear-gradient(45deg,#ffd60a,#ffd60a 12px,#ff9f0a 12px,#ff9f0a 24px);
  padding: 8px; border-radius: 8px; animation: blinkbanner 1.4s infinite;
}
@keyframes blinkbanner { 50% { filter: brightness(1.25); } }

.main-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; margin-top: 12px; }
@media (max-width: 760px) { .main-wrap { grid-template-columns: 1fr; } .phone-col { justify-self: center; } }

/* iPhone */
.phone-col { position: sticky; top: 20px; }
.iphone {
  width: 300px; height: 600px; background: #0c0c0e;
  border-radius: 46px; padding: 12px; position: relative;
  box-shadow: 0 0 0 3px #2c2c30, 0 0 0 6px #101013, 0 30px 60px rgba(0,0,0,.6);
  margin: 0 auto;
}
.iphone.pro { box-shadow: 0 0 0 3px #d4af37, 0 0 0 6px #6b520f, 0 30px 70px rgba(212,175,55,.4); }
.notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 130px; height: 24px; background: #0c0c0e; border-radius: 0 0 16px 16px; z-index: 5; }
.screen { width: 100%; height: 100%; border-radius: 36px; overflow: hidden; position: relative; background: #000; display: flex; flex-direction: column; }
.gloss { position: absolute; inset: 12px; border-radius: 36px; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 30%); z-index: 6; }
.phone-caption { text-align: center; font-size: 11px; color: var(--muted); margin-top: 12px; font-family: 'JetBrains Mono', monospace; }

/* Status bar */
.status-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 4px; font-size: 12px; color: #fff; font-weight: 600; }
.signal { letter-spacing: -2px; font-size: 9px; }
.battery { font-size: 10px; }

/* Home screen */
.home-screen { flex: 1; padding: 8px 14px 0; display: flex; flex-direction: column; position: relative; }
.home-search { background: rgba(255,255,255,.18); backdrop-filter: blur(8px); border-radius: 12px; text-align: center; color: rgba(255,255,255,.7); font-size: 13px; padding: 7px; margin: 6px 20px 14px; }
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; align-content: start; flex: 1; }
.empty-note { grid-column: 1/-1; text-align: center; color: rgba(255,255,255,.75); font-size: 13px; margin-top: 60px; line-height: 1.7; }
.app-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: pop .4s both; }
.app-slot.golden { position: absolute; bottom: 82px; right: 16px; }
@keyframes pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.app-icon { width: 52px; height: 52px; border-radius: 14px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 6px rgba(0,0,0,.3); transition: transform .12s; }
.app-icon:active { transform: scale(.88); }
.app-emoji { font-size: 26px; }
.app-label { font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.dock { position: absolute; bottom: 14px; left: 14px; right: 14px; height: 66px; background: rgba(255,255,255,.2); backdrop-filter: blur(14px); border-radius: 26px; display: flex; align-items: center; justify-content: space-around; }
.dock-icon { font-size: 28px; }

/* Boot */
.boot-screen { flex: 1; background: #000; color: #34c759; font-family: 'JetBrains Mono', monospace; padding: 40px 18px 24px; display: flex; flex-direction: column; }
.boot-logo { font-size: 50px; text-align: center; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.boot-title { text-align: center; color: #fff; font-size: 13px; margin: 6px 0 18px; letter-spacing: 2px; }
.boot-log { flex: 1; overflow-y: auto; font-size: 10.5px; line-height: 1.6; }
.boot-line { animation: fadein .3s; }
@keyframes fadein { from { opacity: 0; } }
.boot-bar-wrap { height: 8px; background: #1a1a1a; border-radius: 4px; margin-top: 14px; overflow: hidden; }
.boot-bar { height: 100%; background: linear-gradient(90deg,#34c759,#0a84ff); transition: width .3s; }
.boot-pct { text-align: center; color: #fff; font-size: 12px; margin-top: 6px; }

/* Running */
.running-app { flex: 1; background: #f5f5f7; color: #1c1c1e; display: flex; flex-direction: column; padding: 40px 16px 60px; position: relative; overflow-y: auto; }
.run-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.run-icon { width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.run-name { font-weight: 700; font-size: 16px; }
.run-stars { color: #ff9f0a; font-size: 12px; }
.run-shot { background: #000; border-radius: 14px; aspect-ratio: 2/3; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.shot-img { width: 100%; height: 100%; object-fit: cover; }
.shot-fallback { color: #fff; font-size: 60px; text-align: center; }
.beachball { font-size: 40px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-desc { font-size: 12px; color: #48484a; line-height: 1.5; margin-bottom: 14px; font-style: italic; }
.run-actions { display: flex; flex-direction: column; gap: 8px; }
.iap-btn { background: #0a84ff; color: #fff; border: none; border-radius: 10px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }
.iap-btn.purchase { background: #34c759; }
.home-btn { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); width: 44px; height: 44px; border-radius: 50%; border: none; background: #d1d1d6; font-size: 22px; color: #48484a; cursor: pointer; }
.home-btn:active { background: #b0b0b6; }

/* Controls column */
.drop-zone { border: 2px dashed #34456a; border-radius: 16px; padding: 26px; text-align: center; transition: all .2s; background: rgba(255,255,255,.02); }
.drop-zone.over { border-color: var(--accent); background: rgba(52,199,89,.08); }
.dz-big { font-size: 18px; font-weight: 700; }
.dz-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }

.input-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.name-input { flex: 1; min-width: 160px; background: var(--panel); border: 1px solid #24304a; border-radius: 12px; padding: 12px 14px; color: var(--ink); font-family: inherit; font-size: 14px; }
.name-input:focus { outline: none; border-color: var(--accent2); }
.install-btn { background: linear-gradient(180deg,#34c759,#248a3d); color: #fff; border: none; border-radius: 12px; padding: 12px 20px; font-weight: 800; cursor: pointer; font-family: inherit; letter-spacing: .5px; box-shadow: 0 4px 12px rgba(52,199,89,.3); }
.install-btn:active { transform: translateY(1px); }
.install-btn:disabled { opacity: .5; cursor: wait; }

.preset-title { margin: 22px 0 10px; font-size: 13px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.preset-btn { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid #24304a; border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); font-family: inherit; text-align: left; transition: all .15s; }
.preset-btn:hover { border-color: var(--accent2); transform: translateY(-2px); }
.preset-ico { font-size: 22px; }
.preset-name { font-size: 12px; font-weight: 600; }

.stats-box { margin-top: 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace; background: var(--panel); border: 1px solid #24304a; border-radius: 12px; padding: 12px 14px; }
.wipe-btn { margin-left: auto; background: transparent; border: 1px solid #ff453a; color: #ff453a; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-family: inherit; font-size: 11px; }
.wipe-btn:hover { background: rgba(255,69,58,.1); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; animation: fadein .2s; }
.modal { background: #f2f2f7; color: #1c1c1e; border-radius: 18px; width: 280px; text-align: center; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: pop .25s; }
.modal-code { font-weight: 800; font-size: 17px; padding: 20px 16px 4px; }
.modal-msg { font-size: 13px; padding: 0 18px 18px; color: #48484a; line-height: 1.5; }
.modal-btns { display: flex; border-top: 1px solid #d1d1d6; }
.modal-btn { flex: 1; background: transparent; border: none; padding: 13px; font-size: 15px; color: #0a84ff; cursor: pointer; font-family: inherit; }
.modal-btn.primary { font-weight: 700; border-right: 1px solid #d1d1d6; }
.modal-btn:active { background: rgba(0,0,0,.05); }

/* Footer */
.app-footer { text-align: center; margin-top: 44px; padding-top: 20px; border-top: 1px solid #1c2438; font-size: 11px; color: var(--muted); line-height: 1.6; }
.remix-link { color: var(--accent2); text-decoration: none; font-family: 'JetBrains Mono', monospace; }
.remix-link:hover { text-decoration: underline; }