/* ============ ТЕМЫ ============ */
:root {
    --bg: #2a2a2a;
    --text: #e8e8e8;
    --accent: #e26a6a;
    --speech-bg: rgba(20, 15, 15, 0.92);
    --speech-border: #e26a6a;
}
body.theme-gray     { --bg: #4a4a4a; }
body.theme-night    { --bg: #1a1a2e; --accent: #8a7fd4; --speech-border: #8a7fd4; }
body.theme-rose     { --bg: #3d2222; --accent: #ff9a9a; --speech-border: #ff9a9a; }
body.theme-forest   { --bg: #1e2f1e; --accent: #8bc34a; --speech-border: #8bc34a; }
body.theme-ocean    { --bg: #1a2a3a; --accent: #5eb3e4; --speech-border: #5eb3e4; }
body.theme-light    { --bg: #e8e8e8; --text: #222; --speech-bg: rgba(255,255,255,0.95); --speech-border: #b55; }
body.theme-violet   { --bg: #1a0f2e; --accent: #b88fe8; --speech-bg: rgba(20, 12, 40, 0.95); --speech-border: #b88fe8; }
body.theme-lavender { --bg: #2e1f42; --accent: #d4a5f5; --speech-bg: rgba(30, 20, 50, 0.94); --speech-border: #d4a5f5; }
body.theme-lilac    { --bg: #4a3560; --accent: #e8c8ff; --speech-bg: rgba(60, 45, 85, 0.92); --speech-border: #e8c8ff; }

/* ============ БАЗА ============ */
* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", "Trebuchet MS", sans-serif;
    transition: background 0.4s ease, color 0.4s ease;
    overflow: hidden;
}

/* ============ ВЕРХНИЙ ЛЕВЫЙ БЛОК ============ */
.top-left-bar {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 101;
    flex-wrap: wrap;
    max-width: calc(100vw - 240px);
}

.ach-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--speech-border);
    background: var(--speech-bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.ach-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
.ach-btn:active { transform: translateY(0); }

/* ============ СЧЁТЧИК ДРУЖБЫ ============ */
.friendship-counter {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    user-select: none;
    transition: color 0.4s, text-shadow 0.3s ease;
    text-shadow: 0 0 8px rgba(0,0,0,0.35);
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.15);
    letter-spacing: -0.5px;
}
.friendship-counter.lvl-1 { color: #ff9a9a; }
.friendship-counter.lvl-2 { color: #ff5a8a; }
.friendship-counter.lvl-3 { color: #ff2a6a; }
.friendship-counter.lvl-4 { color: #ffd54a; }
.friendship-counter.pulse {
    text-shadow: 0 0 18px var(--accent), 0 0 6px var(--accent);
}

/* ============ ТАЙМЕР ============ */
.timer-panel {
    position: fixed;
    top: 170px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    user-select: none;
}
.timer-current {
    color: var(--accent);
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}
.timer-total {
    color: var(--text);
    opacity: 0.7;
    font-size: 11px;
    letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums;
}

/* ============ ПЛЕЕР ============ */
.music-player {
    position: fixed;
    top: 105px;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    max-width: calc(100vw - 400px);
    min-width: 340px;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}
.music-player:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.5); }

.music-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.music-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}
.music-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.06); }
.music-btn:active { transform: scale(0.94); }
.music-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.music-play {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff5a8a, #ff7a5a);
    color: #fff;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(255,90,138,0.35);
}
.music-play:hover {
    background: linear-gradient(135deg, #ff6a94, #ff8a6a);
    box-shadow: 0 6px 18px rgba(255,90,138,0.5);
}

.music-repeat.active {
    background: linear-gradient(135deg, #ff5a8a, #ff7a5a);
    color: #fff;
    box-shadow: 0 0 12px rgba(255,90,138,0.6);
}

.music-expand {
    font-size: 11px;
    transition: transform 0.25s ease, background 0.15s;
}
.music-expand.open { transform: rotate(180deg); }

.music-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 6px;
}
.music-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}
.music-progress-wrap {
    height: 6px;
    width: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.music-progress-wrap:hover { height: 8px; transition: height 0.15s; }
.music-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff5a8a, #ff9a5a);
    border-radius: 3px;
    transition: width 0.1s linear;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255,90,138,0.6);
}
.music-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    opacity: 0.75;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.music-volume-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding: 0 4px; }
.music-vol-icon { font-size: 13px; opacity: 0.75; }
.music-volume {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}
.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ff5a8a;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255,90,138,0.7);
    transition: transform 0.15s;
}
.music-volume::-webkit-slider-thumb:hover { transform: scale(1.2); }
.music-volume::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ff5a8a;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(255,90,138,0.7);
}

.music-list {
    max-height: 0;
    overflow-y: auto;
    transition: max-height 0.35s ease;
    border-top: 0 solid transparent;
    padding: 0 12px;
}
.music-list.open {
    max-height: 220px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.music-list::-webkit-scrollbar { width: 5px; }
.music-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.music-track {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    margin-bottom: 2px;
}
.music-track:hover { background: rgba(255,255,255,0.08); }
.music-track.active {
    background: linear-gradient(135deg, rgba(255,90,138,0.25), rgba(255,154,90,0.15));
    color: #fff;
    font-weight: 700;
}
.music-track-num { width: 18px; font-size: 11px; opacity: 0.5; flex-shrink: 0; text-align: right; }
.music-track.active .music-track-num { opacity: 1; color: #ff9a9a; }

/* ============ ПАНЕЛИ ============ */
.ach-panel,
.meme-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 340px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 14px;
    z-index: 102;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.ach-panel.open,
.meme-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.ach-panel::-webkit-scrollbar,
.meme-panel::-webkit-scrollbar { width: 6px; }
.ach-panel::-webkit-scrollbar-thumb,
.meme-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.ach-header,
.meme-panel-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ============ ГРУППЫ АЧИВОК ============ */
.ach-group {
    margin-bottom: 6px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
}
.ach-group-header {
    padding: 9px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    user-select: none;
    transition: background 0.15s;
}
.ach-group-header:hover { background: rgba(255,255,255,0.06); }
.ach-group-count {
    font-size: 11px;
    opacity: 0.55;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ach-group-arrow {
    font-size: 9px;
    opacity: 0.6;
    transition: transform 0.25s ease;
    display: inline-block;
}
.ach-group.open .ach-group-arrow { transform: rotate(180deg); }
.ach-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 6px;
}
.ach-group.open .ach-group-body {
    max-height: 3000px;
    padding: 4px 6px 6px;
}
.ach-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    margin-bottom: 3px;
    background: rgba(255,255,255,0.03);
    transition: background 0.15s;
}
.ach-item.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}
.ach-item.unlocked {
    background: linear-gradient(135deg, rgba(255,90,138,0.15), rgba(255,154,90,0.08));
}
.ach-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.3;
}
.ach-info { flex: 1; min-width: 0; }
.ach-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.ach-desc {
    font-size: 10.5px;
    opacity: 0.65;
    line-height: 1.3;
}
.ach-status {
    font-size: 11px;
    color: var(--accent);
    flex-shrink: 0;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}
