/* Screen-specific layout. */

/* Welcome / onboarding */
.welcome {
  padding: calc(18px + var(--safe-top)) 18px calc(20px + var(--safe-bottom));
  justify-content: space-between;
  gap: 14px;
}

.welcome-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.welcome-head h1 {
  font-size: 1.6em;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.welcome-crest {
  display: block;
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 0 16px rgba(79, 227, 255, 0.45));
}

.onb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.onb-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  animation: screen-in 0.3s ease-out;
}

.onb-slide h2 {
  font-size: 1.4em;
}

.onb-slide p {
  color: var(--muted);
  max-width: 340px;
}

.onb-art {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 10px;
  justify-content: center;
}

.mini-card {
  display: block;
  width: 72px;
  height: 96px;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 6px 14px rgba(0, 10, 50, 0.4);
}

.mini-card.back {
  background-size: cover;
  background-position: center;
  padding: 0;
}

.mini-card.lift {
  transform: translateY(-6px);
}

.mini-card.glow {
  box-shadow: 0 0 0 3px var(--cyan), 0 0 18px rgba(79, 227, 255, 0.6);
}

.mini-card.shake {
  box-shadow: 0 0 0 3px var(--danger);
  animation: mismatch-shake 0.5s ease-in-out 0.4s 2;
}

.onb-stats {
  grid-template-columns: 1fr;
  gap: 10px;
}

.onb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 1.05em;
}

.onb-badge svg {
  color: var(--cyan);
}

.onb-badge.hot {
  background: linear-gradient(90deg, #ff8a3d, #ffd166);
  color: #3a1600;
  border: 0;
}

.onb-badge.hot svg {
  color: #3a1600;
}

.onb-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.2s, background 0.2s;
}

.dot.on {
  width: 24px;
  background: var(--cyan);
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Call-sign */
.callsign-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.callsign-preview strong {
  font-size: 1.3em;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--panel);
}

.avatar-option .avatar {
  width: 52px;
  height: 52px;
}

.avatar-option small {
  color: var(--muted);
  font-size: 0.78em;
}

.avatar-option.on {
  border-color: var(--cyan);
  background: var(--panel-strong);
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.name-option {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 2px solid transparent;
  font-weight: 700;
}

.name-option.on {
  border-color: var(--cyan);
  background: var(--panel-strong);
}

/* Home */
.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 8px;
}

.rival-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.rival-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.rival-text strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rival-text small {
  color: var(--muted);
  font-size: 0.8em;
}

.rival-text .progress-track {
  height: 5px;
}

.home-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-card {
  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  text-align: left;
}

.hero-art {
  display: block;
  aspect-ratio: 300 / 138;
  overflow: hidden;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 14px;
  background: linear-gradient(180deg, rgba(4, 14, 50, 0.95), rgba(2, 8, 30, 0.98));
}

.hero-info small {
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-info strong {
  font-size: 1.3em;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  font-weight: 800;
  font-size: 0.92em;
  max-width: 100%;
}

.hero-cta span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mode-grid,
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
  min-height: 118px;
  transition: transform 0.12s;
}

.mode-tile:active {
  transform: scale(0.97);
}

.mode-tile small {
  color: var(--muted);
  font-size: 0.8em;
  line-height: 1.25;
}

.mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--blue-2), var(--blue-deep));
  margin-bottom: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mode-tile.daily .mode-icon {
  background: linear-gradient(160deg, #ffb347, #ff6b3d);
}

.mode-tile.done .mode-icon {
  background: linear-gradient(160deg, #3ddc97, #0f8a5f);
}

.mode-tile.small {
  min-height: 0;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 10px;
}

.mode-tile.small .mode-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  margin: 0;
}

.mode-tile.small .mode-icon svg {
  width: 20px;
  height: 20px;
}

.mode-tile.small strong {
  flex: 1;
  min-width: 0;
}

.mode-tile.small small {
  flex-basis: 100%;
}

.mode-tile .badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Profile */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}

