/* Level Web App UI — extends style.css */
.app-header .nav-inner {
  gap: 1rem;
}

.nav-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  gap: 8px;
}

.nav-search input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-search input::placeholder { color: var(--muted); }
.nav-search input:focus {
  outline: none;
  border-color: rgba(60, 242, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(60, 242, 255, 0.12);
}

.nav-search button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(60, 242, 255, 0.45);
  background: rgba(60, 242, 255, 0.12);
  color: var(--cyan);
  font-weight: 800;
  cursor: pointer;
}

.nav-user {
  color: var(--cyan) !important;
  font-weight: 900;
  text-decoration: none !important;
}

.btn-sm { padding: 8px 14px; font-size: 0.82rem; border-radius: 10px; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--subtext);
}

.app-main { padding: 1.5rem 0 3rem; min-height: calc(100vh - var(--nav-h) - 120px); }

.page-head {
  margin-bottom: 1.5rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 0;
  color: var(--subtext);
}

.section-block { margin-bottom: 2.5rem; }

.section-block h2 {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 1rem;
}

/* Horizontal scroll row */
.scroll-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

/* Entity cards */
.entity-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  text-decoration: none !important;
  transition: transform 0.15s, border-color 0.15s;
}

.entity-card:hover {
  transform: translateY(-2px);
  border-color: rgba(60, 242, 255, 0.35);
}

.entity-card-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--bg-elevated);
}

.entity-card-placeholder {
  background: linear-gradient(145deg, rgba(255, 79, 216, 0.25), rgba(60, 242, 255, 0.15));
}

.entity-card-body { padding: 10px; }

.entity-card-score {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}

.score-high { color: var(--green); }
.score-mid { color: var(--cyan); }
.score-low { color: var(--pink); }

.entity-card-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entity-card-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.entity-card-compact { flex-basis: 120px; }

/* Category cards */
.categories-grid,
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.category-card {
  display: block;
  padding: 1.25rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none !important;
  transition: border-color 0.15s, transform 0.15s;
}

.category-card:hover {
  border-color: rgba(57, 255, 136, 0.4);
  transform: translateY(-2px);
}

.category-card-name {
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.category-card-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

/* Entity detail */
.entity-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.entity-hero-img {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 2/3;
  background: var(--card);
}

.entity-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-hero-placeholder {
  background: linear-gradient(160deg, rgba(255, 79, 216, 0.3), rgba(60, 242, 255, 0.2));
}

.entity-detail h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
}

.entity-subtitle {
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.entity-desc {
  color: var(--subtext);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.score-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 1.5rem;
}

.community-score .big-score {
  display: block;
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1;
}

.score-meta {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
}

.rate-panel { flex: 1; min-width: 220px; }

.rate-panel label {
  display: block;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.rate-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rate-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--green);
  height: 6px;
}

.your-score {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--green);
  min-width: 3rem;
  text-align: right;
}

.sign-in-gate {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sign-in-gate a { color: var(--cyan); font-weight: 800; }

/* Reviews */
.reviews-section h2 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 1rem;
}

.review-form {
  margin-bottom: 1.25rem;
}

.review-form textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.review-form textarea:focus {
  outline: none;
  border-color: rgba(57, 255, 136, 0.45);
}

.review-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  margin-bottom: 10px;
}

.review-author {
  font-weight: 900;
  color: var(--cyan);
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.review-text {
  margin: 0;
  color: var(--subtext);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Profile */
.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(60, 242, 255, 0.06), rgba(255, 79, 216, 0.04));
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid rgba(60, 242, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--cyan);
}

.profile-stats {
  display: flex;
  gap: 2rem;
}

.profile-stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}

.profile-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}

/* Auth */
.auth-card {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 900;
}

.auth-card label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin: 1rem 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-card input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
}

.auth-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1.25rem 0;
}

.auth-card .btn { width: 100%; margin-top: 1rem; }

/* App strip */
.app-strip {
  position: sticky;
  bottom: 0;
  z-index: 50;
  border-top: 1px solid var(--border);
  background: rgba(5, 6, 10, 0.95);
  backdrop-filter: blur(10px);
}

.app-strip-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.app-strip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
}

.app-strip-text strong { font-weight: 900; }
.app-strip-text span { color: var(--muted); }

/* Skeletons */
.skeleton {
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-card { height: 88px; }
.skeleton-poster { flex: 0 0 140px; height: 220px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-msg {
  color: var(--subtext);
  padding: 2rem 0;
  text-align: center;
}

.empty-msg.subtle { padding: 1rem 0; font-size: 0.9rem; }

/* Toast */
.level-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

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

.level-toast-success { border-color: rgba(57, 255, 136, 0.5); color: var(--green); }
.level-toast-error { border-color: rgba(255, 79, 216, 0.5); color: var(--pink); }

/* Hero mini on home */
.home-hero {
  padding: 2rem 0 1rem;
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 900;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.home-hero h1 span { color: var(--cyan); }

.home-hero p {
  color: var(--subtext);
  max-width: 520px;
  margin: 0 auto 1.25rem;
}

.home-search {
  max-width: 520px;
  margin: 0 auto;
}

/* Activity feed */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-card {
  display: block;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.15s;
}

.activity-card:hover { border-color: rgba(60, 242, 255, 0.35); }

.activity-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.activity-user {
  font-weight: 900;
  color: var(--cyan);
  font-size: 0.88rem;
  text-decoration: none !important;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.activity-body {
  display: flex;
  gap: 12px;
  align-items: center;
}

.activity-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.activity-thumb-ph {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.25), rgba(60, 242, 255, 0.15));
}

.activity-entity {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.activity-score {
  font-size: 1.1rem;
  font-weight: 900;
  margin-top: 2px;
}

.activity-review {
  margin: 0 0 8px;
  color: var(--subtext);
  font-size: 0.92rem;
  line-height: 1.5;
  font-style: italic;
}

.skeleton-activity { height: 88px; }
.skeleton-review { height: 100px; }

.section-desc-inline {
  color: var(--muted);
  font-size: 0.88rem;
  margin: -0.5rem 0 1rem;
}

.reviews-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-feed-card .review-entity-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green);
  text-decoration: none !important;
}

/* User search results */
.user-results {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 1rem;
}

.user-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none !important;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
}

.user-result-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(60, 242, 255, 0.15);
  border: 1px solid rgba(60, 242, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-weight: 900;
  font-size: 0.85rem;
}

/* Share row */
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0.75rem 0 1rem;
}

.share-label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--subtext);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none !important;
}

.share-btn:hover {
  border-color: rgba(57, 255, 136, 0.4);
  color: var(--green);
}

/* Mobile bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(5, 6, 10, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bottom-nav a.active { color: var(--green); }

body[data-page] .app-main {
  padding-bottom: 5rem;
}

body[data-page] .app-strip {
  bottom: 56px;
}

@media (max-width: 768px) {
  .bottom-nav { display: grid; }
}

@media (min-width: 769px) {
  body[data-page] .app-main { padding-bottom: 3rem; }
  body[data-page] .app-strip { bottom: 0; }
}

@media (max-width: 900px) {
  .nav-search { display: none; }
  .entity-layout { grid-template-columns: 1fr; }
  .entity-hero-img { max-width: 240px; }
}

@media (max-width: 768px) {
  .app-header .nav-links { gap: 0.75rem; }
  .profile-stats { gap: 1.25rem; }
}
