/* === LO-FI ЭСТЕТИКА (Стиль Лоны Фишер) === */
:root {
    --bg-dark: #1c1e1c; /* Мягкий тёмно-зелёно-серый фон */
    --card-bg: rgba(35, 38, 35, 0.85); /* Кофейно-древесный оттенок */
    --text-main: #e8e4cf; /* Тёплый кремовый текст (как старая бумага) */
    --text-muted: #9ca3af;
    --accent-green: #6b8c6c; /* Лесной зелёный */
    --accent-gold: #dcb97a;  /* Горчичный / Свет тёплой лампы */
    --border-color: #3b4039; /* Мягкие границы */
}

body {
    font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-dark);
    /* Лёгкая Lo-Fi сетка на фоне */
    background-image: 
        linear-gradient(rgba(107, 140, 108, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 140, 108, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    letter-spacing: 0.5px;
}

.network-links {
    display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; flex-wrap: wrap;
}

.tg-btn {
    display: flex; align-items: center; gap: 8px;
    background: rgba(25, 28, 25, 0.9);
    color: var(--accent-gold);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 12px; /* Мягкие углы */
    text-decoration: none; font-size: 14px; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-green);
}

.tg-btn:hover {
    border-color: var(--accent-green); color: #fff;
    box-shadow: 0 0 15px rgba(107, 140, 108, 0.3);
    transform: translateY(-2px);
}
header {
    background: linear-gradient(to bottom, #151715, transparent);
    padding: 40px 20px; text-align: center;
    border-bottom: 1px dashed var(--accent-green);
}

h1 {
    margin: 0; font-size: 28px; letter-spacing: 3px;
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(220, 185, 122, 0.3);
}

header p { margin: 10px 0 0 0; color: var(--accent-green); font-size: 14px; font-style: italic; }

main { max-width: 700px; margin: 30px auto; padding: 0 15px; }

section h2 {
    font-size: 18px; color: var(--accent-gold);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px; margin-bottom: 20px;
    letter-spacing: 1px; font-weight: 600;
}

/* Карточка-Пост */
.card {
    background-color: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 16px; /* Супер-мягкие края */
    padding: 20px; margin-bottom: 25px;
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0; transform: translateY(20px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    transition: all 0.3s;
    border-left: 4px solid var(--accent-gold);
}

.card:hover { 
    border-color: var(--accent-gold); transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.4), 0 0 15px rgba(220, 185, 122, 0.1);
}

@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

.post-header {
    display: flex; align-items: center; margin-bottom: 15px;
    border-bottom: 1px dashed var(--border-color); padding-bottom: 15px;
}

.avatar {
    width: 45px; height: 45px; border-radius: 12px; margin-right: 15px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px;
    border: 1px solid var(--accent-green); background: #151715;
}

.avatar.bot { color: var(--accent-gold); border-color: var(--accent-gold); }
.avatar.utility { color: var(--accent-green); border-color: var(--accent-green); }

.post-meta { display: flex; flex-direction: column; gap: 5px; }
.post-author { font-weight: bold; font-size: 16px; color: var(--text-main); line-height: 1.2; }
.post-time { font-size: 12px; color: var(--accent-green); font-family: monospace; }

.post-body p { line-height: 1.7; color: #c2c7b6; font-size: 15px; }

/* Кнопки */
.btn {
    display: inline-block; padding: 10px 18px; margin-top: 10px;
    border-radius: 8px; font-size: 13px; font-weight: bold;
    text-decoration: none; cursor: pointer; transition: all 0.2s;
    background: rgba(20, 22, 20, 0.8); border: 1px solid var(--border-color);
    color: var(--text-main); border-left: 2px solid var(--accent-green);
}

.btn:hover { background-color: var(--accent-green); color: #fff; border-color: var(--accent-green); }

/* ГАЛЕРЕЯ */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-bottom: 40px; }
.gallery-item {
    width: 100%; height: 250px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border-color); box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease; cursor: pointer;
}
.gallery-item:hover { transform: scale(1.02); border-color: var(--accent-gold); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: high-quality; }

/* === РАДИОПЛЕЕР LO-FI === */
@keyframes eqBounce { 0% { height: 4px; } 100% { height: 20px; } }
@keyframes slideMarquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

.l-podcast-body {
  background: var(--card-bg); border: 1px solid var(--border-color); border-top: 3px solid var(--accent-green);
  border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); position: relative;
}
.l-top-section { display: flex; gap: 16px; align-items: stretch; }