.level-badge {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* Campaign map */
.chapter-path {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chapter-path::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 20px;
  bottom: 20px;
  width: 3px;
  background: repeating-linear-gradient(180deg, var(--cyan) 0 8px, transparent 8px 16px);
  opacity: 0.35;
}

.chapter-node {
  position: relative;
  display: block;
  width: 88%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  text-align: left;
  background: var(--bg1);
}

.chapter-node.left {
  align-self: flex-start;
}

.chapter-node.right {
  align-self: flex-end;
}

.chapter-node.locked {
  border-color: var(--line);
}

.chapter-node.done {
  border-color: rgba(61, 220, 151, 0.6);
}

.chapter-art {
  display: block;
  aspect-ratio: 300 / 130;
  overflow: hidden;
}

.chapter-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.chapter-info small {
  color: var(--cyan);
  font-size: 0.75em;
  font-weight: 700;
}

.chapter-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85em;
  white-space: nowrap;
}

.chapter-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.chapter-done {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--good);
  color: #03301c;
}

/* Chapter detail */
.chapter-banner {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 300 / 160;
  border: 1px solid var(--line-strong);
}

.story {
  color: var(--muted);
}

.set-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.set-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.set-card .card-art {
  width: 100%;
}

.set-card small {
  font-size: 0.76em;
  color: var(--muted);
  line-height: 1.2;
}

/* Level select */
.level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}

.level-card.cleared {
  border-color: rgba(79, 227, 255, 0.45);
}

.level-card.locked {
  opacity: 0.55;
}

.level-card strong {
  font-size: 0.95em;
  line-height: 1.2;
}

.level-card small {
  color: var(--muted);
  font-size: 0.78em;
}

.level-num {
  position: absolute;
  top: 8px;
  left: 10px;
  font-weight: 900;
  color: var(--cyan);
}

.level-lock {
  color: var(--muted);
}

.perfect-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--gold);
  color: #3a2600;
}

/* Briefing */
.briefing-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.briefing-head h2 {
  font-size: 1.5em;
}

.briefing-mask .mask-preview {
  width: 140px;
  gap: 5px;
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.goal.perfect svg {
  color: var(--gold);
}

/* Result */
.result .content {
  justify-content: center;
}

.result-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding-top: 12px;
}

.result-hero h1 {
  font-size: 1.7em;
  font-weight: 900;
}

.result-crest {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  animation: crest-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.result-fail .result-crest {
  color: var(--danger);
}

@keyframes crest-in {
  from {
    transform: scale(0.3) rotate(-20deg);
    opacity: 0;
  }
}

.result-level {
  color: var(--cyan);
  font-weight: 700;
}

.result-hero .stars .star {
  animation: star-in 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.result-hero .stars .star:nth-child(2) {
  animation-delay: 0.15s;
}

.result-hero .stars .star:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes star-in {
  from {
    transform: scale(0);
  }
}

.perfect-rays {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 320px;
  height: 320px;
  transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 209, 102, 0.18) 0deg 10deg, transparent 10deg 20deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: rays 12s linear infinite;
  pointer-events: none;
}

@keyframes rays {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

.result-perfect h1 {
  color: var(--gold);
}

.score-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.score-line small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.score-line strong {
  font-size: 2em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* Reward */
.reward-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding-top: 10px;
}

.reward-icon {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--blue-2), var(--blue-deep));
  box-shadow: 0 0 30px rgba(79, 227, 255, 0.35);
  animation: crest-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.reward-total {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}

.reward-total strong {
  font-size: 2.2em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.coin-lines {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
}

.coin-line {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--panel);
}

.coin-line + .coin-line {
  border-top: 1px solid var(--line);
}

.coin-line strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
}

.new-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.new-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  animation: card-deal 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.new-card small {
  font-size: 0.76em;
  color: var(--muted);
}

.new-card .card-art {
  width: 100%;
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(20px) rotateY(90deg);
  }
}

.trophy-list,
.achievement-list,
.mission-list,
.milestone-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trophy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.trophy-art {
  display: block;
  width: 52px;
  height: 52px;
  flex: none;
}

.trophy-art.big {
  width: 110px;
  height: 110px;
  margin: 0 auto;
}

.trophy-text {
  display: flex;
  flex-direction: column;
}

