/* ═════════════════════════════════════════════════════
   CHANNELKIDS NEW DESIGN — Student Dashboard CSS
   Pixel-perfect clone of the React reference design
═════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%; overflow: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #000;
}

.container { max-width: none !important; padding: 0 !important; }

img, svg, video, canvas, iframe { max-width: 100%; }
input, select, textarea, button { font: inherit; }

img.emoji, img.twemoji-img {
    display: inline !important; max-width: 1.4em !important;
    height: 1.4em !important; width: auto !important; vertical-align: -0.25em !important;
}

/* ── App Shell ── */
.ck-shell {
    display: flex; flex-direction: column;
    width: 100%; max-width: 100%; height: 100vh; overflow: auto;
    background: linear-gradient(180deg, #ffb700, #ff8c00);
    position: fixed; top: 0; left: 0;
}

/* ═══════════════════════════════════════
   HEADER (Green Top Bar)
═══════════════════════════════════════ */
.ck-header {
    background: #00c800;
    padding: 8px 24px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 20; flex-shrink: 0;
    gap: 12px;
}

/* Logo (now image-based) */
/* Old CSS logo classes removed — now using ChannelKids image logo */

/* Search Bar */
.ck-search {
    flex: 1; max-width: 560px; margin: 0 32px;
}
.ck-search-bar {
    background: #fff; border-radius: 999px;
    display: flex; align-items: center;
    padding: 6px 8px 6px 16px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    border: 2px solid rgba(0,0,0,0.1);
}
.ck-search-placeholder {
    color: #9ca3af; font-weight: 700; font-size: 18px;
    margin-right: 8px; white-space: nowrap;
}
.ck-search-input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 18px; font-family: inherit;
}
.ck-search-clear {
    background: none; border: none; cursor: pointer;
    color: #9ca3af; font-size: 20px; font-weight: 700;
    width: 24px; height: 24px; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.ck-search-clear:hover { background: #f3f4f6; color: #6b7280; }
.ck-search-clear.visible { display: flex; }
.ck-search-btn {
    width: 32px; height: 32px; background: #00c800;
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Profile Area */
.ck-header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.ck-header-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    color: #fff;
    text-decoration: none;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.08);
    transition: transform 0.15s, background 0.15s;
}
.ck-header-credits:hover {
    background: rgba(0,0,0,0.24);
    transform: translateY(-1px);
}
.ck-header-credits-title {
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.ck-header-credit-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    background: rgba(255,255,255,0.96);
    color: #111827;
}
.ck-header-credit-chip .coin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ck-header-credit-chip.gold .coin {
    background: radial-gradient(circle at 35% 35%, #FFF176, #FFD700, #B8860B);
    border: 1px solid #CC8800;
}
.ck-header-credit-chip.silver .coin {
    background: radial-gradient(circle at 35% 35%, #f8f8f8, #C0C0C0, #808080);
    border: 1px solid #999;
}

.ck-header-credits {
    display: none !important;
}

.ck-daily-bonus {
    background: #ffcc00; color: #000;
    padding: 6px 16px; border-radius: 999px;
    font-weight: 900; font-size: 14px;
    border: none; cursor: pointer;
    box-shadow: 0 3px 0 #cc9900;
    transition: all 0.15s;
    animation: ck-bounce 1s ease infinite;
}
.ck-daily-bonus:hover { transform: translateY(1px); box-shadow: 0 2px 0 #cc9900; }
.ck-daily-bonus:active { transform: translateY(3px); box-shadow: none; }
.ck-daily-bonus.claimed { display: none; }

@keyframes ck-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.ck-notif-btn {
    width: 40px; height: 40px; background: rgba(255,255,255,0.2);
    border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; position: relative;
    transition: transform 0.15s;
}
.ck-notif-btn:hover { transform: scale(1.05); }
.ck-logout-icon-btn {
    text-decoration: none;
    font-size: 18px;
}
.ck-notif-dot {
    position: absolute; top: 0; right: 0;
    width: 14px; height: 14px; background: #ef4444;
    border-radius: 50%; border: 2px solid #00c800;
    display: flex; align-items: center; justify-content: center;
}
.ck-notif-dot span { font-size: 8px; color: #fff; font-weight: 700; }

.ck-user-chip {
    background: #008c00; border-radius: 999px;
    display: flex; align-items: center;
    padding: 4px 12px 4px 4px; gap: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer; transition: background 0.2s;
    text-decoration: none;
}
.ck-user-chip:hover { background: #007a00; }
.ck-user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid #00c800; background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
    color: #9ca3af;
}
.ck-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ck-user-avatar svg { width: 32px; height: 32px; margin-top: 8px; }

/* Los íconos de la tienda tipo "app icon" (item_cat.png, item_dog.png, item_vip.png)
   traen su propio marco/padding blanco integrado — cuando se usan como avatar
   (no en el catálogo de la tienda) se escalan para llenar el círculo. */
.ck-user-avatar img[src*="item_cat"], .ck-user-avatar img[src*="item_dog"], .ck-user-avatar img[src*="item_vip"],
.ckam-avatar img[src*="item_cat"], .ckam-avatar img[src*="item_dog"], .ckam-avatar img[src*="item_vip"],
.ckam-friend-avatar img[src*="item_cat"], .ckam-friend-avatar img[src*="item_dog"], .ckam-friend-avatar img[src*="item_vip"],
.ckam-discover-avatar img[src*="item_cat"], .ckam-discover-avatar img[src*="item_dog"], .ckam-discover-avatar img[src*="item_vip"],
#ckam-profile-avatar img[src*="item_cat"], #ckam-profile-avatar img[src*="item_dog"], #ckam-profile-avatar img[src*="item_vip"],
#ck-settings-avatar-preview[src*="item_cat"], #ck-settings-avatar-preview[src*="item_dog"], #ck-settings-avatar-preview[src*="item_vip"] {
    transform: scale(1.35);
}

/* Wrapper externo (sin overflow:hidden) que rodea el círculo recortado del
   avatar y aloja el glow/anillo premium + los planetas orbitando. Necesita
   su propio border-radius:50% — si no, el box-shadow del glow sale cuadrado. */
.ckam-avatar-outer {
    border-radius: 50%;
}

/* Compatibilidad con perfiles ya renderizados: las decoraciones antiguas
   no deben volver a cubrir la cara del avatar. */
.ckam-orbit {
    display: none !important;
}

/* Avatar premium (comprado en tienda): anillo dorado giratorio + brillo pulsante.
   Compartido con .ckam-avatar-premium en ckam-amigos.css (misma clase, distinto contexto). */
.ckam-avatar-premium {
    position: relative;
    box-shadow: 0 0 0 2px #fff, 0 0 12px 2px rgba(245, 158, 11, .65) !important;
    animation: ckamPremiumPulse 2.2s ease-in-out infinite, ckamPremiumFloat 3.4s ease-in-out infinite;
}
.ckam-avatar-premium::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    padding: 3px;
    background: conic-gradient(from 0deg, #fde68a, #f59e0b, #fbbf24, #fde68a);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ckamPremiumSpin 3s linear infinite;
    pointer-events: none;
}
@keyframes ckamPremiumSpin { to { transform: rotate(360deg); } }
@keyframes ckamPremiumPulse {
    0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 10px 2px rgba(245, 158, 11, .55) !important; }
    50%      { box-shadow: 0 0 0 2px #fff, 0 0 18px 5px rgba(245, 158, 11, .85) !important; }
}
@keyframes ckamPremiumFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-2px) scale(1.025); }
}

/* Tema "space" (avatares con temática espacial: gato astronauta, perro detective):
   en vez del anillo dorado clásico, un halo azul/morado + planetas y estrellas
   orbitando alrededor del avatar. */
.ckam-avatar-premium-space {
    box-shadow: 0 0 0 2px #fff, 0 0 14px 3px rgba(99, 102, 241, .6) !important;
    animation: ckamSpacePulse 2.6s ease-in-out infinite, ckamPremiumFloat 3.4s ease-in-out infinite;
}
.ckam-avatar-premium-space::before {
    background: conic-gradient(from 0deg, #a78bfa, #60a5fa, #38bdf8, #a78bfa);
}
.ckam-orbit {
    position: absolute;
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(0,0,0,.25));
    animation: ckamOrbitSpin linear infinite;
    transform-origin: center;
}
.ckam-orbit-1 { animation-duration: 4.5s; top: 50%; left: 50%; margin: -30px 0 0 -6px; }
.ckam-orbit-2 { animation-duration: 6s; animation-direction: reverse; top: 50%; left: 50%; margin: -30px 0 0 -6px; font-size: 10px; }
.ckam-orbit-3 { animation-duration: 3.2s; top: 50%; left: 50%; margin: -30px 0 0 -6px; font-size: 9px; }
@keyframes ckamOrbitSpin {
    from { transform: rotate(0deg) translateY(-30px) rotate(0deg); }
    to   { transform: rotate(360deg) translateY(-30px) rotate(-360deg); }
}
/* En el hero grande (100px) el radio de órbita se ve corto; lo ampliamos ahí. */
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-1,
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-2,
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-3 {
    margin-top: -58px;
}
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-1 { animation-name: ckamOrbitSpinHero1; }
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-2 { animation-name: ckamOrbitSpinHero2; }
.ckam-avatar.ckam-avatar-premium-space .ckam-orbit-3 { animation-name: ckamOrbitSpinHero3; }
@keyframes ckamOrbitSpinHero1 { from { transform: rotate(0deg) translateY(-58px) rotate(0deg); } to { transform: rotate(360deg) translateY(-58px) rotate(-360deg); } }
@keyframes ckamOrbitSpinHero2 { from { transform: rotate(0deg) translateY(-58px) rotate(0deg); } to { transform: rotate(-360deg) translateY(-58px) rotate(360deg); } }
@keyframes ckamOrbitSpinHero3 { from { transform: rotate(0deg) translateY(-58px) rotate(0deg); } to { transform: rotate(360deg) translateY(-58px) rotate(-360deg); } }
@keyframes ckamSpacePulse {
    0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 10px 2px rgba(99, 102, 241, .5) !important; }
    50%      { box-shadow: 0 0 0 2px #fff, 0 0 20px 6px rgba(99, 102, 241, .8) !important; }
}
@media (prefers-reduced-motion: reduce) {
    .ckam-orbit, .ckam-avatar-premium-space { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ckam-avatar-premium, .ckam-avatar-premium::before { animation: none; }
}

/* El efecto pertenece al círculo del avatar, nunca al contenedor externo.
   Así evita marcos cuadrados y deja la ilustración completamente visible. */
.ckam-avatar-outer.ckam-avatar-premium,
.ckam-avatar-outer.ckam-avatar-premium-space {
    animation: none !important;
    box-shadow: none !important;
}
.ckam-avatar-outer.ckam-avatar-premium::before,
.ckam-avatar-outer.ckam-avatar-premium-space::before {
    display: none !important;
}
.ckam-avatar-outer.ckam-avatar-premium > .ckam-avatar,
.ckam-avatar-outer.ckam-avatar-premium > .ck-user-avatar {
    border-radius: 50% !important;
    box-shadow: 0 0 0 3px #ffffff, 0 0 13px 4px rgba(245, 158, 11, .72) !important;
    animation: ckamAvatarGlow 1.8s ease-in-out infinite;
}
.ckam-avatar-outer.ckam-avatar-premium-space > .ckam-avatar,
.ckam-avatar-outer.ckam-avatar-premium-space > .ck-user-avatar {
    box-shadow: 0 0 0 3px #ffffff, 0 0 15px 5px rgba(96, 165, 250, .82) !important;
}
@keyframes ckamAvatarGlow {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50%      { transform: scale(1.055); filter: brightness(1.12); }
}
.ck-user-info { display: flex; flex-direction: column; justify-content: center; }
.ck-user-name { color: #fff; font-weight: 700; font-size: 14px; line-height: 1.2; }
.ck-user-grade { color: #ffcc00; font-weight: 900; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
.ck-user-icon {
    width: 32px; height: 32px; background: rgba(255,255,255,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-left: 4px; color: #fff;
}

.ck-mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: rgba(0,0,0,0.14);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.15s, background 0.15s;
}
.ck-mobile-menu-toggle:hover {
    background: rgba(0,0,0,0.2);
    transform: translateY(-1px);
}
.ck-mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.ck-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.58);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 99998;
}

.ck-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 360px);
    max-width: 360px;
    padding: 18px 14px 22px;
    background: linear-gradient(180deg, #0f7a3d 0%, #045f32 100%);
    color: #fff;
    transform: translateX(-104%);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.ck-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.16);
}
.ck-mobile-drawer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.ck-mobile-drawer-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ck-mobile-drawer-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
}
.ck-mobile-drawer-title {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ck-mobile-drawer-grade {
    font-size: 12px;
    font-weight: 700;
    color: #d1fae5;
}
.ck-mobile-drawer-close {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}
.ck-mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ck-mobile-drawer-nav .ck-subnav-btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    font-size: 14px;
}
.ck-mobile-drawer-nav .ck-subnav-btn.active {
    background: #ffcc00 !important;
    color: #14532d !important;
    box-shadow: 0 4px 0 #b88700 !important;
}
.ck-mobile-drawer-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.ck-mobile-drawer-pill {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.ck-mobile-drawer-pill-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.68);
}
.ck-mobile-drawer-pill-value {
    font-size: 16px;
    font-weight: 900;
}
.ck-mobile-drawer-links {
    display: grid;
    gap: 8px;
}
.ck-mobile-drawer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ck-mobile-drawer-section-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}
.ck-mobile-drawer-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}
.ck-mobile-drawer-accordions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ck-mobile-drawer-accordion {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    overflow: hidden;
}
.ck-mobile-drawer-accordion-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}
.ck-mobile-drawer-accordion-copy {
    flex: 1;
    min-width: 0;
}
.ck-mobile-drawer-accordion-summary::-webkit-details-marker {
    display: none;
}
.ck-mobile-drawer-accordion-chevron {
    font-size: 18px;
    line-height: 1;
    color: rgba(255,255,255,0.82);
    transition: transform 0.2s ease;
}
.ck-mobile-drawer-accordion[open] .ck-mobile-drawer-accordion-chevron {
    transform: rotate(180deg);
}
.ck-mobile-drawer-accordion-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px 14px;
}
.ck-mobile-drawer-accordion-body #ck-nav-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ck-mobile-drawer-accordion-body .ck-sidebar-pill-nav {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}
.ck-mobile-drawer-accordion-body .ck-sidebar-pill-btn {
    width: 100%;
    justify-content: flex-start;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 16px;
    box-shadow: none;
    margin: 0;
}