.ach-item.unlocked .ach-status {
    background: rgba(255,90,138,0.25);
    color: #fff;
}

/* ============ МЕМЫ ============ */
.meme-item {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    background: rgba(255,255,255,0.035);
    color: var(--text);
    border: 1px solid transparent;
}
.meme-item:hover {
    background: linear-gradient(135deg, rgba(255,90,138,0.22), rgba(255,154,90,0.12));
    border-color: rgba(255,90,138,0.35);
    transform: translateX(3px);
}
.meme-item-play {
    font-size: 13px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    color: #ff9a9a;
}
.meme-item-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.meme-empty {
    padding: 20px 10px;
    text-align: center;
    opacity: 0.5;
    font-size: 12px;
    font-style: italic;
}
.meme-more {
    padding: 12px 6px 4px;
    text-align: center;
    font-size: 11px;
    opacity: 0.5;
    font-style: italic;
    border-top: 1px dashed rgba(255,255,255,0.08);
    margin-top: 8px;
}

/* ============ БЕЙДЖ ============ */
.ach-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff3b6b, #ff7a3b);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 12px rgba(255,59,107,0.7), 0 0 3px rgba(255,255,255,0.4);
    animation: ach-badge-pop 0.4s cubic-bezier(.2,1.5,.5,1);
}
@keyframes ach-badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ============ ТОСТ ============ */
.ach-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 22px 14px 16px;
    background: linear-gradient(135deg, rgba(30, 18, 28, 0.97), rgba(55, 25, 45, 0.97));
    border: 1px solid rgba(255, 90, 138, 0.55);
    border-radius: 14px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.55),
        0 0 30px rgba(255,90,138,0.35),
        inset 0 0 20px rgba(255,90,138,0.08);
    transform: translateX(calc(100% + 60px));
    transition: transform 0.55s cubic-bezier(.2,.9,.3,1), opacity 0.4s ease;
    z-index: 1000;
    opacity: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 340px;
    cursor: pointer;
    pointer-events: none;
}
.ach-toast.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.ach-toast.show:hover {
    box-shadow:
        0 10px 40px rgba(0,0,0,0.55),
        0 0 45px rgba(255,90,138,0.6),
        inset 0 0 30px rgba(255,90,138,0.15);
}
.ach-toast.show:hover .ach-toast-sub { opacity: 1; color: #ffd0e4; }
.ach-toast-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,90,138,0.35), rgba(255,154,90,0.2));
    border: 1px solid rgba(255,90,138,0.5);
    border-radius: 12px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(255,90,138,0.7));
    animation: ach-toast-icon-pulse 1.5s ease-in-out infinite;
}
@keyframes ach-toast-icon-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.08) rotate(-3deg); }
}
.ach-toast-text { min-width: 0; }
.ach-toast-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #ff7aaa;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(255,90,138,0.6);
}
.ach-toast-sub {
    font-size: 12px;
    opacity: 0.8;
    color: #fff;
    line-height: 1.3;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* ============ ТЕМЫ ============ */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 100;
    max-width: 180px;
    justify-content: flex-end;
}
.theme-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.theme-btn:hover { transform: scale(1.15); border-color: var(--accent); }

