:root {
  --bg0:#0E0E12;
  --bg1:#13131A;
  --fg:#E6EDF3;
  --muted:#9aa3ad;
  --glass:rgba(255,255,255,0.14); /* единая подложка стекла */
  --glass-border:rgba(255,255,255,0.22);
  /* Логотипные акценты */
  --accent-orange:#FF8A3D;
  --accent-pink:#FF5EA8;
  /* Liquid Glass цвета (огненный перелив) */
  --lava-a:#FF8A3D;
  --lava-b:#FF5EA8;
  --lava-c:#FF8A3D;
}
* { box-sizing: border-box; }
body {
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--fg);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  position: relative;
}
#app::before, body::before {
  content: "";
  position: fixed;
  inset: -20% -10% -10% -10%;
  z-index: -1;
  background:
    radial-gradient(50% 100% at 0% 60%, var(--lava-a), transparent 60%),
    radial-gradient(60% 120% at 70% 40%, var(--lava-b), transparent 60%),
    radial-gradient(50% 100% at 100% 60%, var(--lava-c), transparent 60%);
  background-size: 200% 200%;
  filter: blur(24px);
  opacity: .16;
  animation: lavaMove 12s ease-in-out infinite alternate;
  pointer-events: none;
}
#app { max-width: 820px; margin: 0 auto; padding: 20px 20px 120px; }
header { display:flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
h1 { font-size: 22px; margin:0; letter-spacing: .2px; }
.muted { color: var(--muted); font-size: 12px; }
.view[hidden] { display: none !important; }
.setting { justify-content: space-between; }
.top-logo { display:flex; justify-content:center; align-items:center; padding-top: 6px; padding-bottom: 10px; }
#brand-logo { width:72px; height:72px; display:block; }
.heart { position:absolute; width:10px; height:10px; transform: rotate(45deg); opacity:0; }
.heart::before, .heart::after { content:""; position:absolute; width:10px; height:10px; background:currentColor; border-radius:50%; }
.heart::before { left:-5px; }
.heart::after { top:-5px; }
@keyframes heartRise { 0%{ transform: translateY(0) scale(0.8) rotate(45deg); opacity:0; } 20%{ opacity:0.9; } 100%{ transform: translateY(-60px) scale(1.1) rotate(45deg); opacity:0; } }
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 16px;
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 28px rgba(0,0,0,0.28);
}
.card.two-col { grid-template-columns: 1fr 1fr; }
.keys-card {
  grid-template-columns: 1fr;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}