.l-avatar {
  width: 90px; height: 90px; flex-shrink: 0; background: #151715;
  border-radius: 12px; border: 2px solid var(--accent-gold);
  overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.l-avatar-image {
  width: 100%; height: 100%;
  background-image: url('https://thumbs2.imgbox.com/59/94/504RReFw_t.png'); 
  background-size: cover; background-position: center; filter: sepia(0.2) contrast(1.1); 
}

.l-speech-bubble {
  background: rgba(25, 28, 25, 0.9); border: 1px solid var(--border-color); border-radius: 12px 12px 12px 2px;
  padding: 14px 18px; color: var(--text-main); font-size: 14px; font-style: italic; line-height: 1.6;
  flex-grow: 1; position: relative; display: flex; flex-direction: column; justify-content: center;
}
.l-speech-bubble::before {
  content: ''; position: absolute; left: -10px; bottom: -1px;
  border-width: 0 10px 14px 0; border-style: solid; border-color: transparent var(--border-color) transparent transparent;
}
.l-speech-bubble::after {
  content: ''; position: absolute; left: -8px; bottom: 0;
  border-width: 0 9px 12px 0; border-style: solid; border-color: transparent rgba(25, 28, 25, 0.9) transparent transparent;
}

.l-player {
  background: rgba(20, 22, 20, 0.9); border: 1px solid var(--border-color); border-radius: 10px;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-left: 3px solid var(--accent-gold);
}
.l-track-info { flex-grow: 1; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }

.l-now-playing-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1px dashed rgba(107, 140, 108, 0.3); padding-bottom: 6px; margin-bottom: 2px;
}
.l-now-playing { font-size: 10px; color: #9ca3af; font-weight: bold; letter-spacing: 1px; }
.l-freq { font-size: 10px; color: var(--accent-gold); font-family: monospace; }

.l-marquee { width: 100%; overflow: hidden; padding: 2px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.l-marquee span {
  display: inline-block; white-space: nowrap; animation: slideMarquee 20s linear infinite;
  color: var(--accent-green); font-family: monospace; font-size: 12px;
}

.l-eq-box {
  background: #151715; border: 1px solid var(--border-color); border-radius: 6px;
  padding: 6px 8px; height: 32px; display: flex; align-items: center; justify-content: center;
}
.l-eq { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.l-eq span { display: block; width: 4px; background: var(--accent-gold); border-radius: 2px; animation: eqBounce 0.6s alternate infinite ease-in-out; }
.l-eq span:nth-child(1) { animation-delay: 0.1s; } .l-eq span:nth-child(2) { animation-delay: 0.3s; }
.l-eq span:nth-child(3) { animation-delay: 0.0s; } .l-eq span:nth-child(4) { animation-delay: 0.4s; }
.l-eq span:nth-child(5) { animation-delay: 0.2s; }

/* === КАСТОМНЫЙ LO-FI ПЛЕЕР === */
.l-audio-container { 
    margin-top: 5px; 
    width: 100%; 
    max-width: 320px; 
}

/* Главная панель */
.custom-lofi-player {
    display: flex; 
    align-items: center; 
    gap: 10px; /* Немного уменьшили отступ, так как кнопки стали широкими */
    background: rgba(20, 22, 20, 0.85); 
    padding: 12px 14px;
    border-radius: 14px; 
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Общий стиль для всех кнопок (широкие прямоугольники одной высоты и цвета) */
#lofi-prev-btn, #lofi-next-btn, #lofi-play-btn {
    height: 38px; /* Жестко фиксируем одинаковую высоту */
    border-radius: 10px; /* Закругленные прямоугольники */
    border: none;
    /* !important перебивает JS-скрипт, делая цвет всех кнопок одинаковым */
    background: var(--accent-gold) !important; 
    color: #1c1e1c !important; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    padding: 0;
}

/* Эффект наведения - все кнопки одинаково светлеют и приподнимаются */
#lofi-prev-btn:hover, #lofi-next-btn:hover, #lofi-play-btn:hover {
    transform: translateY(-2px);
    background: #fff !important; 
    box-shadow: 0 5px 12px rgba(220, 185, 122, 0.4);
}

/* Задаем ширину: пред/след одинаковые, плей - шире */
#lofi-prev-btn, #lofi-next-btn {
    width: 48px; 
    font-size: 16px; 
    line-height: 0; /* Убирает "воздух" текстового символа, чтобы он не съезжал вниз */
}

#lofi-play-btn {
    width: 64px; 
    position: relative; 
}