/* ============ ВИДЖЕТ ============ */
.pet-widget {
    position: relative;
    width: 300px;
    height: 300px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.pet-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ============ ВИДЕО-ОВЕРЛЕЙ ============ */
.youtube-overlay {
    position: fixed;
    top: 120px;
    left: 50%;
    width: 400px;
    height: 225px;
    border-radius: 14px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease, box-shadow 0.4s ease;
    pointer-events: none;
    z-index: 500;
    box-shadow:
        0 12px 40px rgba(0,0,0,0.6),
        0 0 50px rgba(184, 143, 232, 0.5);
    border: 1px solid rgba(200, 160, 255, 0.45);
    background: #000;
    resize: both;
    min-width: 200px;
    min-height: 130px;
    max-width: 90vw;
    max-height: 80vh;
}
.youtube-overlay.show {
    opacity: 0.96;
    pointer-events: auto;
}
.youtube-overlay iframe,
.youtube-overlay video {
    width: 100%;
    height: 100%;
    display: none;
    border: 0;
    background: #000;
    object-fit: contain;
}
.youtube-overlay iframe.active,
.youtube-overlay video.active { display: block; }

/* Плашка для перетаскивания */
.overlay-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 26px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #fff;
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
    transition: opacity 0.2s;
    z-index: 20;
    font-weight: 900;
    user-select: none;
}
.youtube-overlay:hover .overlay-drag-handle { opacity: 1; }
.overlay-drag-handle:active { cursor: grabbing; }

/* Кнопка полного экрана */
.fullscreen-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
}
.youtube-overlay.show:hover .fullscreen-btn { opacity: 1; }
.fullscreen-btn:hover { background: rgba(255,90,138,0.85); transform: scale(1.1); }

/* ============ ИКОНКИ ============ */
.pet-icon { position: absolute; pointer-events: none; font-weight: 900; line-height: 1; z-index: 5; }
.pet-question {
    top: -10px;
    left: 50%;
    transform: translateX(-50%) scale(0.6);
    font-size: 42px;
    color: #ffd54a;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    font-family: "Trebuchet MS", sans-serif;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.pet-widget.sleeping:hover .pet-question {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    animation: pet-bounce 0.6s infinite alternate;
}
@keyframes pet-bounce {
    from { transform: translateX(-50%) scale(1) translateY(0); }
    to   { transform: translateX(-50%) scale(1.15) translateY(-6px); }
}
.pet-angry-mark {
    top: 60px;
    left: 78%;
    font-size: 36px;
    color: #ff3b3b;
    transform: scale(0.4) rotate(-15deg);
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
    opacity: 0;
    transition: none;
}
.pet-widget.mood-angry .pet-angry-mark { top: 20px; left: 48%; }
.pet-widget.waking .pet-angry-mark,
.pet-widget.mood-angry .pet-angry-mark {
    opacity: 1;
    transform: scale(1) rotate(-15deg);
    animation: pet-shake 0.3s infinite;
    transition: opacity 0.25s ease;
}
@keyframes pet-shake {
    0%, 100% { transform: scale(1) rotate(-22deg); }
    50%      { transform: scale(1.1) rotate(-8deg); }
}
.pet-widget.offended:not(.sleeping):not(.waking) .pet-angry-mark {
    opacity: 1;
    transform: scale(1) rotate(-15deg);
    animation: pet-shake 0.3s infinite;
    top: 20px;
    left: 48%;
}

