/* ─── SCREEN CONTENT STYLES ─── */

/* Screen entrance animation */
@keyframes screenFadeIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Sections */
.section {
  margin-top: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-pad);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.section-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: 12px;
  padding: 0 var(--page-pad);
}

/* Search bar */
.search-bar {
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  margin: 0 var(--page-pad) 12px;
  gap: 10px;
}

.search-bar input {
  flex: 1;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

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

.search-icon {
  color: var(--muted);
  font-size: 16px;
}

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 var(--page-pad);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-chip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
}

.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-chip.active-violet {
  background: var(--accent2);
  color: white;
  border-color: var(--accent2);
}

/* Home screen */
.home-screen {
  animation: screenFadeIn 300ms ease;
  padding-bottom: 20px;
}

/* Browse screen */
.browse-screen {
  animation: screenFadeIn 300ms ease;
  padding-top: 12px;
  padding-bottom: 20px;
}

/* Profile screen */
.profile-screen {
  animation: screenFadeIn 300ms ease;
  padding: 24px var(--page-pad) 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  margin-bottom: 12px;
}

.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 28px;
  margin-bottom: 12px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.profile-email {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin: 16px 0;
}

.stat-card {
  height: 44px;
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.stat-label {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
}

.profile-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.profile-settings {
  width: 100%;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.setting-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.setting-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 200ms;
}

.setting-toggle.on {
  background: var(--accent);
  border-color: var(--accent);
}

.setting-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 200ms;
}

.setting-toggle.on::after {
  transform: translateX(20px);
}

.logout-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  background: transparent;
}

/* Worlds screen */
.worlds-screen {
  animation: screenFadeIn 300ms ease;
  padding: 12px 0 20px;
}

.worlds-list {
  padding: 0 var(--page-pad);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.world-card {
  display: flex;
  height: 100px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.world-card-thumb {
  width: 80px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
}

.world-card-content {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.world-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-card-meta {
  font-size: 10px;
  font-weight: 300;
  color: var(--muted);
}

.world-card-actions {
  display: flex;
  gap: 8px;
}

.world-action-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.world-action-btn.primary {
  background: var(--accent);
  color: white;
}

.world-action-btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Auth gate */
.auth-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  padding: 0 var(--page-pad);
  text-align: center;
}

.auth-gate-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 16px;
}

.auth-gate-btn {
  height: 48px;
  padding: 0 32px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 500;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px var(--page-pad);
  text-align: center;
}

.empty-state-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 16px;
}

.empty-state-btn {
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 500;
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px var(--page-pad);
  text-align: center;
}

.error-state-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--red);
  margin-bottom: 16px;
}

.retry-btn {
  height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
}

/* Load more */
.load-more-btn {
  display: block;
  width: calc(100% - var(--page-pad) * 2);
  margin: 16px auto;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