/* Оптическая компенсация текстовых иконок ⏭ и ⏮ */
/* (Сами символы часто нарисованы криво в шрифтах, это ставит их строго в центр) */
#lofi-prev-btn { padding-right: 2px; }
#lofi-next-btn { padding-left: 2px; }

/* Иконки внутри Play/Pause */
#lofi-play-btn .play-icon,
#lofi-play-btn .pause-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    line-height: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Треугольник Play визуально нуждается в смещении вправо */
#lofi-play-btn .play-icon {
    margin-left: 2px; 
}

/* Плавная смена иконок Play <-> Pause */
#lofi-play-btn .pause-icon { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.5); 
    margin-left: 0; /* Пауза ровная, ей смещение не нужно */
}

#lofi-play-btn.is-playing .play-icon { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.5); 
}

#lofi-play-btn.is-playing .pause-icon { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1); 
}

/* Блок ползунка громкости */
.c-vol-wrap { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex: 1; 
    margin-left: 6px; 
}

.c-vol-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Сама дорожка ползунка */
.c-vol-slider {
    -webkit-appearance: none; 
    appearance: none; 
    width: 100%; 
    height: 6px;
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 3px; 
    outline: none; 
    cursor: pointer;
    transition: background 0.2s;
}

.c-vol-slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Ползунок (кружочек) громкости */
.c-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none; 
    appearance: none; 
    width: 14px; 
    height: 14px;
    border-radius: 50%; 
    background: var(--accent-green); 
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.c-vol-slider::-webkit-slider-thumb:hover { 
    background: var(--accent-gold); 
    transform: scale(1.3); 
}