.trophy-text small {
  color: var(--muted);
}

/* Unlock */
.unlock .content {
  justify-content: center;
}

.unlock-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.unlock-hero h1 {
  font-size: 1.5em;
  font-weight: 900;
}

.unlock-burst {
  position: absolute;
  top: -30px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79, 227, 255, 0.35), transparent 65%);
  animation: burst 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes burst {
  50% {
    transform: scale(1.12);
    opacity: 0.7;
  }
}

.unlock-art {
  position: relative;
  display: grid;
  place-items: center;
  animation: crest-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.unlock-art.wide {
  width: 100%;
  aspect-ratio: 300 / 160;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
}

.unlock-card {
  display: block;
  width: 130px;
  height: 173px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.arena-swatch {
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.unlock-art.arena-swatch {
  width: 160px;
  height: 110px;
}

.arena-swatch.arena_nova {
  background: radial-gradient(90% 80% at 50% 0%, #10307f, transparent), linear-gradient(180deg, #0a1c52, #030a22);
}

.arena-swatch.arena_cyan {
  background: radial-gradient(90% 80% at 50% 0%, #0b5a86, transparent), linear-gradient(180deg, #06395a, #021824);
}

.arena-swatch.arena_ice {
  background: radial-gradient(90% 80% at 50% 0%, #2c4a78, transparent), linear-gradient(180deg, #1b2e4d, #0b1424);
}

.arena-swatch.arena_aurora {
  background: radial-gradient(90% 80% at 50% 0%, #2e3a9c, transparent), linear-gradient(180deg, #1d1a5c, #0a0826);
}

/* Collection */
.collection-summary {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.set-head {
  display: flex;
  justify-content: flex-end;
  margin-top: -34px;
  min-height: 24px;
}

.set-count,
.set-claimed {
  font-size: 0.8em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.set-claimed {
  color: var(--good);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.collection-card .card-art {
  width: 100%;
}

.collection-card small {
  font-size: 0.78em;
  color: var(--muted);
  line-height: 1.2;
}

.big-card {
  display: flex;
  justify-content: center;
}

.big-card .card-art {
  width: min(62%, 260px);
  box-shadow: 0 0 0 3px rgba(79, 227, 255, 0.4), 0 18px 40px rgba(0, 0, 0, 0.5);
}

/* Customize */
.customize-preview {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.preview-card {
  display: block;
  width: 78px;
  height: 104px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 6px 14px rgba(0, 10, 50, 0.4);
}

.preview-card.back {
  background-size: cover;
  background-position: center;
  padding: 0;
}

.cosmetic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cosmetic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid transparent;
  text-align: center;
}

.cosmetic small {
  color: var(--muted);
  font-size: 0.74em;
  line-height: 1.2;
}

.cosmetic.equipped {
  border-color: var(--cyan);
}

.cos-swatch {
  display: block;
  margin-bottom: 4px;
}

.cos-swatch.card {
  width: 60px;
  height: 80px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.cos-swatch.arena-swatch {
  width: 100%;
  height: 64px;
}

.cos-status {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78em;
  font-weight: 700;
  color: var(--muted);
}

.cos-status.on {
  color: var(--cyan);
}

.cos-status.price {
  color: var(--gold);
}

.cos-status.locked {
  color: var(--muted);
}

/* Missions */
.mission {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.mission.ready {
  border-color: rgba(255, 209, 102, 0.6);
}

.mission.claimed {
  opacity: 0.65;
}

.mission-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cyan-soft);
  color: var(--cyan);
  flex: none;
}

.mission-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-reward.done {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--good);
}

.sweep-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.18), rgba(61, 139, 255, 0.18));
  border: 1px solid rgba(255, 209, 102, 0.45);
}

.sweep-icon {
  color: var(--gold);
}

.sweep-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sweep-text small {
  color: var(--muted);
}

/* Achievements / trophies */
.achievement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.achievement-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement-body small {
  color: var(--muted);
}

.tier-tag {
  font-size: 0.72em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.tier-tag.gold {
  color: var(--gold);
}

.tier-tag.silver {
  color: #d6ddf0;
}

.tier-tag.bronze {
  color: #f0b27a;
}

.tier-tag.nova {
  color: var(--cyan);
}

.shelf {
  padding: 12px 12px 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18));
  border: 1px solid var(--line);
}

.shelf-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.shelf-head small {
  color: var(--muted);
}

.shelf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.shelf-item {
  width: 58px;
  height: 62px;
  display: grid;
  place-items: end center;
}

.shelf-item .trophy-art {
  width: 54px;
  height: 54px;
}

.shelf-item.got .trophy-art {
  filter: drop-shadow(0 0 10px rgba(79, 227, 255, 0.35));
}

.shelf-plank {
  height: 10px;
  margin: 0 -12px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(180deg, #2a4aa8, #11286b);
}

.cup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.cup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}

.cup small {
  font-size: 0.74em;
  line-height: 1.2;
}

.trophy-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Stats */
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.history-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 90, 110, 0.2);
  color: var(--danger);
  flex: none;
}

.history-row.cleared .history-icon {
  background: rgba(61, 220, 151, 0.2);
  color: var(--good);
}

.history-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.history-text strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-text small {
  color: var(--muted);
  font-size: 0.78em;
}

/* Daily + streak */
.daily-card {
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 138, 61, 0.14), var(--panel));
  border: 1px solid rgba(255, 179, 71, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.daily-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-top small {
  display: block;
  color: var(--muted);
}

.daily-flame {
  color: #ffb347;
  display: grid;
  place-items: center;
}

.daily-flame.big svg {
  filter: drop-shadow(0 0 16px rgba(255, 179, 71, 0.6));
}

.daily-next {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.daily-next svg {
  color: var(--cyan);
}

.calendar-weekdays,
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75em;
  color: var(--muted);
  font-weight: 700;
}

.day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 0.8em;
}

.day.cleared {
  background: linear-gradient(160deg, #ffb347, #ff6b3d);
  color: #3a1600;
  border-color: transparent;
}

.day.tried {
  border-color: rgba(255, 179, 71, 0.5);
}

.day.today {
  box-shadow: 0 0 0 2px var(--cyan);
}

.day.future {
  opacity: 0.35;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.milestone.reached {
  border-color: rgba(255, 179, 71, 0.55);
}

.milestone-days {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: rgba(255, 179, 71, 0.18);
  color: #ffb347;
  flex: none;
}

.milestone-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.milestone-text small {
  color: var(--muted);
}

/* Quick */
.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.size-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 2px solid transparent;
  text-align: center;
}

.size-option.on {
  border-color: var(--cyan);
  background: var(--panel-strong);
}

.size-option small {
  color: var(--muted);
  font-size: 0.78em;
}

.size-option small.best {
  color: var(--cyan);
}

/* Endless intro */
.endless-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding-top: 8px;
}

.endless-icon {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--blue-2), var(--blue-deep));
  box-shadow: 0 0 34px rgba(79, 227, 255, 0.4);
}

.rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.rule-list svg {
  color: var(--cyan);
  margin-top: 2px;
}

/* Help */
.help-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line);
}

.help-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cyan-soft);
  color: var(--cyan);
  flex: none;
}

.help-item p {
  color: var(--muted);
  font-size: 0.9em;
}

/* Credits */
.credits-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 10px 0;
}

.build-tag {
  text-align: center;
  font-size: 0.75em;
  color: var(--muted);
  opacity: 0.7;
}

/* Accessibility preview */
.a11y-preview {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  --card-w: 72px;
}

.card.preview {
  width: 72px;
  height: 96px;
  --card-w: 72px;
}

.card.preview .card-front {
  transform: none;
}

/* Offline */
.offline-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding-top: 12px;
}

.offline-icon {
  width: 100px;
  height: 100px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: var(--panel-strong);
  color: var(--cyan);
}

.net-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--panel);
  border: 1px solid var(--line);
}

.net-status.online {
  color: var(--good);
  border-color: rgba(61, 220, 151, 0.5);
}

.net-status.offline {
  color: var(--danger);
  border-color: rgba(255, 90, 110, 0.5);
}

.net-status.checking svg {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 520px) {
  .collection-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 360px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
}
