/* ===========================
   BUTTONS (bubbly / toy-like)
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 30px;
    border: none;
    border-radius: 20px;
    font-family: var(--font);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    min-height: 52px;
    min-width: 52px;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.93);
}

.btn-primary {
    background: var(--profile-gradient-v);
    color: var(--text-white);
    box-shadow: 0 5px 0 var(--profile-color-dark), 0 8px 16px rgba(0, 0, 0, 0.18);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    box-shadow: 0 2px 0 var(--profile-color-dark), 0 3px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(3px) scale(0.96);
}

.btn-secondary {
    background: linear-gradient(180deg, #64B5F6 0%, #2196F3 50%, #1976D2 100%);
    color: var(--text-white);
    box-shadow: 0 5px 0 var(--primary-dark), 0 8px 16px rgba(21, 101, 192, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
    box-shadow: 0 2px 0 var(--primary-dark), 0 3px 6px rgba(21, 101, 192, 0.2);
    transform: translateY(3px) scale(0.96);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    border: 2px solid var(--text-light);
    backdrop-filter: blur(4px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.35);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 14px;
}

.btn-large {
    padding: 20px 38px;
    font-size: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 6px 0 var(--accent-dark), 0 10px 20px rgba(230, 74, 25, 0.3);
}

/* ===========================
   CARDS
   =========================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 4px 16px var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ===========================
   CHOICE BUTTONS (colorful cards)
   =========================== */
.choice-btn {
    padding: 18px 14px;
    border: 3px solid var(--primary-light);
    border-radius: 20px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F3F8FF 100%);
    font-family: var(--font);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease, transform 0.15s ease;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    touch-action: manipulation;
    box-shadow: 0 4px 0 rgba(100, 181, 246, 0.4), 0 6px 12px var(--shadow);
    position: relative;
}

.choice-btn:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 2px 0 rgba(100, 181, 246, 0.3), 0 3px 6px var(--shadow);
}