/* Адаптив панели для мобильных экранов */
@media (max-width: 560px) {
    .custom-lofi-player {
        flex-wrap: wrap;
        justify-content: center;
        padding: 12px;
        gap: 10px;
    }
    .c-vol-wrap {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
    .c-vol-slider {
        max-width: 180px; 
    }
}

/* === БОКОВЫЕ ВИДЖЕТЫ (СТОЛ ЛОНЫ) === */
.side-widget {
    /* На мобилках выстраиваем их аккуратно по центру друг под другом */
    position: relative; 
    width: 90%; 
    max-width: 320px; 
    margin: 20px auto; 
    z-index: 10;
}

@keyframes floatWidget {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Переключаемся на фиксированную подвеску только на больших экранах */
@media (min-width: 1250px) {
    .side-widget {
        position: fixed; 
        top: 120px; 
        width: 220px; 
        margin: 0;
        animation: floatWidget 6s ease-in-out infinite;
    }
    .widget-left { left: calc(50vw - 580px); }
    .widget-right { right: calc(50vw - 580px); animation-delay: 1s; }
}

/* Таймер Помодоро */
.pomodoro-widget {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-top: 3px solid var(--accent-green); border-radius: 12px;
    padding: 20px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}
.pomo-title { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: bold; letter-spacing: 1px; }
.pomo-time { 
    font-size: 42px; font-weight: 900; color: var(--accent-gold); 
    font-family: monospace; margin: 15px 0; text-shadow: 0 0 15px rgba(220, 185, 122, 0.3);
}
.pomo-controls { display: flex; gap: 10px; justify-content: center; }
.pomo-controls button {
    background: rgba(30, 35, 30, 0.8); border: 1px solid var(--accent-green);
    color: var(--text-main); padding: 6px 12px; border-radius: 6px; 
    font-size: 11px; cursor: pointer; transition: 0.2s; font-weight: bold;
}
.pomo-controls button:hover { background: var(--accent-green); color: #fff; }
.pomo-desc { font-size: 10px; color: var(--text-muted); margin-top: 15px; font-style: italic; }

/* Желтый стикер */
.sticky-note {
    background: #e8d087; color: #3b301a; padding: 25px 20px 20px 20px;
    border-radius: 2px 20px 2px 2px; box-shadow: 3px 8px 15px rgba(0,0,0,0.3);
    transform: rotate(3deg); font-family: 'Comic Sans MS', 'Segoe Print', cursive;
    position: relative; transition: transform 0.3s;
}
.sticky-note:hover { transform: rotate(0deg) scale(1.02); }
.sticky-pin {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    width: 12px; height: 12px; background: #b91c1c; border-radius: 50%;
    box-shadow: -2px 4px 5px rgba(0,0,0,0.4);
}
.sticky-title { font-weight: bold; font-size: 18px; border-bottom: 2px solid rgba(0,0,0,0.1); padding-bottom: 5px; margin-bottom: 12px; }
.sticky-list { list-style: none; padding: 0; margin: 0; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.sticky-list li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.2; }
.sticky-list input[type="checkbox"] { accent-color: #5b7a61; margin-top: 2px; cursor: pointer; }
.sticky-list input[type="checkbox"]:checked + span { text-decoration: line-through; opacity: 0.6; }

/* СПОЙЛЕРЫ */
.toggle-header { cursor: pointer; position: relative; display: inline-block; transition: all 0.2s ease; user-select: none; }
.toggle-header:hover { color: var(--accent-green); }
.toggle-header::after { content: ' ▼'; font-size: 14px; display: inline-block; transition: transform 0.3s; color: var(--accent-gold); margin-left: 8px; }
.toggle-wrapper { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
.toggle-wrapper.collapsed { grid-template-rows: 0fr; }
.toggle-inner { overflow: hidden; transition: opacity 0.3s, transform 0.4s; opacity: 1; transform: translateY(0); }
.toggle-wrapper.collapsed .toggle-inner { opacity: 0; transform: translateY(-10px); }

/* === ЭФФЕКТ ЗА МЫШКОЙ (Ноты и искры) === */
.lofi-particle {
    position: absolute;
    pointer-events: none;
    color: var(--accent-green);
    font-size: 16px;
    z-index: 9999;
    animation: floatUp 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    text-shadow: 0 0 8px rgba(107, 140, 108, 0.6);
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 0.8; }
    100% { transform: translateY(-40px) scale(1.5) rotate(20deg); opacity: 0; }
}
/* === DRAG & DROP ИНТЕРФЕЙС === */
.pomo-title, .sticky-title {
    cursor: grab; /* Показываем лапку */
}
.pomo-title:active, .sticky-title:active {
    cursor: grabbing; /* Схватили! */
}
/* Отключаем плавающую анимацию во время перетаскивания */
.side-widget.is-dragging {
    animation: none !important;
    z-index: 1000; /* Выводим на передний план */
    transform: scale(1.02);
    transition: transform 0.1s;
}
/* === СВЕТЛЯЧКИ (МИНИ-ИГРА) === */
.lofi-firefly {
    position: fixed; bottom: -20px;
    background: var(--accent-gold);
    border-radius: 50%;
    pointer-events: auto;
    cursor: crosshair;
    box-shadow: 0 0 15px 4px rgba(220, 185, 122, 0.4);
    /* Запускаем анимацию ТОЛЬКО 1 раз, и она замирает в конце (forwards) */
    animation: floatFirefly linear forwards;
    z-index: 1;
    transition: transform 0.3s, opacity 0.3s;
}
/* Оставили только увеличение при наведении, без смены цвета */
.lofi-firefly:hover { transform: scale(1.5); }

@keyframes floatFirefly {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-100vh) translateX(50px) scale(0.5); opacity: 0; }
}

/* Счетчик на экране */
#firefly-score-board {
    position: fixed; bottom: 20px; right: 20px;
    background: rgba(20, 22, 20, 0.9);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-gold);
    color: var(--text-main); font-family: monospace; font-size: 14px;
    padding: 10px 15px; border-radius: 8px;
    z-index: 2000; opacity: 0; /* Скрыт, пока не поймаешь первого */
    transition: opacity 0.5s, transform 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
#firefly-score-board.active { opacity: 1; }
#firefly-score-board span { color: var(--accent-gold); font-weight: 900; font-size: 16px; }
/* Увеличенный хитбокс для светлячков (Невидимый бампер) */
.lofi-firefly::after {
    content: '';
    position: absolute;
    top: -20px; left: -20px; right: -20px; bottom: -20px;
    border-radius: 50%;
    cursor: crosshair;
}

/* Система уведомлений (Ачивки) */
#lofi-toasts {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.lofi-toast {
    background: rgba(20, 22, 20, 0.95); border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-gold); color: var(--text-main);
    padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    animation: toastEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, toastLeave 0.4s ease-in 4s forwards;
}
@keyframes toastEnter { from { opacity: 0; transform: translateX(120%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastLeave { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(120%); } }
/* === ЧАСТИЦЫ ВЗРЫВА СВЕТЛЯЧКА === */
.firefly-particle {
    position: fixed;
    width: 6px; height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(220, 185, 122, 0.8);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease-out;
    /* Смещение, чтобы искры летели ровно из центра мышки */
    margin-top: -3px; margin-left: -3px;
}

/* === РИСОВАЛКИ (CANVAS NOTES) === */
.canvas-note {
    position: fixed; z-index: 1500;
    background: #e8d087; /* Тот же цвет, что и у План Лоны */
    padding: 25px 10px 10px 10px;
    border-radius: 2px 20px 2px 2px; 
    box-shadow: 3px 8px 15px rgba(0,0,0,0.3);
    /* Легкий наклон для живости */
    transform: rotate(-2deg);
    transition: transform 0.2s;
}
.canvas-note:hover { transform: rotate(0deg) scale(1.02); z-index: 1501; }

.canvas-handle {
    position: absolute; top: 0; left: 0; right: 0; height: 25px; cursor: grab;
}
.canvas-handle:active { cursor: grabbing; }

.canvas-pin {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 10px; height: 10px; background: #3b82f6; /* Синяя кнопочка для отличия */
    border-radius: 50%; box-shadow: -1px 2px 3px rgba(0,0,0,0.4); 
    pointer-events: none;
}
.canvas-close {
    position: absolute; top: 4px; right: 8px; font-size: 12px; color: #b91c1c;
    cursor: pointer; font-weight: bold; transition: transform 0.2s;
}
.canvas-close:hover { transform: scale(1.3); }

.canvas-board {
    background: rgba(255,255,255,0.15); border: 1px dashed rgba(0,0,0,0.1);
    border-radius: 4px; cursor: crosshair; display: block;
}
/* === ПАНЕЛЬ ИНСТРУМЕНТОВ (ВЫДВИЖНАЯ) === */
.canvas-toolbar {
    position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; padding: 8px 12px; 
    background: rgba(25, 28, 25, 0.95); border: 1px solid var(--accent-gold);
    border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    align-items: center; justify-content: center; width: max-content;
    opacity: 0; pointer-events: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1; /* Прячем под записку */
}

/* Выдвигаем палитру ТОЛЬКО по добавлению спец. класса */
.canvas-note.show-tools .canvas-toolbar {
    opacity: 1; pointer-events: auto; bottom: -55px; z-index: 10;
}

/* Удаляем старый .canvas-note:hover .canvas-toolbar ... */

/* Кнопка-переключатель для палитры */
.canvas-palette-toggle {
    position: absolute; top: 4px; right: 28px; font-size: 13px;
    cursor: pointer; transition: transform 0.2s; z-index: 20;
}
.canvas-palette-toggle:hover { transform: scale(1.3); }

.canvas-color { 
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer; 
    border: 2px solid transparent; transition: transform 0.2s; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.canvas-color:hover { transform: scale(1.2); }
.canvas-color.active { border-color: #f8fafc; outline: 2px solid #1e293b; }

.canvas-tool-btn { 
    background: none; border: none; cursor: pointer; 
    font-size: 16px; opacity: 0.5; transition: all 0.2s; 
    padding: 0 4px; display: flex; align-items: center; justify-content: center;
}
.canvas-tool-btn:hover, .canvas-tool-btn.active { opacity: 1; transform: scale(1.2); }

.canvas-size { 
    width: 50px; height: 4px; -webkit-appearance: none; appearance: none;
    background: rgba(255,255,255,0.2); border-radius: 2px; outline: none; margin: 0 5px;
}
.canvas-size::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent-gold); cursor: pointer;
}

/* Кнопка "Сжечь всё" */
.btn-danger { background: rgba(220, 38, 38, 0.8) !important; border-left-color: #ef4444 !important; }
.btn-danger:hover { background: #ef4444 !important; }

/* === ЭЛЕМЕНТЫ ПОВЕРХ СКЕТЧА (Текст и Чекбоксы) === */
.overlay-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: hidden;
}
.note-checkbox-wrapper, .note-text-wrapper {
    position: absolute; pointer-events: auto; /* Чтобы можно было кликать и таскать */
    font-family: 'Comic Sans MS', 'Segoe Print', cursive;
    cursor: grab; /* Показываем лапку */
}
.note-checkbox-wrapper:active, .note-text-wrapper:active { cursor: grabbing; }

.note-checkbox-wrapper {
    display: flex; align-items: flex-start; 
    gap: 0.4em; /* ФИКС: Расстояние между галочкой и текстом теперь тоже растягивается! */
    font-size: 14px; color: #3b301a;
    background: rgba(232, 208, 135, 0.5); border-radius: 4px; padding: 2px 4px;
}
.note-checkbox-wrapper input { 
    font-size: inherit; /* 🔥 БАГФИКС: Приказываем чекбоксу расти вместе с текстом! */
    accent-color: #5b7a61; 
    margin-top: 0.15em; 
    width: 1.1em; height: 1.1em; 
    cursor: pointer; 
}
.note-checkbox-wrapper input:checked + span { text-decoration: line-through; opacity: 0.6; }

.note-text-wrapper { white-space: nowrap; font-weight: bold; text-shadow: 0px 1px 2px rgba(255,255,255,0.4); }

/* Интерактивный пин-кнопка */
.canvas-pin { 
    cursor: pointer; transition: transform 0.2s, background-color 0.3s; 
    pointer-events: auto !important; /* ФИКС: Делаем кнопку осязаемой */
    z-index: 10; /* Выводим поверх ручки перетаскивания */
}
.canvas-pin:hover { transform: translateX(-50%) scale(1.3); }
/* === ГРУППА КНОПОК СКЕТЧА (АДАПТИВ) === */
#canvas-btn-group {
    position: fixed; bottom: 20px; left: 20px; z-index: 2000; display: flex; gap: 10px;
}

/* Мобильная подвеска для кнопок и светлячков */
@media (max-width: 600px) {
    #canvas-btn-group {
        /* Ставим кнопки столбиком. "Сжечь всё" будет сверху, чтобы случайно не нажать */
        flex-direction: column-reverse; 
        bottom: 15px; left: 15px; gap: 8px;
    }
    #canvas-btn-group .btn {
        padding: 6px 12px; font-size: 12px;
    }
    #firefly-score-board {
        /* Чуть уменьшаем и сдвигаем счетчик искр */
        bottom: 15px; right: 15px; padding: 6px 10px; font-size: 12px;
    }
}
/* Выделение элемента для изменения размера */
.is-selected {
    box-shadow: 0 0 0 2px var(--accent-gold);
    border-radius: 4px;
    z-index: 10;
}

