/* ==============================================
   GEOHUB BASE STYLES (APPLE CLEAN)
   ============================================== */

/* TYPOGRAPHY SYSTEM */
.font-fredoka { font-family: 'Fredoka', sans-serif !important; }
.font-inter { font-family: 'Inter', sans-serif !important; }

body {
    background-color: #f8fafc; /* slate-50 */
    color: #1e293b; /* slate-800 */
    -webkit-font-smoothing: antialiased;
    background-attachment: fixed;
}

canvas,
.mesh-gradient,
.mesh-blob {
    pointer-events: none !important;
}

.mesh-gradient {
    position: fixed;
    inset: 0;
    z-index: -10;
    overflow: hidden;
}

.mesh-blob {
    position: fixed;
    width: 42rem;
    height: 42rem;
    border-radius: 9999px;
    filter: blur(120px);
    opacity: 0.1;
    will-change: transform;
    animation: drift 42s ease-in-out infinite alternate;
}

.mesh-blob-emerald {
    background: #10b981;
    top: -18rem;
    left: -14rem;
    animation-duration: 50s;
}

.mesh-blob-blue {
    background: #3b82f6;
    top: 18%;
    right: -16rem;
    animation-duration: 44s;
    animation-delay: -8s;
}

.mesh-blob-rose {
    background: #f43f5e;
    bottom: -18rem;
    left: 8%;
    animation-duration: 38s;
    animation-delay: -15s;
}

.mesh-blob-amber {
    background: #f59e0b;
    bottom: -14rem;
    right: -12rem;
    animation-duration: 46s;
    animation-delay: -5s;
}

/* APPLE CLEAN PAPER CARD STYLE */
.paper-card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.025);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.paper-card:hover, .paper-card:active {
    border-color: #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.025);
    transform: translateY(-2px);
}

.paper-card:active {
    transform: translateY(0) scale(0.98);
}