.choice-btn:nth-child(1) {
    border-color: #EF9A9A;
    box-shadow: 0 4px 0 rgba(229, 115, 115, 0.5), 0 6px 12px var(--shadow);
    background: linear-gradient(180deg, #FFFFFF 0%, #FFEBEE 100%);
}

.choice-btn:nth-child(2) {
    border-color: #90CAF9;
    box-shadow: 0 4px 0 rgba(100, 181, 246, 0.5), 0 6px 12px var(--shadow);
    background: linear-gradient(180deg, #FFFFFF 0%, #E3F2FD 100%);
}

.choice-btn:nth-child(3) {
    border-color: #A5D6A7;
    box-shadow: 0 4px 0 rgba(129, 199, 132, 0.5), 0 6px 12px var(--shadow);
    background: linear-gradient(180deg, #FFFFFF 0%, #E8F5E9 100%);
}

.choice-btn:nth-child(4) {
    border-color: #CE93D8;
    box-shadow: 0 4px 0 rgba(186, 104, 200, 0.5), 0 6px 12px var(--shadow);
    background: linear-gradient(180deg, #FFFFFF 0%, #F3E5F5 100%);
}

.choice-btn-correct {
    border-color: var(--success) !important;
    background: linear-gradient(180deg, #C8E6C9 0%, var(--success-light) 100%) !important;
    color: #2E7D32;
    box-shadow: 0 4px 0 #43A047, 0 0 16px rgba(102, 187, 106, 0.4) !important;
}

.choice-btn-wrong {
    border-color: var(--warning) !important;
    background: linear-gradient(180deg, #FFE0B2 0%, #FFCC80 100%) !important;
    color: #E65100;
    box-shadow: 0 4px 0 #EF6C00, 0 0 12px rgba(255, 167, 38, 0.3) !important;
}

.choice-btn-eliminated {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(0.5);
}

/* Victory flip animation class for correct choice */
.choice-btn-flip {
    animation: flip-card 0.6s ease;
    border-color: var(--success) !important;
    background: linear-gradient(180deg, #C8E6C9 0%, var(--success-light) 100%) !important;
    color: #2E7D32;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 0 #43A047 !important;
}

/* ===========================
   INPUT
   =========================== */
.input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--primary-light);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1.1rem;
    color: var(--text);
    background: var(--bg-card);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    min-height: 48px;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

/* ===========================
   EMOJI DISPLAY
   =========================== */
.emoji {
    display: inline-block;
    line-height: 1;
}

.emoji-lg {
    font-size: 3rem;
}

.emoji-xl {
    font-size: 4rem;
}

.emoji-xxl {
    font-size: 5rem;
}

/* ===========================
   STAR DISPLAY
   =========================== */
.stars {
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
}

.star-filled {
    color: #FFD700;
    animation: shimmer 2.5s ease-in-out infinite;
}

.star-filled:nth-child(2) { animation-delay: 0.4s; }
.star-filled:nth-child(3) { animation-delay: 0.8s; }

.star-empty {
    color: #D0D0D0;
}

/* ===========================
   BADGE
   =========================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-stars {
    background: linear-gradient(135deg, #FFF9C4 0%, #FFF176 100%);
    color: #B7791F;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.25);
}

/* ===========================
   COIN BADGE (coin count display)
   =========================== */
.coin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #FFF176 0%, #FFD54F 50%, #FFB300 100%);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #5D4037;
    box-shadow: 0 2px 0 #FF8F00, 0 4px 10px rgba(255, 143, 0, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.coin-badge .coin-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* ===========================
   STREAK COUNTER
   =========================== */
.streak-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #FF6F00 0%, #FF8F00 50%, #FFA000 100%);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(255, 111, 0, 0.4);
}

.streak-counter .streak-icon {
    font-size: 1rem;
    line-height: 1;
}

.streak-counter[data-streak="active"] {
    animation: streak-fire 1s ease-in-out infinite;
}

/* ===========================
   PROGRESS FILL (island completion bar)
   =========================== */
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--profile-gradient);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.18) inset;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer-slide 2s ease-in-out infinite;
}

@keyframes shimmer-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===========================
   ACHIEVEMENT POPUP
   =========================== */
.achievement-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fade-in 0.3s ease;
}

.achievement-popup-content {
    background: linear-gradient(145deg, #FFFFFF 0%, #FFF8E1 100%);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    position: relative;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 0 0 4px var(--gold),
        0 0 0 8px rgba(255, 215, 0, 0.3);
    animation: bounce 0.5s ease;
    overflow: hidden;
}

/* Confetti-like animated border effect */
.achievement-popup-content::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: conic-gradient(
        from 0deg,
        #FF6B6B, #FFD93D, #6BCB77, #4D96FF,
        #9B59B6, #FF6B6B, #FFD93D, #6BCB77
    );
    border-radius: calc(var(--radius-lg) + 4px);
    z-index: -1;
    animation: confetti-border-spin 3s linear infinite;
}

@keyframes confetti-border-spin {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.achievement-popup-content::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: linear-gradient(145deg, #FFFFFF 0%, #FFF8E1 100%);
    border-radius: calc(var(--radius-lg) - 0px);
    z-index: -1;
}

/* ===========================
   TOP BAR
   =========================== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 56px;
}

.top-bar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ===========================
   OWL COMPANION
   =========================== */
.owl {
    position: relative;
    display: inline-block;
}

.owl-speech {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 4px 16px var(--shadow);
    margin-bottom: 8px;
}

.owl-speech::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-card);
}


/* ===========================
   GUIDE CHARACTER (CSS-built)
   Positioned bottom-right of challenge screen
   Circular body, two big eyes, smile, wizard hat
   =========================== */
.guide-character {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-round);
    background: linear-gradient(145deg, #7C4DFF 0%, #651FFF 40%, #6200EA 100%);
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.35);
    z-index: 50;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Wizard hat (triangle above head) */
.guide-character::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 26px solid #311B92;
    filter: drop-shadow(0 -2px 4px rgba(49, 27, 146, 0.3));
}

/* Hat brim + star decoration */
.guide-character::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 8px;
    background: linear-gradient(180deg, #4527A0 0%, #311B92 100%);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Eyes - built with box-shadow trick on a single element inside the guide */
.guide-eyes {
    position: absolute;
    top: 18px;
    left: 14px;
    width: 12px;
    height: 14px;
    background: #FFFFFF;
    border-radius: var(--radius-round);
    box-shadow: 20px 0 0 0 #FFFFFF;
}

/* Pupils */
.guide-eyes::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 3px;
    width: 6px;
    height: 7px;
    background: #1A1A2E;
    border-radius: var(--radius-round);
    box-shadow: 20px 0 0 0 #1A1A2E;
}