/* ============ ОБЛАЧКО ============ */
.pet-speech {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 260px;
    min-height: 60px;
    padding: 10px 14px;
    background: var(--speech-bg);
    color: #fff;
    border: 1px solid var(--speech-border);
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.4s, border-color 0.4s;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pet-speech::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: var(--speech-bg);
    transition: border-top-color 0.4s;
}
.pet-widget.awake .pet-speech {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
body.theme-light .pet-speech { color: #222; }

/* ============ ЭФФЕКТЫ КЛИКА ============ */
.click-fx {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    font-weight: 800;
    font-size: 22px;
    font-family: -apple-system, "Segoe UI", sans-serif;
    letter-spacing: -0.5px;
    transform: translate(-50%, -50%);
    animation: fx-float 1.1s cubic-bezier(.2,.9,.3,1) forwards;
}
.click-fx.positive {
    background: linear-gradient(135deg, #ff5a8a 0%, #ff9a5a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 10px rgba(255,90,138,0.7));
}
.click-fx.negative {
    background: linear-gradient(135deg, #8a8a9a 0%, #5a5a6a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(140,140,160,0.5));
}
@keyframes fx-float {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    20%  { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -200%) scale(1); }
}
.click-ring {
    position: fixed;
    pointer-events: none;
    z-index: 998;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,90,138,0.8);
    transform: translate(-50%, -50%);
    animation: ring-expand 0.75s cubic-bezier(.2,.9,.3,1) forwards;
}
.click-ring.negative { border-color: rgba(140,140,160,0.7); }
@keyframes ring-expand {
    0%   { opacity: 0.9; width: 10px; height: 10px; border-width: 3px; }
    100% { opacity: 0; width: 90px; height: 90px; border-width: 1px; }
}
.click-dot {
    position: fixed;
    pointer-events: none;
    z-index: 998;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff7aaa;
    box-shadow: 0 0 8px rgba(255,90,138,0.9);
    transform: translate(-50%, -50%);
    animation: dot-burst 0.85s cubic-bezier(.2,.9,.3,1) forwards;
}
.click-dot.negative {
    background: #8a8a9a;
    box-shadow: 0 0 6px rgba(140,140,160,0.7);
}
@keyframes dot-burst {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); }
}

/* ============ НОТЫ ============ */
.note-particle {
    position: fixed;
    pointer-events: none;
    z-index: 996;
    color: #ffb0d0;
    text-shadow: 0 0 10px rgba(255,90,138,0.9), 0 0 20px rgba(255,90,138,0.5), 0 0 4px #fff;
    transform: translate(-50%, -50%);
    animation: note-float 2.4s ease-out forwards;
    opacity: 0;
    font-weight: 700;
}
@keyframes note-float {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-15deg); }
    15%  { opacity: 1; transform: translate(-50%, -55%) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(-50%, -250%) scale(1.05) rotate(20deg); }
}

/* ============ ФЕЙЕРВЕРКИ ============ */
.firework-particle {
    position: fixed;
    pointer-events: none;
    z-index: 997;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: firework-burst 1.5s cubic-bezier(.2,.9,.3,1) forwards;
    box-shadow: 0 0 10px currentColor, 0 0 4px currentColor;
}
.firework-particle.large { width: 8px; height: 8px; }
@keyframes firework-burst {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    60%  { opacity: 1; transform: translate(calc(-50% + var(--dx) * 0.85), calc(-50% + var(--dy) * 0.85)) scale(1.15); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); }
}

/* ============ ЧАТ ============ */
.chat-panel {
    position: fixed;
    left: 50%;
    bottom: 20px;
    width: 440px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 40px);
    padding: 12px;
    padding-top: 34px;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.chat-panel.open { opacity: 1; pointer-events: auto; }

.chat-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    user-select: none;
    transition: background 0.15s;
}
.chat-header:hover { background: rgba(255,255,255,0.07); }
.chat-header:active { cursor: grabbing; }
.chat-drag-dots { color: var(--accent); font-size: 14px; letter-spacing: 2px; opacity: 0.55; font-weight: 900; }

.chat-status {
    font-size: 11px;
    text-align: center;
    padding: 4px 8px;
    color: var(--accent);
    opacity: 0.85;
    font-style: italic;
    letter-spacing: 0.3px;
    display: none;
}
.chat-status.visible { display: block; }

.chat-messages {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 6px 4px 0;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.chat-msg {
    max-width: 78%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: chat-msg-appear 0.3s ease;
}
@keyframes chat-msg-appear {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(255,90,138,0.4), rgba(255,154,90,0.3));
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.pet {
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
}
.chat-msg.system {
    align-self: center;
    background: transparent;
    color: var(--accent);
    font-size: 11px;
    opacity: 0.7;
    font-style: italic;
    padding: 4px 10px;
    text-align: center;
    max-width: 100%;
}
body.theme-light .chat-msg.pet {
    background: rgba(0,0,0,0.06);
    color: #222;
    border-color: rgba(0,0,0,0.08);
}

.chat-typing {
    display: inline-flex;
    gap: 5px;
    padding: 12px 14px;
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    animation: chat-msg-appear 0.3s ease;
}
.chat-typing span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: chat-dot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-dot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}
body.theme-light .chat-typing { background: rgba(0,0,0,0.06); }

/* ВЫБОР ОТВЕТА (в компоновке, не перекрывает) */
.chat-choices {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--speech-border);
    border-radius: 14px;
    box-shadow: inset 0 0 20px rgba(255,90,138,0.06);
    flex-shrink: 0;
}
.chat-choices.visible { display: flex; }
.chat-choice {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--speech-border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all 0.15s ease;
    letter-spacing: 0.3px;
}
.chat-choice:hover {
    background: linear-gradient(135deg, rgba(255,90,138,0.5), rgba(255,154,90,0.4));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,90,138,0.4);
}
.chat-choice:active { transform: translateY(0); }