.c-radio-btn {
    min-width: 42px;
    padding: 6px 10px;
    flex-shrink: 0;
}

.c-vol-label {
    font-size: 10px;
    color: #9ca3af;
    letter-spacing: 1px;
}

.custom-lofi-player {
    flex-wrap: wrap;
}

@media (max-width: 560px) {
    .custom-lofi-player {
        gap: 8px;
    }

    .c-vol-wrap {
        width: 100%;
    }
}

#lofi-play-btn.c-icon-btn {
    position: relative;
    width: 54px;
    min-width: 54px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

#lofi-play-btn.c-icon-btn .play-icon,
#lofi-play-btn.c-icon-btn .pause-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.22s ease, transform 0.22s ease;
    line-height: 1;
    font-size: 15px;
}

#lofi-play-btn.c-icon-btn .pause-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

#lofi-play-btn.c-icon-btn.is-playing .play-icon {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

#lofi-play-btn.c-icon-btn.is-playing .pause-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.c-radio-btn {
    width: 32px;
    min-width: 32px;
    height: 32px;

    padding: 0;
    font-size: 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #d1d5db;

    border-radius: 6px;

    transition: all 0.2s ease;
}

.c-radio-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

#lofi-play-btn {
    width: 52px;
    min-width: 52px;
    height: 36px;
    border-radius: 8px;
}

