/* ============================================================
   Welcome Mascot - Mobile / Tablet Bottom Sheet
   Floating head avatar + slide-up navigation sheet
   Active on screens ≤ 768px (touch devices)
   ============================================================ */

/* ─── Floating Head Avatar ─── */
.mascot-mobile-avatar {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--mascot-primary, #4a90d9);
    background: var(--mascot-bg, #ffffff);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100003;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mascot-mobile-avatar.visible {
    opacity: 1;
    pointer-events: auto;
}

.mascot-mobile-avatar:active {
    transform: scale(0.92);
}

.mascot-mobile-avatar.sheet-open {
    box-shadow: 0 0 0 3px var(--mascot-primary, #4a90d9), 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Inner wrapper - clips and centers the head */
.mascot-mobile-avatar-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
}

/* Head-only mascot center - renders just the head SVG layers */
.mobile-head-only {
    position: absolute;
    width: 180%;
    height: 180%;
    top: -15%;
    left: -40%;
    pointer-events: none;
}

.mobile-head-only .mascot-head-svg,
.mobile-head-only .mascot-mouth-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.mobile-head-only .mascot-head-svg img,
.mobile-head-only .mascot-head-svg svg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Badge on avatar */
.mascot-mobile-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff4444;
    border: 2px solid #fff;
    z-index: 2;
}

/* ─── Backdrop ─── */
.mascot-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100004;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mascot-sheet-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Bottom Sheet ─── */
.mascot-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--mascot-bg, #ffffff);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    z-index: 100005;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 24px;
    -webkit-overflow-scrolling: touch;
}

.mascot-bottom-sheet.open {
    transform: translateY(0);
}

/* ─── Handle ─── */
.mascot-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    cursor: grab;
}

.mascot-sheet-handle span {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d0d0d0;
}

/* ─── Header ─── */
.mascot-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0 16px;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

.mascot-sheet-greeting {
    font-family: var(--mascot-font, 'Poppins', sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--mascot-text, #333);
}

/* ─── 2-Column Button Grid ─── */
.mascot-sheet-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mascot-sheet-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    background: #f8f9fa;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    text-decoration: none;
    color: var(--mascot-text, #333);
    font-family: var(--mascot-font, 'Poppins', sans-serif);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    transition: background 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.mascot-sheet-btn:active {
    background: #eef1f5;
    transform: scale(0.97);
}

.mascot-sheet-btn-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.mascot-sheet-btn-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Single column on very small phones ─── */
@media (max-width: 360px) {
    .mascot-sheet-buttons {
        grid-template-columns: 1fr;
    }
}

/* ─── Dark mode ─── */
.theme-dark .mascot-mobile-avatar,
body.dark-mode .mascot-mobile-avatar {
    background: #2d2d2d;
    border-color: #667eea;
}

.theme-dark .mascot-bottom-sheet,
body.dark-mode .mascot-bottom-sheet {
    background: #1e1e1e;
}

.theme-dark .mascot-sheet-header,
body.dark-mode .mascot-sheet-header {
    border-bottom-color: #333;
}

.theme-dark .mascot-sheet-btn,
body.dark-mode .mascot-sheet-btn {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.theme-dark .mascot-sheet-btn:active,
body.dark-mode .mascot-sheet-btn:active {
    background: #3d3d3d;
}

.theme-dark .mascot-sheet-backdrop,
body.dark-mode .mascot-sheet-backdrop {
    background: rgba(0, 0, 0, 0.55);
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .mascot-bottom-sheet {
        transition: none;
    }

    .mascot-mobile-avatar {
        transition: opacity 0.15s ease;
    }
}