/* Когда есть выбор — скрываем поле ввода */
.chat-panel.has-choices .chat-input-row { display: none; }

.chat-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.3s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: rgba(255,255,255,0.35); }
.chat-input:disabled { opacity: 0.5; cursor: not-allowed; }
body.theme-light .chat-input {
    background: rgba(0,0,0,0.05);
    color: #222;
    border-color: rgba(0,0,0,0.1);
}
body.theme-light .chat-input::placeholder { color: rgba(0,0,0,0.4); }

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff5a8a, #ff7a5a);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: inherit;
}
.chat-send:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(255,90,138,0.4); }
.chat-send:active { transform: scale(0.95); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ==========================================================
   BACKROOMS (тема)
   ========================================================== */
body.theme-backrooms {
    --bg: #1a1a0a;
    --accent: #d4b856;
    --speech-bg: rgba(20, 15, 5, 0.92);
    --speech-border: #d4b856;
    background-color: #1a1a0a !important;
    background-image: url('images/backrooms.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* ==========================================================
   СТАТЫ (тамагочи)
   ========================================================== */
.stats-panel {
    position: fixed;
    top: 220px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 12px;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 12px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    user-select: none;
    min-width: 180px;
}
.stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
.stat-icon {
    width: 16px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}
.stat-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}
.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.3s;
    width: 0%;
}
.mood-fill  { background: linear-gradient(90deg, #ff5a8a, #ffb0d0); box-shadow: 0 0 6px rgba(255,90,138,0.5); }
.hunger-fill{ background: linear-gradient(90deg, #ffa04a, #ffd54a); box-shadow: 0 0 6px rgba(255,160,74,0.5); }
.clean-fill { background: linear-gradient(90deg, #5eb3e4, #b0e8ff); box-shadow: 0 0 6px rgba(94,179,228,0.5); }

.stat-value {
    width: 24px;
    text-align: right;
    font-weight: 700;
    font-size: 11px;
    opacity: 0.75;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ==========================================================
   ПАНЕЛИ ЗАБОТЫ И МАГАЗИНА
   ========================================================== */
.care-panel,
.shop-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 340px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 14px;
    z-index: 103;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.care-panel.open,
.shop-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.care-panel::-webkit-scrollbar,
.shop-panel::-webkit-scrollbar { width: 6px; }
.care-panel::-webkit-scrollbar-thumb,
.shop-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.care-header,
.shop-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.care-desc {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 10px;
    line-height: 1.4;
    font-style: italic;
}

.care-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 6px;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    width: 100%;
}
.care-action:hover {
    background: linear-gradient(135deg, rgba(255,90,138,0.18), rgba(255,154,90,0.1));
    border-color: rgba(255,90,138,0.35);
    transform: translateX(3px);
}
.care-action-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.care-action-info { flex: 1; min-width: 0; }
.care-action-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
}
.care-action-desc {
    font-size: 10.5px;
    opacity: 0.65;
    line-height: 1.3;
}

/* Магазин */
.shop-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin: 14px 0 6px;
    color: var(--accent);
}
.shop-section-title:first-of-type { margin-top: 0; }

.shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    color: var(--text);
}
.shop-item:hover {
    background: linear-gradient(135deg, rgba(255,90,138,0.18), rgba(255,154,90,0.1));
    border-color: rgba(255,90,138,0.35);
}
.shop-item.disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: grayscale(0.7);
}
.shop-item.disabled:hover {
    background: rgba(255,255,255,0.035);
    border-color: rgba(255,255,255,0.05);
}
.shop-item-icon {
    font-size: 22px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}
.shop-item-info { flex: 1; min-width: 0; }
.shop-item-title {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 2px;
}
.shop-item-desc {
    font-size: 10px;
    opacity: 0.65;
    line-height: 1.3;
}
.shop-item-price {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
    white-space: nowrap;
}
.shop-item.limited {
    background: linear-gradient(135deg, rgba(255,215,74,0.12), rgba(255,90,138,0.08));
    border-color: rgba(255,215,74,0.35);
    animation: shop-limited-pulse 2.5s ease-in-out infinite;
}
@keyframes shop-limited-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(255,215,74,0); }
    50%      { box-shadow: 0 0 14px rgba(255,215,74,0.35); }
}
.shop-limited-timer {
    font-size: 10px;
    color: #ffd54a;
    font-weight: 700;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================
   ИЗБРАННЫЕ МЕМЫ (звёздочки и стрелки)
   ========================================================== */
.meme-item-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}
.meme-item-row .meme-item {
    flex: 1;
    margin-bottom: 0;
}
.meme-star {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #555;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.meme-star:hover {
    background: rgba(255,215,74,0.15);
    color: #ffd54a;
    transform: scale(1.08);
}
.meme-star.active {
    color: #ffd54a;
    background: rgba(255,215,74,0.18);
    border-color: rgba(255,215,74,0.4);
    text-shadow: 0 0 8px rgba(255,215,74,0.6);
}
.meme-move {
    width: 22px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
    opacity: 0.7;
}
.meme-move:hover:not(:disabled) {
    background: rgba(255,90,138,0.15);
    opacity: 1;
}
.meme-move:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Общие стили панелей (если ещё нет) */
.ach-panel,
.meme-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 340px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 14px;
    z-index: 102;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.ach-panel.open,
.meme-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.ach-panel::-webkit-scrollbar,
.meme-panel::-webkit-scrollbar { width: 6px; }
.ach-panel::-webkit-scrollbar-thumb,
.meme-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}
.ach-header,
.meme-panel-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
/* ==========================================================
   BACKROOMS: смещение Ками вниз (сидит на полу)
   ========================================================== */
