:root {
  --text: #f5f9ff;
  --muted: rgba(245, 249, 255, 0.65);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.12);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Space Grotesque', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: #000;
  min-height: 100vh;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  padding: max(10px, env(safe-area-inset-top)) 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 6px 12px;
  flex: 1;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-row:focus-within {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--glass-strong);
}

.search-row svg {
  flex-shrink: 0;
  opacity: 0.6;
  width: 15px;
  height: 15px;
}

.search-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.search-row input::placeholder {
  color: var(--muted);
}

main {
  max-width: 520px;
  padding: 20px 18px 48px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 12px;
}

.app-tile {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
}

.app-tile {
  opacity: 0;
  animation: tile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-tile img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22%;
  display: block;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-tile:active img {
  transform: scale(0.88);
}

.app-tile span {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.empty-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 40px 0;
  grid-column: 1 / -1;
  animation: tile-in 0.3s ease forwards;
}

/* detail view */
.detail-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.28s ease;
  overflow-y: auto;
}

.detail-view.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.detail-header {
  display: flex;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 8px 8px;
}

.back-btn {
  all: unset;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.15s ease, transform 0.15s ease;
}

.back-btn:active {
  background: var(--glass);
  transform: scale(0.9);
}

.detail-body {
  max-width: 440px;
  margin: 0 auto;
  padding: 8px 24px 48px;
}

.detail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-icon {
  width: 100px;
  height: 100px;
  border-radius: 22%;
  display: block;
  flex-shrink: 0;
}

.detail-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 4px;
  line-height: 1.15;
}

.detail-tagline {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 28px;
}

.open-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: #000;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 32px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}

.open-btn:active {
  opacity: 0.8;
  transform: scale(0.95);
}

.icon-btn {
  all: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.7rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.icon-btn:active {
  opacity: 0.6;
  transform: scale(0.9);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.shot-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -24px 28px;
  padding: 0 24px;
}

.shot-scroll img {
  height: 320px;
  border-radius: 14px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shot-scroll img:active {
  transform: scale(0.96);
}

.detail-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.detail-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

#whats-new .detail-section-title {
  margin-top: 28px;
}

.changelog-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 30;
  white-space: nowrap;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