/* GRADIENT TEXT */
.text-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-geo {
    background: linear-gradient(to right, rgba(192, 233, 223, 1) 0%, rgba(192, 233, 223, 1) 40%, #8ACAB5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* HERO BACKGROUND */
.hero-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.hero-pattern {
    background-image: radial-gradient(#10b981 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.1;
}

/* ICON CONTAINER GLASS */
.icon-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* GLASS PREMIUM */
.glass-premium {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.04);
}

/* TOUCH UTILS */
.tap-target { min-height: 48px; min-width: 48px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* FLIP CARD ANIMATION */
.perspective-1000 { perspective: 1000px; }
.transform-style-3d { transform-style: preserve-3d; }
.backface-hidden { backface-visibility: hidden; }
.rotate-y-180 { transform: rotateY(180deg); }
.flip-card-inner { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.is-flipped { transform: rotateY(180deg); }

/* MATCHING GAME STYLES */
.match-card { transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
.match-selected { background-color: #ecfdf5; border-color: #10b981; transform: scale(1.05); z-index: 10; box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1); }
.match-solved { opacity: 0; pointer-events: none; transform: scale(0.9); }

/* ANIMATIONS */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.animate-shake {
    animation: shake 0.3s ease-in-out;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* FADE IN UP ANIMATION */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
}
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

/* RESULT VIEW ANIMATIONS */
@keyframes apple-watch-ring {
    0% { stroke-dasharray: 0, 100; }
    100% { stroke-dasharray: var(--ring-percentage, 0), 100; }
}

@keyframes trophy-reveal {
    0% { transform: scale(0) rotate(-15deg); opacity: 0; }
    70% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.animate-trophy {
    animation: trophy-reveal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.1); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  70% { transform: scale(1); }
}
.animate-heartbeat { animation: heartbeat 2s infinite; }

.glass-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* ==============================================
   GLASS PREMIUM — STRONA GŁÓWNA
   ============================================== */

/* KAFELEK — SZKŁO */
.glass-tile {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@media (min-width: 768px) {
    .glass-tile { border-radius: 2rem; }
}

/* HOVER — UNOSZENIE + POŚWIATA PER KLASA */
.glass-tile:hover, .glass-tile:active {
    transform: translateY(-8px) scale(1.01);
}

.glass-tile:active {
    transform: translateY(0) scale(0.98);
}

.glass-tile-emerald:hover, .glass-tile-emerald:active {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.07), 0 0 40px rgba(16, 185, 129, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.glass-tile-blue:hover, .glass-tile-blue:active {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.07), 0 0 40px rgba(59, 130, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.glass-tile-rose:hover, .glass-tile-rose:active {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.07), 0 0 40px rgba(244, 63, 94, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* GRADIENT NA LOGO GEOHUB */
.geohub-gradient {
    background: linear-gradient(135deg, #064e3b 0%, #059669 55%, #0d9488 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ANIMACJA IKONY PRZY HOVER NA KAFELKU */
@keyframes iconBounce {
    0%   { transform: rotate(0deg) scale(1); }
    40%  { transform: rotate(14deg) scale(1.18); }
    70%  { transform: rotate(-6deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1.05); }
}
.group:hover .icon-bounce, .group:active .icon-bounce {
    animation: iconBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ==============================================
   NOWE STYLE (MOBILE, FISZKI)
   ============================================== */

.card-back { background: #0f172a !important; color: white !important; }
.card-back p { color: white !important; }

/* OPTIMIZED ROZPOCZNIJ BUTTON */
.btn-rozpocznij {
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
    display: flex;
    align-items: center;
    line-height: 1.15;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    cursor: pointer;
    width: fit-content;
    padding: 0.35rem 0;
}

.btn-rozpocznij i {
    flex-shrink: 0;
}

/* HOME — spójne pozycjonowanie CTA na kafelkach klas */
.home-class-tile {
    aspect-ratio: auto !important;
    min-height: 190px;
}

.home-tile-footer {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    row-gap: 0.45rem;
    min-height: 78px;
}

.home-tile-title {
    margin: 0;
    min-height: 2.4em;
    display: flex;
    align-items: flex-end;
}

.home-tile-cta {
    margin-top: 0;
}

@media (min-width: 640px) {
    .home-class-tile {
        aspect-ratio: 1 / 1 !important;
        min-height: 0;
    }
}

/* IMPROVED LEARNING HEADER & PROGRESS */
.learning-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    .learning-layout {
        gap: 1.5rem;
    }
}

.learning-header-container {
    padding-top: clamp(2rem, 5vh, 4rem);
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

.learning-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.learning-progress-full {
    width: 100%;
    height: 6px;
    background-color: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
}

.learning-progress-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.learning-header {
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.25rem);
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.35rem;
}

@media (min-width: 640px) {
    .learning-header {
        padding-top: 2rem;
        gap: 0.5rem;
    }
}

.learning-header-separator {
    height: 1px;
    width: 100%;
    background: #e2e8f0;
}

#app-root.app-root-game-compact {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    min-height: calc(100dvh - 4rem);
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    #app-root.app-root-game-compact {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
}

@media (max-width: 767.98px) {
    body { font-size: 14px; }
    .text-base { font-size: 0.875rem; }
    .text-2xl { font-size: 1.25rem; }
    .text-5xl { font-size: 2.5rem; }
}

/* APP ROOT ponad aurą */
/* ==============================================
   NOWE ANIMACJE I KLASY (FLOATING HUB)
   ============================================== */

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient-flow {
    background-size: 200% auto;
    animation: gradient-flow 6s ease infinite;
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    25% {
        transform: translate3d(7vw, -5vh, 0) scale(1.08);
    }
    50% {
        transform: translate3d(-6vw, 6vh, 0) scale(0.96);
    }
    75% {
        transform: translate3d(5vw, 8vh, 0) scale(1.05);
    }
    100% {
        transform: translate3d(-7vw, -6vh, 0) scale(1.02);
    }
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}

.hover-breathing {
    transition: letter-spacing 0.4s ease-out;
}

.hover-breathing:hover {
    letter-spacing: 0.05em;
}