body.theme-backrooms .pet-widget {
    transform: translateY(160px);
}
body.theme-backrooms.chat-open .pet-widget {
    transform: translateY(160px);
}

/* ==========================================================
   КНОПКА КАЛЕНДАРИКА (ежедневный бонус)
   ========================================================== */
#dailyBtn {
    position: relative;
}
.daily-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd54a, #ff9a3b);
    color: #222;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 12px rgba(255,213,74,0.7);
    animation: ach-badge-pop 0.4s cubic-bezier(.2,1.5,.5,1);
}

/* ==========================================================
   ПАНЕЛЬ ЕЖЕДНЕВНОГО БОНУСА
   ========================================================== */
.daily-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 360px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 16px;
    z-index: 104;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.daily-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.daily-panel::-webkit-scrollbar { width: 6px; }
.daily-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.daily-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.daily-timer {
    font-size: 11px;
    text-align: center;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}
.daily-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.daily-cell {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
}
.daily-cell .daily-day {
    font-size: 9px;
    opacity: 0.5;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}
.daily-cell .daily-reward {
    font-size: 15px;
    font-weight: 900;
    color: #ffd54a;
    text-shadow: 0 0 10px rgba(255,213,74,0.6);
    line-height: 1;
}
.daily-cell .daily-reward-sub {
    font-size: 8px;
    opacity: 0.6;
    margin-top: 2px;
    letter-spacing: 0.3px;
}
.daily-cell.claimed {
    background: linear-gradient(135deg, rgba(255,213,74,0.15), rgba(255,154,59,0.1));
    border-color: rgba(255,213,74,0.4);
}
.daily-cell.claimed::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    color: #ffd54a;
    font-size: 12px;
    font-weight: 900;
}
.daily-cell.available {
    background: linear-gradient(135deg, rgba(255,90,138,0.25), rgba(255,154,90,0.18));
    border-color: rgba(255,90,138,0.55);
    box-shadow: 0 0 18px rgba(255,90,138,0.4);
    animation: daily-pulse 1.8s ease-in-out infinite;
}
@keyframes daily-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255,90,138,0.35); }
    50%      { box-shadow: 0 0 22px rgba(255,90,138,0.65); }
}
.daily-cell.future {
    opacity: 0.4;
    filter: grayscale(0.5);
}
.daily-cell.secret {
    background: linear-gradient(135deg, rgba(80,80,80,0.3), rgba(40,40,40,0.25));
    border-color: rgba(120,120,120,0.3);
}
.daily-cell.secret .daily-reward {
    color: #888;
    text-shadow: none;
    font-size: 22px;
}
.daily-claim-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--speech-border);
    background: linear-gradient(135deg, #ff5a8a, #ff9a5a);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.daily-claim-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,90,138,0.45); }
.daily-claim-btn:active { transform: translateY(0); }
.daily-claim-btn.disabled {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================
   ПАНЕЛЬ ИНВЕНТАРЯ
   ========================================================== */
.inv-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 14px;
    z-index: 105;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.inv-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.inv-panel::-webkit-scrollbar { width: 6px; }
.inv-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.inv-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.inv-empty {
    padding: 20px 10px;
    text-align: center;
    opacity: 0.5;
    font-size: 12px;
    font-style: italic;
}
.inv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.inv-item {
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    position: relative;
}
.inv-item:hover {
    background: linear-gradient(135deg, rgba(255,90,138,0.18), rgba(255,154,90,0.1));
    border-color: rgba(255,90,138,0.35);
    transform: translateY(-2px);
}
.inv-item-icon { font-size: 26px; margin-bottom: 4px; }
.inv-item-title {
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
    word-break: break-word;
}
.inv-item.limited {
    background: linear-gradient(135deg, rgba(255,213,74,0.12), rgba(255,90,138,0.08));
    border-color: rgba(255,213,74,0.35);
}
.inv-item.limited::after {
    content: '★';
    position: absolute;
    top: 4px;
    right: 6px;
    color: #ffd54a;
    font-size: 11px;
}

/* Летящая еда при кормлении */
.flying-food {
    position: fixed;
    font-size: 32px;
    pointer-events: none;
    z-index: 500;
    transform: translate(-50%, -50%);
    transition: left 0.7s cubic-bezier(.5,0,.5,1), top 0.7s cubic-bezier(.5,0,.5,1), transform 0.7s, opacity 0.7s;
}
.flying-food.arrived {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
}

/* ==========================================================
   ИНТЕРАКТИВНЫЙ УХОД (курсор-инструмент)
   ========================================================== */
.care-cursor {
    position: fixed;
    font-size: 32px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%) rotate(-20deg);
    display: none;
    filter: drop-shadow(0 0 8px rgba(255,90,138,0.6));
}
.care-cursor.active {
    display: block;
}
.pet-widget.care-mode {
    cursor: none;
}
.care-progress {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    z-index: 200;
    display: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.care-progress.visible { display: block; }

/* ==========================================================
   ВИТРИНА (в ачивках)
   ========================================================== */
.vitrina-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed rgba(255,213,74,0.35);
    background: rgba(255,213,74,0.05);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}
.vitrina-btn:hover {
    background: rgba(255,213,74,0.12);
    border-color: rgba(255,213,74,0.6);
}
.vitrina-panel {
    position: fixed;
    top: 70px;
    left: 20px;
    width: 380px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid rgba(255,213,74,0.4);
    border-radius: 16px;
    padding: 16px;
    z-index: 106;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(255,213,74,0.15);
}
.vitrina-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.vitrina-panel::-webkit-scrollbar { width: 6px; }
.vitrina-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.vitrina-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffd54a;
    opacity: 0.9;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,213,74,0.2);
}
.vitrina-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 6px;
}
.vitrina-item.owned {
    background: linear-gradient(135deg, rgba(255,213,74,0.15), rgba(255,90,138,0.08));
    border-color: rgba(255,213,74,0.4);
}
.vitrina-item.missed {
    opacity: 0.45;
    filter: grayscale(0.85);
}
.vitrina-icon {
    font-size: 26px;
    width: 34px;
    text-align: center;
    flex-shrink: 0;
}
.vitrina-info { flex: 1; min-width: 0; }
.vitrina-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
}
.vitrina-date {
    font-size: 10.5px;
    opacity: 0.6;
}
.vitrina-status {
    font-size: 15px;
    color: #ffd54a;
    flex-shrink: 0;
}
.vitrina-item.missed .vitrina-status { color: #777; }

/* ==========================================================
   ДЕВ-ЛОГ (версия)
   ========================================================== */
.dev-version {
    position: fixed;
    bottom: 12px;
    right: 16px;
    font-size: 11px;
    color: var(--text);
    opacity: 0.4;
    cursor: pointer;
    z-index: 90;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: 0.3px;
}
.dev-version:hover {
    opacity: 1;
    background: rgba(255,255,255,0.06);
    color: var(--accent);
}

.devlog-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.devlog-modal.open { opacity: 1; pointer-events: auto; }
.devlog-box {
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--speech-bg);
    border: 1px solid var(--speech-border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    position: relative;
}
.devlog-box::-webkit-scrollbar { width: 8px; }
.devlog-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.devlog-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}
.devlog-close:hover { opacity: 1; color: var(--accent); }
.devlog-header {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.devlog-version {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.devlog-version:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.devlog-version-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: 0.5px;
}
.devlog-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.65;
    opacity: 0.85;
}
.devlog-list li { margin-bottom: 2px; }
.vitrina-desc {
    font-size: 10.5px;
    opacity: 0.7;
    line-height: 1.35;
    font-style: italic;
    margin-bottom: 3px;
}
body.theme-yararara {
    --bg: #e01720;
    --accent: #ffb0b0;
    --speech-bg: rgba(80, 5, 10, 0.95);
    --speech-border: #ff8080;
    background: #e01720 !important;
}
/* ============ КОРИЧНЕВЫЕ ТЕМЫ (пасхалка) ============ */
body.theme-brown1 {
    --bg: #4a3020;
    --accent: #a67c52;
    --speech-bg: rgba(40, 25, 15, 0.95);
    --speech-border: #a67c52;
}
body.theme-brown2 {
    --bg: #2e1f14;
    --accent: #b08050;
    --speech-bg: rgba(30, 20, 12, 0.95);
    --speech-border: #b08050;
}
body.theme-brown3 {
    --bg: #6b4a32;
    --accent: #d4a574;
    --speech-bg: rgba(50, 35, 22, 0.95);
    --speech-border: #d4a574;
}

