/**
 * MathCats and Horses - Modern Kids-Friendly Theme Styles
 * Dla dzieci w wieku 10-15 lat
 */

:root {
    /* Podstawowe kolory */
    --primary-color: #6a11cb;
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --secondary-gradient: linear-gradient(135deg, #989ebb 0%, #71667c 100%);
    --light-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Kolory rzadkości */
    --color-common: #6c757d;
    --color-uncommon: #0d6efd;
    --color-rare: #0dcaf0;
    --color-epic: #ffc107;
    --color-legendary: #dc3545;
    
    /* Cienie dla rzadkości */
    --shadow-common: rgba(108, 117, 125, 0.6);
    --shadow-uncommon: rgba(13, 110, 253, 0.6);
    --shadow-rare: rgba(13, 202, 240, 0.6);
    --shadow-epic: rgba(255, 193, 7, 0.6);
    --shadow-legendary: rgba(220, 53, 69, 0.6);
    
    /* Kolory kategorii */
    --cat-color: #ff9800;
    --horse-color: #4caf50;
    
    /* Inne kolory */
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --red: #dc3545;
}


/* ==== PODSTAWOWE STYLE ==== */
body {
    font-family: "Playpen Sans", Arial, sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    background-color: #f9f9f9;
    margin: 0; /* prevent default 8px margin creating white borders */
}

.red {
    color: var(--red);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#wprowadzenie-form p strong {
    color: #6518ce;
    font-weight: 700;
}
.wprowadzenie-step .avatar-desc {
    width: calc(100% - 30px);
}

/* ==== STRONA GŁÓWNA - HERO SECTION ==== */
.home .container-fluid {
    max-width: 1680px;
}

.mathcats-hero {
    background: var(--hero-gradient);
    position: relative; /* anchor ::before overlay */
    display: flex; /* for vertical centering */
    align-items: center;
    min-height: 100dvh; /* dynamic viewport height (mobile-safe) */
    box-sizing: border-box; /* include padding in the block size */
    padding-block: clamp(24px, 6vh, 80px); /* avoid adding fixed 80px to 100vh */
    overflow: hidden; /* hide any bleed from inner effects */
}

.mathcats-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Ensure inner grid stretches to enable full-height alignment */
.mathcats-hero > .container-fluid { height: 100%; }
.mathcats-hero > .container-fluid > .row { height: 100%; }

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 40px;
}

.hero-text-wrapper {
    max-width: 768px;
}

.home > header {
    display: none !important;
}

