/* ==========================================================================
   AzTyping - Pixel Art Games Hub, Game Cards & Game Modal Overlays
   ========================================================================== */

/* ============================================================
   PIXEL ART GAMES HUB â€” WELL-ORGANIZED EQUAL GRID
   ============================================================ */
.detailed-games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.detailed-game-card {
  background: var(--card-bg);
  border: 2px solid rgba(110, 68, 255, 0.2);
  border-radius: 18px !important;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  height: 100%;
}
.detailed-game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(110, 68, 255, 0.15);
  border-color: var(--primary-purple);
}

/* Each card accent color */
.detailed-game-card.card-purple { border-color: rgba(110, 68, 255, 0.3); }
.detailed-game-card.card-green  { border-color: rgba(34, 197, 94, 0.3); }
.detailed-game-card.card-red    { border-color: rgba(239, 68, 68, 0.3); }
.detailed-game-card.card-blue   { border-color: rgba(59, 130, 246, 0.3); }
.detailed-game-card.card-orange { border-color: rgba(249, 115, 22, 0.3); }
.detailed-game-card.card-teal   { border-color: rgba(16, 185, 129, 0.3); }

.detailed-game-card.card-purple:hover { box-shadow: 7px 7px 0 rgba(110,68,255,.4); }
.detailed-game-card.card-green:hover  { box-shadow: 7px 7px 0 rgba(34,197,94,.4); }
.detailed-game-card.card-red:hover    { box-shadow: 7px 7px 0 rgba(239,68,68,.4); }
.detailed-game-card.card-blue:hover   { box-shadow: 7px 7px 0 rgba(59,130,246,.4); }
.detailed-game-card.card-orange:hover { box-shadow: 7px 7px 0 rgba(249,115,22,.4); }
.detailed-game-card.card-teal:hover   { box-shadow: 7px 7px 0 rgba(16,185,129,.4); }