.theme-btn[data-theme="rgb"] {
    background: linear-gradient(135deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    border: 2px solid rgba(255,255,255,0.4);
}

.reset-video-btn {
    position: fixed;
    bottom: 12px;
    right: 72px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    opacity: 0.4;
    cursor: pointer;
    z-index: 90;
    user-select: none;
    padding: 3px 9px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: 0.3px;
    line-height: 1;
}
.reset-video-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.06);
    color: var(--accent);
    transform: rotate(-90deg);
}
/* Розовые темы */
body.theme-pink1 { --bg: #3d1a2a; --accent: #ffb0d0; --speech-bg: rgba(50, 20, 35, 0.94); --speech-border: #ffb0d0; }
body.theme-pink2 { --bg: #4a2035; --accent: #ffc8dd; --speech-bg: rgba(60, 25, 45, 0.94); --speech-border: #ffc8dd; }
body.theme-pink3 { --bg: #5a2840; --accent: #ffd8e8; --speech-bg: rgba(70, 30, 50, 0.92); --speech-border: #ffd8e8; }

/* Летящие сердечки */
.heart-particle {
    position: fixed;
    pointer-events: none;
    z-index: 996;
    color: #ff8ab8;
    font-size: 22px;
    text-shadow: 0 0 10px rgba(255, 120, 170, 0.8), 0 0 20px rgba(255, 120, 170, 0.4);
    animation: heart-float-up 4s ease-out forwards;
    opacity: 0;
    user-select: none;
}
@keyframes heart-float-up {
    0%   { opacity: 0; transform: translateY(20px) scale(0.5) rotate(-15deg); }
    15%  { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-100vh) scale(1.1) rotate(20deg); }
}

/* Ползунок блокировки фонов */
.theme-lock-btn {
    position: fixed;
    bottom: 12px;
    right: 100px;
    font-size: 15px;
    color: var(--text);
    opacity: 0.4;
    cursor: pointer;
    z-index: 90;
    user-select: none;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: "SF Mono", Consolas, monospace;
    line-height: 1;
    border: none;
    background: transparent;
}
.theme-lock-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.06);
    color: var(--accent);
}
.theme-lock-btn.active {
    opacity: 1;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(226,106,106,0.6);
}
body.theme-tomorrow {
    --bg: #d7fe05;
    --accent: #2a2a00;
    --speech-bg: rgba(30, 40, 0, 0.92);
    --speech-border: #d7fe05;
    background: #d7fe05 !important;
}
.music-shuffle.active {
    background: linear-gradient(135deg, #ff5a8a, #ff7a5a);
    color: #fff;
    box-shadow: 0 0 12px rgba(255,90,138,0.6);
}
.music-search-wrap {
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}
.music-search-wrap.open {
    max-height: 46px;
    padding: 0 12px 10px;
}
.music-search {
    width: 100%;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.music-search:focus { border-color: var(--accent); background: rgba(255,255,255,0.08); }
.music-search::placeholder { color: rgba(255,255,255,0.35); }
body.theme-light .music-search {
    background: rgba(0,0,0,0.05);
    color: #222;
    border-color: rgba(0,0,0,0.1);
}
/* ============ ПЛЕЕР: ручка перетаскивания ============ */
.music-player {
    position: fixed;
    resize: both;
    overflow: hidden;
    min-width: 320px;
    min-height: 46px;
    max-width: 95vw;
    max-height: 90vh;
}
.music-drag-handle {
    height: 10px;
    text-align: center;
    font-size: 9px;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.25);
    cursor: grab;
    user-select: none;
    line-height: 10px;
}
.music-drag-handle:active { cursor: grabbing; }
body.theme-light .music-drag-handle { color: rgba(0,0,0,0.25); }

/* ============ КНОПКИ АВТОРОВ ============ */
.music-authors {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.music-authors.open { display: flex; }
.music-author-btn {
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}
.music-author-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.music-author-btn.active {
    background: linear-gradient(135deg, #ff5a8a, #ff7a5a);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(255,90,138,0.5);
}

/* ============ ИЗБРАННОЕ (звёздочки) ============ */
.music-fav-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}
.music-fav-btn:hover { color: #ffd54a; transform: translateY(-50%) scale(1.2); }
.music-fav-btn.active { color: #ffd54a; text-shadow: 0 0 8px rgba(255,213,74,0.7); }
.music-track { position: relative; padding-right: 32px !important; }

.music-fav-move {
    position: absolute;
    right: 32px;
    width: 18px;
    height: 22px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 9px;
    font-family: inherit;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.music-fav-move.up { top: 2px; }
.music-fav-move.down { bottom: 2px; }
.music-fav-move:hover:not(:disabled) { color: var(--accent); }
.music-fav-move:disabled { opacity: 0.2; cursor: not-allowed; }

/* Разделитель между избранным и остальными */
.music-separator {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.4;
    padding: 8px 6px 4px;
    color: var(--accent);
}