.hero-badge {
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge .badge {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-description .text-primary {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease-out 0.6s both;
    opacity: 0;
    box-shadow: 0 15px 25px rgba(106, 17, 203, 0.2);
}

.feature-item.animate-in {
    opacity: 1;
}

.feature-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.feature-text {
    color: white;
}

.feature-text strong {
    font-size: 1.1rem;
}

.feature-text small {
    opacity: 0.8;
    font-size: 0.9rem;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.btn-gradient {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border: none;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

.btn-outline-primary {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    color: white;
    transform: translateY(-2px);
}

/* ==== SLIDER SECTION ==== */
.hero-slider-section {
    position: relative;
    z-index: 2;
    padding: 0 40px;
}

.slider-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 25px rgba(106, 17, 203, 0.2);
}

.slider-header {
    text-align: center;
    margin-bottom: 30px;
}

.slider-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.slider-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ==== SWIPER CARDS SLIDER ==== */
.mySwiper {
    width: 240px;
    height: 300px;
    margin: 30px auto;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Kolorowe tła dla slajdów jak w przykładzie */
.swiper-slide.slide-1 { background-color: rgb(206, 17, 17); }
.swiper-slide.slide-2 { background-color: rgb(0, 140, 255); }
.swiper-slide.slide-3 { background-color: rgb(10, 184, 111); }
.swiper-slide.slide-4 { background-color: rgb(211, 122, 7); }
.swiper-slide.slide-5 { background-color: rgb(118, 163, 12); }
.swiper-slide.slide-6 { background-color: rgb(180, 10, 47); }
.swiper-slide.slide-7 { background-color: rgb(35, 99, 19); }
.swiper-slide.slide-8 { background-color: rgb(0, 68, 255); }
.swiper-slide.slide-9 { background-color: rgb(218, 12, 218); }
.swiper-slide.slide-10 { background-color: rgb(54, 94, 77); }
.swiper-slide.slide-11 { background-color: rgb(255, 165, 0); }
.swiper-slide.slide-12 { background-color: rgb(128, 0, 128); }

.home .award-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    text-align: center;
}

.home .award-image-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.home .award-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home .award-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.home .award-type-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.home .award-rarity {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.home .award-points {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
}

/* ==== SLIDER STATS ==== */
.slider-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 25px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: white;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--primary-gradient);
    border-radius: 20px;
    padding: 25px 20px;
    min-width: 140px;
    box-shadow: 0 10px 30px rgba(106, 17, 203, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stat-item:nth-child(2) {
    background: var(--secondary-gradient);
    box-shadow: 0 10px 30px rgba(152, 158, 187, 0.3);
}

.stat-item:nth-child(3) {
    background: var(--hero-gradient);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-item.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(106, 17, 203, 0.4);
}

.stat-item:nth-child(2):hover {
    box-shadow: 0 15px 40px rgba(152, 158, 187, 0.4);
}

.stat-item:nth-child(3):hover {
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    position: relative;
    z-index: 2;
}

.home .stat-label {
    color: #fff;
    font-size: 12px;
}

.home .stat-item {
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.home .stat-item div {
    flex: 0 0 100%;
    margin: 5px 0;
}

/* ==== ANIMATIONS ==== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loginRegister img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
}

.loginRegister .card-header p {
    font-size: 14px;
    font-weight: 500;
}

/* Dodatkowe style dla nagłówka - pozostałe style są w mathcats-style.css */
.navbar {
    background: var(--primary-gradient) !important;
    padding: 15px 0;
}

.navbar-brand .brand-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Avatar w nagłówku */
.avatar-toggle {
    cursor: pointer;
    padding: 5px;
    border-radius: 50px;
    transition: all 0.3s;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-status {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    bottom: 3px;
    right: 3px;
    border: 2px solid white;
}

/* Animowany efekt hover na avatar */
.avatar-toggle img {
    border: 2px solid rgba(255,255,255,0.8);
    transition: all 0.3s;
    border-radius: 200px;
    overflow: hidden;
}

.avatar-toggle:hover img {
    border-color: white;
    transform: scale(1.05);
}

/* ==== SIDEBAR LIST GROUP (Klasy / Działy) ==== */
.list-group.list-group-flush .list-group-item.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

.list-group.list-group-flush .list-group-item.list-group-item-action:hover {
    background-color: rgba(106, 17, 203, 0.06);
}

.list-group-item .d-flex small {
    flex: 0 0 110px;
}

/* usuń górne zaokrąglenia tylko dla pierwszego AKTYWNEGO elementu */
.list-group.list-group-flush .list-group-item:first-child.active {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
}

/* ==== LEADERBOARD (Ranking) ==== */
.podium-card {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  position: relative;
}

.podium-card .podium-rank {
  font-size: 24px;
}

.podium-avatar .avatar-96 {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.avatar-48 {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.podium-gold { background: linear-gradient(180deg, #fff8e1, #fff); border: 2px solid #f9d56e; }
.podium-silver { background: linear-gradient(180deg, #f3f6fb, #fff); border: 2px solid #cfd8dc; }
.podium-bronze { background: linear-gradient(180deg, #fff1e6, #fff); border: 2px solid #e0a37d; }

/* Podium: gradientowy tytuł i badge XP */
.podium-card .podium-name {
  font-weight: 700;
  background: linear-gradient(90deg, #7c4dff, #b388ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.podium-card .podium-xp.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6a1b9a, #8e24aa, #ab47bc);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 14px rgba(171, 71, 188, 0.35);
}

.podium-card .podium-xp .xp-text {
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: .3px;
}

/* Podium medal w badge XP (bez pozycjonowania absolutnego) */
.podium-avatar { display: inline-block; }
.podium-card .podium-xp .podium-rank {
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em !important;
  height: 1.5em !important;
  font-size: 1.5em;
  line-height: 1;
}

.leaderboard-table-container { margin-top: 8px; }
.leaderboard-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
  width: max-content; /* dopasuj się do treści */
  min-width: 100%;   /* ale nie mniejsze niż kontener */
}

/* Pozycja: sztywno 100px */
.leaderboard-table .rank-column,
.leaderboard-table .rank-cell {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* Pozostałe kolumny auto – bez sticky */
.leaderboard-table thead th { position: static; font-size: 12px;}
.leaderboard-table .player-cell,
.leaderboard-table .points-cell,
.leaderboard-table .streak-cell,
.leaderboard-table .awards-cell,
.leaderboard-table .achievements-cell { position: static; background: transparent; z-index: auto; }
.leaderboard-table thead th {
  background: var(--secondary-gradient);
  color: #fff;
  font-weight: 700;
  letter-spacing: .3px;
}

.leaderboard-table tbody tr:hover { background: #f9fbff; }
.leaderboard-table .player-info { display: flex; align-items: center; gap: 12px; }
.leaderboard-table .player-avatar { position: relative; display: inline-block; }

.leaderboard-table .player-last-active {
    font-size: 10px;
}

.leaderboard-table .player-avatar .online-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #28a745; /* green */
  border: 1px solid #fff; /* white border */
  top: 2px;
  left: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}
.leaderboard-table .xp-badge { min-width: 86px; display: inline-block; text-align: right; }
.current-user-row { box-shadow: inset 2px 0 0 #198754; background: #f5fff8; }

/* Awards badges: border-only with purple count */
.leaderboard-table .awards-cell .badge {
  background: transparent !important;
  border: 1px solid #cfd8dc;
  color: #444;
  border-radius: 999px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-table .awards-cell .badge .count {
  color: #7c4dff; /* systemowy fiolet */
  font-size: 1.24em; /* powiększona o połowę */
  line-height: 1;
}

/* Kompaktowy tryb mobilny (bez ukrywania kolumn) */
h1.page-title, h1.entry-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.container-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==== NOTYFIKACJE ==== */

.notification-message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    max-width: 400px;
    animation: slideIn 0.5s ease forwards;
    backdrop-filter: blur(5px);
}

.notification-message.success {
    background-color: rgba(40, 167, 69, 0.95);
    border-left: 5px solid #1e7e34;
    color: white;
}

.notification-message.error {
    background-color: rgba(220, 53, 69, 0.95);
    border-left: 5px solid #bd2130;
    color: white;
}

.notification-icon {
    font-size: 24px;
    margin-right: 15px;
}

.notification-text {
    flex-grow: 1;
    font-weight: 500;
    font-size: 16px;
}

.notification-close {
    background: transparent;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    transition: opacity 0.3s;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

.notification-hide {
    animation: slideOut 0.5s ease forwards;
}

/* ==== PRZYCISKI ==== */
.btn {
    transition: all ease 0.3s;
    text-transform: uppercase !important;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    padding: 12px 25px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 8px;
    box-shadow: 0 10px 10px rgba(106, 17, 203, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 15px rgba(106, 17, 203, 0.15);
}

.btn-secondary {
    background: var(--secondary-gradient);
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-weight: bold;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.2);
}

.btn-outline-primary-white {
    color: white;
    border: 2px solid #fff
}

/* Auth header white text/icons */
.auth-card .card-header h1,
.auth-card .card-header .task-title,
.auth-card .card-header .task-title i,
.auth-card .card-header p {
    color: #fff !important;
}


/* ==== KARTY ==== */

.card {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    transition: all ease 0.3s;
    background-color: #fff !important;
}

.single-task .card {
    margin-bottom: 20px;
}

.card.shadow-sm {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

/* Achievements: sidebar list */
.nearest-achievements-container { /* default: no forced scroll */
    max-height: none;
    overflow: visible;
}

/* Enable vertical scrolling only when more than 3 items */
.nearest-achievements-container .row.with-scroll {
    max-height: 430px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; /* Firefox */
}

/* WebKit scrollbar styling */
.nearest-achievements-container .row.with-scroll::-webkit-scrollbar {
    width: 8px;
    height: 0; /* hide horizontal */
}
.nearest-achievements-container .row.with-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.nearest-achievements-container .row.with-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* Achievements preview (dashboard card) */
.achievements-preview {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 60px;
}
.achievements-preview .achievement-thumb {
    width: auto;
    height: 30px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.achievements-preview .achievement-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #6c757d;
}
.achievements-preview .achievement-icon i {
    font-size: 22px;
    line-height: 1;
}
.achievements-preview .achievement-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    height: 24px;
    border-radius: 999px;
    background: #eef3ff;
    color: #2f57eb;
    font-weight: 600;
    font-size: 12px;
}

.card.shadow-sm:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 18px;
}

/* ==== MOBILE TASK STICKY BAR + BOTTOM SHEET (Single Task) ==== */
/* Base hidden by default */
.task-mobile-bar,
.task-bottom-sheet,
.task-sheet-overlay { display: none; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

.gradient-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-header h3 {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-img-top .card-body {
    padding: 20px 10px 10px 10px;
}

/* ==== FORMULARZE ==== */
.form-control, .form-select {
    border-radius: 10px;
    padding: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.teacher-task-actions {
    width: 100%;
}

.teacher-task-search {
    min-width: 200px;
}

.teacher-task-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.teacher-task-search-input {
    width: 100%;
    padding-left: 44px;
    padding-right: 50px;
}

.teacher-task-search-icon {
    position: absolute;
    left: 14px;
    color: rgba(0,0,0,0.4);
    pointer-events: none;
}

.teacher-task-refresh {
    position: absolute;
    right: 10px;
    width: 38px;
    height: 38px;
    border: none;
    background: white;
    color: #5a5a5a;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: transform .2s ease, box-shadow .2s ease;
}

.teacher-task-refresh:hover {
    transform: rotate(-90deg) scale(1.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.16);
}

.teacher-task-refresh i {
    font-size: 16px;
}

.teacher-assignment-library {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teacher-assignment-library .form-select {
    flex: 1;
    padding-right: 48px;
}

.teacher-assignment-library-refresh {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #fff;
    color: #6236ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(98, 54, 255, 0.18);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.teacher-assignment-library-refresh:hover {
    transform: rotate(90deg);
    box-shadow: 0 6px 18px rgba(98, 54, 255, 0.25);
    background: #f5f1ff;
}

.teacher-assignment-library-refresh i {
    font-size: 16px;
}

.teacher-assignment-library-preview {
    margin-top: 10px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8f9ff;
    border: 1px solid rgba(98, 54, 255, 0.18);
    min-height: 64px;
}

.teacher-assignment-library-preview h6 {
    font-weight: 600;
    margin-bottom: 6px;
}

.teacher-assignment-library-preview p {
    margin-bottom: 0;
}

#teacher-task-content,
#teacher-task-hint {
    height: 162px !important;
}

.form-check {
    padding-left: 2em;
}

#difficulty-select {
    min-width: 100px;
}

.form-control:focus, .form-select:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.25);
}

label {
    font-weight: bold;
    margin-bottom: 8px;
}

/* ==== TABELE ==== */

table {
    border-radius: 10px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    margin-bottom: 1.5rem;
}

thead {
    background: var(--secondary-gradient);
    color: white;
}

th {
    padding: 15px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    border: none;
}

td {
    padding: 12px 15px;
    border: none;
    border-top: 1px solid #f2f2f2;
}

tbody tr {
    background-color: white;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

border-top {
    border-top: 1px solid #f2f2f2;
}

/* ==== PASEK POSTĘPU ==== */

.progress {
    height: 20px;
    border-radius: 50px;
    background-color: #f1f1f1;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.stat-content .progress {
    margin: 5px 5px 5px 20px;
    width: 100%;
}

.progress-bar {
    background: linear-gradient(45deg, #2575fc, #6a11cb);
    box-shadow: 0 3px 6px rgba(106, 17, 203, 0.3);
    padding: 0 2px;
}

/* ==== LISTY ==== */

.list-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.list-group-item {
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ==== NAGŁÓWKI SEKCJI ==== */

.section-header {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 10px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.single.single-task .section-header .task-title {
    font-size: 26px;
    line-height: 1.4;
}

/* iOS-safe: disable gradient text in task header to avoid invisible sup/sub/fractions */
.single.single-task .section-header .task-title {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #7e18a8 !important;
    -webkit-text-fill-color: #7e18a8 !important; /* Safari/WebKit */
}

/* Ensure superscripts/subscripts are visible in the header */
.single.single-task .section-header .task-title sup,
.single.single-task .section-header .task-title sub {
    color: #7e18a8 !important;
    -webkit-text-fill-color: #7e18a8 !important;
}

/* Ensure new mc-frac structure (and legacy .frac) uses solid color in header */
.single.single-task .section-header .task-title .mc-frac,
.single.single-task .section-header .task-title .mc-frac * {
    color: #7e18a8 !important;
    -webkit-text-fill-color: #7e18a8 !important;
}

.single.single-task .section-header .task-title .frac,
.single.single-task .section-header .task-title .frac span,
.single.single-task .section-header .task-title .frac sup {
    color: #7e18a8 !important;
    background: transparent !important;
}


/* Fraction rendering (mobile-safe) */
.mc-frac {display:inline-flex;flex-direction:column;align-items:center;justify-content:center;margin:0 .15em;vertical-align:middle;font-variant-numeric:lining-nums tabular-nums}
.mc-frac .mc-num,.mc-frac .mc-den{display:block;line-height:1}
.mc-frac .mc-num{padding-bottom:2px}
.mc-frac .mc-den{padding-top:2px}
.mc-frac .mc-bar{display:block;width:100%;height:1px;background:currentColor;opacity:.9;margin:0}
.single.single-task .mc-frac .mc-bar {
    color: #7e18a8 !important;
}


/* Award toast */
.mc-award-toast{position:fixed;left:50%;bottom:8%;transform:translateX(-50%) translateY(10px);background:rgba(30,30,30,.95);color:#fff;padding:10px 14px;border-radius:12px;box-shadow:0 10px 24px rgba(0,0,0,.25);z-index:9999;opacity:0;pointer-events:none;display:flex;align-items:center;gap:10px;font-weight:700}
.mc-award-toast.show{animation:mc-toast-pop 2.3s ease-out forwards}
.mc-award-toast img{width:36px;height:36px;object-fit:cover;border-radius:8px;flex:0 0 auto}
@keyframes mc-toast-pop{0%{opacity:0;transform:translateX(-50%) translateY(10px)}15%{opacity:1;transform:translateX(-50%) translateY(0)}80%{opacity:1}100%{opacity:0;transform:translateX(-50%) translateY(-6px)}}

/* Award modal */
.mc-award-modal{position:fixed;inset:0;background:rgba(10,10,10,.6);backdrop-filter:saturate(120%) blur(2px);display:flex;align-items:center;justify-content:center;z-index:10000;opacity:0;transition:opacity .22s ease}
.mc-award-modal.show{opacity:1}
.mc-award-dialog{width:initial;background:#fff;color:#7e18a8;border-radius:18px;padding:22px 20px;box-shadow:0 20px 50px rgba(0,0,0,.45);transform:translateY(20px) scale(.85);transition:transform .35s cubic-bezier(0.68, -0.55, 0.265, 1.55);text-align:center}
.mc-award-modal.show .mc-award-dialog{transform:translateY(0) scale(1);animation:mc-bounce-in .6s cubic-bezier(0.68, -0.55, 0.265, 1.55)}
@keyframes mc-bounce-in{0%{transform:translateY(20px) scale(.85)}50%{transform:translateY(-5px) scale(1.02)}100%{transform:translateY(0) scale(1)}}
.mc-award-title{margin:0 0 10px;font-size:20px;font-weight:800}
.mc-award-meta{opacity:.85;margin:4px 0 14px;font-size:14px; color: #7e18a8}
.mc-award-img{width:100%;height:300px;object-fit:cover;border-radius:16px;box-shadow:0 10px 24px rgba(0,0,0,.35);margin:8px auto 12px;display:block}
.mc-award-actions{display:flex;justify-content:center;gap:12px;margin-top:8px}
.mc-btn{appearance:none;border:0;border-radius:999px;padding:10px 18px;font-weight:800;cursor:pointer}
.mc-btn-primary{background:linear-gradient(135deg,#7f53ac,#647dee);color:#fff;box-shadow:0 6px 18px rgba(100,125,238,.35)}
.mc-btn-primary:hover{filter:brightness(1.05)}
@media (prefers-reduced-motion: reduce){.mc-award-modal,.mc-award-dialog{transition:none !important}}

/* ==== NAGRODY I KOLEKCJE ==== */

/* Karty nagród */
.award-card-wrapper {
    position: relative;
    margin-bottom: 30px;
    perspective: 1000px;
    cursor: pointer;
}

.award-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.award-card:hover {
    transform: translateY(-15px) rotateY(5deg);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
}

/* Onboarding Wizard */
.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
}

.avatar-option {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.avatar-option:hover img {
    transform: scale(1.05);
}

.avatar-option img {
    border: 4px solid transparent;
    transition: border-color 0.2s ease-in-out;
}

.avatar-option img.selected {
    border-color: #0d6efd; /* Bootstrap Primary Color */
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
}


/* Wstążka rzadkości */
.award-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Container na obraz */
.award-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    margin-top: 36px; /* Miejsce na ribbon */
}

#all-awards .award-image-container {
    margin-top: 0;
}

.award-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}

/* Efekt blur dla nagród w widoku zadania */
.single-task .award-image {
    filter: blur(4px);
    opacity: 0.8;
}

/* Karuzela nagród */
.awards-carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    scrollbar-width: thin;
}

.awards-carousel .award-card-wrapper {
    flex: 0 0 240px;
    max-width: 240px;
    padding: 0 0 15px 15px;
}

.awards-carousel .award-card {
    height: 100%;
}

.awards-carousel .award-image-container {
    height: 200px;
}

.award-card:hover .award-image {
    transform: scale(1.05);
}

/* Szczegóły nagrody */
.award-details {
    padding: 20px;
    text-align: center;
}

.award-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #343a40;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}

.award-badges {
    margin-bottom: 10px;
}

.award-type-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px;
    margin-right: 5px;
}

.cat-badge {
    background-color: var(--cat-color);
    color: white;
}

.horse-badge {
    background-color: var(--horse-color);
    color: white;
}

.award-points {
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 50px;
    display: inline-block;
    font-weight: bold;
    background-color: #f1f1f1;
}

.home .award-points {
    background-color: #343a40;
}

.home .award-image-container {
background-color: transparent;
}

.xp-icon {
    display: inline-block;
    padding: 2px 6px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 12px;
}

/* Efekty dla różnych rzadkości */
[data-award-rarity="legendary"] .award-card {
    box-shadow: 0 10px 25px var(--shadow-legendary);
    animation: pulse-legendary 2s infinite alternate;
}

[data-award-rarity="epic"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-epic);
    animation: pulse-epic 3s infinite alternate;
}

[data-award-rarity="rare"] .award-card {
    box-shadow: 0 10px 15px var(--shadow-rare);
}

[data-award-rarity="uncommon"] .award-card {
    box-shadow: 0 8px 15px var(--shadow-uncommon);
}

[data-award-rarity="common"] .award-card {
    box-shadow: 0 5px 15px var(--shadow-common);
}

/* Animacje dla kart */
@keyframes pulse-legendary {
    0% { box-shadow: 0 10px 25px var(--shadow-legendary); }
    100% { box-shadow: 0 15px 35px var(--shadow-legendary); }
}

@keyframes pulse-epic {
    0% { box-shadow: 0 10px 20px var(--shadow-epic); }
    100% { box-shadow: 0 15px 30px var(--shadow-epic); }
}

/* Animacja dla nowych nagród */
@keyframes newAwardGlow {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(25, 135, 84, 0.8); }
    50% { transform: scale(1.03); box-shadow: 0 0 40px rgba(25, 135, 84, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(25, 135, 84, 0.8); }
}

.award-card-wrapper.new-award .award-card {
    animation: newAwardGlow 2s infinite;
}

/* ==== ZADANIA ==== */

.task-container {
    border-radius: 15px;
    background-color: white;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tax-dzial aside > .card {
    position: sticky;
    top: 20px;
    z-index: 1;
}

#tax-filters-form button[type="submit"] {
    display: none;
}


/* ==== RECOMMENDED TASKS: unify to column-1 style for all titles ==== */
.task-title-small,
.task-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 8px 0 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    letter-spacing: .2px;
    /* reset possible pill style */
    display: block;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
    text-transform: initial !important;
}

body:not(.single.single-task) .task-title {
    -webkit-line-clamp: 2; /* WebKit */
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Spec draft */
    white-space: normal;
    /* line clamp to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    min-height: 63px;
}

.page-template-page-reset-password .task-title,
.page-template-page-login .task-title,
.page-template-page-register .task-title {
    line-clamp: initial !important;
    min-height: initial !important;
}

.archive .task-title {
    font-weight: 500;
}

.page-template-page-dashboard .task-title {
    font-size: 1.5rem ;
}

/* Completed task cards */
.archive .task-card.task-completed {
    border: 1px solid #d1e7dd; /* bootstrap success-subtle border */
    background: #f8fff9; /* subtle greenish background */
    position: relative;
}

.task-completed {
  background-color: #f6fff6;
  border: 1px solid #cce9cc;
  opacity: 0.85;
}

.task-completed h5, .task-completed .card-title {
  text-decoration: line-through;
}

/* Finished task (learning center list group) */
.finishedTask {
  background-color: #f6fff6 !important;
  border: 1px solid #cce9cc !important;
  opacity: 0.9;
}
.finishedTask h5 {
  text-decoration: line-through;
}
.finishedTask, .finishedTask * {
  cursor: not-allowed;
}
.finishedTask a {
  pointer-events: none;
}

.archive .task-card {
    background-color: #fff;
}

.archive .task-card.task-completed .btn[aria-disabled="true"],
.archive .task-card.task-completed .btn.disabled {
    pointer-events: none;
    opacity: .75;
}
.archive .task-card.task-completed .badge.bg-success {
    box-shadow: 0 0 0 2px #fff;
}

/* Utility: purple background for rarity badge */
.bg-purple {
    background-color: #6f42c1 !important; /* Bootstrap's purple */
    color: #fff !important;
}

/* Rarity badges (achievements) */
.badge-rarity-common {
    background-color: #6c757d; /* secondary gray */
    color: #fff;
}
.badge-rarity-rare {
    background-color: #0d6efd; /* brand primary */
    color: #fff;
}
.badge-rarity-epic {
    background-color: #6f42c1; /* purple */
    color: #fff;
}
.badge-rarity-legendary {
    background-image: linear-gradient(135deg, #f59e0b, #fbbf24); /* golden gradient */
    color: #111;
    border: 1px solid rgba(0,0,0,0.08);
}

.task-content {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Sekcja nagłówka zadania + XP badge */
.task-container .section-header {
    position: relative;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.task-container .section-header .task-title {
    margin: 0;
}

.task-container .section-header .xp-badge {
    align-self: center;
    font-weight: 800;
    letter-spacing: .5px;
}

/* ==== STAT CARDS (dashboard) ==== */
.stats-cards .card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stats-cards .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    color: var(--primary-color);
    font-size: 26px;
    margin: 12px 12px 0 12px;
    flex: 0 0 56px;
}

.stats-cards .stat-content-col {
    width: 100%;
}

.stats-cards .stat-info {
    width: 100%;
}

.stats-cards .progress-container {
    width: 100%;
}

/* Ujednolicenie koloru etykiet */
.recommendations-container .lead,
.achievement-empty,
.stats-cards .stat-label {
    color: #6c757d !important;
}

.recommendations-container .lead {
    font-size: 16px;
}

.card-img-top {
    width: 100%;
    object-fit: contain;
}

.progress-container .progress {
    height: 12px;
    background: #e9ecef;
    border-radius: 999px;
    overflow: hidden;
}

.progress-container .progress-bar {
    background: var(--primary-gradient);
    box-shadow: inset 0 2px 6px rgba(106, 17, 203, 0.25);
}

.progress-text {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.progress-text span {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f5f7fa;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.progress-text span:first-child {
    /* Poziom */
    background: rgba(102, 126, 234, 0.12); /* nawiązanie do --secondary-gradient */
}

.progress-text span:last-child {
    /* Do kolejnego poziomu */
    background: rgba(118, 75, 162, 0.12); /* nawiązanie do --primary-color */
}

/* ==== STREAK (płomienie) i osiągnięcia (ikony) na dashboardzie ==== */
.streak-flames .flame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 69, 0, 0.08);
    color: #ff6b00;
    animation: flamePulse 1.6s ease-in-out infinite;
}

.streak-flames .flame i { line-height: 1; }
.streak-flames .flame-2 { animation-delay: .1s; }
.streak-flames .flame-3 { animation-delay: .2s; }
.streak-flames .flame-4 { animation-delay: .3s; }
.streak-flames .flame-5 { animation-delay: .4s; }

@keyframes flamePulse {
    0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(255,107,0,0)); }
    50% { transform: translateY(-2px) scale(1.06); filter: drop-shadow(0 4px 10px rgba(255,107,0,.35)); }
}

.achievement-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f5f7fa;
    color: var(--primary-color);
}

.achievement-more { font-weight: 700; color: #6c757d; margin-left: 4px; }
.achievement-empty { color: #6c757d; font-style: italic; }


/* Subtelne akcenty kart na hover dla wszystkich kolumn */
.task-card .task-card-body {
    transition: transform .2s ease, box-shadow .2s ease;
    border-radius: 12px;
}

.task-card .task-card-body:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.task-card .task-title a {
    color: inherit; /* Inherit color from h4 */
    text-decoration: none; /* Remove underline */
    transition: color 0.2s ease-in-out;
}

.task-card .task-title a:hover,
.task-card .task-title a:focus {
    color: var(--bs-primary); /* Use theme's primary color on hover */
    text-decoration: underline;
}

.answer-form {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

.custom-file-upload {
    margin-top: 20px;
    text-align: center;
}

.hint-button {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 15px;
    margin-left: 10px;
    transition: all 0.3s;
}

.hint-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.nav-card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

/* ==== DASHBOARD: Nawigacyjne kafelki ==== */
.navigation-cards .nav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eef1f5;
    text-align: left;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.navigation-cards .nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
    border-color: rgba(118, 75, 162, 0.25);
}

.navigation-cards .nav-card .nav-card-icon {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    color: var(--primary-color);
    margin: 0 8px 0 0;
    font-size: 24px;
}

.navigation-cards .nav-card .nav-card-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 800;
    color: #333;
}

.navigation-cards .nav-card .nav-card-content p {
    margin: 0;
    color: #6c757d;
    font-size: .9rem;
}

.navigation-cards .nav-card .nav-card-arrow {
    margin-left: auto;
    color: #adb5bd;
}

/* Opcjonalne akcenty kolorystyczne wg typu karty */
.navigation-cards .nav-card.learning-center .nav-card-icon { background: rgba(102,126,234,.12); color: #647dee; }
.navigation-cards .nav-card.achievements .nav-card-icon { background: rgba(111,66,193,.12); color: #6f42c1; }
.navigation-cards .nav-card.collection .nav-card-icon { background: rgba(25,135,84,.12); color: #198754; }
.navigation-cards .nav-card.profile .nav-card-icon { background: rgba(13,110,253,.12); color: #0d6efd; }
.navigation-cards .nav-card.leaderboard .nav-card-icon { background: rgba(255,193,7,.12); color: #fd7e14; }

/* ==== DASHBOARD: Pasek powitalny z avatarem ==== */
.dashboard-welcome .user-avatar {
    position: relative;
}

#avatarDropdown.avatar-toggle span {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-welcome .user-avatar .avatar-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.dashboard-welcome .user-avatar .user-status {
    position: absolute;
    z-index: 1;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2ecc71; /* online */
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

.dashboard-welcome .greeting-text h2 {
    margin: 0;
    font-size: 1.5rem;
}

/* ==== NAVBAR I MENU ==== */

.navbar {
    padding: 15px 0;
    background: var(--primary-gradient) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 24px;
    color: white !important;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 50px;
    transition: all 0.3s;
    margin: 0 5px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: white !important;
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

.dropdown-menu {
    right: 0;
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 10px;
    margin-top: 10px;
}

.dropdown-menu img {
    border-radius: 100px;
    overflow: hidden;
    padding-right: 10px;
}

.dropdown-item {
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.dropdown-item:hover {
    background-color: #f1f1f1;
    transform: translateX(5px);
}

.avatar-dropdown {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 5px;
    width: auto;
}

.avatar-dropdown .avatar-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}

.avatar-dropdown .avatar-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 3px solid var(--primary-color);
}

.avatar-dropdown .avatar-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 3px;
}

.avatar-dropdown .avatar-email {
    font-size: 14px;
    color: #6c757d;
}

.avatar-dropdown .dropdown-divider {
    margin: 10px 0;
    border-color: #f1f1f1;
}

/* Avatar w formularzu profilu */
.user-avatar,
.current-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50px;
    overflow: hidden;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.3);
    margin: 0 auto;
}

.user-avatar img,
.current-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 0 !important;
}

/* ==== PROFIL UCZNIA ==== */

.profile-container {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 60px;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.3);
    margin-right: 30px;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    width: calc(100% - 120px);
}

.profile-info h2 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.profile-stats {
    background-color: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    padding: 12px;
    margin-bottom: 10px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.stat-label {
    font-weight: bold;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.stat-value {
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 0;
}

.stat-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding-left: 15px;
}

.stat-content h4 {
    font-size: 14px;
    margin-bottom: 0;
    margin-right: 10px;
    color: #6c757d;
}

/* Trudność zadania */
.task-footer {
    margin-top: 20px;
}

.task-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}
.task-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f8f9fa;
}
.difficulty-label {
    color: #6c757d;
    font-weight: 600;
    margin-right: 8px;
}
.difficulty-value {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

/* Variants tied to PHP classes set in page-dashboard.php */
.task-difficulty .difficulty-text { font-weight: 700; }
.task-difficulty.difficulty-easy { background: rgba(25,135,84,.12); color: #198754; }
.task-difficulty.difficulty-medium { background: rgba(13,110,253,.12); color: #0d6efd; }
.task-difficulty.difficulty-hard { background: rgba(220,53,69,.12); color: #dc3545; }

/* Utility label used in dashboard meta rows */
.section-label { color: #6c757d; }

/* Points pill for dashboard cards */
.task-points {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 6px 10px;
    margin-top: 6px;
}

/* ==== ANIMACJE ==== */

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.parent-info .code-copy-btn {
    border: none !important;
    margin-left: 10px;
}

.parent-info .key.parent-icon {
    float: left;
    margin-right: 10px;
}


/* ==== FAST BONUS TOAST (persistent styles) ==== */
.fast-bonus-toast {
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translateX(-50%) scale(.9);
    background: linear-gradient(135deg, #7f53ac, #647dee);
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    font-weight: 800;
    letter-spacing: .3px;
}

.fast-bonus-toast.show {
    animation: mc-pop 1.5s ease-out forwards;
}

@keyframes mc-pop {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.8); }
    30% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(.9); }
}


/* Styl container dla kolekcji */
.award-collection-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Stylowanie zakładek */
.award-tabs {
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    background: #f8f9fa;
    border: none;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}

.award-tabs .nav-link {
    font-size: 18px;
    font-weight: bold;
    padding: 15px 20px;
    border: none;
    transition: all 0.3s;
    color: #495057;
    position: relative;
}

.award-tabs .nav-link i {
    margin-right: 8px;
    font-size: 22px;
    vertical-align: middle;
}

.award-tabs .nav-link:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
}

.award-tabs .nav-link.active {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

/* Nagłówki kategorii */
.category-header {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 10px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rarity-section {
    margin-bottom: 30px;
    padding-left: 15px;
    border-radius: 10px;
}

/* Stylowanie kart nagród */
.award-card-wrapper {
    position: relative;
    margin-bottom: 30px;
    perspective: 1000px;
    cursor: pointer;
}

.award-card {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.award-card:hover {
    transform: translateY(-15px) rotateY(5deg);
    box-shadow: 0 20px 30px rgba(0,0,0,0.2);
}

/* Rarity-based shadows */
.award-card-wrapper[data-award-rarity="common"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-common);
}

.award-card-wrapper[data-award-rarity="common"] .award-card:hover {
    box-shadow: 0 20px 30px var(--shadow-common);
}

.award-card-wrapper[data-award-rarity="uncommon"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-uncommon);
}

.award-card-wrapper[data-award-rarity="uncommon"] .award-card:hover {
    box-shadow: 0 20px 30px var(--shadow-uncommon);
}

.award-card-wrapper[data-award-rarity="rare"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-rare);
}

.award-card-wrapper[data-award-rarity="rare"] .award-card:hover {
    box-shadow: 0 20px 30px var(--shadow-rare);
}

.award-card-wrapper[data-award-rarity="epic"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-epic);
}

.award-card-wrapper[data-award-rarity="epic"] .award-card:hover {
    box-shadow: 0 20px 30px var(--shadow-epic);
}

.award-card-wrapper[data-award-rarity="legendary"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-legendary);
}

.award-card-wrapper[data-award-rarity="legendary"] .award-card:hover {
    box-shadow: 0 20px 30px var(--shadow-legendary);
}

/* Wstążka rzadkości */
.award-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    padding: 8px 12px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Container na obraz */
.award-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    margin-top: 36px; /* Miejsce na ribbon */
}

.award-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}

.award-card:hover .award-image {
    transform: scale(1.05);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image i {
    font-size: 80px;
    color: #dee2e6;
}

/* Szczegóły nagrody */
.award-details {
    padding: 20px;
    text-align: center;
}

.award-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #343a40;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.award-badges {
    margin-bottom: 10px;
}

.award-type-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px;
    margin-right: 5px;
}

.cat-badge {
    background-color: #ff9800;
    color: white;
}

.horse-badge {
    background-color: #4caf50;
    color: white;
}

.award-points {
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 50px;
    display: inline-block;
    font-weight: bold;
    background-color: #f1f1f1;
}

.xp-icon {
    display: inline-block;
    padding: 2px 6px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 12px;
}

/* Efekty dla różnych rzadkości */
[data-award-rarity="legendary"] .award-card {
    box-shadow: 0 10px 25px var(--shadow-legendary);
    animation: pulse-legendary 2s infinite alternate;
}

[data-award-rarity="epic"] .award-card {
    box-shadow: 0 10px 20px var(--shadow-epic);
    animation: pulse-epic 3s infinite alternate;
}

[data-award-rarity="rare"] .award-card {
    box-shadow: 0 10px 15px var(--shadow-rare);
}

[data-award-rarity="uncommon"] .award-card {
    box-shadow: 0 8px 15px var(--shadow-uncommon);
}

[data-award-rarity="common"] .award-card {
    box-shadow: 0 5px 15px var(--shadow-common);
}

/* Animacje dla kart */
@keyframes pulse-legendary {
    0% { box-shadow: 0 10px 25px var(--shadow-legendary); }
    100% { box-shadow: 0 15px 35px var(--shadow-legendary); }
}

@keyframes pulse-epic {
    0% { box-shadow: 0 10px 20px var(--shadow-epic); }
    100% { box-shadow: 0 15px 30px var(--shadow-epic); }
}

/* Animacja dla nowych nagród */
@keyframes newAwardGlow {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(25, 135, 84, 0.8); }
    50% { transform: scale(1.03); box-shadow: 0 0 40px rgba(25, 135, 84, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(25, 135, 84, 0.8); }
}

.award-card-wrapper.new-award .award-card {
    animation: newAwardGlow 2s infinite;
}

/* Przycisk powrót do panelu */
.text-center .btn-primary {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border: none;
    padding: 15px 30px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(106, 17, 203, 0.3);
    transition: all 0.3s;
}

.text-center .btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(106, 17, 203, 0.4);
}

/* Stylowanie formularza filtrowania */
.card {
    border-radius: 15px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    font-size: 18px;
}

.form-select, .form-control {
    border-radius: 10px;
    padding: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.form-select:focus, .form-control:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.25);
}

.btn-outline-secondary {
    border-radius: 8px;
    padding: 8px 20px;
}

/* Pusty stan */
.empty-collection {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: none;
}

.empty-collection h4 {
    color: #4a4a4a;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: bold;
}

.empty-collection p {
    font-size: 18px;
    color: #6c757d;
}

.empty-collection .btn-lg {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 50px;
}

.loginRegister,
.mathcats-hero {
    padding: 20px 0;
}

.btn-lg {
    font-size: 20px !important;
}


/* Style dla zebranych i niezebranych nagród */
.award-card-wrapper.not-collected .award-card {
    filter: grayscale(90%);
    opacity: 0.6;
    transition: all 0.3s ease-in-out;
}

.award-card-wrapper.not-collected:hover .award-card {
    filter: grayscale(0%);
    opacity: 1;
}

.award-card-wrapper.is-collected .award-card {
    border: 2px solid #198754; /* Zielona ramka dla zebranych */
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.5);
}


/* ==== RESPONSYWNOŚĆ ==== */
@media (min-height: 990px) {
    .loginRegister {
        height: 100dvh;
        box-sizing: border-box;
        padding-block: clamp(24px, 6vh, 80px);
        position: relative;
        overflow: hidden;
    }
}

@media (min-width: 768px) {
    /* Na większych ekranach: ikona z lewej, treść z prawej */
    .stats-cards .card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }
    .stats-cards .stat-icon {
        margin: 16px;
    }
}

@media (max-width: 1366px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 1199px) {
    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 1080px) {
    /* Stack stat cards content vertically and shrink icon */
    .stats-cards .card {
        flex-direction: column !important;
        align-items: center !important;
    }
    .stats-cards .stat-icon {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        font-size: 18px;
        margin: 8px 0 6px 0;
    }
    .stats-cards .stat-info h4 {
        text-align: center;
    }
}

@media (max-width: 992px) {
    /* Make each stat card full width with spacing */
    .stats-cards .stat-card {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-top: 20px;
    }

    /* Recommended tasks: make task cards full width with spacing */
    .recommended-tasks .task-card {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-top: 20px;
    }
    .recommended-tasks .task-card:first-child {
        margin-top: 0;
    }

    .hero-title {
        font-size: 2rem;
    }
    
    .hero-content, .hero-slider-section {
        padding: 0 20px;
        margin-bottom: 40px;
    }

    .card-body {
        padding: 10px;
    }

    .single-task .card-body img {
        width: auto !important;
        height: 30px !important;
        margin-right: 10px !important;
    }
}

@media (max-width: 768px) {
    h1.page-title, h1.entry-title {
        font-size: 2rem;
    }
    
    .section-header {
        font-size: 20px;
        padding: 8px 12px;
    }
    
    .award-image-container {
        height: 200px;
    }
    
    .award-title {
        font-size: 16px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        margin-right: 15px;
    }
    
    .profile-info h2 {
        font-size: 24px;
    }

    .profile-container {
        padding: 10px
    }

    .task-container .section-header {
        padding: 10px;
    }

    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
    }
    
    .title-section h1,
    .page .container > .d-flex > h1,
    .page .container > h1 {
        font-size: 26px;
        display: inline-block;
        width: 100%;
        flex: 0 0 100%;
    }

    .single.single-task .section-header .task-title {
        font-size: 22px;
    }

    .task-footer {
        flex-wrap: wrap;
    }

    .task-footer > div {
        flex: 0 0 100%;
        justify-content: space-between;
    }

    .card-body {
        padding: 10px;
    }

    .filter-block .form-label {
        font-size: 12px;
    }

    .container-wrapper {
        padding: 0 10px;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-actions .btn {
        text-align: center;
    }
    
    .slider-stats {
        flex-direction: column;
        gap: 15px;
    }

    .task-container {
        padding: 10px;
    }

    .award-tabs .nav-link {
        font-size: 14px;
        padding: 10px;
    }
    
    .award-tabs .nav-link i {
        margin-right: 5px;
        font-size: 16px;
    }
    
    .category-header {
        font-size: 20px;
    }
    
    .award-title {
        font-size: 16px;
    }
    
    .award-image-container {
        height: 200px;
    }

    /* Prevent horizontal scroll on mobile */
  html, body { overflow-x: hidden; }
  .container-wrapper { padding-left: 12px; padding-right: 12px; }

  /* Hide the desktop sidebar column (right) on mobile to avoid duplication */
  .single-task .row > .col-md-4 { display: none; }

  /* Reserve space so content is not hidden behind the bar */
  .single-task .task-container { padding-bottom: 76px; }

  .task-mobile-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1040; /* above content, below modal (1050) */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -6px 16px rgba(0,0,0,0.08);
  }

  .task-mobile-bar .bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; width: calc(100% - 40px); }
  .task-mobile-bar .timer-badge { white-space: nowrap; }
  .task-mobile-bar .xp-mini { flex: 1 1 auto; min-width: 120px; }
  .task-mobile-bar .xp-mini .progress { height: 8px; border-radius: 8px; }
  .task-mobile-bar .xp-mini .progress-bar { border-radius: 8px; }
  .task-mobile-bar #xp-label-mobile { 
    font-size: 12px;
   }

   
   .leaderboard-table .player-info { gap: 8px; }
    .leaderboard-table .avatar-48 { width: 36px; height: 36px; }
    .leaderboard-table .xp-badge { min-width: auto; text-align: left; font-size: 0.95rem; }
    .leaderboard-table td, .leaderboard-table th { padding: 10px 12px; }

  /* Toggle button: use Bootstrap btn styles; keep compact and aligned */
  .task-mobile-bar .bar-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px; /* compact */
    width: 30px !important;
  }
  .task-mobile-bar .bar-action i { line-height: 1; }

  /* Overlay behind the sheet */
  .task-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1041;
  }

  /* Bottom sheet panel */
  .task-bottom-sheet {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    transform: translateY(100%);
    transition: transform 300ms ease;
    z-index: 1042;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .task-bottom-sheet.open { transform: translateY(0); }
  .task-sheet-overlay.open { display: block; }

  .task-bottom-sheet .sheet-handle {
    width: 44px; height: 5px; border-radius: 3px;
    background: #dee2e6; margin: 10px auto 6px auto;
  }
  .task-bottom-sheet .sheet-header {
    padding: 6px 14px 0 14px;
    text-align: center;
    color: #6c757d;
    font-weight: 600;
  }
  .task-bottom-sheet .sheet-content { padding: 8px 14px 14px 14px; }
  .task-bottom-sheet .card { margin-bottom: 14px; }

/* ==== MOBILE FULL-WIDTH MODALS (time-bonus info, etc.) ==== */

  /* Bootstrap modal */
  .modal.show .modal-dialog {
    max-width: none;
    width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: env(safe-area-inset-bottom, 16px);
    margin-top: 16px;
  }
  .modal .modal-content { border-radius: 12px; }

  /* SweetAlert2 (if used) */
  .swal2-popup {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    border-radius: 12px !important;
  }

  .slider-stats .stat-number {
    font-size: 2rem;
  }

  .slider-stats .stat-item {
    padding: 6px;
    width: 100%;
  }
}

@media (max-width: 601px) {
    .btn {
        width: 100%;
        margin: 5px 0;
    }

    .form-check .form-check-input {
        margin-left: -1em;
        margin-right: 10px;
    }
        
    textarea.form-control {
        min-height: 30vh !important;
    }

    .list-group-item .d-flex small {
        display: none;
    }

    h5.card-title {
        font-size: 16px;
    }

    .container-fluid > .row > div h1,
    h1.page-title, 
    h1.entry-title {
        font-size: 24px;
    }

    #chat-form {
        flex-wrap: wrap;
    }
}

/* Adjust for small screens */
@media (max-width: 480px){
    .mc-frac{transform-origin:center;gap:0}
    .mc-frac .mc-num,.mc-frac .mc-den{font-size:.95em}
}