.label { color: var(--muted); font-size: 12px; }
.value { font-size: 18px; font-weight: 650; }
.row { grid-column: 1 / -1; display:flex; gap: 10px; align-items: center; }
select, button { color: var(--fg); font-size: 15px; }
select {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 12px 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
button { background: transparent; border: none; }

button.secondary {
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed rgba(255,255,255,0.24);
  box-shadow: none;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(820px - 32px);
  bottom: calc(18px + env(safe-area-inset-bottom));
  height: 76px;
  border-radius: 30px;
  background: rgba(255,255,255,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 10px 28px rgba(0,0,0,0.28);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 10px 12px;
  overflow: hidden;
  z-index: 100;
}
.bottom-nav .lava {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: radial-gradient(60% 120% at 0% 50%, var(--lava-a), transparent 60%),
              radial-gradient(80% 140% at 60% 40%, var(--lava-b), transparent 60%),
              radial-gradient(60% 120% at 100% 50%, var(--lava-c), transparent 60%);
  background-size: 200% 200%;
  filter: blur(22px);
  opacity: 0.4;
  animation: lavaMove 11s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes lavaMove { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.nav-item {
  position: relative;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: 0;
  cursor: pointer;
  min-width: 44px; min-height: 44px;
  transition: transform .24s ease, color .24s ease, filter .24s ease, box-shadow .24s ease;
}
.nav-item:active { transform: scale(0.94); }
.nav-item .pill {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 8px 20px rgba(0,0,0,0.25);
  transition: box-shadow .24s ease, background .24s ease, filter .24s ease;
}
.nav-item.active { color: #fff; }
.nav-item.active .pill {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  box-shadow: 0 0 16px rgba(255,94,168,0.35);
}
.nav-item .label { font-size: 12px; line-height: 1; }

/* Skeletons */
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,0.08); border-radius: 8px; }
.skeleton::after { content:""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent); transform: translateX(-100%); animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { to { transform: translateX(100%); } }

.hidden { display: none !important; }

/* CTA buttons — стеклянные с лавовым эффектом */
.cta, .btn-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 22px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.14);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .24s ease, filter .24s ease;
}
.cta::before, .btn-link::before {
  content: "";
  position: absolute; inset: -20%; border-radius: 16px;
  background: radial-gradient(70% 120% at 0% 50%, var(--accent-pink), transparent 60%),
              radial-gradient(80% 140% at 100% 50%, var(--accent-orange), transparent 60%);
  background-size: 200% 200%;
  opacity: .35;
  animation: lavaMoveBtn 9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes lavaMoveBtn { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.cta:active, .btn-link:active { transform: scale(0.96); box-shadow: 0 0 20px rgba(255,94,168,0.5); }
.cta.large { padding: 14px 20px; font-size: 16px; }

/* Tutorial card specifics */
.tutorial-card { position: relative; overflow: hidden; }
.tutorial-title { margin: 0 0 10px; font-size: 18px; }
.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 12px; }
.btn-link { display: inline-flex; }

/* Events (Tap) — fullscreen, no glass under image */
.tap-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 10px 0 14px;
  min-height: calc(100dvh - 160px); /* header+nav */
  background: transparent;
  border: 0;
}
.tap-hud { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display:flex; gap: 14px; align-items: baseline; }
#tap-overlay { position:absolute; inset:0; pointer-events:none; }

/* Tap target visual and animation */
#tap-target { transition: transform .2s ease, box-shadow .24s ease; box-shadow: 0 12px 28px rgba(0,0,0,0.28); }
#tap-target.pop { animation: tapPop 180ms ease-out; }
@keyframes tapPop { 0%{ transform: scale(0.94) } 60%{ transform: scale(1.06) } 100%{ transform: scale(1.0) } }

/* Ripple rings on tap */
.tap-ring { position:absolute; left:50%; top:50%; width:34px; height:34px; border-radius:50%; border:2px solid rgba(255,255,255,0.7); transform: translate(-50%,-50%) scale(0.8); opacity:.85; animation: tapRing 650ms ease-out forwards; }
@keyframes tapRing { to { transform: translate(-50%,-50%) scale(3.2); opacity:0; } }

/* Keys list */
.keys-list { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.key-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 12px 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.28);
  overflow: hidden;
  transform-origin: center;
  will-change: transform;
}
.key-left { display:flex; flex-direction: column; gap: 6px; min-width: 0; }
.key-title { font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-sub { color: rgba(255,255,255,0.65); font-size: 12px; }
.btn-copy {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 8px 20px rgba(0,0,0,0.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-copy:active { transform: scale(0.96); box-shadow: 0 0 16px rgba(255,94,168,0.35); }

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  *.lava, .bottom-nav .lava, .cta::before, .btn-link::before { animation: none !important; }
  * { transition: none !important; }
}

/* Progress bars */
.progress { position: relative; width: 100%; height: 10px; background: rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.18); }
.progress > span { display:block; height:100%; background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink)); box-shadow: 0 4px 12px rgba(255,94,168,0.25) inset; transition: width .3s ease; }

/* Layering helpers */
.z-bg { z-index: 0; }
.z-content { z-index: 1; }
.z-toast { z-index: 10; }
.z-nav { z-index: 100; }

/* Accessibility: ensure focus styles */
.nav-item:focus-visible, .btn-copy:focus-visible { outline: 2px solid rgba(255,255,255,0.6); outline-offset: 2px; border-radius: 16px; }

/* Home grid — единые стеклянные карточки */
.grid-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 680px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
}
.gcard {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 14px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 28px rgba(0,0,0,0.28);
  transition: box-shadow .24s ease, transform .18s ease;
}
.gcard:hover { box-shadow: 0 14px 32px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.1); }
.gcard .label { font-size: 12px; color: var(--muted); }
.gcard .value { font-size: 18px; font-weight: 650; margin-top: 6px; }

.btn-wide { width: 100%; }
#tap-overlay .tap-float{ position:absolute; left:50%; transform: translateX(-50%); color:#fff; font-weight:800; text-shadow:0 2px 8px rgba(0,0,0,0.5); opacity:0; animation: tf 700ms ease-out forwards; }
@keyframes tf { 0%{ transform:translate(-50%,0) scale(0.92); opacity:.0 } 10%{ opacity:1 } 100%{ transform:translate(-50%,-42px) scale(1.06); opacity:0 } }