/* Smile */
.guide-smile {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 0 0 10px 10px;
}

/* --- Guide animation states --- */

/* Idle: gentle breathing / bobbing */
.guide-idle {
    animation: guide-breathe 3s ease-in-out infinite;
}

@keyframes guide-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.03); }
}

/* Cheer: jump and spin */
.guide-cheer {
    animation: guide-cheer 0.8s ease;
}

@keyframes guide-cheer {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-20px) rotate(-10deg) scale(1.1); }
    50% { transform: translateY(-25px) rotate(360deg) scale(1.15); }
    75% { transform: translateY(-10px) rotate(370deg) scale(1.05); }
    100% { transform: translateY(0) rotate(360deg) scale(1); }
}

/* Sad: gentle droop */
.guide-sad {
    animation: guide-droop 1.5s ease-in-out infinite;
}

@keyframes guide-droop {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(6px) rotate(-5deg); }
}

/* Think: thoughtful bob */
.guide-think {
    animation: guide-think 2s ease-in-out infinite;
}

@keyframes guide-think {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-3px) rotate(3deg); }
    60% { transform: translateY(-2px) rotate(-2deg); }
}

/* Speech bubble above character */
.guide-speech {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    max-width: 180px;
    box-shadow: 0 4px 16px var(--shadow);
    animation: guide-speech-bounce 0.4s ease;
    white-space: normal;
    line-height: 1.4;
}

.guide-speech::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 8px solid transparent;
    border-top-color: var(--bg-card);
}

