/* Page-specific layout rules. Shared components live in components.css. */

/* --- Main menu (index) --- */
.profile-strip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.profile-strip__info {
  flex: 1;
  min-width: 0;
}
.profile-strip__name {
  font-weight: 800;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-strip__level {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.profile-strip__pills {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  min-height: 108px;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out-soft);
}
.menu-card:active {
  transform: scale(0.96);
}
.menu-card--primary {
  grid-column: span 2;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-500) 30%, var(--bg-card)), var(--bg-card));
  border-color: color-mix(in srgb, var(--accent-500) 40%, transparent);
}
.menu-card__icon {
  font-size: 26px;
}
.menu-card__title {
  font-weight: 800;
  font-size: 14.5px;
}
.menu-card__sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.menu-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--danger-500);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

/* --- Profile page --- */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.profile-hero__avatar-wrap {
  position: relative;
}
.profile-hero__avatar {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 3px solid color-mix(in srgb, var(--accent-500) 60%, transparent);
  background: var(--bg-elevated);
}
.profile-hero__level-chip {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #201400;
  font-weight: 800;
  font-size: 12px;
  border: 2px solid var(--bg-app);
}
.profile-hero__name {
  font-size: 19px;
  font-weight: 800;
}
.profile-hero__handle {
  font-size: 13px;
  color: var(--text-secondary);
}
.profile-hero__xp {
  width: 100%;
  max-width: 280px;
}
.profile-hero__xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.gear-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.gear-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  /* Without this, a grid item's default min-width (auto) is the intrinsic
     width of its nowrap label — ellipsis truncation never kicks in and the
     4-column grid overflows the screen, forcing horizontal scroll. */
  min-width: 0;
}
.gear-slot__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.gear-slot__icon img { width: 100%; height: 100%; object-fit: contain; }
.gear-slot__label {
  font-size: 10px;
  text-align: center;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* --- Fishing page --- */
.fishing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.location-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
}
.location-pill img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.fishing-stage {
  position: relative;
}
.fishing-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* --- Shop page --- */
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.catalog-card {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}
.catalog-card__thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.catalog-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.catalog-card__body { flex: 1; min-width: 0; }
.catalog-card__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.catalog-card__stats {
  display: flex;
  gap: var(--space-3);
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.catalog-card__action {
  flex-shrink: 0;
}
.catalog-card.is-locked {
  opacity: 0.55;
}

/* --- Collection page --- */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.dex-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  text-align: center;
  min-width: 0;
}
.dex-tile__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.dex-tile.is-uncaught .dex-tile__img {
  filter: brightness(0) opacity(0.4);
}
.dex-tile__name {
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.dex-tile__count {
  font-size: 10px;
  color: var(--text-secondary);
}

/* --- Locations page --- */
.location-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 120px;
  display: flex;
  align-items: flex-end;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
}
.location-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(2,8,16,0.85));
}
.location-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}
.location-card__name {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
.location-card__meta {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}
.location-card.is-locked::after {
  content: "🔒";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(2,8,16,0.55);
  z-index: 2;
}
.location-card.is-current {
  outline: 2px solid var(--accent-400);
  outline-offset: -2px;
}

/* --- Achievements / quests --- */
.quest-card, .achievement-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}
.quest-card__icon, .achievement-card__icon {
  font-size: 26px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.quest-card__body, .achievement-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quest-card__title, .achievement-card__title {
  font-weight: 700;
  font-size: 14px;
}
.quest-card__desc, .achievement-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
}
.achievement-card.is-unlocked {
  border-color: color-mix(in srgb, var(--gold-500) 40%, transparent);
}

/* --- Leaderboard --- */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}
.leaderboard-row.is-me {
  background: color-mix(in srgb, var(--accent-500) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-500) 40%, transparent);
}
.leaderboard-row__rank {
  width: 28px;
  text-align: center;
  font-weight: 800;
  color: var(--text-secondary);
}
.leaderboard-row__rank--top1 { color: var(--gold-400); }
.leaderboard-row__rank--top2 { color: #d5dee8; }
.leaderboard-row__rank--top3 { color: #e3a06a; }
.leaderboard-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-row__score {
  font-weight: 800;
  color: var(--accent-400);
}

/* --- Daily reward --- */
.daily-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
.daily-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
}
.daily-day.is-claimed {
  border-color: color-mix(in srgb, var(--success-500) 45%, transparent);
  opacity: 0.7;
}
.daily-day.is-next {
  border-color: color-mix(in srgb, var(--gold-500) 55%, transparent);
  box-shadow: var(--shadow-glow-gold);
}

/* --- Settings --- */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.settings-row:last-child { border-bottom: none; }

.switch {
  width: 46px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease-out-soft);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.switch.is-on {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-600));
  border-color: transparent;
}
.switch.is-on .switch__knob {
  transform: translateX(20px);
}