@media (min-width: 1101px) {
    .ck-mobile-backdrop,
    .ck-mobile-drawer {
        display: none;
    }
}

/* ═══════════════════════════════════════
   SECONDARY NAV
═══════════════════════════════════════ */
.ck-subnav {
    background: #008c00; padding: 10px 24px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.ck-subnav-left { display: flex; align-items: center; gap: 4px; }
.ck-subnav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ck-subnav-credits {
    order: 1;
    margin-left: auto;
    margin-right: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    min-height: 46px;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255,204,0,0.22), rgba(255,255,255,0.12)),
        rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.16),
        0 6px 18px rgba(0,0,0,0.14);
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.ck-subnav-credits::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.18) 48%, transparent 100%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
}
.ck-subnav-credits:hover::before {
    transform: translateX(120%);
}
.ck-subnav-credits:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}
.ck-subnav-credits-kicker,
.ck-subnav-credits-values {
    position: relative;
    z-index: 1;
}
.ck-subnav-credits-kicker {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.ck-subnav-credits-values {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ck-subnav-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    color: #111827;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
.ck-subnav-credit-pill .coin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ck-subnav-credit-pill.gold .coin {
    background: radial-gradient(circle at 35% 35%, #FFF176, #FFD700, #B8860B);
    border: 1px solid #CC8800;
}
.ck-subnav-credit-pill.silver .coin {
    background: radial-gradient(circle at 35% 35%, #f8f8f8, #C0C0C0, #808080);
    border: 1px solid #999;
}
.ck-subnav-btn {
    color: #fff; padding: 6px 12px; border-radius: 999px;
    font-weight: 700; font-size: 13px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    transition: background 0.2s;
    text-decoration: none; font-family: inherit;
    white-space: nowrap;
}
.ck-subnav-btn:hover { background: rgba(255,255,255,0.1); }
.ck-subnav-btn.active {
    background: #fff; color: #059669;
    box-shadow: none;
}
.ck-subnav-btn .icon { font-size: 16px; }
.ck-subnav-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.3); margin: 0 12px; }

.ck-subnav-create {
    order: 2;
    background: #ffcc00; color: #000; padding: 6px 14px;
    border-radius: 999px; font-weight: 900; font-size: 13px;
    border: none; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 3px 0 #cc9900; transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.ck-subnav-create:hover { transform: translateY(1px); box-shadow: 0 2px 0 #cc9900; }

.ck-subnav-create,
.ck-subnav-credits {
    display: none !important;
}

.ck-subnav-premium-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd84d 0%, #ffbf00 100%);
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.65),
        0 4px 0 #c58c00,
        0 10px 20px rgba(0,0,0,0.12);
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.ck-subnav-premium-card:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}
.ck-subnav-premium-card .spark {
    font-size: 14px;
    color: #0ea5e9;
}

.ck-subnav-credit-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 6px 12px 6px 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(4,78,59,0.95) 0%, rgba(6,95,70,0.95) 100%);
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 8px 18px rgba(0,0,0,0.14);
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}
.ck-subnav-credit-card:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        0 10px 22px rgba(0,0,0,0.18);
}
.ck-subnav-credit-card-label {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #d1fae5;
    white-space: nowrap;
}
.ck-subnav-credit-card-values {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ck-subnav-credit-card-values .mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    color: #111827;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}
.ck-subnav-credit-card-values .mini .coin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ck-subnav-credit-card-values .mini.gold .coin {
    background: radial-gradient(circle at 35% 35%, #FFF176, #FFD700, #B8860B);
    border: 1px solid #CC8800;
}
.ck-subnav-credit-card-values .mini.silver .coin {
    background: radial-gradient(circle at 35% 35%, #f8f8f8, #C0C0C0, #808080);
    border: 1px solid #999;
}

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════ */
.ck-main {
    flex: 1;
    padding: clamp(12px, 1.25vw, 24px);
    display: flex;
    gap: clamp(12px, 1.25vw, 24px);
    overflow: visible;
    max-width: none;
    margin: 0;
    width: 100%;
}

/* ═══════════════════════════════════════
   LEFT SIDEBAR
═══════════════════════════════════════ */
.ck-sidebar-left {
    width: 280px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 16px;
    margin-left: 24px;
    align-self: flex-start;
    position: sticky; top: 24px;
    max-height: calc(100vh - 180px);
    overflow-y: auto; overflow-x: hidden;
    background: transparent;
}
/* Scroll gris claro para barra izquierda */
.ck-sidebar-left::-webkit-scrollbar { width: 6px; }
.ck-sidebar-left::-webkit-scrollbar-track { background: transparent; }
.ck-sidebar-left::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }
.ck-sidebar-left::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.ck-sidebar-pill-nav {
    background: transparent;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 3px solid #22c55e;
    border-radius: 16px;
}
.ck-sidebar-pill-btn {
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: #1e293b;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}
.ck-sidebar-pill-btn:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transform: none;
}

.ck-sidebar-pill-btn:active {
    transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.ck-sidebar-pill-btn.active {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(34,197,94,0.35);
    transform: none;
}
.ck-sidebar-pill-btn.active .ck-pill-icon {
    background: rgba(255,255,255,0.25) !important;
}

/* Icon chip inside pill buttons */
.ck-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 18px;
    flex-shrink: 0;
}

/* Original Sidebar Styles (Restored) */
.ck-sidebar-nav {
    background: transparent;
    border-radius: 0;
    padding: 16px; display: flex; flex-direction: column; gap: 12px;
    box-shadow: none;
    border: none;
}

.ck-sidebar-btn {
    padding: 10px 16px; border-radius: 16px;
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; gap: 12px;
    border: none; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
    text-decoration: none; color: #374151;
    background: #f5ebd6;
    box-shadow: 0 4px 0 #e0d4bc;
}

.ck-sidebar-btn:hover {
    background: #ffcc00; color: #000;
    transform: scale(1.02);
}

.ck-sidebar-btn:active {
    transform: scale(1) translateY(2px);
    box-shadow: 0 2px 0 #e0d4bc;
}

.ck-sidebar-btn.active {
    background: #ffcc00; color: #000; font-weight: 900;
    box-shadow: 0 4px 0 #cc9900;
}

.ck-sidebar-btn .icon { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1)); }

.ck-sidebar-btn:hover {
    background: #ffcc00; color: #000;
    transform: scale(1.02);
}
.ck-sidebar-btn:active {
    transform: scale(1) translateY(2px);
    box-shadow: 0 2px 0 #e0d4bc;
}
.ck-sidebar-btn.active {
    background: #ffcc00;
    color: #000;
    font-weight: 900;
    box-shadow: 0 4px 0 #cc9900;
    transform: scale(1.05);
}
.ck-sidebar-btn.active-old {
    background: #ffcc00; color: #000; font-weight: 900;
    box-shadow: 0 4px 0 #cc9900;
}
.ck-sidebar-btn .icon { font-size: 20px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1)); }