@keyframes guide-speech-bounce {
    0% { transform: scale(0.5) translateY(10px); opacity: 0; }
    60% { transform: scale(1.05) translateY(-2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ===========================
   ISLANDS SELECT SCREEN
   =========================== */
.islands-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #E3F2FD 0%, #FCE4EC 50%, #FFF8E1 100%);
}

.islands-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.islands-hello {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 600;
    margin: 4px 0 8px;
}

.islands-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.island-card {
    position: relative;
    background: var(--island-gradient, linear-gradient(135deg, #29B6F6, #0288D1));
    color: #FFF;
    border: none;
    border-radius: 24px;
    padding: 20px 16px 18px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: var(--font);
    min-height: 160px;
    overflow: hidden;
}

.island-card::before {
    /* soft glow sheen */
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 70%);
    pointer-events: none;
}

.island-card:active {
    transform: translateY(4px) scale(0.98);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.island-card-new {
    filter: brightness(0.92) saturate(0.9);
}

.island-card-complete {
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 0 24px rgba(255, 215, 64, 0.7);
}

.island-card-emoji {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 6px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.island-mascot {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

.island-card-name {
    font-size: 1.7rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.5px;
}

.island-card-tagline {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 2px;
    margin-bottom: 12px;
}

.island-card-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.island-card-progress-bar {
    width: 80%;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.island-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD740, #FF7043);
    border-radius: 999px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(255, 215, 64, 0.6);
}

.island-card-progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    opacity: 0.95;
}

.island-card-banner {
    position: absolute;
    top: 10px;
    left: -36px;
    background: #FFD740;
    color: #5D4037;
    padding: 4px 40px;
    transform: rotate(-25deg);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

.island-trophy {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: guide-breathe 2s ease-in-out infinite;
}

.islands-bottom {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 12px 0 4px;
}

/* ===========================
   USER-SELECT SCREEN (profile picker)
   =========================== */
.users-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #F3E5F5 0%, #FCE4EC 50%, #FFF3E0 100%);
}

.users-header {
    padding: 18px 16px 4px;
    text-align: center;
}

.users-title {
    font-family: 'Fredoka One', 'Nunito', var(--font);
    font-size: 1.7rem;
    line-height: 1.1;
    font-weight: 800;
    color: #6A1B9A;
    text-shadow: 0 3px 0 rgba(255, 255, 255, 0.6), 0 4px 16px rgba(106, 27, 154, 0.25);
    letter-spacing: 1px;
}

.users-container {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.users-hello {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 700;
    margin: 2px 0 8px;
}

.users-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.user-card {
    position: relative;
    background: var(--user-gradient, linear-gradient(135deg, #E91E63, #AD1457));
    color: #FFF;
    border: none;
    border-radius: 24px;
    padding: 14px 16px 14px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-family: var(--font);
    min-height: 92px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto auto;
    gap: 2px 14px;
    align-items: center;
}

.user-card::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -15%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 70%);
    pointer-events: none;
}

.user-card:active {
    transform: translateY(4px) scale(0.98);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.22);
}

.user-card-avatar {
    grid-row: 1 / span 3;
    grid-column: 1;
    font-size: 3.6rem;
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    text-align: center;
}

.user-card-avatar-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

.user-card-name {
    grid-column: 2;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    line-height: 1.1;
}

.user-card-age {
    grid-column: 2;
    font-size: 0.82rem;
    opacity: 0.92;
    font-weight: 600;
}

.user-card-tagline {
    grid-column: 2;
    font-size: 0.82rem;
    opacity: 0.95;
    font-weight: 600;
}

.user-card-active-pill {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Current-user chip (shown in top bars) */
.current-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ===========================
   KID CHARACTER (frame + face + accessory + hat)
   =========================== */
.kid-character {
    position: relative;
    display: inline-block;
    width: var(--kid-size, 48px);
    height: var(--kid-size, 48px);
    line-height: 1;
    border-radius: 50%;
    background: var(--kid-frame, linear-gradient(135deg, #FFE082 0%, #FFB300 100%));
    box-shadow:
        inset 0 -3px 0 rgba(0, 0, 0, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 0.45),
        0 4px 10px rgba(0, 0, 0, 0.12);
}

.kid-character-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--kid-size, 48px) * 0.70);
    z-index: 1;
}

.kid-character-accessory {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: calc(var(--kid-size, 48px) * 0.38);
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
/* Glasses / sunglasses sit over the eyes */
.kid-character-accessory-glasses,
.kid-character-accessory-sunglasses {
    top: calc(var(--kid-size, 48px) * 0.28);
}
/* Bowtie / scarf sit below the chin */
.kid-character-accessory-bowtie,
.kid-character-accessory-scarf {
    top: calc(var(--kid-size, 48px) * 0.66);
    font-size: calc(var(--kid-size, 48px) * 0.34);
}
/* Mustache sits between nose and mouth */
.kid-character-accessory-mustache {
    top: calc(var(--kid-size, 48px) * 0.48);
    font-size: calc(var(--kid-size, 48px) * 0.32);
}
/* Medal/star floats in lower-right corner */
.kid-character-accessory-medal,
.kid-character-accessory-star {
    top: calc(var(--kid-size, 48px) * 0.55);
    left: calc(var(--kid-size, 48px) * 0.62);
    transform: none;
    font-size: calc(var(--kid-size, 48px) * 0.42);
}

.kid-character-hat {
    position: absolute;
    top: calc(var(--kid-size, 48px) * -0.30);
    left: 50%;
    transform: translateX(-50%);
    font-size: calc(var(--kid-size, 48px) * 0.55);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    z-index: 3;
}

.avatar-builder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.avatar-builder-chip {
    min-width: 56px;
    height: 56px;
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 3px solid transparent;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 1.6rem;
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.avatar-builder-chip:active { transform: scale(0.94); }
.avatar-builder-chip-selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.avatar-builder-chip-label {
    font-size: 0.62rem;
    color: var(--text-light);
    font-weight: 600;
}
.avatar-builder-chip-swatch {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

/* ===========================
   FAMILY PROGRESS STRIP (on map screen)
   =========================== */
.family-strip {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.family-member {
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 6px 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    border: 2px solid transparent;
    font-size: 0.72rem;
    color: var(--text);
    transition: transform 0.15s ease;
}

.family-member-active {
    border-color: var(--profile-color);
    box-shadow: 0 0 0 2px var(--profile-color-light), 0 2px 8px rgba(0, 0, 0, 0.12);
    background: #FFF;
    transform: translateY(-2px);
}

.family-avatar {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.family-name {
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.family-stars {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
}

.family-member-active .family-stars {
    color: var(--profile-color-dark);
}
