:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --glass-bg: rgba(20, 20, 24, 0.34);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.96);
  --muted: rgba(255, 255, 255, 0.68);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { min-height: 100svh; overflow: hidden; background: #0d0d0f; color: var(--text); }
button { font: inherit; }

.wallpaper {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, #343943 0%, #16171a 42%, #09090a 100%);
  isolation: isolate;
}

.wallpaper-layer {
  position: absolute;
  inset: -1.5%;
  background-position: center;
  background-size: cover;
  transform: scale(1.015);
  transition: opacity 560ms cubic-bezier(.2,.7,.2,1), transform 7s ease-out;
  will-change: opacity, transform;
}
.wallpaper-layer--current { opacity: 0; }
.wallpaper-layer--next { opacity: 0; }
.wallpaper.loaded .wallpaper-layer--current { opacity: 1; transform: scale(1); }
.wallpaper-layer.visible { opacity: 1; transform: scale(1); }

.shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.22) 0%, transparent 26%, transparent 67%, rgba(0,0,0,.48) 100%),
    radial-gradient(circle at center, transparent 35%, rgba(0,0,0,.18) 100%);
  pointer-events: none;
  z-index: 2;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 12px 34px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  backdrop-filter: blur(22px) saturate(155%);
}

.topbar {
  position: absolute;
  z-index: 4;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 15px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 0 14px rgba(255,255,255,.7);
}

.icon-button {
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  color: var(--text);
  cursor: pointer;
  font-weight: 760;
  font-family: Georgia, serif;
  font-size: 17px;
  transition: transform .18s ease, background .18s ease;
}
.icon-button:hover { transform: scale(1.06); background: rgba(35,35,40,.48); }
.icon-button:active { transform: scale(.96); }

.center-status {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  transition: opacity .28s ease;
  pointer-events: none;
}
.center-status.hidden { opacity: 0; }
.center-status p { margin: 0; font-size: 14px; text-shadow: 0 2px 16px rgba(0,0,0,.5); }
.loader {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255,255,255,.22);
  border-top-color: rgba(255,255,255,.88);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.image-info {
  position: absolute;
  z-index: 5;
  top: calc(max(18px, env(safe-area-inset-top)) + 54px);
  right: max(18px, env(safe-area-inset-right));
  width: min(340px, calc(100vw - 36px));
  padding: 14px;
  border-radius: 18px;
  display: grid;
  gap: 12px;
}
.image-info[hidden] { display: none; }
.image-info > div { min-width: 0; }
.info-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .08em; }
.image-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.text-button {
  border: 0;
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(255,255,255,.11);
  color: var(--text);
  cursor: pointer;
}

.dock {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border-radius: 23px;
  max-width: calc(100vw - 24px);
}
.dock-button {
  position: relative;
  min-width: 62px;
  height: 50px;
  padding: 0 13px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .18s ease, transform .18s ease;
}
.dock-button:hover { background: rgba(255,255,255,.12); transform: translateY(-1px); }
.dock-button:active { transform: scale(.96); }
.dock-button[disabled] { opacity: .5; cursor: wait; transform: none; }
.dock-button.active { background: rgba(255,255,255,.19); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.dock-icon { font-size: 19px; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,.2)); }
.dock-icon.symbol { font-size: 24px; font-weight: 450; }
.dock-count { min-width: 12px; text-align: left; font-weight: 650; font-size: 13px; }
.dock-label { font-size: 13px; font-weight: 620; }
.dock-separator { width: 1px; height: 27px; background: rgba(255,255,255,.16); margin: 0 2px; }

.toast {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 78px);
  transform: translate(-50%, 8px);
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(16,16,19,.72);
  border: 1px solid rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: rgba(255,255,255,.92);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 620px) {
  .brand { height: 39px; border-radius: 14px; padding-inline: 13px; }
  .icon-button { width: 39px; height: 39px; }
  .dock { width: calc(100vw - 24px); justify-content: space-between; border-radius: 21px; }
  .dock-button { min-width: 0; flex: 1; padding: 0 9px; gap: 6px; }
  .dock-label { display: none; }
  .dock-button--action .dock-icon { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