/* Credits Widget */
.ck-credits-widget {
    background: linear-gradient(135deg, #FFB700, #FF6B00);
    border: 4px solid #000;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 4px 4px 0 rgba(0,0,0, 0.15);
    margin-top: 16px;
}
.ck-credits-widget-title {
    font-weight: 900;
    font-size: 13px;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
    font-family: Arial, Helvetica, sans-serif;
}
.ck-credits-widget-title span {
    font-size: 1.2em;
    margin-right: 6px;
    display: inline-block;
}
.ck-credits-list {
    display: flex;
    gap: 8px;
    flex-direction: column;
}
.ck-credits-row {
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    color: #000;
}
.ck-credits-row.silver {
    background: rgba(255, 255, 255, 0.7);
    color: #333;
}
.ck-credits-row span.emoji {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
.ck-subnav-left form + .ck-subnav-btn {
    display: none !important;
}

.ck-sidebar-right .ck-credits-widget,
.ck-sidebar-right .ck-social-btn {
    display: none !important;
}

/* Points Widget */
.ck-points-widget {
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
    border: 2px solid #00a000;
    margin-top: 8px; position: relative;
}
.ck-points-widget:hover .ck-share-btn { opacity: 1; }
.ck-points-top {
    background: #00c800; padding: 16px;
    display: flex; align-items: center; justify-content: center; gap: 12px;
}
.ck-points-star { font-size: 50px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.ck-points-value {
    color: #fff; font-weight: 900; font-size: 40px;
    text-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.ck-points-bottom {
    background: #ffcc00; padding: 8px 4px;
    text-align: center; font-size: 11px; font-weight: 900;
    color: #000; border-top: 2px solid #00a000;
}

/* Profile Link Button */
.ck-profile-btn {
    background: #ffcc00; color: #000;
    padding: 12px; border-radius: 999px;
    font-weight: 900; font-size: 18px;
    border: none; cursor: pointer; width: 100%;
    box-shadow: 0 4px 0 #cc9900;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.15s; margin-top: 4px; font-family: inherit;
    text-decoration: none;
}
.ck-profile-btn:hover { transform: scale(1.02); filter: brightness(1.05); }
.ck-profile-btn:active { transform: scale(1) translateY(2px); box-shadow: 0 2px 0 #cc9900; }

/* User Card */
.ck-user-card {
    background: #fff8e7; border-radius: 32px;
    padding: 16px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.5);
    margin-top: auto;
}
.ck-user-card-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    border: 2px solid #16a34a; background: #4ade80;
    overflow: hidden; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.ck-user-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ck-user-card-info { flex: 1; display: flex; flex-direction: column; }
.ck-user-card-name { font-weight: 900; font-size: 16px; color: #1f2937; line-height: 1.2; }
.ck-user-card-link {
    background: #f5ebd6; color: #4b5563; font-size: 12px;
    font-weight: 700; padding: 4px 12px; border-radius: 999px;
    margin-top: 6px; width: fit-content; border: none; cursor: pointer;
    box-shadow: 0 2px 0 #e0d4bc; transition: background 0.2s;
    text-decoration: none; font-family: inherit;
}
.ck-user-card-link:hover { background: #e8dec9; }

/* Share Button */
.ck-share-btn {
    position: absolute; top: 8px; right: 8px;
    background: #3b82f6; color: #fff;
    width: 32px; height: 32px; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0; transition: opacity 0.2s;
    z-index: 10;
}
.ck-share-btn:hover { background: #2563eb; }

/* ═══════════════════════════════════════
   CENTER COLUMN
═══════════════════════════════════════ */
/* .ck-gallery-scroll es el wrapper de fallback que layouts/student.blade.php
   genera para vistas sin @section('student_content'). Debe compartir la misma
   geometria que .ck-center para que el marco exterior sea identico al patron
   de /mi-clase/gallery/enciclomedia. */
.ck-center,
.ck-gallery-scroll {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 24px;
    padding-right: 8px;
    min-height: 100%;
    position: sticky; top: 24px;
    max-height: calc(100vh - 180px);
    overflow-y: auto; overflow-x: hidden;
}
.ck-center::-webkit-scrollbar,
.ck-gallery-scroll::-webkit-scrollbar { width: 6px; }
.ck-center::-webkit-scrollbar-track,
.ck-gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.ck-center::-webkit-scrollbar-thumb,
.ck-gallery-scroll::-webkit-scrollbar-thumb { background: #00c800; border-radius: 6px; }
.ck-center::-webkit-scrollbar-thumb:hover,
.ck-gallery-scroll::-webkit-scrollbar-thumb:hover { background: #00a000; }

/* Hero Banner */
.ck-hero {
    background: linear-gradient(135deg, #00c800, #009900);
    border-radius: 32px; padding: 24px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    min-height: 160px;
}
.ck-hero-content { position: relative; z-index: 1; width: 66%; }
.ck-hero h1 {
    color: #fff; font-weight: 900; font-size: 40px;
    margin-bottom: 8px; text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ck-hero p {
    color: #fff; font-weight: 700; font-size: 16px;
    margin-bottom: 16px; text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.ck-hero-btn {
    background: #ffcc00; color: #000;
    padding: 14px 32px; border-radius: 999px;
    font-weight: 900; font-size: 20px;
    border: none; cursor: pointer;
    box-shadow: 0 5px 0 #cc9900;
    display: inline-flex; align-items: center; gap: 12px;
    transition: all 0.15s; width: fit-content; font-family: inherit;
}
.ck-hero-btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 #cc9900; }
.ck-hero-btn:active { transform: translateY(5px); box-shadow: none; }
.ck-hero-btn.loading { opacity: 0.8; cursor: not-allowed; }
.ck-hero-btn .play-icon {
    background: #2563eb; color: #fff;
    width: 24px; height: 24px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.ck-hero-rocket {
    position: absolute; right: 32px; top: 50%; transform: translateY(-50%) rotate(-15deg);
    width: 180px; height: 180px;
}
.ck-hero-rocket-glow {
    width: 100%; height: 100%; background: #fff; border-radius: 50%;
    opacity: 0.2; filter: blur(48px); position: absolute;
}
.ck-hero-rocket-emoji {
    font-size: 120px; position: relative; z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); line-height: 1;
}

/* Cards Row */
.ck-row { display: flex; gap: 24px; }
.ck-row-240 { height: 240px; }
.ck-row-160 { height: 160px; }

/* Card Base */
.ck-card {
    flex: 1;
    background: #fff8e7; border-radius: 32px;
    padding: 16px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.5);
    display: flex; flex-direction: column;
}
.ck-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.ck-card-title { font-weight: 900; font-size: 20px; color: #1f2937; }
.ck-card-arrow {
    color: #9ca3af; font-weight: 700; font-size: 24px;
    cursor: pointer; transition: color 0.2s;
    background: none; border: none; font-family: inherit;
}
.ck-card-arrow:hover { color: #4b5563; }

/* Mission Card */
.ck-mission-select {
    background: #fff; border: 2px solid #e5e7eb;
    border-radius: 12px; padding: 8px 12px;
    font-size: 14px; font-weight: 700; color: #4b5563;
    outline: none; cursor: pointer; font-family: inherit;
}
.ck-mission-select:focus { border-color: #00c800; }

.ck-mission-item {
    background: #fff; border-radius: 16px;
    padding: 16px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 3px 0 #e0d4bc; border: 1px solid #f3f4f6;
    cursor: pointer; transition: background 0.2s;
}
.ck-mission-item:hover { background: #f9fafb; }
.ck-mission-icon {
    width: 56px; height: 56px; background: #dcfce7;
    border-radius: 50%; border: 2px solid #22c55e;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; flex-shrink: 0;
}
.ck-mission-info { flex: 1; min-width: 0; }
.ck-mission-name { font-weight: 900; font-size: 18px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.ck-mission-pts { color: #00a000; font-weight: 700; font-size: 16px; }
.ck-mission-bar { width: 100%; background: #e5e7eb; border-radius: 999px; height: 8px; margin-top: 4px; border: 1px solid #d1d5db; overflow: hidden; }
.ck-mission-fill { background: #00c800; height: 100%; border-radius: 999px; transition: width 0.5s; }
.ck-mission-pct { font-size: 10px; color: #9ca3af; font-weight: 700; text-align: right; margin-top: 2px; }
.ck-mission-play {
    width: 48px; height: 48px; background: #0055cc;
    border-radius: 12px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    box-shadow: 0 4px 0 #003399; transition: all 0.15s;
}
.ck-mission-play:active { transform: translateY(4px); box-shadow: none; }
.ck-mission-placeholder {
    background: #f5ebd6; border-radius: 16px;
    height: 56px; margin-top: 16px; opacity: 0.5;
}

/* Achievement Badges (Center) */
.ck-achiev-row { display: flex; justify-content: space-between; padding: 0 8px; margin-bottom: 20px; }
.ck-achiev-item { display: flex; flex-direction: column; align-items: center; }
.ck-achiev-circle {
    width: 64px; height: 64px; border-radius: 50%;
    border: 3px solid; display: flex; align-items: center; justify-content: center;
    font-size: 30px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: relative;
}
.ck-achiev-count {
    position: absolute; bottom: -12px;
    background: #ffcc00; color: #000; font-size: 12px; font-weight: 900;
    padding: 2px 10px; border-radius: 999px; border: 2px solid #cc9900;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); white-space: nowrap;
}

/* Action Buttons Row */
.ck-action-btn {
    flex: 1; border-radius: 32px; border: 2px solid rgba(255,255,255,0.3);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; cursor: pointer;
    box-shadow: 0 8px 0; transition: all 0.15s;
    text-decoration: none; border-style: solid;
}
.ck-action-btn:hover { transform: translateY(2px); }
.ck-action-btn:active { transform: translateY(8px); box-shadow: none !important; }
.ck-action-btn .icon { font-size: 60px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); transition: transform 0.2s; }
.ck-action-btn:hover .icon { transform: scale(1.1); }
.ck-action-btn .label {
    color: #fff; font-weight: 900; font-size: 30px;
    text-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.ck-action-jugar {
    background: linear-gradient(180deg, #ffcc00, #ffaa00);
    box-shadow: 0 8px 0 #cc7700;
}
.ck-action-jugar:hover { box-shadow: 0 6px 0 #cc7700; }
.ck-action-crear {
    background: linear-gradient(180deg, #33ccff, #0088ff);
    box-shadow: 0 8px 0 #0055cc;
}
.ck-action-crear:hover { box-shadow: 0 6px 0 #0055cc; }

.ck-yellow-btn {
    background: #ffcc00; color: #000; width: 100%;
    padding: 10px; border-radius: 999px; font-weight: 900;
    font-size: 16px; border: none; cursor: pointer;
    box-shadow: 0 4px 0 #cc9900; margin-top: auto;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.15s; font-family: inherit;
    text-decoration: none;
}
.ck-yellow-btn:hover { transform: scale(1.02); filter: brightness(1.05); }
.ck-yellow-btn:active { transform: scale(1) translateY(4px); box-shadow: none; }

/* ═══════════════════════════════════════
   RIGHT SIDEBAR
═══════════════════════════════════════ */
.ck-sidebar-right {
    width: 300px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 24px;
    align-self: flex-start;
    position: sticky; top: 24px;
    max-height: calc(100vh - 180px);
    overflow-y: auto; overflow-x: hidden;
}
/* Scroll verde para barra derecha */
.ck-sidebar-right::-webkit-scrollbar { width: 6px; }
.ck-sidebar-right::-webkit-scrollbar-track { background: transparent; }
.ck-sidebar-right::-webkit-scrollbar-thumb { background: #00c800; border-radius: 6px; }
.ck-sidebar-right::-webkit-scrollbar-thumb:hover { background: #00a000; }


/* Medals Grid */
.ck-medals-filter {
    margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.ck-medals-search-bar {
    background: #fff; border-radius: 999px;
    display: flex; align-items: center;
    padding: 8px 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}
.ck-medals-search-bar:focus-within { border-color: #00c800; }
.ck-medals-search-bar .search-icon { color: #9ca3af; margin-right: 8px; font-size: 14px; }
.ck-medals-search-input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; font-weight: 700; color: #4b5563; font-family: inherit;
}
.ck-medals-sort {
    display: flex; justify-content: flex-end; gap: 8px;
    font-size: 12px; font-weight: 700; color: #6b7280;
}
.ck-medals-sort button {
    background: none; border: none; cursor: pointer;
    font-weight: 700; font-size: 12px; color: #6b7280;
    transition: color 0.2s; font-family: inherit;
}
.ck-medals-sort button:hover { color: #1f2937; }
.ck-medals-sort button.active { color: #00a000; text-decoration: underline; }

.ck-medals-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px 4px; margin-bottom: 16px;
    min-height: auto; align-content: start;
}
.ck-medal { display: flex; flex-direction: column; align-items: center; position: relative; }
.ck-medal-circle {
    width: 56px; height: 56px; border-radius: 50%;
    border: 3px solid; display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative; cursor: pointer; transition: transform 0.15s;
}
.ck-medal-circle:hover { transform: scale(1.05); }
.ck-medal-count {
    position: absolute; bottom: -10px;
    background: #ffcc00; color: #000; font-size: 10px; font-weight: 900;
    padding: 1px 8px; border-radius: 999px; border: 2px solid #cc9900;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); white-space: nowrap;
}
.ck-medal-share {
    position: absolute; top: -8px; right: -8px;
    background: #3b82f6; color: #fff;
    width: 24px; height: 24px; border-radius: 50%;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0; transition: opacity 0.2s; z-index: 10;
}
.ck-medal:hover .ck-medal-share { opacity: 1; }
.ck-medal-share:hover { background: #2563eb; }
.ck-medals-empty { grid-column: 1 / -1; text-align: center; color: #6b7280; font-weight: 700; font-size: 14px; padding: 32px 0; }

/* Social Links */
.ck-social-card {
    background: #fff8e7; border-radius: 32px;
    padding: 12px; display: flex; flex-direction: column; gap: 12px;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.5);
}
.ck-social-btn {
    background: #f5ebd6; width: 100%;
    padding: 16px 20px; border-radius: 24px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 0 #e0d4bc;
    cursor: pointer; border: none; font-family: inherit;
    transition: all 0.15s;
}
.ck-social-btn:hover { background: #ffcc00; transform: scale(1.02); }
.ck-social-btn:active { transform: scale(1) translateY(4px); box-shadow: none; }
.ck-social-btn-left { display: flex; align-items: center; gap: 16px; }
.ck-social-btn .icon { font-size: 30px; }
.ck-social-btn .label { font-weight: 900; font-size: 20px; color: #1f2937; }
.ck-social-btn .arrow { color: #9ca3af; font-weight: 700; font-size: 24px; }
.ck-social-btn:hover .arrow { color: #000; }

/* Logout Button */
.ck-logout-btn {
    background: linear-gradient(180deg, #ff4d4d, #cc0000);
    color: #fff; width: 100%; padding: 16px;
    border-radius: 999px; font-weight: 900; font-size: 24px;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 6px 0 #990000;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 12px; transition: all 0.15s; margin-top: auto; font-family: inherit;
}
.ck-logout-btn:hover { transform: translateY(2px); box-shadow: 0 4px 0 #990000; }
.ck-logout-btn:active { transform: translateY(6px); box-shadow: none; }

/* ═══════════════════════════════════════
   MODALS
═══════════════════════════════════════ */
.ck-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 50; display: flex; align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(4px);
}
.ck-modal {
    background: #fff; border-radius: 32px;
    padding: 32px; max-width: 480px; width: 100%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    border: 4px solid #ffcc00;
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
}
.ck-modal-icon { font-size: 60px; margin-bottom: 16px; }
.ck-modal h2 { font-weight: 900; font-size: 30px; color: #1f2937; margin-bottom: 8px; }
.ck-modal p { color: #4b5563; font-weight: 700; font-size: 18px; margin-bottom: 24px; }
.ck-modal-rewards {
    background: #fff8e7; border-radius: 16px;
    padding: 16px; width: 100%; margin-bottom: 24px;
    border: 2px solid #ffcc00;
}
.ck-modal-rewards h3 { font-weight: 900; color: #1f2937; margin-bottom: 12px; }
.ck-modal-rewards-row { display: flex; justify-content: center; gap: 16px; }
.ck-modal-reward {
    display: flex; align-items: center; gap: 8px;
    background: #fff; padding: 8px 12px; border-radius: 12px;
    border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.ck-modal-reward .icon { font-size: 24px; }
.ck-modal-reward .value { font-weight: 900; }
.ck-modal-reward .value-green { color: #00a000; }
.ck-modal-reward .value-gold { color: #cc9900; }

.ck-modal-ok {
    background: #00c800; color: #fff; width: 100%;
    padding: 14px; border-radius: 999px; font-weight: 900; font-size: 20px;
    border: none; cursor: pointer;
    box-shadow: 0 4px 0 #008c00; transition: all 0.15s; font-family: inherit;
}
.ck-modal-ok:hover { transform: translateY(2px); box-shadow: 0 2px 0 #008c00; }
.ck-modal-ok:active { transform: translateY(4px); box-shadow: none; }

/* ═══════════════════════════════════════
   NOTIFICATIONS (Toast)
═══════════════════════════════════════ */
.ck-toast {
    position: fixed; bottom: 32px; right: 32px; z-index: 50;
    background: #fff; border-radius: 16px;
    padding: 12px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-left: 8px solid #00c800;
    display: flex; align-items: center; gap: 16px;
    transform: translateY(100px); opacity: 0;
    transition: all 0.5s ease;
}
.ck-toast.show { transform: translateY(0); opacity: 1; }
.ck-toast-icon {
    width: 40px; height: 40px; background: #ffcc00;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); flex-shrink: 0;
}
.ck-toast-label { color: #6b7280; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.ck-toast-text { color: #1f2937; font-weight: 900; font-size: 16px; }

/* ═══════════════════════════════════════
   LOADING SPINNER
═══════════════════════════════════════ */
@keyframes ck-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.ck-spinner {
    width: 24px; height: 24px;
    border: 4px solid rgba(0,0,0,0.15);
    border-top-color: #000;
    border-radius: 50%;
    animation: ck-spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

/* ── Ultra-wide / 4K (>1920px) ── */
@media (min-width: 1921px) {
    .ck-main { max-width: none; margin: 0; }
    .ck-sidebar-left { width: 320px; }
    .ck-sidebar-right { width: 320px; }
}

@media (min-width: 1600px) and (max-width: 1920px) {
    .ck-sidebar-left { width: 300px; }
    .ck-sidebar-right { width: 300px; }
    .ck-center, .ck-gallery-scroll { padding-right: 0; }
}

/* ── Large desktop (1440–1920px) ── */
@media (max-width: 1440px) {
    .ck-sidebar-left { width: 260px; }
    .ck-sidebar-right { width: 280px; }
    .ck-sidebar-btn { font-size: 18px; padding: 12px 16px; gap: 12px; }
    .ck-sidebar-btn .icon { font-size: 26px; }
    .ck-social-btn .label { font-size: 18px; }
    .ck-social-btn .icon { font-size: 26px; }
}

/* ── Standard laptop (1280–1440px) ── */
@media (max-width: 1280px) {
    .ck-sidebar-left { width: 220px; }
    .ck-sidebar-right { width: 240px; }
    .ck-sidebar-btn { font-size: 16px; padding: 10px 14px; gap: 10px; }
    .ck-sidebar-btn .icon { font-size: 22px; }
    .ck-hero h1 { font-size: 34px; }
    .ck-hero-btn { font-size: 18px; padding: 12px 28px; }
    .ck-card-title { font-size: 18px; }
    .ck-mission-name { font-size: 16px; }
    .ck-action-btn .label { font-size: 24px; }
    .ck-action-btn .icon { font-size: 48px; }
    .ck-social-btn .label { font-size: 16px; }
    .ck-social-btn .icon { font-size: 24px; }
    .ck-points-value { font-size: 34px; }
    .ck-points-star { font-size: 42px; }
    .ck-search-placeholder { font-size: 16px; }
    .ck-search-input { font-size: 16px; }
    .ck-subnav-btn { font-size: 16px; }
}

/* ── Small laptop / large tablet (1024–1280px) ── */
@media (max-width: 1100px) {
    .ck-sidebar-left { display: none; }
    .ck-sidebar-right { display: none; }
    .ck-main { padding: 16px; gap: 16px; }
    .ck-hero h1 { font-size: 32px; }
    .ck-hero p { font-size: 16px; }
    .ck-hero-btn { font-size: 16px; padding: 10px 24px; }
    .ck-hero-rocket { width: 140px; height: 140px; }
    .ck-hero-rocket-emoji { font-size: 90px; }
    .ck-subnav-btn { font-size: 15px; padding: 7px 14px; }
    .ck-subnav-create { font-size: 15px; padding: 7px 20px; }
}

/* ── Tablet landscape (900–1100px) ── */
@media (max-width: 1100px) {
    .ck-main { padding: 12px; gap: 12px; }
    .ck-row { flex-direction: column; }
    .ck-row-240, .ck-row-160 { height: auto; }
    .ck-hero-rocket { display: none; }
    .ck-hero-content { width: 100%; }
    .ck-hero { min-height: auto; padding: 20px; border-radius: 24px; }
    .ck-hero h1 { font-size: 28px; }
    .ck-hero-btn { font-size: 15px; padding: 10px 20px; }
    .ck-mobile-menu-toggle { display: inline-flex; }
    .ck-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        padding: 8px 16px;
        gap: 8px;
    }
    .ck-header > div:first-child {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }
    .ck-search { max-width: none; margin: 8px 0 0; order: 4; grid-column: 1 / -1; }
    .ck-search-placeholder { font-size: 14px; }
    .ck-search-input { font-size: 14px; }
    .ck-subnav {
        padding: 8px 10px;
        gap: 8px;
        overflow: visible;
    }
    .ck-subnav-left {
        display: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ck-subnav-left::-webkit-scrollbar { display: none; }
    .ck-subnav-btn { font-size: 14px; padding: 6px 12px; white-space: nowrap; }
    .ck-subnav-sep { margin: 0 6px; }
    .ck-subnav-create { font-size: 14px; padding: 6px 16px; }
    .ck-user-info { display: none; }
    .ck-user-icon { display: none; }
    .ck-user-chip { padding: 4px; }
    .ck-daily-bonus { font-size: 12px; padding: 5px 12px; min-width: 100px; }
    .ck-card { border-radius: 24px; padding: 14px; }
    .ck-card-title { font-size: 17px; }
    .ck-action-btn .label { font-size: 22px; }
    .ck-action-btn .icon { font-size: 44px; }
    .ek-grid { grid-template-columns: 1fr; padding: 0 16px 16px; }
    .ek-hero-content h1 { font-size: 32px; }
    .ck-subnav-actions {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }
    .ck-subnav-premium-card,
    .ck-subnav-credit-card {
        flex: 1 1 220px;
        min-width: 0;
        justify-content: center;
    }
    body.ck-mobile-nav-open {
        overflow: hidden !important;
    }
    body.ck-mobile-nav-open .ck-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.ck-mobile-nav-open .ck-mobile-drawer {
        transform: translateX(0);
        box-shadow: 0 24px 56px rgba(0,0,0,0.32);
    }
}

/* ── Tablet portrait / large phone (700–900px) ── */
@media (max-width: 700px) {
    html, body { overflow: auto !important; }
    .ck-shell { position: relative; height: auto; min-height: 100vh; }
    .ck-main { flex-direction: column; overflow: visible; padding: 10px; gap: 10px; }
    .ck-center, .ck-gallery-scroll { overflow: visible; padding-right: 0; position: static; max-height: none; }
    .ck-header { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
    .ck-search { max-width: none; margin: 8px 0 0; order: 3; flex: 0 0 100%; }
    .ck-search-bar { padding: 5px 8px 5px 12px; }
    .ck-search-btn { width: 28px; height: 28px; }
    .ck-subnav { padding: 6px 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .ck-subnav::-webkit-scrollbar { display: none; }
    .ck-subnav-btn { font-size: 13px; padding: 5px 10px; gap: 6px; }
    .ck-subnav-btn .icon { font-size: 16px; }
    .ck-subnav-sep { margin: 0 4px; height: 20px; }
    .ck-subnav-create { font-size: 13px; padding: 5px 14px; }
    .ck-hero { min-height: auto; padding: 16px; border-radius: 20px; }
    .ck-hero h1 { font-size: 24px; margin-bottom: 6px; }
    .ck-hero p { font-size: 14px; margin-bottom: 12px; }
    .ck-hero-btn { font-size: 14px; padding: 10px 20px; }
    .ck-card { border-radius: 20px; padding: 12px; }
    .ck-card-title { font-size: 16px; }
    .ck-card-header { margin-bottom: 8px; }
    .ck-row { gap: 10px; }
    .ck-mission-item { padding: 12px; gap: 12px; border-radius: 14px; }
    .ck-mission-icon { width: 44px; height: 44px; font-size: 24px; }
    .ck-mission-name { font-size: 15px; max-width: 120px; }
    .ck-mission-play { width: 40px; height: 40px; border-radius: 10px; }
    .ck-action-btn .label { font-size: 20px; }
    .ck-action-btn .icon { font-size: 40px; }
    .ck-action-btn { border-radius: 24px; gap: 6px; }
    .ck-achiev-circle { width: 52px; height: 52px; font-size: 24px; }
    .ck-notif-btn { width: 36px; height: 36px; font-size: 18px; }
    .ck-header-right { gap: 8px; }
    .ck-daily-bonus { font-size: 11px; padding: 4px 10px; min-width: auto; }
    .ek-hero-content h1 { font-size: 26px; }
    .ek-hero-trophy { font-size: 60px; }
    .ek-hero { padding: 20px 16px; min-height: auto; }
    .ek-widget-title { font-size: 16px; }
    .ek-games-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; padding: 8px 12px 12px; }
    .ek-game-card { min-height: 130px; padding: 14px 10px; }
    .ek-game-icon { font-size: 36px; }
    .ek-game-title { font-size: 13px; }
    .ck-mobile-drawer {
        width: min(90vw, 340px);
    }
    .ck-card {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ck-subnav-actions {
        gap: 8px;
    }
    .ck-subnav-premium-card,
    .ck-subnav-credit-card {
        flex: 1 1 100%;
        width: 100%;
    }
    .ck-main :where(table) {
        min-width: 640px;
    }
    .ck-main :where(.table-responsive, .overflow-x-auto, .responsive-table-shell) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Phone (480–700px) ── */
@media (max-width: 480px) {
    .ck-header { padding: 6px 8px; }
    .ck-header > div:first-child img { height: 36px; }
    .ck-header > div:first-child > div:last-child { display: none; }
    .ck-main { padding: 8px; gap: 8px; }
    .ck-hero { padding: 14px; border-radius: 18px; box-shadow: 0 4px 0 rgba(0,0,0,0.1); }
    .ck-hero h1 { font-size: 20px; }
    .ck-hero p { font-size: 13px; }
    .ck-hero-btn { font-size: 13px; padding: 8px 16px; box-shadow: 0 3px 0 #cc9900; }
    .ck-card { border-radius: 18px; padding: 10px; box-shadow: 0 4px 0 rgba(0,0,0,0.08); }
    .ck-card-title { font-size: 15px; }
    .ck-subnav-btn { font-size: 12px; padding: 4px 8px; gap: 4px; }
    .ck-subnav-btn .icon { font-size: 14px; }
    .ck-subnav-create { font-size: 12px; padding: 4px 12px; }
    .ck-subnav-sep { display: none; }
    .ck-mission-item { padding: 10px; gap: 10px; }
    .ck-mission-icon { width: 38px; height: 38px; font-size: 20px; }
    .ck-mission-name { font-size: 14px; max-width: 100px; }
    .ck-mission-pts { font-size: 14px; }
    .ck-mission-play { width: 36px; height: 36px; }
    .ck-action-btn .label { font-size: 16px; }
    .ck-action-btn .icon { font-size: 32px; }
    .ck-action-btn { border-radius: 20px; box-shadow-offset-y: 4px; }
    .ck-achiev-row { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .ck-achiev-circle { width: 44px; height: 44px; font-size: 20px; }
    .ck-achiev-count { font-size: 10px; padding: 1px 6px; }
    .ck-yellow-btn { font-size: 14px; padding: 8px; }
    .ck-notif-btn { width: 32px; height: 32px; font-size: 16px; }
    .ck-user-avatar { width: 34px; height: 34px; }
    .ck-daily-bonus { display: none; }
    .ck-toast { bottom: 16px; right: 16px; left: 16px; border-radius: 12px; padding: 10px 14px; }
    .ck-toast-icon { width: 32px; height: 32px; font-size: 16px; }
    .ck-modal { padding: 24px 20px; border-radius: 24px; border-width: 3px; }
    .ck-modal h2 { font-size: 24px; }
    .ck-modal p { font-size: 15px; }
    .ck-modal-icon { font-size: 48px; }
    .ek-hero-content h1 { font-size: 22px; }
    .ek-hero-trophy { font-size: 48px; margin-left: 12px; }
    .ek-hero { padding: 16px 12px; }
    .ek-widget-header { padding: 10px 12px; }
    .ek-widget-title { font-size: 15px; }
    .ek-games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 8px 10px 10px; }
    .ek-game-card { min-height: 110px; padding: 12px 8px; }
    .ek-game-icon { font-size: 30px; margin-bottom: 6px; }
    .ek-game-title { font-size: 12px; }
    .ek-game-desc { font-size: 11px; }
    .ek-medals-grid { grid-template-columns: repeat(3, 1fr); gap: 10px 4px; }
    .ek-medal-icon { width: 44px; height: 44px; font-size: 22px; }
    .ek-medal-label { font-size: 10px; }
    .ek-cog-value { font-size: 36px; }
    .ek-cog-card { padding: 14px; }
    .ck-mobile-menu-toggle,
    .ck-mobile-drawer-close {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .ck-mobile-drawer {
        width: min(94vw, 320px);
        padding: 16px 12px 20px;
    }
    .ck-mobile-drawer-header {
        padding-bottom: 12px;
    }
    .ck-mobile-drawer-meta {
        grid-template-columns: 1fr;
    }
    .ck-mobile-drawer-nav .ck-subnav-btn {
        min-height: 46px;
        padding: 11px 13px;
        font-size: 13px;
    }
}

/* ── Small phone (<380px) ── */
@media (max-width: 380px) {
    .ck-header { padding: 4px 6px; }
    .ck-header > div:first-child img { height: 30px; }
    .ck-search-bar { padding: 4px 6px 4px 10px; }
    .ck-search-placeholder { font-size: 13px; }
    .ck-search-input { font-size: 13px; }
    .ck-search-btn { width: 26px; height: 26px; }
    .ck-main { padding: 6px; gap: 6px; }
    .ck-hero h1 { font-size: 18px; }
    .ck-hero p { font-size: 12px; }
    .ck-hero-btn { font-size: 12px; padding: 7px 14px; }
    .ck-card { border-radius: 16px; padding: 8px; }
    .ck-subnav { padding: 4px 6px; }
    .ck-subnav-btn { font-size: 11px; padding: 3px 6px; }
    .ek-games-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ek-game-card { min-height: 100px; padding: 10px 6px; }
    .ek-hero-content h1 { font-size: 18px; }
    .ek-hero-trophy { font-size: 40px; }
    .ck-mobile-drawer-title { font-size: 16px; }
    .ck-mobile-drawer-grade { font-size: 11px; }
    .ck-mobile-drawer-link { min-height: 42px; padding: 10px 12px; }
}

/* ── Touch device optimizations ── */
@media (hover: none) and (pointer: coarse) {
    .ck-sidebar-btn { min-height: 44px; }
    .ck-subnav-btn { min-height: 40px; }
    .ck-mission-play { min-width: 44px; min-height: 44px; }
    .ck-hero-btn { min-height: 44px; }
    .ck-action-btn { min-height: 44px; }
    .ck-notif-btn { min-width: 40px; min-height: 40px; }
}

/* ── Landscape phone ── */
@media (max-height: 500px) and (orientation: landscape) {
    .ck-hero { min-height: auto; padding: 12px; }
    .ck-hero h1 { font-size: 20px; }
    .ck-hero-btn { padding: 8px 16px; font-size: 13px; }
    .ck-subnav { padding: 4px 8px; }
    .ck-header { padding: 4px 8px; }
}

/* ── Utility ── */
.sr-only {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0,0,0,0) !important; border: 0 !important;
}

/* ═══════════════════════════════════════════════════════════
   ENCARTA KIDS DESIGN SYSTEM  (ek-*)
   Used by student pages: shared-content, enciclo-kids, etc.
   Colors: bg #ffffcc · border 3px solid #008000
           shadow 4px 4px 0 rgba(0,0,0,0.2) · font Arial
═══════════════════════════════════════════════════════════ */

/* ── Panel / Tab System ── */
.ek-panel               { display: block; width: 100%; height: 100%; overflow-y: auto; flex: 1; min-width: 0; }
.ek-panel:not(.active)  { display: none; }

/* Remove ck-main padding when it contains full-bleed ek-panels */
.ck-main:has(> .ek-panel) { padding: 0 !important; max-width: none !important; margin: 0 !important; }
/* EncicloKids fills ck-main with no padding */
.ck-main:has(> #enciclo-app) { padding: 0 !important; max-width: none !important; margin: 0 !important; overflow: hidden; }

/* ── 2-Column Grid ── */
.ek-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 0 24px 24px; }
.ek-col  { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .ek-grid { grid-template-columns: 1fr; } }

/* ── Hero Band ── */
.ek-hero {
    display: flex; align-items: center; justify-content: space-between;
    position: relative; overflow: hidden; min-height: 140px;
    padding: 32px 24px;
}
.ek-hero-content       { flex: 1; z-index: 1; }
.ek-hero-content h1    { font-weight: 900; font-size: 40px; color: #000; margin: 0 0 8px; }
.ek-hero-content p     { font-size: 16px; color: rgba(0,0,0,0.7); margin: 0; font-weight: 600; }
.ek-hero-trophy        { font-size: 80px; flex-shrink: 0; margin-left: 24px; line-height: 1; }
.ek-hero-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(180deg, #ffff66, #ffcc00);
    color: #000; padding: 12px 24px; border-radius: 999px;
    font-weight: 900; font-size: 18px; text-decoration: none;
    border: 2px solid #008000; cursor: pointer;
    box-shadow: 0 4px 0 #cc9900; margin-top: 16px; transition: all 0.15s;
    font-family: Arial, Helvetica, sans-serif;
}
.ek-hero-btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 #cc9900; }
.ek-hero-btn:active { transform: translateY(4px); box-shadow: none; }

/* ── Widget (Card) ── */
.ek-widget {
    background: #ffffcc; border: 3px solid #008000;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    overflow: hidden;
}
.ek-widget-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 2px solid #008000;
    background: #f0ffd0;
}
.ek-widget-title { font-weight: 900; font-size: 18px; color: #000; }

/* ── Progress Bar ── */
.ek-progress-bar  { width: 100%; background: #d4edda; border: 2px solid #008000; border-radius: 999px; height: 12px; overflow: hidden; }
.ek-progress-fill { background: #00c800; height: 100%; border-radius: 999px; transition: width 0.5s; }

/* ── Lesson List ── */
.ek-lessons { display: flex; flex-direction: column; gap: 8px; }
.ek-lesson  {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; text-decoration: none; color: #000;
    border-bottom: 1px solid #c8e6c9; transition: background 0.15s;
}
.ek-lesson:hover { background: #f0ffd0; }
.ek-lesson-icon {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
}
.ek-lesson-title { font-weight: 700; font-size: 14px; }
.ek-lesson-meta  { font-size: 12px; color: #555; font-weight: 500; }

/* ── Task Row ── */
.ek-task {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; text-decoration: none; color: #000;
    border-bottom: 1px solid #c8e6c9; transition: background 0.15s;
}
.ek-task:hover        { background: #f0ffd0; }
.ek-task-left         { display: flex; align-items: center; gap: 12px; }
.ek-task-icon         { font-size: 28px; }
.ek-task-title        { font-weight: 700; font-size: 14px; }
.ek-task-sub          { font-size: 12px; color: #555; }
.ek-task-right        { display: flex; align-items: center; gap: 8px; }
.ek-task-pts          { background: #00c800; color: #fff; font-weight: 900; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.ek-task-check        { width: 24px; height: 24px; background: #00c800; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 900; }

/* ── Points Widget ── */
.ek-points-row  { display: flex; align-items: center; gap: 12px; padding: 16px; }
.ek-points-star { font-size: 48px; }
.ek-points-value{ font-size: 40px; font-weight: 900; color: #000; }
.ek-points-sub  { padding: 0 16px 12px; font-size: 14px; font-weight: 700; color: #555; }
.ek-store-btn   {
    display: block; margin: 0 16px 16px; padding: 10px 16px; border-radius: 999px;
    background: linear-gradient(180deg, #ffff66, #ffcc00); color: #000;
    border: 2px solid #008000; font-weight: 900; font-size: 15px; cursor: pointer;
    text-align: center; text-decoration: none; font-family: Arial,Helvetica,sans-serif;
    box-shadow: 0 3px 0 #cc9900; transition: all 0.15s;
}
.ek-store-btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 #cc9900; }

/* ── Medals Grid ── */
.ek-medals-search-wrap {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 2px solid #008000; border-radius: 999px;
    padding: 6px 12px; margin-bottom: 12px;
}
.ek-medals-search-icon { font-size: 16px; color: #555; }
.ek-medals-search      { flex: 1; border: none; outline: none; font-size: 14px; font-weight: 700; font-family: Arial,Helvetica,sans-serif; background: transparent; }
.ek-medals-box  { overflow-y: auto; max-height: 260px; }
.ek-medals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; padding: 4px; }
.ek-medal       { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ek-medal-icon  {
    width: 56px; height: 56px; border-radius: 50%; background: #ffcc00;
    border: 3px solid #008000; display: flex; align-items: center; justify-content: center;
    font-size: 28px; box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
    transition: transform 0.15s;
}
.ek-medal-icon:hover     { transform: scale(1.05); }
.ek-medal-icon.locked    { background: #ccc; border-color: #999; filter: grayscale(1) opacity(0.5); }
.ek-medal-label          { font-size: 11px; font-weight: 700; color: #555; text-align: center; }

/* ── Notices ── */
.ek-notices-list  { display: flex; flex-direction: column; gap: 4px; }
.ek-notice-item   { padding: 10px 12px; border-bottom: 1px solid #c8e6c9; font-size: 14px; }
.ek-notice-item small { color: #888; font-size: 12px; }
.ek-new-count     { background: #ef4444; color: #fff; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 999px; }

/* ── Stat Pair ── */
.ek-stat-pair          { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ek-stat-mini          { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 12px 8px; }
.ek-stat-mini-icon     { font-size: 28px; }
.ek-stat-mini-label    { font-size: 11px; font-weight: 700; color: #555; text-align: center; }
.ek-stat-mini-bar      { width: 100%; background: #e5e7eb; border-radius: 999px; height: 8px; overflow: hidden; border: 1px solid #d1d5db; }
.ek-stat-mini-fill-blue{ background: #3b82f6; height: 100%; border-radius: 999px; transition: width 0.5s; }
.ek-stat-mini-fill-pink{ background: #ec4899; height: 100%; border-radius: 999px; transition: width 0.5s; }
.ek-stat-mini-value        { font-size: 13px; font-weight: 900; }
.ek-stat-mini-value--blue  { color: #3b82f6; }
.ek-stat-mini-value--pink  { color: #ec4899; }

/* ── Game Cards ── */
.ek-games-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.ek-games-title  { font-weight: 900; font-size: 20px; color: #000; }
.ek-games-more   { color: #008000; font-weight: 700; font-size: 14px; text-decoration: none; }
.ek-games-more:hover { text-decoration: underline; }
.ek-games-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; padding: 8px 16px 16px; }
.ek-game-card    {
    background: #ffffcc; border: 3px solid #008000;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    padding: 20px 12px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 160px; text-decoration: none; color: #000; position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ek-game-card:hover  { transform: translateY(-4px); box-shadow: 4px 8px 0 rgba(0,0,0,0.3); }
.ek-game-icon        { font-size: 44px; margin-bottom: 10px; }
.ek-game-title       { font-weight: 900; font-size: 15px; margin-bottom: 4px; }
.ek-game-desc        { font-size: 12px; color: #555; }
.ek-game-reward      { margin-top: 8px; background: #00c800; color: #fff; font-size: 12px; font-weight: 900; padding: 3px 8px; border-radius: 999px; }
.ek-game-lock        { position: absolute; top: 8px; right: 8px; font-size: 18px; }
.ek-unlock-banner    { background: #fff8e7; border: 3px solid #ffcc00; margin: 0 16px 16px; padding: 20px; text-align: center; font-weight: 700; }

/* ── Cognitive Card ── */
.ek-cog-card     {
    background: #ffffcc; border: 3px solid #008000;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2); padding: 20px; text-align: center; cursor: pointer;
    transition: transform 0.15s;
}
.ek-cog-card:hover { transform: translateY(-3px); }
.ek-cog-value    { font-size: 48px; font-weight: 900; color: #008000; }
.ek-cog-label    { font-size: 14px; font-weight: 700; color: #555; margin-bottom: 8px; }
.ek-cog-badge    { display: inline-block; background: #00c800; color: #fff; font-size: 13px; font-weight: 900; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px; }
.ek-cog-trend    { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.ek-cog-layers   { font-size: 12px; color: #555; }

/* ── Marketplace Shell ── */
.ek-marketplace        { display: flex; flex-direction: column; height: 100%; }
.ek-marketplace-header {
    background: #008000; color: #fff; padding: 12px 16px;
    display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px;
    position: sticky; top: 0; z-index: 5;
}
.ek-coin-badge { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; }

/* ── Nav Button (ek-navbtn) ── */
.ek-navbtn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: linear-gradient(180deg, #ffff66, #ffcc00);
    border: 2px solid #008000; border-radius: 8px;
    padding: 10px 16px; cursor: pointer; font-family: Arial,Helvetica,sans-serif;
    font-weight: 700; font-size: 14px; color: #000; text-decoration: none;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.15); transition: all 0.15s;
}
.ek-navbtn:hover { background: linear-gradient(180deg, #ffcc00, #ff9900); }
.ek-navbtn.active { background: #ffcc00; border-color: #004d00; box-shadow: 2px 2px 0 #004d00; }
.ek-navbtn-icon  { font-size: 22px; }
.ek-navbtn-label { font-size: 12px; font-weight: 700; }

/* ── Yellow Button ── */
.ek-yellow-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, #ffff66, #ffcc00); color: #000;
    padding: 12px 24px; border-radius: 999px;
    font-weight: 900; font-size: 16px; text-decoration: none;
    border: 2px solid #008000; cursor: pointer;
    box-shadow: 0 4px 0 #cc9900; transition: all 0.15s;
    font-family: Arial, Helvetica, sans-serif;
}
.ek-yellow-btn:hover  { transform: translateY(2px); box-shadow: 0 2px 0 #cc9900; }
.ek-yellow-btn:active { transform: translateY(4px); box-shadow: none; }

/* Encarta is the default student theme. These rules intentionally sit after
   the legacy ck-* dashboard styles so /mi-clase paints with the Encarta shell. */
.ck-theme-encarta {
    --encarta-orange: #ff9933;
    --encarta-orange-dark: #ff7a00;
    --encarta-green: #008000;
    --encarta-green-light: #059669;
    --encarta-yellow: #ffcc00;
    --encarta-cream: #ffffcc;
    --encarta-radius: 22px;
    --encarta-radius-sm: 14px;
    --encarta-radius-lg: 30px;
    --encarta-radius-pill: 999px;
    --encarta-shadow: 4px 4px 0 rgba(0,0,0,0.2);

    /* Portada del alumno: lienzo pastel y paleta de las tarjetas. */
    --encarta-home-canvas: linear-gradient(170deg, #fffdf7 0%, #fdfaf2 26%, #f2f8fd 62%, #e4f1fb 100%);
    --encarta-home-ink: #123a6b;
    --encarta-home-accent: #f5b301;
    --encarta-card-radius: 16px;
    --encarta-card-border: 1px solid rgba(15, 23, 42, 0.06);
    --encarta-card-ink: #1f2937;
    --enc-card-math: #e8f0fe;
    --enc-card-science: #e4f4ef;
    --enc-card-living: #eaf5e4;
    --enc-card-landscape: #f0eafc;
    --enc-card-history: #fdeae7;
    --enc-card-language: #fdf3d8;
    --enc-card-arts: #fde8f1;
    --enc-card-play: #e6f2fd;
}

.ck-theme-encarta .ck-shell {
    background: var(--encarta-home-canvas);
    font-family: Arial, Helvetica, sans-serif;
}

/* La portada del alumno es un canvas de alto fijo: cabe entera en el
   viewport, sin scroll de pagina. Cada contenedor cede su alto al
   siguiente para que el contenido se adapte a lo disponible.
   Se marca con la clase del <body> (no con :has()) porque #ck-panel-home
   existe en el DOM en todas las pestañas, solo que oculto. */
.ck-theme-encarta.ck-student-home-route .ck-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}
.ck-theme-encarta.ck-student-home-route .ck-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.ck-theme-encarta.ck-student-home-route .ck-center {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ck-theme-encarta .ck-header {
    background: var(--encarta-green-light) !important;
    border-bottom: none;
    box-shadow: none;
}

/* Cintillo estilo referencia: blanco, iconos a color, texto azul marino.
   El boton activo se marca con una pildora blanca + sombra suave, sin
   linea verde de borde inferior en todo el ancho. */
.ck-theme-encarta .ck-subnav {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
}

.ck-theme-encarta .ck-main {
    background: transparent;
}

.ck-theme-encarta .ck-sidebar-pill-nav,
.ck-theme-encarta .ck-sidebar-nav {
    background: #ffffff;
    border: 3px solid #22c55e;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ck-theme-encarta .ck-sidebar-pill-btn,
.ck-theme-encarta .ck-sidebar-btn,
.ck-theme-encarta .ck-subnav-btn {
    border-radius: var(--encarta-radius-pill);
    font-family: Arial, Helvetica, sans-serif;
}

.ck-theme-encarta .ck-sidebar-pill-btn,
.ck-theme-encarta .ck-sidebar-btn {
    background: #ffffff;
    color: #1e293b;
    border: 1.5px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.ck-theme-encarta .ck-sidebar-pill-btn:hover,
.ck-theme-encarta .ck-sidebar-btn:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transform: none;
}

.ck-theme-encarta .ck-sidebar-btn.active {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: none;
}
.ck-theme-encarta .ck-sidebar-pill-btn.active {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(34,197,94,0.35);
    transform: none;
}
.ck-theme-encarta .ck-sidebar-pill-btn.active .ck-pill-icon {
    background: rgba(255,255,255,0.25) !important;
}

/* Botones del cintillo, clonados de la referencia: iconos a todo color
   (emoji, sin chip de fondo), texto azul marino. El boton activo se marca
   con una pildora blanca + sombra suave y texto/icono en verde. */
.ck-theme-encarta .ck-subnav-btn {
    background: transparent !important;
    color: #1e3a5f !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 700;
    padding: 0 14px !important;
}
.ck-theme-encarta .ck-subnav-btn .icon {
    display: inline-flex;
    font-size: 16px;
    line-height: 1;
}
.ck-theme-encarta .ck-subnav-btn:hover {
    background: #f8fafc !important;
    color: var(--encarta-green) !important;
}
.ck-theme-encarta .ck-subnav-btn.active {
    background: #ffffff !important;
    color: var(--encarta-green) !important;
    border: 1.5px solid var(--encarta-green) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.12) !important;
    font-weight: 900;
}

.ck-theme-encarta .ck-search-bar,
.ck-theme-encarta .ck-user-chip,
.ck-theme-encarta .ck-subnav-credit-card,
.ck-theme-encarta .ck-subnav-premium-card,
.ck-theme-encarta .ck-daily-bonus,
.ck-theme-encarta .ck-notif-btn {
    border-radius: var(--encarta-radius-pill);
}

/* Pildora "Mis Creditos": fondo blanco con borde, como en la referencia,
   en vez del panel oscuro pensado para el cintillo verde original. */
.ck-theme-encarta .ck-subnav-credit-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}
.ck-theme-encarta .ck-subnav-credit-card:hover {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
}
.ck-theme-encarta .ck-subnav-credit-card-label {
    color: #9ca3af !important;
}

.ck-theme-encarta .ekp-hero,
.ck-theme-encarta .ck-card,
.ck-theme-encarta .ck-social-card,
.ck-theme-encarta .ck-action-card,
.ck-theme-encarta .ck-gallery-scroll {
    border-radius: 0 !important;
}

/* No redondees la linea del contenedor */
.ck-theme-encarta .ck-shell,
.ck-theme-encarta .ck-main,
.ck-theme-encarta .ck-center,
.ck-theme-encarta div {
    border-radius: 0 !important;
}

.ck-theme-encarta button,
.ck-theme-encarta input[type="button"],
.ck-theme-encarta input[type="submit"],
.ck-theme-encarta input[type="reset"],
.ck-theme-encarta [role="button"],
.ck-theme-encarta .ck-subnav-btn,
.ck-theme-encarta .ck-sidebar-btn,
.ck-theme-encarta .ck-action-btn,
.ck-theme-encarta .ek-yellow-btn,
.ck-theme-encarta .ek-hero-btn,
.ck-theme-encarta .ek-store-btn,
.ck-theme-encarta .ek-navbtn {
    border-radius: var(--encarta-radius-pill) !important;
}

/* Sidebar pill buttons keep their own 14px radius */
.ck-theme-encarta .ck-sidebar-pill-btn {
    border-radius: 14px !important;
}

.ck-theme-encarta .ck-header,
.ck-theme-encarta .ck-subnav,
.ck-theme-encarta nav {
    border-radius: 0 !important;
}

.ck-theme-encarta .ck-header button,
.ck-theme-encarta .ck-header [role="button"],
.ck-theme-encarta .ck-header .ck-search-bar,
.ck-theme-encarta .ck-header .ck-user-chip,
.ck-theme-encarta .ck-header .ck-daily-bonus,
.ck-theme-encarta .ck-subnav button,
.ck-theme-encarta .ck-subnav [role="button"],
.ck-theme-encarta .ck-subnav .ck-subnav-btn,
.ck-theme-encarta .ck-subnav .ck-subnav-credit-card,
.ck-theme-encarta .ck-subnav .ck-subnav-premium-card,
.ck-theme-encarta nav button,
.ck-theme-encarta nav [role="button"],
.ck-theme-encarta nav a {
    border-radius: var(--encarta-radius-pill) !important;
}

.ck-theme-encarta .ck-header .ck-user-avatar,
.ck-theme-encarta .ck-header .ck-notif-btn,
.ck-theme-encarta .ck-header .ck-notif-dot,
.ck-theme-encarta .ck-header .coin {
    border-radius: 50% !important;
}

.ck-theme-encarta .ck-sidebar-pill-nav,
.ck-theme-encarta .ck-sidebar-nav,
.ck-theme-encarta .ekp-hero,
.ck-theme-encarta .ck-card,
.ck-theme-encarta .ck-social-card,
.ck-theme-encarta .ck-action-card,
.ck-theme-encarta .ck-gallery-scroll,
.ck-theme-encarta .ek-widget,
.ck-theme-encarta .ek-cog-card,
.ck-theme-encarta .ek-game-card,
.ck-theme-encarta .ek-unlock-banner {
    border-radius: var(--encarta-radius-lg) !important;
}

.ck-theme-encarta .ck-user-avatar,
.ck-theme-encarta .ck-notif-btn,
.ck-theme-encarta .ck-notif-dot,
.ck-theme-encarta .coin,
.ck-theme-encarta .ek-medal-icon,
.ck-theme-encarta .ek-task-check {
    border-radius: 50% !important;
}

/* --- Standardized Gallery Headers --- */
.sidebar-gallery-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 24px 28px !important;
    border-radius: 20px !important;
    color: #fff !important;
    margin-bottom: 24px !important;
    position: relative !important;
    overflow: hidden !important;
}

.sidebar-gallery-icon {
    font-size: 3rem !important;
    line-height: 1 !important;
    background: rgba(255,255,255,0.2) !important;
    width: 72px !important;
    height: 72px !important;
    border-radius: 18px !important;
    border: 2px solid rgba(255,255,255,0.4) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.sidebar-gallery-title {
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    margin: 0 !important;
    line-height: 1.1 !important;
}

/* ═══════════════════════════════════════════════════════════
   ENCARTA DASHBOARD (enc-*)  ·  panel Home de /mi-clase
   Layout de 3 columnas: tarjeta del alumno · materias · misión+pizarra.
   Alcance: solo el área del alumno (este archivo lo carga
   únicamente layouts/student.blade.php). No toca el CSS docente.
═══════════════════════════════════════════════════════════ */

.enc-shell {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 315px;
    gap: 24px;
    align-items: stretch;
    min-height: 0;
    height: calc(100% - 158px);
    padding: clamp(12px, 1.8vh, 22px) clamp(18px, 2vw, 30px) 14px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Portada del alumno: degradado pastel crema -> azul cielo, con una capa
   decorativa de iconos (nubes, estrellas, lapiz, avion de papel) dibujados
   como SVG inline. Van en ::before para no tocar el markup ni el JS de
   paneles: es solo pintura detras del contenido. */
#ck-panel-home {
    position: relative;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}
/* El contenido va por encima de la capa decorativa. */
#ck-panel-home > * {
    position: relative;
    z-index: 1;
}

/* Cabecera propia de la portada, basada en la referencia. */
.enc-topbar {
    height: 86px;
    flex: 0 0 86px;
    display: grid;
    grid-template-columns: 300px minmax(260px, 1fr) auto minmax(250px, 330px);
    align-items: center;
    gap: 18px;
    padding: 10px 24px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #20af0a, #078b05);
    border-bottom: 4px solid #087a05;
    box-shadow: 0 5px 14px rgba(71, 66, 0, .28);
    z-index: 3;
}
.enc-brand img { display: block; width: min(100%, 285px); max-height: 62px; object-fit: contain; object-position: left center; }
.enc-search { height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px; border-radius: 999px; background: #fffdf6; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08), 0 3px 8px rgba(0,0,0,.18); color: #183128; }
.enc-search i { font-size: 25px; }
.enc-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #34423c; font: 800 19px/1 inherit; }
.enc-header-actions { display: flex; align-items: center; gap: 12px; padding-right: 18px; border-right: 2px solid rgba(255,255,255,.45); }
.enc-header-actions a, .enc-header-actions button { width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 3px solid rgba(255,255,255,.75); border-radius: 50%; background: linear-gradient(#fff45d,#f7b700); color: #096c15; font-size: 24px; box-shadow: 0 4px 0 rgba(6,91,13,.45); cursor: pointer; }
.enc-header-actions a:last-child, .enc-header-actions button:last-child { background: linear-gradient(#57c9ff,#1672df); color: #fff; }
.enc-profile { min-width: 0; height: 62px; display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 4px 12px 4px 5px; border-radius: 999px; background: rgba(4,121,4,.38); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.enc-profile img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; border: 3px solid #fff3bd; }
.enc-profile strong, .enc-profile span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-profile strong { font-size: 16px; }.enc-profile span { margin-top: 2px; color: #fff58c; font-size: 13px; font-weight: 800; }

/* ── Tarjeta del alumno (izquierda) ──
   La imagen (mascot-boy-v2.png / mascot-girl-v2.png) ya trae el marco,
   la caja superior para el saludo y la caja inferior para el nivel
   dibujadas en el arte; aqui solo se posiciona texto real encima de
   esas dos zonas (coordenadas medidas sobre el lienzo 1024x1536). */
.enc-student-card {
    align-self: center;
    display: flex;
    justify-content: center;
    max-height: 100%;
    min-height: 0;
}
/* El arte lleva el marco y las cajas de texto dibujadas, asi que la
   proporcion es intocable: se limita el alto y el ancho lo sigue. */
.enc-student-card-media {
    position: relative;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1024 / 1536;
}
.enc-student-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.enc-student-card-greeting {
    position: absolute;
    top: 4%;
    height: 11%;
    left: 10%;
    right: 10%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 900;
    line-height: 1.15;
    color: #7a4a00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.enc-student-card-level {
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 5.5%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.enc-student-card-level-text {
    display: block;
    text-align: center;
    font-size: clamp(11px, 1.1vw, 15px);
    font-weight: 800;
    color: #7a4a00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.enc-student-card-level-bar {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.enc-student-card-level-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* ── Materias (centro) ── */
/* Titulo alineado a la izquierda con subrayado amarillo corto, como en
   el diseño de referencia. */
.enc-subjects-title {
    position: relative;
    flex: 0 0 auto;
    text-align: left;
    font-size: clamp(22px, 2vw, 32px);
    line-height: 1.1;
    margin: 0 0 clamp(12px, 1.6vh, 20px);
    padding-bottom: 10px;
    font-weight: 900;
    color: var(--encarta-home-ink);
    text-shadow: none;
}
.enc-subjects-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 5px;
    border-radius: var(--encarta-radius-pill);
    background: var(--encarta-home-accent);
}
/* El centro es una columna: el titulo mide lo suyo y la reja se queda con
   el alto restante, repartido en dos filas iguales. Las tarjetas se
   adaptan a ese alto en vez de imponerlo, que es lo que sacaba el
   contenido del viewport. */
.enc-subjects {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.enc-subject-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 16px;
    min-height: 0;
}
/* Tarjeta cuadrada: icono centrado arriba, etiqueta centrada abajo,
   fondo pastel solido por materia (clon del diseño de referencia). */
.enc-subject {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 0;
    max-height: 100%;
    border: var(--encarta-card-border);
    padding: 14px 10px;
    background: var(--enc-card-color, #e8effe);
    border-radius: var(--encarta-card-radius);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    transition: transform .15s ease, box-shadow .15s ease;
}
/* Los PNG son ilustraciones cuadradas ya centradas sobre blanco liso
   (ver artisan encarta:generate-subject-icons), asi que la imagen se
   muestra completa: sin recorte, sin chip de fondo. El mix-blend-mode
   funde el blanco del PNG con el pastel de la tarjeta. */
.enc-subject-icon {
    flex: 1 1 auto;
    display: block;
    width: auto;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
}
.enc-subject img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    mix-blend-mode: multiply;
}

.enc-subject-label {
    flex: 0 0 auto;
    display: block;
    font-size: clamp(13px, 1vw, 16px);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    color: var(--encarta-card-ink);
    text-shadow: none;
    pointer-events: none;
}
.enc-subject:hover,
.enc-subject:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    outline: none;
}

/* Fondo pastel por materia, tomado de los tokens del tema. */
.enc-subject--math      { --enc-card-color: var(--enc-card-math); }
.enc-subject--science   { --enc-card-color: var(--enc-card-science); }
.enc-subject--living    { --enc-card-color: var(--enc-card-living); }
.enc-subject--landscape { --enc-card-color: var(--enc-card-landscape); }
.enc-subject--history   { --enc-card-color: var(--enc-card-history); }
.enc-subject--language  { --enc-card-color: var(--enc-card-language); }
.enc-subject--arts      { --enc-card-color: var(--enc-card-arts); }
.enc-subject--play      { --enc-card-color: var(--enc-card-play); }

/* ── Columna derecha: misión + pizarra ── */
.enc-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    min-height: 0;
}
/* La mision se queda con el alto sobrante; la pizarra mide lo suyo. */
.enc-mission {
    position: relative;
    display: block;
    flex: 0 0 auto;
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: var(--encarta-radius-lg, 30px);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--encarta-shadow, 4px 4px 0 rgba(0,0,0,0.2));
    transition: transform .15s ease;
}
.enc-mission img { width: 100%; height: auto; display: block; }
.enc-mission:hover { transform: translateY(-4px); }
.enc-mission-text {
    position: absolute;
    top: 8%;
    left: 10%;
    right: 10%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.enc-mission-label {
    font-size: clamp(12px, 1.1vw, 15px);
    font-weight: 800;
    color: #64748b;
}
.enc-mission-title {
    font-size: clamp(16px, 1.7vw, 22px);
    font-weight: 900;
    line-height: 1.15;
    color: #0d2d61;
}
.enc-mission-progress {
    font-size: clamp(12px, 1.1vw, 14px);
    font-weight: 700;
    color: #475569;
}
.enc-mission-cta {
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: 6%;
    height: 9%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 1.5vw, 19px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.enc-board {
    flex: 0 0 auto;
    background: linear-gradient(155deg, #f2f0ff 0%, #e6f4ff 100%);
    border: 2px solid #d9d3f7;
    border-radius: 22px;
    padding: 16px 20px;
    box-shadow: 0 8px 20px rgba(99, 91, 189, 0.1);
}

.enc-bottom-nav {
    align-self: center;
    width: min(1320px, calc(100% - 80px));
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(120px, .65fr);
    overflow: hidden;
    border: 3px solid #f2ca41;
    border-radius: 34px 34px 0 0;
    background: #fffbd0;
    box-shadow: 0 -3px 0 rgba(176,111,0,.15), 0 7px 20px rgba(95,53,0,.22);
    z-index: 3;
}
.enc-bottom-nav a, .enc-bottom-nav button { display: flex; align-items: center; justify-content: center; gap: 14px; border: 0; border-right: 2px solid #f2df8c; background: transparent; color: #0d2d61; text-decoration: none; font: 900 clamp(15px,1.35vw,22px)/1 inherit; cursor: pointer; }
.enc-bottom-nav i { font-size: 29px; color: #e58a00; }.enc-bottom-nav a:first-child i { color:#1676d7; }.enc-bottom-nav a:nth-child(3) i { color:#138e4d; }
.enc-bottom-nav a:hover, .enc-bottom-nav button:hover { background: #fff3a5; }
.enc-board-title {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 900;
    color: #4c3d99;
}
.enc-board-note {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #6b7280;
}
.enc-board-note--live { color: #1d8a5e; }

.enc-board-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 999px;
    margin-top: 12px;
    background: linear-gradient(180deg, #b4a6f5, #8f7de8);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 0 #6f5cd0;
    transition: transform .15s ease, box-shadow .15s ease;
}
.enc-board-btn:hover  { transform: translateY(2px); box-shadow: 0 2px 0 #6f5cd0; }
.enc-board-btn:active { transform: translateY(4px); box-shadow: none; }
.enc-board-btn.is-disabled {
    background: #eef0f6;
    color: #a0a7b8;
    box-shadow: 0 4px 0 #dadfea;
    cursor: not-allowed;
    font-size: 15px;
}
.enc-board-btn.is-disabled:hover,
.enc-board-btn.is-disabled:active {
    transform: none;
    box-shadow: 0 4px 0 #dadfea;
}

/* La portada es un canvas fijo: el shell mide el viewport y cada nivel
   cede su alto al siguiente, de modo que las tarjetas se ajustan a lo que
   queda en vez de empujar la pagina y sacar una barra de scroll.
   Al colgar de .ck-theme-encarta (clase del <body>) y vivir al final de la
   hoja, estas reglas ganan la cascada sin necesidad de !important. */
.ck-theme-encarta.ck-student-home-route #ck-panel-home {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
}
.ck-theme-encarta.ck-student-home-route .enc-shell {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
}

/* ── Responsive ── */
@media (max-width: 1400px) {
    .enc-shell { grid-template-columns: minmax(360px, 1fr) 280px; gap: 18px; }
}
@media (max-width: 1200px) {
    .enc-shell { grid-template-columns: minmax(300px, 1fr) 250px; gap: 16px; padding: 4px 16px 24px; }
    .enc-subject-grid { gap: 14px; }
    .enc-board-title { font-size: 19px; }
    .enc-board-btn { font-size: 18px; height: 44px; }
}
@media (max-width: 1100px) {
    .enc-topbar { grid-template-columns: 220px minmax(220px,1fr) auto; }
    .enc-profile { display:none; }
}
@media (max-width: 1000px) {
    /* La mascota es decorativa: se retira antes que el contenido útil */
    .enc-shell { grid-template-columns: minmax(0, 1fr) 260px; }
    .enc-student-card { display: none; }
}
@media (max-width: 820px) {
    .enc-topbar { height:70px; flex-basis:70px; grid-template-columns:170px 1fr; padding:8px 12px; }
    .enc-header-actions, .enc-profile { display:none; }
    .enc-search { height:46px; }
    .enc-shell { height:calc(100% - 130px); grid-template-columns: 1fr; padding: 10px 14px; overflow-y:auto; }
    .enc-subject-grid { grid-template-columns: repeat(3, 1fr); }
    .enc-right { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .enc-bottom-nav { width:100%; height:60px; flex-basis:60px; border-radius:0; grid-template-columns:repeat(5,1fr); }
    .enc-bottom-nav a, .enc-bottom-nav button { flex-direction:column; gap:3px; font-size:10px; }.enc-bottom-nav i{font-size:20px;}
}
@media (max-width: 560px) {
    .enc-subject-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .enc-subject { padding: 14px 8px 12px; }
    .enc-right { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .enc-subject, .enc-mission, .enc-board-btn { transition: none; }
    .enc-subject:hover, .enc-mission:hover { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   UNIVERSAL STUDENT PANEL DESIGN (Basado en /mi-clase/mis-clases)
   Aplica la misma geometría, contenedor blanco puro, padding y sombra
   a todos los módulos del área de estudiantes.
   ═══════════════════════════════════════════════════════════════════════ */
.ckrw-wrap,
.ckti-wrap,
.ckam-wrap,
.sdict-wrap,
.sidebar-gallery-wrapper,
.ckam-gallery-card,
#mis-clases-panel > .ckam-gallery-card {
    background: #ffffff !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
    padding: 24px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}
