/* LookCat - Games Styles */

/* === HIGHSCORE SCREEN === */
#highscoreScreen { gap: 16px; }
.hs-podium {
  display: flex; justify-content: center; align-items: flex-end; gap: 6px;
  padding: 8px 0 16px; width: 100%;
}
.hs-podium-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: 20px; padding: 14px 8px 16px; position: relative;
  width: 32%; box-shadow: var(--shadow-soft);
}
.hs-podium-item.gold { background: linear-gradient(135deg, #FFF8E1, #FFE082); border: 2px solid #FFD54F; order: 2; padding-bottom: 60px; }
.hs-podium-item.silver { background: linear-gradient(135deg, #F5F5F5, #E0E0E0); border: 2px solid #BDBDBD; order: 1; padding-bottom: 30px; }
.hs-podium-item.bronze { background: linear-gradient(135deg, #FFF3E0, #FFCC80); border: 2px solid #FFB74D; order: 3; }
.hs-podium-rank {
  position: absolute; top: -14px;
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15px; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.hs-podium-item.gold .hs-podium-rank { background: #F5A623; }
.hs-podium-item.silver .hs-podium-rank { background: #9E9E9E; }
.hs-podium-item.bronze .hs-podium-rank { background: #FF8F00; }
.hs-podium-avatar {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); margin-top: 14px;
}
.hs-podium-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hs-podium-name { font-size: 15px; font-weight: 800; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-podium-pts { font-size: 20px; font-weight: 900; color: var(--orange); margin-bottom: -2px; }
.hs-podium-level { font-size: 13px; color: var(--text-soft); font-weight: 700; margin-top: -4px; }
.hs-podium-item.is-me { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow), var(--shadow-soft); }

.hs-list { display: flex; flex-direction: column; gap: 8px; }
.hs-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 12px 16px;
  box-shadow: var(--shadow-soft); border: 1.5px solid #F0EDE8;
}
.hs-row.is-me { border-color: var(--green); background: linear-gradient(135deg, #E8F5E9, #F1F8E9, var(--card)); }
.hs-row-rank { font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900; color: var(--text-soft); min-width: 28px; text-align: center; }
.hs-row-avatar { width: 69px; height: 69px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.hs-row-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hs-row-info { flex: 1; min-width: 0; }
.hs-row-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-row-level { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.hs-row-pts { font-size: 18px; font-weight: 900; color: var(--orange); }
.hs-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--text-soft); text-align: center; font-size: 15px; font-weight: 600; }

/* === GAMES SCREEN === */
#gamesScreen { gap: 14px; }
.games-grid { display: grid; grid-template-columns: 1fr; gap: 14px; width: 100%; }
.challenge-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-soft); border: 2px solid #F0EDE8;
  cursor: pointer; position: relative; overflow: hidden;
  -webkit-user-select: none; user-select: none;
}
@media (hover: hover) { .challenge-card:active { transform: scale(0.98); } }
.challenge-card.completed { border-color: var(--green); background: linear-gradient(135deg, #f0faf0, var(--card)); }
.challenge-card.seasonal { border-color: #A5D6A7; background: linear-gradient(135deg, #E8F5E9, #F1F8E9, var(--card)); }
.challenge-card .seasonal-badge { position: absolute; top: 6px; right: 8px; background: linear-gradient(135deg, #F5A623, #FF9800); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 10px; letter-spacing: .5px; }
.challenge-card.seasonal.completed { border-color: var(--green); background: linear-gradient(135deg, #C8E6C9, #E8F5E9, var(--card)); }
.challenge-card.geo { border-color: #80DEEA; background: linear-gradient(135deg, #E0F7FA, #E8F5E9, var(--card)); }
.challenge-card.geo .seasonal-badge { background: linear-gradient(135deg, #00ACC1, #00897B); }
.challenge-card.geo.completed { border-color: var(--green); background: linear-gradient(135deg, #B2EBF2, #E0F7FA, var(--card)); }
.challenge-icon {
  width: 102px; height: 102px; min-width: 102px; border-radius: 50%; overflow: hidden;
  background: var(--orange-light); display: flex; align-items: center; justify-content: center;
}
.challenge-icon img { width: 100%; height: 100%; object-fit: cover; }
.challenge-icon .emoji-fallback { font-size: 34px; }
.challenge-info { flex: 1; min-width: 0; }
.challenge-name {
  font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.challenge-desc {
  font-size: 15px; color: var(--text-soft); font-weight: 600; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.challenge-progress { margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.challenge-bar {
  flex: 1; height: 10px; background: #EEE; border-radius: 5px; overflow: hidden;
}
.challenge-bar-fill {
  height: 100%; border-radius: 5px; transition: width .5s;
  background: linear-gradient(90deg, var(--orange), var(--green));
}
.challenge-count {
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; color: var(--text);
  white-space: nowrap;
}
.challenge-reward {
  display: flex; flex-direction: column; align-items: center; min-width: 48px;
}
.challenge-pts {
  font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900; color: var(--orange);
}
.challenge-pts-label { font-size: 11px; font-weight: 700; color: var(--text-soft); }
.challenge-card.completed .challenge-pts { color: var(--green); }
.challenge-check {
  position: absolute; top: 8px; right: 8px; font-size: 18px;
}

/* === CHALLENGE DETAIL SCREEN === */
#challengeDetailScreen { gap: 16px; align-items: center; }
.ch-detail-header {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%;
  padding: 12px 16px 20px; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.ch-detail-icon { width: 200px; height: 200px; min-width: 200px; border-radius: 50%; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.1); border: 4px solid var(--orange-light); }
.ch-detail-icon img { width: 100%; height: 100%; object-fit: cover; }
.ch-detail-title-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.ch-detail-title {
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 900; color: var(--text); text-align: center;
}
.ch-detail-play-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--green), #3a7a32); color: #fff;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; box-shadow: 0 2px 8px rgba(74,139,63,.4);
  padding: 0 0 0 3px; line-height: 1;
}
.ch-detail-desc {
  font-size: 16px; color: var(--text-soft); font-weight: 600; margin-top: -2px; line-height: 1.4; text-align: center;
}
.ch-detail-timer {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px; width: 100%;
  background: var(--orange-light); border-radius: var(--radius); font-weight: 700;
}
.ch-detail-timer .timer-icon { font-size: 24px; }
.ch-detail-timer .timer-text { font-size: 16px; color: var(--text); flex: 1; }
.ch-detail-timer .timer-value {
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 900; color: var(--orange);
}
.ch-detail-timer.running { background: #FFF8E1; }
.ch-detail-timer.expired { background: #FFEBEE; }
.ch-detail-timer.expired .timer-value { color: #E53935; }
.ch-detail-progress-box {
  width: 100%; padding: 16px; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.ch-detail-progress-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.ch-detail-progress-label { font-size: 16px; font-weight: 700; color: var(--text); }
.ch-detail-progress-num {
  font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900; color: var(--orange);
}
.ch-detail-bar { width: 100%; height: 12px; background: #EEE; border-radius: 6px; overflow: hidden; }
.ch-detail-bar-fill {
  height: 100%; border-radius: 6px; transition: width .5s;
  background: linear-gradient(90deg, var(--orange), var(--green));
}
.ch-detail-points-row {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 14px; font-weight: 700; color: var(--text-soft);
}
.ch-detail-funde-title {
  font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800;
  color: var(--text); width: 100%; text-align: left;
}
.ch-detail-funde-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%;
}
.ch-fund-card {
  aspect-ratio: 1; border-radius: 16px; overflow: hidden; position: relative;
  background: var(--orange-light);
}
.ch-fund-card img { width: 100%; height: 100%; object-fit: cover; }
.ch-fund-pts {
  position: absolute; bottom: 4px; right: 4px; background: var(--orange);
  color: #fff; font-size: 11px; font-weight: 800; padding: 2px 6px;
  border-radius: 8px;
}
.ch-fund-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #DDD; border: 2px dashed #E0E0E0; border-radius: 16px;
}
.ch-detail-start-btn {
  width: 100%; max-width: 340px; padding: 18px; border: none; border-radius: 20px;
  font-family: 'Nunito', sans-serif; font-size: 20px; font-weight: 900;
  color: #fff; cursor: pointer; transition: all .2s;
  box-shadow: 0 6px 24px rgba(245,166,35,.35);
}
.ch-detail-start-btn:active { transform: scale(0.96); }
.ch-detail-start-btn.start { background: linear-gradient(135deg, var(--orange), var(--orange-warm)); }
.ch-detail-start-btn.resume { background: linear-gradient(135deg, var(--green), var(--green-light)); }
.ch-detail-back {
  background: none; border: none; font-size: 16px; font-weight: 700;
  color: var(--text-soft); cursor: pointer; padding: 8px 0; width: 100%; text-align: left;
}

/* === CHALLENGE SCAN SCREEN === */
#challengeScanScreen {
  align-items: center; justify-content: center; gap: 16px;
  position: relative;
}
.ch-scan-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101;
  display: flex; align-items: center; padding: calc(var(--safe-top) + 12px) 16px 12px; gap: 12px;
}
.ch-scan-back {
  background: rgba(255,255,255,.9); border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.ch-scan-title {
  flex: 1; font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.ch-scan-progress-pill {
  background: rgba(255,255,255,.9); border-radius: 20px; padding: 6px 14px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800;
  color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.ch-scan-timer-pill {
  background: rgba(255,255,255,.9); border-radius: 20px; padding: 6px 14px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
  color: var(--orange); box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.ch-scan-info-btn {
  background: rgba(255,255,255,.9); border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* === CHALLENGE COMPLETE SCREEN === */
#challengeCompleteScreen { align-items: center; justify-content: center; gap: 0; }
.chc-content {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 24px; text-align: center; gap: 4px;
}
.chc-icon {
  width: 140px; height: 140px; border-radius: 50%; object-fit: cover;
  border: 5px solid var(--orange); box-shadow: 0 6px 24px rgba(245,166,35,.35);
  margin-bottom: 8px;
  animation: chcPop .6s cubic-bezier(.175,.885,.32,1.275);
}
.chc-star {
  font-size: 48px;
  animation: chcSpin .8s ease-out;
}
.chc-title {
  font-family: 'Nunito', sans-serif; font-size: 28px; font-weight: 900;
  color: var(--orange); margin: 0; line-height: 1.2;
}
.chc-subtitle {
  font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 700;
  color: var(--text-soft); margin: 0 0 16px;
}
.chc-points-wrap {
  background: var(--card); border-radius: 20px; padding: 16px 28px;
  box-shadow: var(--shadow-soft); border: 2px solid #F0EDE8;
  width: 100%; max-width: 280px;
}
.chc-points-row {
  display: flex; justify-content: space-between; align-items: center; padding: 6px 0;
}
.chc-points-label {
  font-size: 15px; font-weight: 700; color: var(--text-soft);
}
.chc-points-value {
  font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 900; color: var(--text);
}
.chc-bonus .chc-points-value { color: var(--orange); }
.chc-total .chc-points-label { font-size: 17px; color: var(--text); }
.chc-total .chc-points-value {
  font-size: 28px; color: var(--green);
}
.chc-points-divider {
  height: 1px; background: #F0EDE8; margin: 2px 0;
}
.chc-btn-row { width: 100%; padding: 0 24px calc(env(safe-area-inset-bottom, 16px) + 24px); }
.chc-btn {
  width: 100%; padding: 16px; border-radius: 16px; border: none;
  background: linear-gradient(135deg, var(--orange), #e8951a);
  color: #fff; font-family: 'Nunito', sans-serif; font-size: 18px; font-weight: 800;
  cursor: pointer; box-shadow: 0 4px 16px rgba(245,166,35,.35);
}
.chc-btn:active { transform: scale(0.96); }
@keyframes chcPop {
  0% { transform: scale(0); } 100% { transform: scale(1); }
}
@keyframes chcSpin {
  0% { transform: scale(0) rotate(-180deg); } 100% { transform: scale(1) rotate(0); }
}

/* === ARCADE SCREEN (Coin-Hub + Mini-Games) === */
#arcadeScreen { gap: 14px; }

.arc-status {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.arc-status-coins, .arc-status-streak {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer; position: relative;
  transition: transform 0.12s ease;
}
.arc-status-coins:active, .arc-status-streak:active { transform: scale(0.97); }
.arc-info-i {
  position: absolute; top: 6px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.15); color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  font-style: italic;
}
.arc-status-coins {
  background: linear-gradient(135deg, #FFF8E1, #FFE082);
  border: 2px solid #FFD54F;
}
.arc-status-streak {
  background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
  border: 2px solid #EF9A9A;
}
.arc-coin-icon, .arc-streak-fire { font-size: 32px; line-height: 1; }
.arc-coin-info, .arc-streak-info { display: flex; flex-direction: column; gap: 2px; }
.arc-coin-value, .arc-streak-value {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: 24px; line-height: 1; color: var(--text);
}
.arc-coin-label, .arc-streak-label {
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700;
  color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px;
}

.arc-today {
  background: var(--card); border: 2px solid #F0EDE8;
  padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.arc-today-label {
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  color: var(--text-soft);
}
.arc-today-bar {
  height: 10px; background: #F5F1EB; border-radius: 6px; overflow: hidden;
  position: relative;
}
.arc-today-fill {
  height: 100%; background: linear-gradient(90deg, #FFB74D, #FF9800);
  border-radius: 6px; width: 0%;
  transition: width .5s cubic-bezier(.22,1,.36,1);
}
.arc-today-text {
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 900;
  color: var(--text); align-self: flex-end;
}

.arc-howto {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow-soft); display: flex; flex-direction: column; gap: 8px;
}
.arc-howto-title {
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 900;
  color: var(--text); margin-bottom: 4px;
}
.arc-howto-tip {
  display: flex; align-items: flex-start; gap: 10px;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border: 2px solid #FFB74D;
  border-radius: 12px; padding: 10px 12px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: #5D4037; line-height: 1.4;
  margin-bottom: 4px;
}
.arc-howto-tip-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.arc-howto-tip b { color: #E65100; font-weight: 900; }
.arc-howto-row {
  display: flex; align-items: center; gap: 10px;
}
.arc-howto-icon { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
.arc-howto-text {
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--text-soft); line-height: 1.3;
}

/* === ARC INFO MODALS (Coins / Streak) === */
.arc-info-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 250; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.arc-info-modal.show { display: flex; animation: arcInfoFadeIn 0.25s ease-out; }
@keyframes arcInfoFadeIn { from { opacity: 0; } to { opacity: 1; } }
.arc-info-content {
  background: var(--card); border-radius: 20px; padding: 24px 22px;
  max-width: 420px; width: 100%;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.arc-info-title {
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 900;
  color: var(--text); display: flex; align-items: center; gap: 10px;
}
.arc-info-text {
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text-soft); line-height: 1.5;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border: 2px solid #FFB74D;
  border-radius: 12px; padding: 12px 14px;
}
.arc-info-text b { color: #E65100; font-weight: 900; }
.arc-info-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: #FFF8E1; border: 1px solid #FFE082;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--text); line-height: 1.4;
}
.arc-info-icon { font-size: 22px; flex-shrink: 0; line-height: 1.2; }
.arc-info-close {
  margin-top: 6px; padding: 12px 24px;
  background: var(--orange); color: #fff; border: none; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900;
  cursor: pointer; align-self: stretch;
}
.arc-info-close:active { transform: scale(0.96); }

.arc-games-title {
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900;
  color: var(--text); margin-top: 4px;
}
.arc-games-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.arc-game-tile {
  background: var(--card); border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 2px 4px rgba(0,0,0,.08);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.arc-game-tile-img {
  width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover;
  pointer-events: none;
}
.arc-game-meta {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px 10px;
}
.arc-game-tile.locked {
  filter: grayscale(0.4);
  opacity: 0.85;
}
.arc-game-name {
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 900;
  color: var(--text); text-align: center;
}
.arc-game-cost {
  font-family: 'Nunito', sans-serif; font-size: 12px; font-weight: 800;
  color: var(--orange); display: flex; align-items: center; gap: 3px;
}
.arc-game-soon {
  position: absolute; top: 8px; right: -28px;
  background: var(--orange); color: #fff;
  font-family: 'Nunito', sans-serif; font-size: 9px; font-weight: 900;
  padding: 3px 32px; transform: rotate(35deg);
  text-transform: uppercase; letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.arc-game-tile.playable { cursor: pointer; transition: transform .15s ease; }
.arc-game-tile.playable:active { transform: scale(0.96); }

/* === LEADERBOARD MODAL (shared) === */
.lb-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.lb-modal.show { display: flex; }
.lb-content {
  background: var(--card);
  border-radius: 20px;
  max-width: 400px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.lb-title {
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 900;
  color: var(--text); text-align: center; margin-bottom: 16px;
}
.lb-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  background: #FFF8E1; border: 1px solid #FFE082;
}
.lb-row.gold { background: linear-gradient(135deg, #FFF8E1, #FFD54F); border-color: #FFC107; }
.lb-row.silver { background: linear-gradient(135deg, #F5F5F5, #BDBDBD); }
.lb-row.bronze { background: linear-gradient(135deg, #FFE0B2, #FFB74D); }
.lb-row.me { box-shadow: 0 0 0 3px var(--orange); }
.lb-rank {
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 18px;
  color: var(--text); min-width: 36px;
}
.lb-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid #fff;
}
.lb-name {
  flex: 1; font-family: 'Nunito', sans-serif; font-weight: 800;
  color: var(--text); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-score {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  color: var(--orange); font-size: 18px;
}
.lb-empty, .lb-loading {
  text-align: center; padding: 30px; color: var(--text-soft);
  font-family: 'Nunito', sans-serif; font-weight: 700;
}
.lb-close-btn {
  background: var(--orange); color: #fff; border: none;
  padding: 12px 24px; border-radius: 12px;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900;
  cursor: pointer; align-self: stretch;
}

/* === CAT-WM GAME === */
/* Hide all top/bottom UI when in game (belt & suspenders) */
body.in-game .bottom-nav,
body.in-game .top-bar { display: none !important; }

#catWmScreen {
  background: linear-gradient(180deg, #87CEEB 0%, #4ABD3A 50%, #267020 100%);
  padding: 0 !important;
  overflow: hidden;
  display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catWmScreen.active { display: flex !important; flex-direction: column; }

#catchScreen {
  background: linear-gradient(180deg, #FFE9C4 0%, #F4C173 50%, #C68B3D 100%);
  padding: 0 !important;
  overflow: hidden;
  display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catchScreen.active { display: flex !important; flex-direction: column; }

#catSwapScreen {
  background: linear-gradient(180deg, #B79CFF 0%, #8366D9 50%, #4D2E8E 100%);
  padding: 0 !important;
  overflow: hidden;
  display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catSwapScreen.active { display: flex !important; flex-direction: column; }

#catJumpScreen {
  background: linear-gradient(180deg, #87CEEB 0%, #4FC3F7 50%, #FFB74D 100%);
  padding: 0 !important;
  overflow: hidden;
  display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catJumpScreen.active { display: flex !important; flex-direction: column; }

#catStackScreen {
  background: linear-gradient(180deg, #7AC8FF 0%, #B6E1FF 60%, #FFE4A8 100%);
  padding: 0 !important; overflow: hidden; display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catStackScreen.active { display: flex !important; flex-direction: column; }

#catFlapScreen {
  background: linear-gradient(180deg, #7AC8FF 0%, #B6E1FF 60%, #E6F3FF 100%);
  padding: 0 !important; overflow: hidden; display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catFlapScreen.active { display: flex !important; flex-direction: column; }

#choirCatScreen {
  background: linear-gradient(180deg, #1A0B3D 0%, #000 100%);
  padding: 0 !important; overflow: hidden; display: none;
  position: fixed; inset: 0; z-index: 50;
}
#choirCatScreen.active { display: flex !important; flex-direction: column; }
#choirCatScreen .cwm-header {
  background: linear-gradient(180deg, rgba(20,10,50,0.95), rgba(0,0,0,0.85));
  border-bottom: 2px solid rgba(186,104,200,0.4);
}

#catrisScreen {
  background: linear-gradient(180deg, #1A237E 0%, #0D1442 100%);
  padding: 0 !important;
  overflow: hidden;
  display: none;
  position: fixed; inset: 0; z-index: 50;
}
#catrisScreen.active { display: flex !important; flex-direction: column; }

/* Catris-spezifischer Header — Back-Button sichtbar auf dunklem BG */
#catrisScreen .cwm-header {
  background: linear-gradient(180deg, rgba(20,30,80,0.95), rgba(13,20,66,0.85));
  border-bottom: 2px solid rgba(186,104,200,0.4);
  padding-left: 8px; padding-right: 8px; gap: 4px;
}
/* 4 Stats: kompakter — sonst zu eng auf Mobile */
#catrisScreen .cwm-stat > span:last-child { font-size: 22px; }
#catrisScreen .cwm-stat > span:first-child { font-size: 10px; }
#catrisScreen .cwm-back {
  background: linear-gradient(180deg, #BA68C8 0%, #7B1FA2 100%);
  border: 2px solid rgba(255,255,255,0.45);
  color: #fff; font-weight: 900; font-size: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}
#catrisScreen .cwm-back:active {
  background: linear-gradient(180deg, #F06292 0%, #C2185B 100%);
}
/* Time-Stat: rot pulsen wenn ≤ 10s */
#ctTime.ct-time-low {
  color: #FF5252 !important;
  animation: ctTimeLow 0.6s ease-in-out infinite alternate;
}
@keyframes ctTimeLow {
  from { transform: scale(1);    text-shadow: 0 2px 4px rgba(0,0,0,.5); }
  to   { transform: scale(1.15); text-shadow: 0 0 12px rgba(255,82,82,0.8), 0 2px 4px rgba(0,0,0,.5); }
}

/* Catris Control Buttons — eleganter, mit Glow + klare Farben */
.ct-controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px 14px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, rgba(13,20,66,0) 0%, rgba(13,20,66,0.6) 30%, rgba(0,0,0,0.85) 100%);
  z-index: 5;
}
.ct-btn {
  position: relative;
  background: linear-gradient(180deg, #3949AB 0%, #1A237E 100%);
  border: 2px solid rgba(126, 142, 209, 0.6);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 32px; font-weight: 900;
  border-radius: 18px;
  height: 64px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 4px 0 rgba(0,0,0,0.4),
    0 0 18px rgba(126,142,209,0.25),
    inset 0 1px 0 rgba(255,255,255,0.25);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.ct-btn:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 rgba(0,0,0,0.4),
    0 0 24px rgba(255,193,7,0.5),
    inset 0 1px 0 rgba(255,255,255,0.25);
  background: linear-gradient(180deg, #FFC107 0%, #FF8F00 100%);
  border-color: rgba(255,255,255,0.7);
}
.ct-btn-rotate {
  background: linear-gradient(180deg, #BA68C8 0%, #6A1B9A 100%);
  border-color: rgba(225, 190, 231, 0.7);
  box-shadow:
    0 4px 0 rgba(0,0,0,0.4),
    0 0 18px rgba(186,104,200,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
.ct-btn-rotate:active {
  background: linear-gradient(180deg, #E1BEE7 0%, #BA68C8 100%);
}
.ct-btn-drop {
  background: linear-gradient(180deg, #FF7043 0%, #BF360C 100%);
  border-color: rgba(255, 204, 188, 0.7);
  box-shadow:
    0 4px 0 rgba(0,0,0,0.4),
    0 0 18px rgba(255,112,67,0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
.ct-btn-drop:active {
  background: linear-gradient(180deg, #FFAB91 0%, #FF5722 100%);
}

/* Shuffle Button — only shown when no moves possible */
.cs-shuffle-btn {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 60px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(180deg, #FFC107 0%, #FF8F00 100%);
  color: #fff; border: 3px solid #fff;
  border-radius: 24px;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 900;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), 0 0 24px rgba(255,193,7,0.6);
  cursor: pointer;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.25s ease;
}
.cs-shuffle-btn.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
  pointer-events: auto;
  animation: csShuffleBounce 1.6s ease-in-out infinite;
}
@keyframes csShuffleBounce {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.06); }
}
.cs-shuffle-btn:active { transform: translateX(-50%) scale(0.94); animation: none; }
.cs-shuffle-icon { font-size: 22px; }
.cwm-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(var(--safe-top) + 12px) 14px 12px;
  background: linear-gradient(180deg, rgba(0,40,0,0.85), rgba(0,40,0,0.65));
  color: #fff;
  font-family: 'Nunito', sans-serif; font-weight: 900;
  border-bottom: 2px solid rgba(255,215,0,0.4);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  z-index: 5;
}
.cwm-back {
  background: rgba(0,0,0,0.55);
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  font-variant-emoji: text;     /* erzwingt Text-Rendering, kein Color-Emoji */
  border: 2px solid rgba(255,255,255,0.75);
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 28px; font-weight: 900; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.cwm-back:active { background: rgba(0,0,0,0.75); transform: scale(0.94); }
.cwm-stat {
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
  flex: 1;
  text-align: center;
}
.cwm-stat > span:first-child {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  opacity: .85; margin-bottom: 2px;
}
.cwm-stat > span:last-child {
  font-size: 28px; font-weight: 900; line-height: 1;
  color: #FFD700;
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.cwm-canvas {
  flex: 1; width: 100%; display: block; touch-action: none;
}
.cwm-hint {
  position: absolute; bottom: calc(var(--safe-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  text-align: center; color: #fff; font-family: 'Nunito', sans-serif;
  font-size: 12px; font-weight: 800;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 14px; border-radius: 16px;
  max-width: calc(100% - 32px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* === SHARED GAME OVER OVERLAY === */
.cwm-gameover, .game-over {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 20, 40, 0.78) 0%, rgba(0, 0, 0, 0.92) 100%);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; z-index: 10;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cwm-gameover.show, .game-over.show {
  display: flex;
  animation: goFadeIn 0.4s ease-out;
}
@keyframes goFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.go-trophy {
  font-size: 88px; line-height: 1;
  filter: drop-shadow(0 6px 20px rgba(255, 215, 0, 0.6));
  animation: goTrophyPop 0.6s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes goTrophyPop {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(15deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}
.go-trophy-gold   { filter: drop-shadow(0 6px 24px rgba(255, 215, 0, 0.85)); }
.go-trophy-silver { filter: drop-shadow(0 6px 20px rgba(220, 220, 230, 0.7)); }
.go-trophy-bronze { filter: drop-shadow(0 6px 20px rgba(205, 127, 50, 0.7)); }

.go-title {
  font-family: 'Nunito', sans-serif; font-size: 26px; font-weight: 900;
  color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
  animation: goSlideIn 0.5s ease-out 0.15s both;
}

.go-score-label {
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 800;
  color: rgba(255, 215, 0, 0.85);
  text-transform: uppercase; letter-spacing: 2px;
  margin-top: -4px; margin-bottom: -8px;
  animation: goSlideIn 0.5s ease-out 0.25s both;
}
.go-score {
  font-family: 'Nunito', sans-serif;
  font-size: 64px; font-weight: 900;
  color: #FFD700;
  line-height: 1;
  text-shadow: 0 4px 24px rgba(255, 215, 0, 0.5), 0 2px 4px rgba(0,0,0,0.6);
  animation: goSlideIn 0.5s ease-out 0.35s both;
}
.go-score-pop { animation: goScorePop 0.4s ease-out; }
@keyframes goScorePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); text-shadow: 0 6px 32px rgba(255,215,0,0.85), 0 2px 4px rgba(0,0,0,0.6); }
  100% { transform: scale(1); }
}
@keyframes goSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.go-rank {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 8px 16px; border-radius: 20px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
  color: #fff;
  animation: goSlideIn 0.5s ease-out 0.5s both;
}
.go-rank-icon { font-size: 18px; }
.go-rank #cwmRank, .go-rank #catchRank, .go-rank #csRank {
  color: #FFD700; font-size: 16px;
}

.cwm-go-buttons {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 14px;
  animation: goSlideIn 0.5s ease-out 0.6s both;
}
.cwm-go-buttons button {
  padding: 12px 22px; border-radius: 14px; border: none;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cwm-go-buttons button:active { transform: scale(0.95); }
.cwm-go-buttons .btn-primary {
  background: linear-gradient(180deg, #FFC107 0%, #FF8F00 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 143, 0, 0.5);
}
.cwm-go-buttons .btn-secondary {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}