/* === КОШКА БРУНИКА НА РАДИО === */
#bruniik-cat-widget {
    position: absolute;
    top: -48px; /* Сидит ровно на рамке плеера */
    right: 20px;
    width: 85px; /* Сделали чуть больше, чтобы оценить детализацию */
    height: 60px;
    
    /* ПО УМОЛЧАНИЮ КОШКА СПИТ */
    background-image: url('https://images2.imgbox.com/8d/a9/MG5ddpl0_o.png'); 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom center;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s ease;
    
    /* Плавное дыхание во сне */
    animation: catBreathe 4s infinite ease-in-out;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); /* Глубокая тень для реалистичного арта */
}

/* СОСТОЯНИЕ: ПРОСНУЛАСЬ (Смотрит на тебя) */
#bruniik-cat-widget.awake {
    background-image: url('https://images2.imgbox.com/c1/97/L46WffjF_o.png'); 
    animation: none; /* Когда проснулась - не дышит так тяжело */
}

#bruniik-cat-widget:hover {
    transform: scale(1.05) translateY(-2px);
}

/* Иконка голода (рыбка) */
.cat-hungry-bubble {
    position: absolute;
    top: -15px;
    right: -10px;
    background: #fff;
    border-radius: 50%;
    padding: 5px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: floatBubble 2s infinite ease-in-out;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 21;
}

.cat-hungry-bubble.show {
    opacity: 1;
}

@keyframes catBreathe {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50% { transform: scaleY(1.03) translateY(-1px); } /* Слегка дышит спинкой */
}

@keyframes floatBubble {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Вылетающие сердечки при поглаживании */
.cat-heart {
    position: absolute;
    color: #ef4444; 
    font-size: 18px;
    pointer-events: none;
    z-index: 25;
    animation: flyHeart 1s ease-out forwards;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

@keyframes flyHeart {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    100% { transform: translateY(-40px) scale(1.5); opacity: 0; }
}