/* Locked Game Card Styling */
.locked-card { opacity: 0.55; filter: grayscale(0.8); cursor: not-allowed; }
.locked-card:hover { transform: none !important; box-shadow: 4px 4px 0 rgba(0,0,0,0.15) !important; }
.locked-card .dgc-banner img { transform: none !important; }
.locked-overlay { position: absolute; top: 10px; left: 10px; z-index: 10; background: rgba(0,0,0,0.85); color: #FFF; padding: 8px; border-radius: 0; display: flex; align-items: center; justify-content: center; border: 2px solid #555; }
.locked-card .dgc-play-btn { background: #334155 !important; color: #64748B !important; box-shadow: 0 3px 0 #1e293b !important; cursor: not-allowed; }

.dgc-header { display: flex; justify-content: space-between; align-items: center; }
.dgc-title-area { display: flex; align-items: center; gap: 10px; }
.dgc-title-area h3 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.dgc-icon { background: rgba(0,0,0,0.06); width: 34px; height: 34px; border-radius: 2px; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(0,0,0,0.08); }
.dgc-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}
.tag-speed { background: #ede9fe; color: #5b21b6; border: 1px solid #6E44FF; }
.tag-accuracy { background: #dcfce7; color: #166534; border: 1px solid #22c55e; }
.tag-challenge { background: #fee2e2; color: #991b1b; border: 1px solid #ef4444; }
.tag-relax { background: #dbeafe; color: #1e40af; border: 1px solid #3b82f6; }
.tag-accuracy-orange { background: #ffedd5; color: #9a3412; border: 1px solid #f97316; }
.tag-hacker { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }

.tag-free-badge {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFF !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.tag-pro-badge {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFF !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  padding: 3px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

.pro-game-card.is-locked {
  border-color: rgba(245, 158, 11, 0.4) !important;
}
.pro-game-card.is-locked:hover {
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.25) !important;
  border-color: #F59E0B !important;
}
.pro-game-card.is-locked .dgc-play-btn {
  background: linear-gradient(135deg, #F59E0B, #D97706) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
}

/* Pixel banner with scanlines */
.dgc-banner {
  width: 100%;
  height: 150px;
  border-radius: 2px !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(0,0,0,0.15);
  position: relative;
}
.dgc-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 3px);
  pointer-events: none;
}
.dgc-banner img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform 0.3s ease; }
.detailed-game-card:hover .dgc-banner img { transform: scale(1.06); }

.banner-purple { border-color: #6E44FF; }
.banner-green  { border-color: #22C55E; }
.banner-red    { border-color: #EF4444; }
.banner-blue   { border-color: #3B82F6; }
.banner-orange { border-color: #F97316; }
.banner-teal   { border-color: #10B981; }

.dgc-desc { font-size: 0.82rem; color: var(--text-muted); }

.dgc-stats-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.04);
  padding: 10px 12px;
  border-radius: 2px;
  border: 2px solid rgba(0,0,0,0.08);
}
.dgc-stats { display: flex; gap: 14px; }
.d-stat { display: flex; flex-direction: column; gap: 2px; }
.d-stat span { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: bold; letter-spacing: 0.5px; }
.d-stat strong { font-size: 1rem; color: var(--text-main); }
.color-purple { color: #6E44FF !important; }
.color-green  { color: #22C55E !important; }
.color-red    { color: #EF4444 !important; }
.color-blue   { color: #3B82F6 !important; }
.color-orange { color: #F97316 !important; }
.color-yellow { color: #EAB308 !important; }

/* Pixel-style play button */
.dgc-play-btn {
  font-family: 'Press Start 2P', monospace !important;
  font-size: 0.6rem !important;
  padding: 10px 16px;
  border-radius: 2px !important;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.dgc-play-btn:active { transform: translateY(3px) !important; }

.btn-green  { background: #22C55E; color: #000; box-shadow: 0 4px 0 #166534; }
.btn-green:hover { background: #16A34A; }
.btn-green:active { box-shadow: 0 1px 0 #166534 !important; }
.btn-red    { background: #EF4444; color: #fff; box-shadow: 0 4px 0 #991b1b; }
.btn-red:hover { background: #DC2626; }
.btn-red:active { box-shadow: 0 1px 0 #991b1b !important; }
.btn-blue   { background: #3B82F6; color: #fff; box-shadow: 0 4px 0 #1d4ed8; }
.btn-blue:hover { background: #2563EB; }
.btn-blue:active { box-shadow: 0 1px 0 #1d4ed8 !important; }
.btn-orange { background: #F97316; color: #fff; box-shadow: 0 4px 0 #c2410c; }
.btn-orange:hover { background: #EA580C; }
.btn-orange:active { box-shadow: 0 1px 0 #c2410c !important; }
.btn-teal   { background: #10B981; color: #000; box-shadow: 0 4px 0 #065f46; }
.btn-teal:hover { background: #059669; }
.btn-teal:active { box-shadow: 0 1px 0 #065f46 !important; }
.btn-purple { background: #6E44FF; color: #fff; box-shadow: 0 4px 0 #3b0764; }
.btn-purple:hover { background: #5b21b6; }
.btn-purple:active { box-shadow: 0 1px 0 #3b0764 !important; }

.games-hub-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; }
.footer-mascot-msg { display: flex; align-items: flex-end; gap: 12px; }
.footer-avatar { width: 70px; height: 70px; border-radius: 4px; image-rendering: pixelated; }
.speech-bubble { background: var(--card-bg); border: 2px solid rgba(0,0,0,0.12); border-radius: 4px; border-bottom-left-radius: 0; padding: 12px 18px; box-shadow: 3px 3px 0 rgba(0,0,0,0.08); font-weight: bold; font-family: 'Kalam', cursive; font-size: 1.1rem; }

.footer-stats-box { flex: 1; display: flex; justify-content: space-around; padding: 20px; align-items: center; }
.f-stat-col { display: flex; align-items: center; gap: 14px; }
.f-stat-col div { display: flex; flex-direction: column; gap: 2px; }
.f-stat-col span { font-size: 0.85rem; color: var(--text-muted); font-weight: bold; }
.f-stat-col strong { font-size: 1.2rem; color: var(--text-main); }
.reward-col { min-width: 250px; background: rgba(0,0,0,0.02); padding: 10px 16px; border-radius: 4px; border: 2px solid rgba(0,0,0,0.08); }


/* Playable Mini Game Modal */
.game-modal-card { max-width: 550px; width: 90%; display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.game-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed #E2E8F0; padding-bottom: 10px; }
.game-arena { display: flex; flex-direction: column; gap: 14px; }
.game-score-row { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: bold; background: #F1F5F9; padding: 8px 16px; border-radius: 10px; }
.falling-words-box { background: #FAF5FF; border: 2px solid #E9D5FF; border-radius: 14px; min-height: 180px; position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; padding: 14px; }
.falling-word { background: #DDD6FE; color: #5B21B6; font-weight: bold; padding: 4px 12px; border-radius: 8px; animation: floatDown 4s linear infinite; }

@keyframes floatDown { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(150px) rotate(8deg); opacity: 0; } }
.falling-word { background: #DDD6FE; color: #5B21B6; font-weight: bold; padding: 4px 12px; border-radius: 8px; animation: floatDown 4s linear forwards; transition: transform 0.15s ease, background 0.15s ease; }
.falling-word:hover { background: #6E44FF; color: #fff; transform: scale(1.05); }

/* Leaderboard */
.leaderboard-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.leaderboard-table-card { display: flex; flex-direction: column; gap: 14px; }

/* Leaderboard Podium Cards */
.podium-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin: 10px 0 24px 0;
    padding: 10px 0;
}
.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 2px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    position: relative;
    width: 140px;
    transition: transform 0.25s ease;
}
.podium-card:hover { transform: translateY(-4px); }
.silver-podium { border-color: #CBD5E1; background: linear-gradient(180deg, #F8FAFC, #F1F5F9); }
.gold-podium { border-color: #F59E0B; background: linear-gradient(180deg, #FEF3C7, #FDE68A); width: 160px; transform: scale(1.06); }
.gold-podium:hover { transform: scale(1.08) translateY(-4px); }
.bronze-podium { border-color: #F97316; background: linear-gradient(180deg, #FFEDD5, #FED7AA); }

.crown-icon { font-size: 1.6rem; margin-bottom: -6px; animation: bounceCrown 2s infinite ease-in-out; }
@keyframes bounceCrown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.podium-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 12px;
    background: #E2E8F0;
    color: #475569;
    margin-bottom: 8px;
}
.gold-badge { background: #F59E0B; color: #FFF; }
.podium-avatar { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid #FFF; box-shadow: 0 4px 10px rgba(0,0,0,0.15); margin-bottom: 6px; }
.gold-avatar { width: 56px; height: 56px; border-color: #F59E0B; }
.podium-name { font-weight: 800; font-size: 0.95rem; color: var(--text-main); text-align: center; }
.podium-score { font-weight: 800; font-size: 1.1rem; color: var(--primary-purple); margin-top: 2px; }
.gold-score { font-size: 1.25rem; color: #D97706; }
.podium-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.rank-pill { display: inline-block; padding: 4px 10px; border-radius: 12px; font-weight: 800; font-size: 0.8rem; background: rgba(0,0,0,0.05); }
.rank-gold { background: #FEF3C7; color: #D97706; border: 1px solid #F59E0B; }
.rank-silver { background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; }
.rank-bronze { background: #FFEDD5; color: #C2410C; border: 1px solid #F97316; }
.rank-user { background: #EDE9FE; color: #6E44FF; border: 1px solid #8B5CF6; }
.badge-you { background: #6E44FF; color: #FFF; font-size: 0.62rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin-left: 4px; vertical-align: middle; }

.leader-table { width: 100%; border-collapse: collapse; text-align: left; }
.leader-table th, .leader-table td { padding: 12px 14px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.leader-table th { color: var(--text-muted); font-size: 0.95rem; }
.player-cell { display: flex; align-items: center; gap: 10px; }
.tbl-avatar { width: 32px; height: 32px; border-radius: 50%; }
.rank-1 { background: #FEF9C3; font-weight: bold; }
.rank-2 { background: #F1F5F9; font-weight: bold; }
.rank-3 { background: #FFEDD5; font-weight: bold; }
.rank-you { background: #EDE9FE; color: #5B21B6; font-weight: bold; border-left: 4px solid var(--primary-purple); }
.leaderboard-footer { text-align: center; color: var(--primary-purple); font-weight: bold; font-size: 1.1rem; margin-top: 10px; }

/* Achievements */
.achievements-screen-layout { display: flex; flex-direction: column; gap: 16px; width: 100%; }

/* Header Bar */
.ach-header-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
    border-radius: 16px; padding: 16px 22px;
    box-shadow: 0 8px 24px rgba(110,68,255,0.18);
}
.ach-header-left { display: flex; align-items: center; gap: 14px; }
.ach-page-title { margin: 0; font-size: 1.3rem; font-weight: 800; color: #F8FAFC; letter-spacing: -0.3px; }
.ach-progress-pill {
    background: rgba(110,68,255,0.25); color: #C4B5FD;
    border: 1px solid rgba(139,92,246,0.4); border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; padding: 3px 12px;
}
.ach-header-right { display: flex; gap: 22px; }
.ach-summary-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ach-sum-val { font-size: 1.4rem; font-weight: 900; color: #F8FAFC; line-height: 1; }
.ach-sum-lbl { font-size: 0.65rem; color: #94A3B8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Filter Pills */
.ach-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.ach-filter-pill {
    padding: 5px 14px; border-radius: 20px; border: 1.5px solid rgba(110,68,255,0.2);
    background: transparent; color: var(--text-muted); font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}
.ach-filter-pill:hover { border-color: rgba(110,68,255,0.5); color: var(--primary-purple); background: rgba(110,68,255,0.06); }
.ach-filter-pill.active { background: var(--primary-purple); color: #fff; border-color: var(--primary-purple); box-shadow: 0 3px 10px rgba(110,68,255,0.3); }

/* Achievement Grid */
.achievements-full-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.achieve-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 14px 14px 12px;
    border-radius: 14px;
    border: 1.5px solid rgba(0,0,0,0.07);
    background: rgba(255,255,255,0.85);
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative; overflow: hidden;
}
.achieve-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: transparent; transition: background 0.3s ease;
    border-radius: 14px 14px 0 0;
}
.achieve-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.1); }
.unlocked-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(245,243,255,0.95));
    border-color: rgba(110,68,255,0.3);
    box-shadow: 0 4px 16px rgba(110,68,255,0.1);
}
.unlocked-card::before { background: linear-gradient(90deg, #6E44FF, #a78bfa); }
.achieve-card.locked { opacity: 0.55; filter: grayscale(0.6); }
.achieve-card.locked:hover { transform: none; box-shadow: none; }

/* Card Top Row */
.ach-card-top { display: flex; align-items: center; gap: 10px; }
.ach-icon-box {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ach-card-meta { flex: 1; min-width: 0; }
.ach-title-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 2px; }
.ach-title-row h4 { margin: 0; font-size: 0.84rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-unlocked { background: #DCFCE7; color: #15803D; font-size: 0.58rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; border: 1px solid #86EFAC; flex-shrink: 0; }
.ach-card-meta p { margin: 0; font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }

/* Progress Bar inside card */
.ach-progress-wrap { display: flex; flex-direction: column; gap: 3px; }
.ach-prog-track { height: 4px; background: rgba(0,0,0,0.07); border-radius: 4px; overflow: hidden; }
.ach-prog-fill { height: 100%; border-radius: 4px; transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.ach-prog-labels { display: flex; justify-content: space-between; }
.ach-prog-labels span { font-size: 0.64rem; color: var(--text-muted); font-weight: 600; }

.achieve-footer-msg { text-align: center; color: var(--primary-purple); font-weight: 700; font-size: 0.95rem; margin-top: 6px; opacity: 0.8; }


/* Settings */
.settings-screen-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.settings-main-card { display: flex; flex-direction: column; gap: 18px; position: relative; }
.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 450px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
.setting-select { padding: 6px 14px; border-radius: 10px; border: 1.5px solid #CBD5E1; font-family: inherit; font-size: 1rem; }
.toggle-switch { width: 44px; height: 24px; accent-color: var(--primary-purple); cursor: pointer; }
.settings-sticky { position: absolute; right: 30px; top: 40px; transform: rotate(-3deg); }



/* Themes Customizer */
.themes-screen-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.themes-main-card { display: flex; flex-direction: column; gap: 18px; position: relative; }
.theme-cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.theme-picker-card { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center; border: 2px solid transparent; transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease; border-radius: 14px; padding: 12px 8px; position: relative; }
.theme-picker-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.theme-picker-card.active { border-color: var(--primary-purple) !important; box-shadow: 0 0 0 3px rgba(110,68,255,0.3), 0 8px 24px rgba(0,0,0,0.15) !important; transform: translateY(-3px); }
.theme-preview { width: 100%; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #FFF; }
.preview-paper { background: linear-gradient(135deg, #F6F3EB, #FFFFFF); color: #2D3748; border: 1.5px solid #CBD5E1; }
.preview-dark { background: linear-gradient(135deg, #09090B, #18181B); border: 1.5px solid #27272A; }
.preview-neon { background: linear-gradient(135deg, #030712, #0B0F19); border: 1.5px solid #C084FC; }
.preview-forest { background: linear-gradient(135deg, #022C22, #064E3B); border: 1.5px solid #047857; }
.preview-ocean { background: linear-gradient(135deg, #082F49, #075985); border: 1.5px solid #0284C7; }

.fonts-cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.font-picker-card { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 12px; cursor: pointer; border: 2px solid transparent; text-align: center; transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, background 0.22s ease; border-radius: 14px; position: relative; }
.font-picker-card:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 6px 16px rgba(0,0,0,0.09); background: rgba(110,68,255,0.08); }
.font-picker-card.active { border-color: var(--primary-purple) !important; background: var(--pill-active-bg) !important; color: var(--pill-active-text) !important; box-shadow: 0 0 0 3px rgba(110,68,255,0.3), 0 8px 24px rgba(0,0,0,0.15) !important; transform: translateY(-3px); }
.font-picker-card.active h2, .font-picker-card.active span { color: #FFFFFF !important; }

/* Active Check Pill Badge */
.active-check-pill {
    display: none;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    background: #10B981;
    color: #FFFFFF !important;
    margin-top: 4px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.45);
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.theme-picker-card.active .active-check-pill,
.font-picker-card.active .active-check-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    animation: activePillPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes activePillPop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.theme-sticky { position: absolute; right: 30px; bottom: 20px; transform: rotate(-2deg); }

/* Footer */
.main-footer { display: flex; justify-content: center; padding: 16px; background: var(--card-bg); border: 1.5px solid rgba(0,0,0,0.08); border-radius: 16px; margin-top: 20px; }
.footer-single-row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; max-width: 1000px; gap: 20px; }
.footer-copyright-link { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.footer-social-icons { display: flex; align-items: center; gap: 12px; }
.footer-social-icons a { color: var(--text-muted); transition: color 0.2s ease, transform 0.2s ease; }
.footer-social-icons a:hover { color: var(--primary-purple); transform: translateY(-2px); }
.buy-website-btn { background: rgba(110,68,255,0.1); color: var(--primary-purple); padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: bold; font-size: 0.95rem; transition: background 0.2s ease, transform 0.2s ease; }
.buy-website-btn:hover { background: rgba(110,68,255,0.2); transform: translateY(-2px); }

/* Modal Overlay */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.hidden { display: none !important; }
.result-modal-card { max-width: 420px; width: 90%; text-align: center; padding: 32px 24px; }
.modal-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.modal-stat-box { background: rgba(0,0,0,0.03); padding: 12px; border-radius: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* Game Modal CSS */
.game-modal-card { width: 90%; max-width: 600px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.game-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed rgba(0,0,0,0.1); padding-bottom: 12px; }
.game-arena { display: flex; flex-direction: column; gap: 12px; }
.game-score-row { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.1rem; color: var(--primary-purple); }
.falling-words-box { height: 300px; background: rgba(0,0,0,0.02); border: 2px solid #CBD5E1; border-radius: 14px; position: relative; overflow: hidden; }
.falling-word { position: absolute; font-size: 1.2rem; font-weight: bold; color: #334155; padding: 4px 10px; background: #FFF; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: top 0.05s linear; white-space: nowrap; }
.falling-word.danger { color: #DC2626; border: 1.5px solid #DC2626; background: #FEE2E2; }
.typing-input-field { width: 100%; padding: 14px; border-radius: 12px; border: 2px solid #CBD5E1; font-size: 1.2rem; font-family: inherit; font-weight: bold; outline: none; transition: border-color 0.2s ease; text-align: center; }
.typing-input-field:focus { border-color: var(--primary-purple); }

/* Settings View Styling */
.settings-screen-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.settings-main-card { position: relative; min-height: 480px; display: flex; flex-direction: column; padding: 24px; }
.settings-tab-panel { display: none; flex-direction: column; gap: 20px; animation: settingsPanelFade 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.settings-tab-panel.active { display: flex; }

@keyframes settingsPanelFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-panel-header { border-bottom: 1.5px dashed rgba(0,0,0,0.1); padding-bottom: 12px; margin-bottom: 4px; }
.settings-panel-header h3 { font-size: 1.25rem; color: var(--primary-purple); font-weight: 700; margin-bottom: 4px; }
.settings-panel-header p { font-size: 0.9rem; color: var(--text-muted); }

/* Compact Settings Grid */
.settings-grid-compact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.setting-item-compact { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: rgba(0,0,0,0.02); border: 1.5px solid rgba(0,0,0,0.06); border-radius: 14px; transition: border-color 0.2s ease, background 0.2s ease; }
.setting-item-compact:hover { border-color: rgba(110,68,255,0.3); background: rgba(110,68,255,0.03); }
.setting-item-compact.full-width { grid-column: 1 / -1; }

.setting-meta { display: flex; flex-direction: column; gap: 2px; }
.setting-meta h4 { font-size: 0.98rem; font-weight: 700; color: var(--text-main); margin: 0; }
.setting-meta p { font-size: 0.82rem; color: var(--text-muted); margin: 0; max-width: 260px; line-height: 1.3; }

/* Live Preview Card */
.settings-preview-card { margin-top: 10px; background: rgba(0,0,0,0.03); border: 1.5px solid rgba(110,68,255,0.2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.preview-card-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 0.88rem; color: var(--primary-purple); }
.preview-badge { font-size: 0.75rem; background: rgba(110,68,255,0.12); color: var(--primary-purple); padding: 2px 8px; border-radius: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.preview-text-box { background: var(--card-bg, #FFFFFF); border: 1.5px solid rgba(0,0,0,0.08); border-radius: 10px; padding: 16px 20px; font-family: inherit; font-size: 1.5rem; font-weight: 600; line-height: 1.5; color: var(--text-main); text-align: center; }
.preview-text-box .correct-text { color: #10B981; }
.preview-text-box .pending-text { color: var(--text-muted); opacity: 0.5; }
.preview-caret { color: var(--primary-purple); display: inline-block; font-weight: bold; }

/* Sound Pack Selector Row */
.sound-pack-row { display: flex; align-items: center; gap: 8px; }
.sound-pack-row .btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }

/* Account & Data Actions */
.account-settings-card { background: rgba(0,0,0,0.02); border: 1.5px solid rgba(0,0,0,0.06); border-radius: 14px; padding: 18px; }
.account-mini-profile { display: flex; align-items: center; gap: 16px; }
.account-avatar-preview { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid var(--primary-purple); object-fit: cover; }
.account-info h4 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.account-badge { font-size: 0.85rem; font-weight: 700; color: #5B21B6; background: #EDE9FE; padding: 3px 10px; border-radius: 12px; }

.data-actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.btn-danger { background: #EF4444; color: #FFFFFF; border: none; padding: 10px 18px; border-radius: 10px; font-weight: 700; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.btn-danger:hover { background: #DC2626; transform: translateY(-2px); }

/* Auto-Save Toast */
.settings-toast { position: absolute; top: 16px; right: 20px; background: #10B981; color: #FFFFFF; font-weight: 700; font-size: 0.85rem; padding: 6px 14px; border-radius: 20px; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35); animation: toastPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; z-index: 10; }
@keyframes toastPop {
    from { opacity: 0; transform: translateY(-10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Switch Toggle Custom Checkbox */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #CBD5E1; transition: .3s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .3s; }
input:checked + .slider { background-color: #22C55E; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
input:focus + .slider { box-shadow: 0 0 1px #22C55E; }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* Settings Select and Buttons */
.settings-select { padding: 7px 12px; border-radius: 10px; border: 1.5px solid #CBD5E1; font-family: inherit; font-weight: bold; color: var(--text-main); outline: none; background: var(--card-bg, #F8FAFC); cursor: pointer; font-size: 0.9rem; transition: border-color 0.2s ease; }
.settings-select:focus { border-color: var(--primary-purple); }

.btn-group-toggle { display: flex; background: rgba(0,0,0,0.05); border-radius: 10px; padding: 3px; gap: 2px; }
.btn-toggle { background: transparent; border: none; padding: 5px 12px; font-weight: 700; border-radius: 8px; cursor: pointer; color: var(--text-muted); transition: all 0.2s ease; font-family: inherit; font-size: 0.85rem; }
.btn-toggle.active { background: var(--card-bg, #FFFFFF); color: var(--primary-purple); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.settings-footer { display: flex; gap: 16px; margin-top: 20px; }

/* Profile View Styling */
.profile-layout { display: flex; flex-direction: column; gap: 24px; padding: 10px 0; }
.profile-header-card { display: flex; flex-direction: column; gap: 20px; }
.profile-header-main { display: flex; align-items: center; gap: 20px; }
.profile-avatar-large { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--primary-purple); box-shadow: 0 4px 10px rgba(110,68,255,0.2); }
.profile-user-info h2 { font-size: 1.8rem; color: var(--text-main); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.profile-user-info .join-date { color: var(--text-muted); font-size: 0.95rem; }
.profile-level-box { display: flex; align-items: center; gap: 20px; background: rgba(0,0,0,0.02); padding: 16px; border-radius: 12px; border: 1.5px dashed rgba(0,0,0,0.1); }
.level-badge-large { display: flex; flex-direction: column; align-items: center; background: #FFF; padding: 10px 20px; border-radius: 12px; border: 2px solid #F59E0B; box-shadow: 0 4px 0 #F59E0B; }
.level-badge-large .lvl-label { font-size: 0.8rem; font-weight: bold; color: #D97706; text-transform: uppercase; letter-spacing: 1px; }
.level-badge-large strong { font-size: 1.8rem; color: #B45309; }
.xp-progress-container { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.xp-progress-bar { height: 12px; background: #E2E8F0; border-radius: 10px; overflow: hidden; }
.xp-progress-fill { height: 100%; background: linear-gradient(90deg, #F59E0B, #FBBF24); border-radius: 10px; transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.xp-text-row { display: flex; justify-content: space-between; font-size: 0.9rem; font-weight: bold; color: var(--text-muted); }

/* Header Active Theme Badge Widget */
.theme-badge-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(110, 68, 255, 0.08);
    border: 1.5px solid var(--primary-purple);
    color: var(--primary-purple);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-badge-widget:hover {
    background: var(--primary-purple);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(110, 68, 255, 0.25);
}

.profile-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.p-stat-card { display: flex; align-items: center; gap: 16px; padding: 20px; transition: transform 0.2s ease; }
.p-stat-card:hover { transform: translateY(-3px); }
.p-stat-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.p-stat-icon.purple-bg { background: #EDE9FE; }
.p-stat-icon.green-bg { background: #DCFCE7; }
.p-stat-icon.blue-bg { background: #DBEAFE; }
.p-stat-icon.orange-bg { background: #FFEDD5; }
.p-stat-details { display: flex; flex-direction: column; }
.p-stat-details span { font-size: 0.9rem; color: var(--text-muted); font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.p-stat-details strong { font-size: 1.6rem; }

.activity-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1.5px solid rgba(0,0,0,0.05); }
.activity-item:last-child { border-bottom: none; }
.activity-info { display: flex; align-items: center; gap: 12px; }
.activity-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: rgba(0,0,0,0.03); border-radius: 50%; }
.activity-details h4 { font-size: 1.1rem; color: var(--text-main); }
.activity-details p { font-size: 0.9rem; color: var(--text-muted); }
.activity-stats { text-align: right; }
.activity-stats strong { display: block; font-size: 1.1rem; color: var(--primary-purple); }
.activity-stats span { font-size: 0.85rem; color: var(--text-muted); }

.activity-stats { text-align: right; }
.activity-stats strong { display: block; font-size: 1.1rem; color: var(--primary-purple); }
.activity-stats span { font-size: 0.85rem; color: var(--text-muted); }

/* Edit Profile Modal Styling */
.edit-profile-btn { margin-left: auto; width: 44px; height: 44px; background: rgba(110,68,255,0.1); color: var(--primary-purple); border-radius: 12px; transition: all 0.2s; }
.edit-profile-btn:hover { background: var(--primary-purple); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(110,68,255,0.3); }
.edit-profile-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 0.95rem; font-weight: bold; color: var(--text-main); }
.avatar-select-grid { display: flex; gap: 12px; margin-bottom: 8px; }
.avatar-option { width: 60px; height: 60px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform 0.2s, border-color 0.2s; opacity: 0.6; }
.avatar-option:hover { transform: scale(1.1); opacity: 0.8; }
.avatar-option.selected { border-color: var(--primary-purple); opacity: 1; transform: scale(1.1); box-shadow: 0 4px 10px rgba(110,68,255,0.2); }
.edit-profile-form .settings-select, .edit-profile-form .typing-input-field { width: 100%; box-sizing: border-box; }
.edit-profile-form .typing-input-field { padding: 10px 14px; font-size: 1rem; border-radius: 8px; border: 1.5px solid #CBD5E1; }
.edit-profile-form .typing-input-field:focus { border-color: var(--primary-purple); outline: none; }
/* Heatmap Design */
.heatmap-grid { display: flex; gap: 6px; justify-content: space-between; margin-top: 12px; }
.heatmap-box { width: 18px; height: 18px; border-radius: 4px; background: rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s, border 0.2s; position: relative; }
.heatmap-box:hover { transform: scale(1.3); z-index: 10; border: 1.5px solid rgba(0,0,0,0.3); }
.heatmap-box.level-1 { background: #BBF7D0; }
.heatmap-box.level-2 { background: #4ADE80; }
.heatmap-box.level-3 { background: #16A34A; }
.heatmap-box.level-4 { background: #14532D; }
.heatmap-box.today-box { border: 2px dashed #F97316; }
.heatmap-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; color: var(--text-muted); font-weight: bold; text-transform: uppercase; padding: 0 2px; }


/* Footer Styling Update */
.main-footer { display: flex; margin-top: auto; padding: 24px; background: var(--card-bg); border-radius: 20px; align-items: center; justify-content: center; border: 2px solid rgba(0,0,0,0.08); font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.footer-single-row { display: flex; flex-direction: row; justify-content: space-between; align-items: center; width: 100%; max-width: 1000px; gap: 20px; }
.footer-copyright-link { color: var(--text-muted); text-decoration: none; font-size: 1rem; transition: color 0.2s; white-space: nowrap; }
.footer-copyright-link:hover { color: var(--primary-purple); text-decoration: underline; }
.footer-social-icons { display: flex; gap: 16px; flex: 1; justify-content: center; }
.social-icon { color: var(--text-muted); transition: color 0.2s, transform 0.2s; display: flex; align-items: center; justify-content: center; }
.social-icon:hover { color: var(--primary-purple); transform: scale(1.1); }
.char-correct { color: var(--primary-purple); text-shadow: 0 0 10px rgba(110,68,255,0.4); }
.char-error { color: #EF4444; background: rgba(239,68,68,0.15); border-radius: 4px; text-decoration: underline; text-decoration-color: #EF4444; text-decoration-thickness: 2px; }
.char-error-flash { background: rgba(239,68,68,0.6) !important; color: white !important; border-radius: 4px; transition: background 0.1s; }

/* Blind Mode */
.blind-mode-active .char-pending { opacity: 0; color: transparent; background: transparent; text-shadow: none; }
.blind-mode-active .char-active { opacity: 1; border-left-color: var(--primary-purple); }
.buy-website-btn { background: #10B981; color: white; padding: 10px 24px; border-radius: 30px; text-decoration: none; font-size: 1rem; display: inline-block; transition: all 0.2s; box-shadow: 0 4px 10px rgba(16,185,129,0.3); border: 2px solid #059669; white-space: nowrap; }
.buy-website-btn:hover { background: #059669; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16,185,129,0.4); }

@media (max-width: 1024px) {
    .app-body, .practice-screen-layout, .dashboard-grid-layout { grid-template-columns: 1fr; }
    .modes-grid, .achievements-full-grid, .theme-cards-grid, .fonts-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-single-row { gap: 10px; }
    .footer-copyright-link { font-size: 0.85rem; }
    .buy-website-btn { padding: 8px 16px; font-size: 0.85rem; }
}

/* ==========================================================================
   MODAL OVERLAYS & GAME IFRAME POPUP
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 5, 25, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.hidden {
    display: none !important;
}
