* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    background: #1a1a2e;
}

:root {
    --bg-color: #1a1a2e;
    --bg-gradient: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    --card-bg: rgba(22, 33, 62, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-color: #eaeaea;
    --text-muted: #a0a0a0;
    --accent-color: #e94560;
    --success-color: #4ecca3;
    --warning-color: #ffc107;
    --hunger-color: #ff6b6b;
    --mood-color: #ffd93d;
    --energy-color: #6bcb77;
    --glow-color: rgba(233, 69, 96, 0.3);
    --tg-viewport-height: 100vh;
    --tg-header-height: 0px;

    /* Вычисляются из Telegram WebApp API в init() → --tg-padded-top.
       Safe/content отдельно — для отладки; в отступе контейнера их не суммируем. */
    --tg-safe-inset-top: env(safe-area-inset-top, 0px);
    --tg-content-inset-top: 0px;
    /*
     * До init(): грубая оценка «шапка TG + зазор» без двойного safe+content.
     */
    --tg-padded-top: calc(env(safe-area-inset-top, 0px) + 59px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    min-height: var(--tg-viewport-height, 100vh);

    /*
     * Базовый отступ сверху.
     * В обычном режиме WebView стартует ниже хедера Telegram, хватает небольшого зазора.
     * В fullscreen — хедер рисуется поверх нашего контента, поэтому используем переменные.
     */
    padding-top: 16px;
}

/* Динамическая высота viewport для мобильных */
@supports (height: 100dvh) {
    .container {
        min-height: 100dvh;
    }
}

/* Telegram Mini App — полноэкранный режим.
   Отступ задаётся одной величиной --tg-padded-top (см. init в app.js):
   приоритет у contentSafeAreaInsets (зона под кнопками «Закрыть» / «···»), без суммы с safe — иначе контент уезжает слишком низко. */
body.tg-fullscreen .container {
    padding-top: var(--tg-padded-top);
}

/* Обычный режим Mini App (WebView стартует ниже хедера Telegram — нужен только notch + буфер) */
body:not(.tg-fullscreen) .container {
    padding-top: calc(env(safe-area-inset-top, 0px) + 51px);
}

.hidden {
    display: none !important;
}

/* ==================== Кнопка меню ==================== */
.app {
    position: relative;
}

.menu-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 20;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-btn:hover,
.menu-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.menu-btn-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-color);
    border-radius: 1px;
}

/* ==================== Полноэкранное меню ==================== */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10, 10, 25, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.menu-overlay.hidden {
    display: none !important;
}

.menu-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.28s ease;
}

.menu-overlay.showing-notifications .menu-panel {
    opacity: 0;
    pointer-events: none;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

/* Заголовок меню */
.menu-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0 20px;
}

.menu-header-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 12px rgba(233, 69, 96, 0.6));
}

.menu-header-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-header-petname {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

/* Группы кнопок */
.menu-items-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 6px;
    overflow: hidden;
}

.menu-items-group--secondary {
    background: transparent;
    border-color: transparent;
    padding: 0;
}

.menu-item {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.menu-item-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item-label {
    flex: 1;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.14);
}

.menu-item-test {
    opacity: 0.6;
    font-size: 14px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.menu-item-test:hover {
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.09);
}

.menu-item-admin {
    font-size: 14px;
    padding: 10px 16px;
    background: rgba(233, 69, 96, 0.08);
    border: 1px solid rgba(233, 69, 96, 0.25);
    border-radius: 12px;
    color: #e94560;
    font-weight: 600;
}

.menu-item-admin:hover {
    background: rgba(233, 69, 96, 0.18);
    border-color: rgba(233, 69, 96, 0.5);
}

/* ==================== Экран уведомлений (внутри overlay, crossfade с меню) ==================== */
.difficulty-screen {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    height: 100%;
    padding: 24px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.menu-overlay.showing-notifications .difficulty-screen {
    opacity: 1;
    pointer-events: auto;
}

.diff-screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.difficulty-back {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    font-size: 18px;
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.difficulty-back:hover {
    background: rgba(255, 255, 255, 0.14);
}

.difficulty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.difficulty-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-left: 4px;
}

.difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
}

.difficulty-option {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    color: var(--text-color);
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.18s;
    display: flex;
    align-items: center;
    gap: 14px;
}

.difficulty-option:last-child {
    border-bottom: none;
}

.difficulty-option:hover {
    background: rgba(255, 255, 255, 0.07);
}

.difficulty-option:active {
    background: rgba(255, 255, 255, 0.12);
}

.difficulty-option.current {
    background: rgba(233, 69, 96, 0.1);
}

.difficulty-option:disabled {
    opacity: 0.4;
    cursor: default;
}

.diff-icon {
    font-size: 22px;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.diff-text {
    flex: 1;
    min-width: 0;
}

.diff-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.diff-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
    word-break: break-word;
}

.diff-check {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.difficulty-cooldown {
    margin-top: 16px;
    font-size: 13px;
    color: var(--warning-color);
    padding-left: 4px;
}

/* Модальное окно: два кнопки в ряд */
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-buttons .save-name-btn {
    flex: 1;
}

.save-name-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

.save-name-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* TODO: временно - выбор рарности при создании персонажа */
.rarity-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    margin-bottom: 6px;
}

.rarity-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.rarity-btn {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.rarity-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.rarity-btn.active {
    border-color: var(--accent-color);
    background: rgba(233, 69, 96, 0.2);
}

/* ==================== Загрузка ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-bg);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Модальное окно имени ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-gradient);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-pet-preview {
    margin-bottom: 20px;
}

.modal-pet-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px var(--glow-color));
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-color);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.name-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.name-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--glow-color);
}

.name-input::placeholder {
    color: var(--text-muted);
}

.save-name-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-color), #d63d56);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-name-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--glow-color);
}

.save-name-btn:active {
    transform: translateY(0);
}

/* ==================== Основное приложение ==================== */
.app {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.5s ease;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
}

/* ==================== Нижняя навигация (мультиплеер-каркас) ==================== */
.main-tab-screen {
    display: block;
}

.main-tab-screen:not(#main-tab-pet) {
    padding-top: 34px;
}

.section-screen {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px;
    min-height: 320px;
    backdrop-filter: blur(10px);
}

.section-screen-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-test-btn {
    margin-left: auto;
    background: rgba(255, 200, 80, 0.15);
    border: 1px dashed rgba(255, 200, 80, 0.5);
    border-radius: 8px;
    color: #ffc850;
    font-size: 14px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.4;
}
.admin-test-btn:hover { background: rgba(255, 200, 80, 0.25); }

.section-placeholder {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    color: var(--text-muted);
}

.section-placeholder-icon {
    font-size: 32px;
    opacity: 0.95;
}

.section-placeholder-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.section-placeholder-text {
    font-size: 13px;
}

.friends-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friends-subtabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.friends-primary-btn,
.friends-secondary-btn,
.friends-mini-btn,
.friends-subtab-btn,
.friends-back-btn {
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.friends-primary-btn {
    background: linear-gradient(135deg, rgba(78, 204, 163, 0.28), rgba(78, 204, 163, 0.12));
    border-color: rgba(78, 204, 163, 0.35);
}

.friends-secondary-btn,
.friends-mini-btn,
.friends-subtab-btn,
.friends-back-btn {
    background: rgba(255, 255, 255, 0.06);
}

.friends-primary-btn:disabled,
.friends-secondary-btn:disabled {
    opacity: 0.68;
    cursor: default;
}

.friends-mini-btn {
    white-space: nowrap;
    padding: 8px 10px;
}

.friends-back-btn {
    align-self: flex-start;
}

.friends-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    border-radius: 999px;
    background: rgba(255, 107, 107, 0.85);
    color: #fff;
    font-size: 11px;
}

.friends-subtab-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 9px 4px;
}

.friends-subtab-btn.is-active {
    border-color: rgba(78, 204, 163, 0.45);
    background: rgba(78, 204, 163, 0.12);
    box-shadow: 0 0 0 1px rgba(78, 204, 163, 0.2);
}

.friends-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friend-code-card,
.friends-privacy-card,
.friend-card,
.friend-request-card,
.friends-result-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
}

.friend-code-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.friend-code-card > div:first-child {
    min-width: 0;
}

.friend-code-label,
.friends-input-label,
.friends-privacy-title {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.friend-code-value {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-color);
}

.friend-invite-link {
    margin-top: 4px;
    color: var(--text-color);
    font-size: 12px;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.friend-card,
.friend-request-card,
.friends-result-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(78, 204, 163, 0.14);
    border: 1px solid rgba(78, 204, 163, 0.25);
    font-size: 22px;
    overflow: hidden;
}

.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.friend-info-left {
    flex: 1;
    min-width: 0;
}

.friend-title {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-subtitle {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-status-badge {
    flex-shrink: 0;
    min-width: 110px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.friend-relation,
.friends-help-text {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.friend-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-request-card {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 10px 0;
}

.friend-request-card .friend-info {
    flex-direction: column;
    align-items: flex-start;
}

.friend-request-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 50px;
}

.friend-search-info {
    flex: 1;
    min-width: 0;
}

.friend-search-status {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.friend-search-add-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(78, 204, 163, 0.35);
    background: rgba(78, 204, 163, 0.12);
    color: #4ecfa3;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.friend-search-add-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.friend-interact-btn,
.friend-action-chip,
.friend-remove-btn {
    border: 1px solid rgba(78, 204, 163, 0.28);
    background: rgba(78, 204, 163, 0.12);
    color: var(--text-color);
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
}

.friend-remove-btn {
    border-color: rgba(255, 107, 107, 0.32);
    background: rgba(255, 107, 107, 0.12);
}

.friend-action-chip[disabled] {
    opacity: 0.65;
}

.friends-search-input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-color);
    padding: 12px;
    font-size: 14px;
    outline: none;
}

.friends-privacy-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-color);
    font-size: 12px;
}

.friends-privacy-card label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-privacy-card input[type="checkbox"] {
    accent-color: #4ecca3;
}

.friends-public-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.friends-subtitle {
    color: var(--text-color);
    font-size: 15px;
    margin: 0;
}

/* ── Добавить друга: новые блоки ─────────────────────── */
.add-friend-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.add-friend-block-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding-left: 2px;
}

.add-friend-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    overflow: hidden;
}

.add-friend-card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.add-friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.add-friend-row-info {
    min-width: 0;
    flex: 1;
}

.add-friend-row-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.add-friend-search-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
}

.add-friend-search-card .friends-search-input {
    border-radius: 10px;
}

.add-friend-search-card .friends-primary-btn {
    border-radius: 10px;
    width: 100%;
}

.add-friend-privacy-card {
    display: flex;
    flex-direction: column;
}

.add-friend-privacy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
}

.add-friend-privacy-row input[type="checkbox"] {
    accent-color: #4ecca3;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gender-select {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 10px 0;
}

.gender-btn {
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    border-radius: 12px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 700;
}

.gender-btn.active {
    border-color: rgba(78, 204, 163, 0.45);
    background: rgba(78, 204, 163, 0.14);
}

.profile-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Карточка питомца в профиле */
.profile-pet-card {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    padding: 16px;
}

.profile-pet-avatar-wrap {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: 16px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-pet-avatar {
    width: 76px;
    height: 76px;
    object-fit: contain;
    image-rendering: pixelated;
}

.profile-pet-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-pet-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-pet-rarity {
    font-size: 13px;
    font-weight: 600;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
}

.profile-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.profile-display-name {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 800;
}

.profile-help-text {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.legacy-subtabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.legacy-subtab-btn {
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    border-radius: 12px;
    padding: 9px 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.legacy-subtab-btn.is-active {
    border-color: rgba(78, 204, 163, 0.45);
    background: rgba(78, 204, 163, 0.12);
    box-shadow: 0 0 0 1px rgba(78, 204, 163, 0.2);
}

.main-bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    width: min(420px, calc(100vw - 20px));
    z-index: 85;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(16, 24, 48, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.main-nav-btn {
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    min-height: 54px;
    padding: 6px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.main-nav-btn .main-nav-icon {
    font-size: 16px;
    line-height: 1;
}

.main-nav-btn .main-nav-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.main-nav-btn.is-active {
    color: var(--text-color);
    background: rgba(78, 204, 163, 0.14);
    box-shadow: inset 0 0 0 1px rgba(78, 204, 163, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== Зона питомца ==================== */
.pet-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 60px 118px; /* больше места под карусель */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    /* Минимальная высота рассчитана так, чтобы 7 кнопок (44px + 10px gap) влезали без выхода за верхний край:
       top(16) + 7*44 + 6*10 + bottom(110) ≈ 494px → берём 500px */
    min-height: 500px;
}

.pet-container {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

/* Кнопка «Связь» — левый нижний угол зоны питомца */
.pet-zone .bond-btn {
    position: absolute;
    left: 12px;
    bottom: 16px;
    z-index: 25;
    pointer-events: auto;
}

/* Модалка «Связь» */
.bond-modal-content {
    position: relative;
}
.bond-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.bond-modal-emoji {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 4px;
}
.bond-modal-hearts {
    font-size: 24px;
    letter-spacing: 3px;
    margin: 10px 0 6px;
}
.bond-modal-desc {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
}
.bond-modal-hint {
    font-size: 13px;
    opacity: 0.75;
    line-height: 1.4;
    margin: 0;
}

/* Карточка характера питомца в модалке связи */
.bond-character {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.bond-character-icon {
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
}
.bond-character-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.bond-character-name {
    font-size: 15px;
    font-weight: 700;
}
.bond-character-desc {
    font-size: 13px;
    opacity: 0.8;
    line-height: 1.35;
}

/* «Думает…» — мягкая пульсация пузыря, пока питомец генерирует ответ */
.thought-bubble-thinking {
    animation: thinkingPulse 1.1s ease-in-out infinite;
}
@keyframes thinkingPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* Стадии жизни: яйцо и плашка-таймлайн */
.pet-egg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 110px;
    line-height: 1;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}
.life-timeline {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 2px 0 8px;
    font-size: 15px;
}
.life-stage-dot {
    opacity: 0.32;
    filter: grayscale(70%);
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
.life-stage-dot.active {
    opacity: 1;
    filter: none;
    transform: scale(1.35);
}

/* Цель дня + стрик */
.daily-care-section {
    margin: 0 0 16px;
}
.daily-care-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}
.daily-care-sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.6;
}
.daily-care {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin: 0;
    font-size: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px 14px;
}
.daily-streak {
    font-weight: 700;
    font-size: 13px;
    background: rgba(255, 140, 0, 0.16);
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.daily-care.goal-done .daily-streak {
    background: rgba(76, 175, 80, 0.28);
}
.daily-task {
    position: relative;
    opacity: 0.33;
    filter: grayscale(80%);
    transition: opacity 0.2s ease, filter 0.2s ease;
}
.daily-task.done {
    opacity: 1;
    filter: none;
}
.daily-task.done::after {
    content: '✓';
    position: absolute;
    top: -7px;
    right: -9px;
    font-size: 10px;
    font-weight: 700;
    color: #4caf50;
}

/* Достижения */
.achievements-section { margin-top: 14px; }
.achievements-title {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 8px;
}
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.achievement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}
.achievement.locked { opacity: 0.5; }
.achievement.unlocked { background: rgba(76, 175, 80, 0.10); }
.achievement-icon { font-size: 22px; line-height: 1; }
.achievement-name { font-size: 14px; font-weight: 600; }
.achievement-desc { font-size: 12px; opacity: 0.7; }

/* Свечение вокруг персонажа (по рарности) */
.pet-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        circle,
        var(--rarity-glow-color, transparent) 0%,
        transparent 50%,
        transparent 70%
    );
    opacity: var(--rarity-glow-intensity, 0);
    animation: var(--rarity-glow-animation, none);
}

@keyframes rarity-glow-constant {
    0%, 100% { opacity: var(--rarity-glow-intensity, 0.2); }
}

@keyframes rarity-glow-pulsing {
    0%, 100% { opacity: calc(var(--rarity-glow-intensity, 0.4) * 0.7); transform: translate(-50%, -50%) scale(1); }
    50% { opacity: var(--rarity-glow-intensity, 0.4); transform: translate(-50%, -50%) scale(1.08); }
}

@keyframes rarity-glow-pulsing-aura {
    0%, 100% { opacity: calc(var(--rarity-glow-intensity, 1) * 0.6); transform: translate(-50%, -50%) scale(1); }
    50% { opacity: var(--rarity-glow-intensity, 1); transform: translate(-50%, -50%) scale(1.15); }
}

/* Контейнер частиц вокруг персонажа */
.pet-particles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.pet-particles .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rarity-particle-color, transparent);
    opacity: var(--rarity-particle-opacity, 0);
    animation: var(--rarity-particle-animation, none);
}

.pet-particles .particle.sparkle {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 6px 2px var(--rarity-particle-color, transparent);
}

@keyframes particle-float-soft {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    10% { opacity: var(--rarity-particle-opacity, 0.3); }
    90% { opacity: var(--rarity-particle-opacity, 0.2); }
    100% { transform: translate(var(--particle-dx), var(--particle-dy)) scale(0.5); opacity: 0; }
}

@keyframes particle-float-slow {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    15% { opacity: var(--rarity-particle-opacity, 0.5); }
    85% { opacity: var(--rarity-particle-opacity, 0.4); }
    100% { transform: translate(var(--particle-dx), var(--particle-dy)) scale(0.6); opacity: 0; }
}

@keyframes particle-float-bright {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    20% { opacity: var(--rarity-particle-opacity, 0.8); }
    80% { opacity: var(--rarity-particle-opacity, 0.6); }
    100% { transform: translate(var(--particle-dx), var(--particle-dy)) scale(0.8); opacity: 0; }
}

.pet-image {
    position: relative;
    width: 160px;
    height: 160px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    z-index: 1;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

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

.pet-shadow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: shadow-pulse 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes shadow-pulse {
    0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.4; }
    50% { transform: translateX(-50%) scaleX(0.8); opacity: 0.6; }
}

.pet-image.grayscale {
    filter: grayscale(100%) drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    animation: none;
}

/* Имя питомца — сверху pet-zone, абсолютно */
.pet-name {
    position: absolute;
    top: 10px;
    left: 58px;
    right: 58px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--rarity-name-color, var(--text-color));
    text-shadow: var(--rarity-name-shadow, 0 2px 10px rgba(0, 0, 0, 0.3));
    z-index: 6;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Статус питомца — снизу pet-zone, за какашками */
.pet-status {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.pet-status.menu-open {
    opacity: 0;
}

/* Слот фиксированной высоты — питомец не смещается при появлении/скрытии пузыря */
.thought-bubble-slot {
    position: relative;
    height: 72px;
    width: 100%;
    margin-bottom: 4px;
}

/* Пузырь скрыт, но место под него зарезервировано */
.thought-bubble.thought-bubble-empty {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ==================== Пузырь мыслей питомца (над питомцем) ==================== */
.thought-bubble {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 12px 20px;
    max-width: min(340px, 85vw);
    width: max-content;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: thoughtAppear 0.4s ease;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

/* Кружочки как в комиксах (мысли) */
.thought-bubble::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.thought-bubble::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.thought-text {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    margin: 0;
    font-style: normal;
    word-break: break-word;
}

.thought-text::before {
    content: '« ';
    color: var(--accent-color);
    font-style: normal;
}

.thought-text::after {
    content: '\00a0»';
    color: var(--accent-color);
    font-style: normal;
}

.thought-bubble.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes thoughtAppear {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

/* ==================== Текст рассказчика (под ником питомца) ==================== */
.narrator-text {
    margin-top: 8px;
    padding: 5px 12px;
    background: rgba(107, 114, 128, 0.1);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 8px 8px 0;
    max-width: 300px;
    animation: narratorAppear 0.4s ease;
}

.narrator-text.narrator-below-name {
    margin-top: 4px;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
}

.narrator-text p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    margin: 0;
    font-style: normal;
}

.narrator-text.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes narratorAppear {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ==================== Статистика ==================== */
.stats-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
}

.stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-icon {
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.stat-fill.hunger {
    background: linear-gradient(90deg, var(--hunger-color), #ff8787);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

.stat-fill.mood {
    background: linear-gradient(90deg, var(--mood-color), #ffe066);
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.4);
}

.stat-fill.energy {
    background: linear-gradient(90deg, var(--energy-color), #95d5b2);
    box-shadow: 0 0 10px rgba(107, 203, 119, 0.4);
}

.stat-fill.vigor {
    background: linear-gradient(90deg, #818cf8, #a5b4fc);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.45);
}

.stat-fill.hp {
    background: linear-gradient(90deg, #ff6b6b, #ff8e72);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

.stat-value {
    font-size: 10px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
    color: var(--text-color);
}

/* ==================== Возраст (в шапке блока «Здоровье») ==================== */
.health-container .age-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin: 0;
    padding: 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.health-container .age-container .age-icon {
    font-size: 11px;
}

.age-icon {
    font-size: 16px;
}

/* ==================== Боковые кнопки действий ==================== */
.side-buttons {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 10px;
    top: 16px;
    bottom: 110px; /* не наезжаем на карусель */
    justify-content: center;
    overflow: visible;
    z-index: 5;
}

.left-buttons {
    left: 8px;
}

.right-buttons {
    right: 8px;
    top: 62px; /* уводим вниз от кнопки меню */
}

.icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    position: relative;
}

.icon-btn:hover:not(:disabled):not(.on-cooldown) {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
}

.icon-btn:active:not(:disabled):not(.on-cooldown) {
    transform: scale(0.88);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition-duration: 0.05s;
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Кулдаун: круговой индикатор (часы/радар) */
.icon-btn.on-cooldown {
    pointer-events: none;
    cursor: not-allowed;
}

.icon-btn .cooldown-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    /* Оставшееся время — затемнённая дуга, которая уменьшается по кругу */
    background: conic-gradient(
        from 0deg,
        rgba(0, 0, 0, 0.55) 0deg,
        rgba(0, 0, 0, 0.55) var(--cooldown-angle, 360deg),
        transparent var(--cooldown-angle, 360deg)
    );
    pointer-events: none;
    transition: none;
}

/* Цвета кнопок */
.icon-btn.feed-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-color: #ff5252;
}

.icon-btn.drink-btn {
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    border-color: #03a9f4;
}

.icon-btn.sleep-btn {
    background: linear-gradient(135deg, #667eea, #5a67d8);
    border-color: #5c6bc0;
}

.icon-btn.play-btn {
    background: linear-gradient(135deg, #ffd54f, #ffca28);
    border-color: #ffc107;
}

.icon-btn.heal-btn {
    background: linear-gradient(135deg, #81c784, #66bb6a);
    border-color: #4caf50;
}

.icon-btn.stroke-btn {
    background: linear-gradient(135deg, #f48fb1, #e91e63);
    border-color: #c2185b;
}

.icon-btn.groom-btn {
    background: linear-gradient(135deg, #ce93d8, #ab47bc);
    border-color: #8e24aa;
}

.icon-btn.walk-btn {
    background: linear-gradient(135deg, #69f0ae, #00c853);
    border-color: #00b341;
}

.icon-btn.errand-btn {
    background: linear-gradient(135deg, #80b0ff, #5b7fff);
    border-color: #4a6fff;
}

.icon-btn.surgery-btn {
    background: linear-gradient(135deg, #f48fb1, #e53935);
    border-color: #c62828;
}


/* ==================== Сообщение ==================== */
.message {
    text-align: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    animation: slideUp 0.3s ease;
    font-size: 14px;
}

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

.message.success {
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.message.error {
    border-left: 4px solid var(--accent-color);
    color: var(--accent-color);
}

.message.info {
    border-left: 4px solid #7f8c8d;
    color: #7f8c8d;
}

/* ==================== Экран ошибки (отдельный экран) ==================== */
#error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 16px;
    text-align: center;
}

#error .error-icon {
    font-size: 64px;
    margin-bottom: 8px;
}

#error p {
    color: var(--text-muted);
    font-size: 16px;
}

.retry-btn {
    padding: 14px 28px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-color);
}

/* ==================== Экран смерти ==================== */
.dead-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    overflow-y: auto;
    padding: 28px 20px 40px;
    gap: 10px;
    text-align: center;
}

.dead-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 2px;
    filter: grayscale(30%);
}

.dead-screen h2 {
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.dead-age-line {
    color: var(--text-muted);
    font-size: 13px;
}

.dead-screen p {
    color: var(--text-muted);
    font-size: 13px;
}

.dead-message {
    font-style: italic;
    opacity: 0.6;
    font-size: 12px;
    margin-top: -2px;
}

.dead-summary {
    width: min(100%, 320px);
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
}

.dead-reason {
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.dead-recent-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dead-recent-title {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.dead-recent-events {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.dead-recent-events li + li {
    margin-top: 4px;
}

/* Разделитель между итогами и формой нового питомца */
.dead-divider {
    width: min(100%, 320px);
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Форма создания нового питомца */
.new-pet-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

.new-pet-prompt {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.new-pet-form .name-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-color);
    text-align: center;
    transition: border-color 0.2s ease;
}

.new-pet-form .name-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.create-pet-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.create-pet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.create-pet-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.create-pet-btn .btn-icon {
    font-size: 20px;
}

.create-pet-btn .btn-text {
    font-size: 15px;
}

/* Светлая системная тема намеренно не применяется — игра всегда в тёмном режиме. */

/* ==================== Дополнительные статы ==================== */
.stat-fill.thirst {
    background: linear-gradient(90deg, #4fc3f7, #81d4fa);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.4);
}

.stat-fill.health {
    background: linear-gradient(90deg, #e91e63, #f48fb1);
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.4);
}

/* ==================== Новые кнопки ==================== */
.drink-btn {
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    color: white;
}

.drink-btn:hover {
    box-shadow: 0 8px 25px rgba(79, 195, 247, 0.4);
}

.play-btn {
    background: linear-gradient(135deg, #ffd93d, #ffca28);
    color: #333;
}

.play-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 217, 61, 0.4);
}

.heal-btn {
    background: linear-gradient(135deg, #e91e63, #d81b60);
    color: white;
}

.heal-btn:hover {
    box-shadow: 0 8px 25px rgba(233, 30, 99, 0.4);
}

.clean-room-btn {
    background: linear-gradient(135deg, #a5d6a7, #66bb6a);
    color: #1b5e20;
}

.clean-room-btn:hover {
    box-shadow: 0 8px 25px rgba(102, 187, 106, 0.4);
}

.wash-pet-btn {
    background: linear-gradient(135deg, #80deea, #26c6da);
    color: #006064;
}

.wash-pet-btn:hover {
    box-shadow: 0 8px 25px rgba(38, 198, 218, 0.4);
}

.stat-fill.room-cleanliness {
    background: linear-gradient(90deg, #66bb6a, #a5d6a7);
    box-shadow: 0 0 10px rgba(102, 187, 106, 0.4);
}

.stat-fill.body-cleanliness {
    background: linear-gradient(90deg, #26c6da, #80deea);
    box-shadow: 0 0 10px rgba(38, 198, 218, 0.4);
}

.stat-fill.grooming {
    background: linear-gradient(90deg, #ce93d8, #ab47bc);
    box-shadow: 0 0 10px rgba(171, 71, 188, 0.4);
}
.stat-fill.grooming.danger {
    background: linear-gradient(90deg, #e57373, #ef5350);
    box-shadow: 0 0 10px rgba(229, 115, 115, 0.45);
}

/* Предупреждение на кнопке при высокой загрязнённости */
.icon-btn.stat-warning {
    animation: warning-pulse 1.8s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 152, 0, 0); }
    50% { box-shadow: 0 4px 20px rgba(255, 152, 0, 0.6); }
}

/* ==================== Анимация загрязнённости комнаты ==================== */

.room-dirt-overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    overflow: hidden;
    z-index: 4;
    transition: background 2s ease;
}

/* Фоновая дымка по стадиям */
.room-dirt-overlay.room-stage-dust {
    background: radial-gradient(ellipse at 50% 110%, rgba(160, 155, 145, 0.08) 0%, transparent 55%);
}
.room-dirt-overlay.room-stage-messy {
    background:
        radial-gradient(ellipse at 50% 110%, rgba(140, 130, 110, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 100%, rgba(120, 110, 90, 0.10) 0%, transparent 35%),
        radial-gradient(ellipse at 90% 100%, rgba(120, 110, 90, 0.10) 0%, transparent 35%);
}
.room-dirt-overlay.room-stage-dirty {
    background:
        radial-gradient(ellipse at 50% 110%, rgba(110, 95, 70, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse at 5%  100%, rgba(90, 78, 55, 0.18) 0%, transparent 40%),
        radial-gradient(ellipse at 95% 100%, rgba(90, 78, 55, 0.18) 0%, transparent 40%),
        linear-gradient(to top, rgba(80, 70, 50, 0.10) 0%, transparent 40%);
}
.room-dirt-overlay.room-stage-filthy {
    background:
        radial-gradient(ellipse at 50% 110%, rgba(80, 65, 35, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 0%  100%, rgba(65, 50, 25, 0.40) 0%, transparent 45%),
        radial-gradient(ellipse at 100% 100%, rgba(65, 50, 25, 0.40) 0%, transparent 45%),
        linear-gradient(to top, rgba(55, 45, 20, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 0%, rgba(45, 75, 25, 0.22) 0%, transparent 45%);
}

/* Частица пыли */
.room-dirt-overlay .dust-p {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
    animation: dust-drift var(--d-dur) var(--d-delay) ease-in-out infinite;
}

@keyframes dust-drift {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(var(--d-scale, 1));
    }
    15% {
        opacity: var(--d-opacity);
    }
    85% {
        opacity: var(--d-opacity);
    }
    100% {
        opacity: 0;
        transform: translate(var(--d-dx), var(--d-dy)) scale(calc(var(--d-scale, 1) * 0.6));
    }
}

/* ==================== Индикаторы ==================== */
.sleep-indicator {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 28px;
    color: #667eea;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
    animation: zzz 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes zzz {
    0%, 100% { 
        opacity: 0.5;
        transform: translateY(0) scale(0.9);
    }
    50% { 
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
}

.sick-indicator {
    position: absolute;
    top: 10px;
    left: -10px;
    width: 28px;
    height: 28px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    animation: sick-pulse 1.5s ease-in-out infinite;
    z-index: 10;
}

@keyframes sick-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

/* ==================== Debug панель (тестирование) ==================== */
.debug-panel {
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 10px;
    font-family: 'Courier New', monospace;
}

.debug-title {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}

.debug-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.debug-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debug-section-title {
    color: var(--accent-color);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: bold;
}

.debug-item {
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.4;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
}

.debug-item.critical {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

/* Характер + темперамент + отношения — один блок, 2 колонки */
.debug-character-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.debug-character-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debug-character-col .debug-section-title {
    margin-bottom: 2px;
    margin-top: 4px;
}

.debug-character-col .debug-section-title:first-child {
    margin-top: 0;
}

.debug-item.debug-rarity {
    font-weight: bold;
    margin-top: 4px;
}

/* Рарность имени/персонажа задаётся через CSS-переменные из JS */

/* ==================== Кнопка скрытия дебаг-панелей ==================== */
.toggle-debug-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 15;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 13px;
    line-height: 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.toggle-debug-btn:hover,
.toggle-debug-btn:active {
    opacity: 1;
}

.toggle-debug-btn.panels-hidden {
    opacity: 0.3;
}

.debug-panels-wrapper {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.debug-panels-wrapper.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

/* ==================== Tooltip при зажатии кнопки ==================== */
.longpress-tooltip {
    position: fixed;
    z-index: 100;
    padding: 4px 10px;
    font-size: 12px;
    color: #fff;
    background: rgba(30, 30, 40, 0.9);
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.9);
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.longpress-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

/* ==================== Мобильная адаптация ==================== */
@media (max-width: 380px) {
    .container {
        padding: 12px;
    }
    
    .pet-image {
        width: 140px;
        height: 140px;
    }
    
    .pet-name {
        font-size: 18px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
    
    .btn-text {
        font-size: 11px;
    }
    
    .debug-panel {
        font-size: 9px;
    }
    
    .debug-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .debug-character-block {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 16px;
    }

    .side-buttons {
        gap: 7px;
    }

    .pet-zone {
        padding: 20px 50px 96px;
        /* Минимальная высота для 7 кнопок по 38px с gap 7px:
           top(16) + 7*38 + 6*7 + bottom(96) = 420px → берём 430px */
        min-height: 430px;
    }
}

@media (max-height: 700px) {
    .side-buttons {
        gap: 6px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 16px;
    }
}

/* ─── КАКАШКИ ─────────────────────────────────────────────── */
/* Размер ещё +10%: 34px → 38px; большая зона тапа для мобильных */
/* z-index: 50 — выше pet-name/pet-status (z-index:6), которые в том же stacking context (backdrop-filter) и перекрывают зону внизу */
.poop-container {
    position: absolute;
    bottom: 0;
    left: 58px;
    right: 58px;
    height: 75px;
    overflow: visible;
    pointer-events: none;
    z-index: 50;
    touch-action: manipulation;
}

.poop-item {
    /* <button> reset */
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    /* layout */
    position: absolute;
    width: 38px;
    height: 38px;
    /* interaction */
    pointer-events: auto;
    cursor: pointer;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.poop-item img,
.poop-item .poop-steam {
    pointer-events: none;
}

.poop-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 4px rgba(101, 67, 33, 0.4));
}

/* Состояние при взрыве: сам объект скрыт, видны только куски */
.poop-item.poop-exploding {
    pointer-events: none;
}

.poop-item.poop-exploding > img,
.poop-item.poop-exploding > .poop-steam {
    visibility: hidden;
}

/* Куски при разлёте (создаются в JS) */
.poop-piece {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #8b6914, #5c3d0e);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes poop-piece-fly {
    from {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: var(--poop-piece-end);
    }
}

/* Волнистые линии вони — SVG, добавляются через JS */
.poop-steam {
    position: absolute;
    bottom: 34px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    overflow: visible;
}

.poop-steam path {
    fill: none;
    stroke: rgba(101, 67, 33, 0.6);
    stroke-width: 1.5;
    stroke-linecap: round;
    animation: poop-steam-rise 2.2s ease-in-out infinite;
}
.poop-steam path:nth-child(2) { animation-delay: 0.55s; }
.poop-steam path:nth-child(3) { animation-delay: 1.1s; }

@keyframes poop-steam-rise {
    0%   { opacity: 0;   transform: translateY(0);     }
    20%  { opacity: 0.7; }
    80%  { opacity: 0.35; }
    100% { opacity: 0;   transform: translateY(-13px); }
}

/* ==================== Кнопка Тренировка ==================== */
.train-btn {
    background: linear-gradient(135deg, #ffb347, #ff6a00);
    border-color: #ff8c00;
}
.train-btn:hover:not(:disabled):not(.on-cooldown) {
    background: linear-gradient(135deg, #ffc460, #ff8c00);
}
.train-btn.active-training {
    animation: training-pulse 1.5s ease-in-out infinite;
    border-color: rgba(255, 165, 0, 0.9);
}
@keyframes training-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 165, 0, 0.5); }
    50%       { box-shadow: 0 0 18px rgba(255, 165, 0, 0.9); }
}

/* ==================== Универсальное всплывающее меню (popup-menu) ==================== */
/* Использование: добавь div.popup-menu + дочерние .popup-item-wrap > button.popup-btn + span.popup-btn-label */
.popup-menu {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}
.popup-menu.visible {
    pointer-events: all;
}
.popup-item-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: scale(0.5) translateY(14px);
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.popup-btn-label {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
}
.popup-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.popup-btn:hover {
    transform: scale(1.13) !important;
    border-color: rgba(255, 255, 255, 0.55);
}
.popup-btn:active {
    transform: scale(0.92) !important;
}
.popup-menu.visible .popup-item-wrap,
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.popup-menu.visible .popup-item-wrap:nth-child(1) { transition-delay: 0.00s; }
.popup-menu.visible .popup-item-wrap:nth-child(2) { transition-delay: 0.04s; }
.popup-menu.visible .popup-item-wrap:nth-child(3) { transition-delay: 0.08s; }
.popup-menu.visible .popup-item-wrap:nth-child(4) { transition-delay: 0.12s; }
.popup-menu.visible .popup-item-wrap:nth-child(5) { transition-delay: 0.16s; }
.popup-menu.visible .popup-item-wrap:nth-child(6) { transition-delay: 0.20s; }

/* ─── Тултип при нажатии на кнопку ─── */
.click-tooltip {
    position: fixed;
    background: rgba(15, 15, 30, 0.93);
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: normal;
    text-align: center;
    max-width: 160px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, calc(-100% - 8px));
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.click-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 10px));
}
/* Стрелка вниз */
.click-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(15, 15, 30, 0.93);
}

/* ─── Карусельное меню (> 5 элементов) ─── */
.popup-menu--carousel {
    align-items: center;
    gap: 6px;
    bottom: 6px; /* еще ниже, чтобы не лезла на кнопки */
}

.popup-carousel-viewport {
    width: 272px; /* 5 × 48px + 4 × 8px gap */
    min-height: 72px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    touch-action: pan-y; /* разрешаем вертикальный скролл страницы, горизонталь — наш */
}

/* Внутри карусели — заменяем scale на glow чтобы не клипировало */
.popup-carousel-track .popup-btn:hover {
    transform: none !important;
    box-shadow: 0 0 0 2.5px rgba(255,255,255,0.7), 0 0 18px rgba(255,255,255,0.22) !important;
    border-color: rgba(255,255,255,0.8) !important;
}
.popup-carousel-track .popup-btn:active {
    transform: scale(0.92) !important;
}

/* Кулдаун лекарств (глобальный с сервера) — на слотах карусели, не на 💊 */
.popup-carousel-track .popup-btn.popup-btn--medicine-cooldown,
.popup-carousel-track .popup-btn:disabled.popup-btn--medicine-cooldown {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.35);
    box-shadow: none !important;
}
.popup-carousel-track .popup-btn.popup-btn--medicine-cooldown:hover {
    transform: none !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.popup-carousel-track {
    display: flex;
    flex-direction: row;
    gap: 8px;
    transition: transform 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}
.popup-carousel-track.is-dragging {
    transition: none; /* мгновенно следует за пальцем */
}
/* В карусели items фиксированной ширины */
.popup-carousel-track .popup-item-wrap {
    flex-shrink: 0;
    width: 48px;
}
.popup-carousel-track .popup-btn-label {
    max-width: 48px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Стрелки */
.popup-carousel-arrow {
    flex-shrink: 0;
    width: 26px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, opacity 0.15s;
    user-select: none;
    -webkit-user-select: none;
}
.popup-carousel-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}
.popup-carousel-arrow:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
}
.popup-carousel-arrow:disabled {
    opacity: 0.22;
    cursor: default;
}

/* Анимация появления элементов карусели */
.popup-menu--carousel .popup-carousel-track .popup-item-wrap {
    opacity: 0;
    transform: scale(0.5) translateY(14px);
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(1) { transition-delay: 0.00s; }
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(2) { transition-delay: 0.03s; }
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(3) { transition-delay: 0.06s; }
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(4) { transition-delay: 0.09s; }
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(5) { transition-delay: 0.12s; }
/* Остальные элементы (за пределами видимых 5) появляются без задержки при скролле */
.popup-menu--carousel.visible .popup-carousel-track .popup-item-wrap:nth-child(n+6) { transition-delay: 0s; }

/* ==================== Блок Здоровье ==================== */
.health-container {
    background: var(--card-bg);
    border: 1px solid rgba(78, 204, 163, 0.2);
    border-radius: 8px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}
.health-container-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    padding-bottom: 2px;
    margin-bottom: 2px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.15);
}

.health-title-text {
    flex-shrink: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--success-color);
}

/* Цвета полосок здоровья */
.stat-fill.immunity {
    background: linear-gradient(90deg, #4ecca3, #00e5a0);
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.4);
}
.stat-fill.diet {
    background: linear-gradient(90deg, #56cfad, #7be0c8);
    box-shadow: 0 0 10px rgba(86, 207, 173, 0.4);
}
.stat-fill.nausea {
    background: linear-gradient(90deg, #8aff9e, #2db83c);
    box-shadow: 0 0 10px rgba(138, 255, 158, 0.35);
}
.stat-fill.nausea.warning {
    background: linear-gradient(90deg, #f0a500, #ffc300);
    box-shadow: 0 0 10px rgba(240, 165, 0, 0.5);
}
.stat-fill.nausea.danger {
    background: linear-gradient(90deg, #e74c3c, #ff6b6b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}
.stat-fill.obesity {
    background: linear-gradient(90deg, #4f9cf9, #6ec3ff);
    box-shadow: 0 0 10px rgba(79, 156, 249, 0.35);
}
.stat-fill.obesity.danger {
    background: linear-gradient(90deg, #f39c12, #e67e22);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.45);
}
.stat-fill.appetite {
    background: linear-gradient(90deg, #1abc9c, #2ecc71);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}
.stat-fill.appetite.low {
    background: linear-gradient(90deg, #e67e22, #e74c3c);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

/* ==================== Панель баффов/дебаффов ==================== */
.buffs-panel {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 8px;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}
.buffs-panel-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.buffs-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.buff-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
}
.buff-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.buff-item.is-disease {
    border-color: rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.06);
}
.buff-item[data-buff-type="DiseaseOvereating"] {
    border-color: rgba(230, 126, 34, 0.4);
    background: rgba(230, 126, 34, 0.08);
}
.buff-item[data-buff-type="DiseaseOvereating"] .buff-timer {
    color: #e67e22;
}
.buff-item[data-buff-type="DiseaseOvereating"] .buff-timer.ending-soon {
    color: #f39c12;
}
/* Лекарство — положительный эффект (зелёный) */
.buff-item.tone-positive {
    border-color: rgba(39, 174, 96, 0.4);
    background: rgba(39, 174, 96, 0.08);
}
.buff-item.tone-positive .buff-timer {
    color: #27ae60;
}
/* Лекарство — побочный эффект (красный, чуть другой оттенок чем болезнь) */
.buff-item.tone-negative {
    border-color: rgba(192, 57, 43, 0.45);
    background: rgba(192, 57, 43, 0.09);
}
.buff-item.tone-negative .buff-timer {
    color: #c0392b;
}
.buff-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.buff-info {
    flex: 1;
    min-width: 0;
}
.buff-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.buff-desc {
    font-size: 9px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.buff-timer {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}
.buff-timer.ending-soon {
    color: var(--warning-color);
    animation: timer-blink 1s ease-in-out infinite;
}
@keyframes timer-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Тултип при нажатии на бафф */
.buff-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 30, 0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: var(--text-color);
    white-space: nowrap;
    pointer-events: none;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    animation: tooltip-appear 0.15s ease;
}

.buff-tooltip--wide {
    white-space: normal;
    width: 240px;
    left: 0;
    transform: none;
    line-height: 1.55;
}
@keyframes tooltip-appear {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==================== Панель валюты ==================== */
@keyframes currency-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.currency-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 0 10px 0;
    position: relative;
    z-index: 10;
}

.currency-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px 6px 10px;
    background: linear-gradient(135deg, rgba(255, 205, 60, 0.20) 0%, rgba(255, 170, 30, 0.12) 100%);
    border: 1px solid rgba(255, 210, 80, 0.38);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(255, 200, 50, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    min-width: 68px;
    cursor: default;
    user-select: none;
}

.currency-pill--crystals {
    background: linear-gradient(135deg, rgba(160, 90, 255, 0.24) 0%, rgba(120, 55, 220, 0.14) 100%);
    border-color: rgba(180, 120, 255, 0.42);
    box-shadow: 0 2px 12px rgba(150, 80, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.currency-pill:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, rgba(255, 205, 60, 0.30) 0%, rgba(255, 170, 30, 0.20) 100%);
}

.currency-pill--crystals:active {
    background: linear-gradient(135deg, rgba(160, 90, 255, 0.34) 0%, rgba(120, 55, 220, 0.22) 100%);
}

.currency-pill.pop .currency-value {
    animation: currency-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.currency-icon {
    font-size: 17px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.currency-value {
    font-size: 14px;
    font-weight: 800;
    color: #ffe066;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    display: inline-block;
}

.currency-pill--crystals .currency-value {
    color: #d4aaff;
}

/* ==================== Оверлей «питомец на поручении» ==================== */
@keyframes errand-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.08); }
}

.errand-away-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 60;
    pointer-events: none;
    text-align: center;
}

.errand-away-icon {
    font-size: 44px;
    animation: errand-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 12px rgba(90, 130, 255, 0.5));
}

.errand-away-title {
    font-size: 15px;
    font-weight: 700;
    color: rgba(160, 190, 255, 0.95);
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.errand-away-task {
    font-size: 12px;
    color: rgba(160, 190, 255, 0.65);
    max-width: 180px;
    line-height: 1.4;
}

.errand-away-timer {
    font-size: 22px;
    font-weight: 800;
    color: rgba(120, 170, 255, 0.95);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    text-shadow: 0 0 12px rgba(90, 130, 255, 0.6);
}

/* ── Оверлей «на прогулке» ── */
.walk-away-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 60;
    pointer-events: none;
    text-align: center;
}

.walk-away-icon {
    font-size: 44px;
    animation: errand-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 12px rgba(75, 195, 110, 0.6));
}

.walk-away-title {
    font-size: 15px;
    font-weight: 700;
    color: rgba(130, 220, 150, 0.95);
    letter-spacing: 0.04em;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.walk-away-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: rgba(130, 220, 150, 0.75);
    margin-top: -2px;
}

.walk-away-timer {
    font-size: 22px;
    font-weight: 800;
    color: rgba(100, 210, 130, 0.95);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    text-shadow: 0 0 12px rgba(75, 195, 110, 0.6);
}

/*
 * Питомец «не дома» (прогулка / поручение): убираем только модель и привязанные к нему элементы
 * (пузырь, имя, статус). Какашки и слой пыли/загрязнения комнаты остаются на экране.
 */
.pet-zone--on-walk .pet-container,
.pet-zone--on-walk .thought-bubble-slot,
.pet-zone--on-walk .pet-name,
.pet-zone--on-walk .pet-status,
.pet-zone--on-errand .pet-container,
.pet-zone--on-errand .thought-bubble-slot,
.pet-zone--on-errand .pet-name,
.pet-zone--on-errand .pet-status {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    filter: none;
    transition: opacity 0.15s ease, visibility 0.15s linear;
}

.pet-zone--on-walk .pet-container *,
.pet-zone--on-errand .pet-container * {
    animation: none !important;
}

/* Кнопки: прогулка — приглушены, уборка доступна */
.pet-zone--on-walk .side-buttons {
    opacity: 0.22;
    transition: opacity 0.2s ease;
}

.pet-zone--on-walk .side-buttons .icon-btn {
    pointer-events: none;
}

.pet-zone--on-walk #btn-clean-room {
    opacity: 1;
    pointer-events: auto;
}

/* Поручение: все боковые кнопки недоступны */
.pet-zone--on-errand .side-buttons {
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ==================== Статус активности (прогулка/поручение) ==================== */
.activity-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(75, 195, 110, 0.12);
    border: 1px solid rgba(75, 195, 110, 0.25);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 13px;
}

.activity-status-bar.is-errand {
    background: rgba(90, 130, 255, 0.12);
    border-color: rgba(90, 130, 255, 0.25);
}

/* Иконка и таймер фиксированной ширины; подпись забирает остаток и может переноситься */
#activity-status-icon {
    flex-shrink: 0;
}

#activity-status-text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.activity-timer {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 700;
    font-size: 12px;
    color: var(--success-color);
    font-variant-numeric: tabular-nums;
}

/* ==================== Панель травм ==================== */
.injury-panel {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.injury-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: rgba(231, 76, 60, 0.9);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.injury-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.injury-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.15);
}

.injury-item-info {
    flex: 1;
    min-width: 0;
}

.injury-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.injury-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.injury-item-timer {
    font-size: 11px;
    font-weight: 700;
    color: rgba(231, 76, 60, 0.8);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Состояние «под лечением» */
.injury-item.is-under-treatment {
    background: rgba(75, 195, 110, 0.08);
    border-color: rgba(75, 195, 110, 0.25);
}

.injury-item-timer--healing {
    font-size: 11px;
    font-weight: 600;
    color: rgba(75, 195, 110, 0.9);
    white-space: nowrap;
    animation: healing-pulse 1.8s ease-in-out infinite;
}

@keyframes healing-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* Тон «treatment» для баффов лечения в панели баффов */
.buff-item.tone-treatment {
    border-color: rgba(75, 195, 110, 0.3);
    background: rgba(75, 195, 110, 0.08);
}

/* Тон «injury» для травм в панели активных эффектов */
.buff-item.tone-injury {
    border-color: rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.07);
}

.buff-item.tone-injury.is-under-treatment {
    border-color: rgba(75, 195, 110, 0.3);
    background: rgba(75, 195, 110, 0.07);
}

.injury-heal-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(231, 76, 60, 0.18);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.injury-heal-btn:hover { background: rgba(231, 76, 60, 0.28); }

/* Полоса эффективности */
.effectiveness-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.effectiveness-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.effectiveness-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.effectiveness-fill {
    height: 100%;
    background: var(--success-color);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.effectiveness-fill.low {
    background: var(--warning-color);
}

.effectiveness-fill.critical {
    background: #e74c3c;
}

.effectiveness-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
    min-width: 36px;
    text-align: right;
}

/* ==================== Модальное окно (общие дополнения) ==================== */
.modal-content--wide {
    width: 100%;
    max-width: 360px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
}
.modal-close-btn:hover { color: var(--text-color); background: rgba(255,255,255,0.1); }

/* ==================== Модал: Выбор предмета (магазин) ==================== */
.item-modal-content {
    width: calc(100vw - 32px);
    max-width: 360px;
}
.item-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px;
}
.item-modal-coins {
    font-size: 14px;
    font-weight: 700;
    color: #ffd24a;
    background: rgba(255, 210, 74, 0.12);
    border: 1px solid rgba(255, 210, 74, 0.35);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}
.item-grid {
    display: grid;
    /* Авто-перестроение: 2 колонки, если хватает ширины; иначе плитки в один столбец. Без гориз. прокрутки. */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 2px 2px;
    -webkit-overflow-scrolling: touch;
}
.item-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 11px 9px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    color: var(--text-color);
    position: relative;
    min-width: 0; /* позволяет плитке ужиматься в гриде, без горизонтального переполнения */
}
.item-card:active {
    transform: scale(0.96);
}
.item-card:not(.item-card--locked):hover {
    border-color: var(--accent-color, #7aa2ff);
    background: rgba(255, 255, 255, 0.04);
}
.item-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
}
.item-card-icon {
    font-size: 22px;
    line-height: 1;
}
.item-card-name {
    font-size: 14px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.item-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.25;
}
.item-card-effects {
    font-size: 11px;
    color: #8fd6a8;
    line-height: 1.25;
    margin-top: 1px;
}
.item-card-price {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #ffd24a;
}
.item-card--locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.item-card--locked .item-card-price {
    color: #ff6b6b;
}
.item-card--cooldown {
    opacity: 0.55;
    cursor: not-allowed;
}
.item-card--cooldown .item-card-price {
    color: var(--text-muted);
}
.item-grid-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px 0;
}

/* ==================== Модал: Прогулка ==================== */
.walk-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.walk-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(75, 195, 110, 0.08);
    border: 1px solid rgba(75, 195, 110, 0.2);
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
}

.walk-option-btn:hover, .walk-option-btn:active {
    background: rgba(75, 195, 110, 0.18);
    border-color: rgba(75, 195, 110, 0.4);
}

.walk-option-name {
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
}

.walk-option-time {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 700;
    min-width: 45px;
}

.walk-option-effects {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-left: auto;
}

.effect-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.effect-mood  { background: rgba(255, 217, 61, 0.15); color: #ffd93d; }
.effect-energy { background: rgba(107, 203, 119, 0.15); color: #6bcb77; }
.effect-stress { background: rgba(100, 160, 255, 0.15); color: #7db6ff; }

/* ==================== Модал: Поручения ==================== */
.errand-difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.errand-diff-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(90, 130, 255, 0.08);
    border: 1px solid rgba(90, 130, 255, 0.2);
    border-radius: 12px;
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
}

.errand-diff-btn:hover, .errand-diff-btn:active {
    background: rgba(90, 130, 255, 0.16);
}

/* Per-difficulty accent colours */
.errand-diff-btn--elementary { border-color: rgba(160,160,160,0.35); }
.errand-diff-btn--elementary:hover { background: rgba(160,160,160,0.12); border-color: rgba(160,160,160,0.55); }
.errand-diff-btn--easy        { border-color: rgba(76,175,80,0.4);  }
.errand-diff-btn--easy:hover  { background: rgba(76,175,80,0.12);   border-color: rgba(76,175,80,0.6);  }
.errand-diff-btn--normal      { border-color: rgba(255,193,7,0.4);  }
.errand-diff-btn--normal:hover{ background: rgba(255,193,7,0.12);   border-color: rgba(255,193,7,0.6);  }
.errand-diff-btn--hard        { border-color: rgba(244,67,54,0.4);  }
.errand-diff-btn--hard:hover  { background: rgba(244,67,54,0.12);   border-color: rgba(244,67,54,0.6);  }
.errand-diff-btn--insane      { border-color: rgba(100,100,100,0.5); }
.errand-diff-btn--insane:hover{ background: rgba(50,50,50,0.3);     border-color: rgba(120,120,120,0.7); }

.errand-diff-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.errand-diff-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.errand-diff-name {
    font-size: 14px;
    font-weight: 600;
}

.errand-diff-time {
    font-size: 11px;
    color: var(--text-muted);
}

.errand-diff-reward {
    font-size: 12px;
    color: #ffd93d;
    font-weight: 700;
}

.errand-diff-risk {
    font-size: 11px;
    color: var(--text-muted);
}

/* Детали поручения — загрузка */
.errand-detail-loading {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Бэдж сложности в деталях */
.errand-detail-difficulty {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Фраза питомца при отправке */
.errand-send-phrase {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin: 4px 0 10px;
}

/* Детали поручения */
.errand-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
}

.errand-stat {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 0;
}

.errand-stat span:first-child { color: var(--text-muted); }
.errand-stat span:last-child  { font-weight: 600; }

/* Результат поручения */
.errand-result-errand-title {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 4px 0 2px;
}

.errand-result-return-phrase {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin: 0 0 8px;
}

.errand-result-body {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.errand-result-reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.result-reward-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-reward-amount {
    font-size: 28px;
    font-weight: 800;
    color: #ffd93d;
}

.errand-result-bonus {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--success-color);
    font-weight: 600;
}

.errand-result-injury {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(231, 76, 60, 0.9);
    padding: 6px 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
}

.walk-result-subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 8px;
}

.walk-result-body {
    padding: 8px 0 4px;
}

.walk-result-hint {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(160, 200, 170, 0.9);
    text-align: center;
    margin: 0;
    max-width: 280px;
}

/* ==================== Лечение травм (модал) ==================== */
.heal-injury-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.heal-injury-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(231, 76, 60, 0.15);
    border-radius: 10px;
}

.heal-injury-info {
    flex: 1;
}

.heal-injury-name {
    font-size: 13px;
    font-weight: 600;
}

.heal-injury-medicine {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.heal-injury-timer {
    font-size: 11px;
    color: rgba(231, 76, 60, 0.8);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.apply-heal-btn {
    padding: 6px 14px;
    font-size: 12px;
    background: rgba(78, 204, 163, 0.15);
    border: 1px solid rgba(78, 204, 163, 0.3);
    border-radius: 8px;
    color: var(--success-color);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: background 0.15s;
}
.apply-heal-btn:hover { background: rgba(78, 204, 163, 0.25); }

/* ── Friend Detail Card ──────────────────────────────────────────────────── */
.friend-detail-topbar {
    display: flex;
    align-items: center;
    padding-top: 4px;
    margin-bottom: 10px;
}

.friend-back-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 14px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.friend-back-btn:hover { background: rgba(255,255,255,0.14); }

.friend-detail-hero {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 10px;
}

/* Строка: аватар + инфо */
.friend-detail-hero-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.friend-detail-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.friend-detail-hero-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0;
}

.friend-detail-pet-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.friend-detail-inner-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 8px 0;
}

.friend-detail-owner-block {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.friend-detail-pet-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.friend-detail-pet-gender {
    font-size: 12px;
    color: var(--text-secondary);
}

.friend-detail-owner-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.friend-detail-owner-name::before {
    content: '👤 ';
}

.friend-detail-pet-status {
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.friend-detail-pet-status.status-free     { color: #4ecfa3; }
.friend-detail-pet-status.status-busy     { color: #ffc850; }
.friend-detail-pet-status.status-dead     { color: #888; }

.friend-detail-relation {
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 6px;
    border-left: 1px solid rgba(255,255,255,0.15);
}

.friend-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── Шкала Симпатии ─────────────────────────────────────────── */
.friend-relation-bar-wrap {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

/* Вариант внутри hero — без отдельной карточки */
.friend-relation-bar-inset {
    background: none;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    padding: 10px 0 0 0;
    margin-top: 10px;
    margin-bottom: 0;
}

.friend-relation-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Колонка: "Симпатия" + стадия */
.friend-relation-bar-label-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.friend-relation-bar-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.friend-relation-stage {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.friend-relation-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.friend-relation-track {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: visible;
    margin-bottom: 5px;
}

.friend-relation-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
    transition: left 0.5s ease, width 0.5s ease, background-color 0.5s ease;
}

.friend-relation-center-line {
    position: absolute;
    left: 50%;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: rgba(255,255,255,0.35);
    transform: translateX(-50%);
    border-radius: 1px;
}

.friend-relation-limits {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

.friend-detail-action-btn {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.friend-detail-action-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.friend-detail-action-btn:disabled { opacity: 0.45; cursor: default; }

.friend-detail-action-btn.action-primary {
    background: rgba(78, 207, 163, 0.15);
    border-color: rgba(78, 207, 163, 0.35);
    color: #4ecfa3;
}

.friend-detail-action-btn.action-primary:hover { background: rgba(78, 207, 163, 0.25); }

.friend-actions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.friend-actions-chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s ease;
    display: inline-block;
}

.friend-actions-chevron-open {
    transform: rotate(180deg);
}

.friend-detail-session-wrap { margin-top: 4px; }

.friend-detail-history-wrap { margin-top: 8px; }

.friend-history-btn {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ── История Симпатии: модал ─────────────────────────────────── */
.interaction-history-card {
    max-width: 400px;
    width: 94%;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;   /* перекрываем padding из .modal-content */
    text-align: left !important;
    overflow: hidden;
}

.interaction-history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.interaction-history-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.modal-close-x {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.interaction-history-list {
    overflow-y: auto;
    flex: 1;
    padding: 10px 0;
}

.interaction-history-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 24px;
}

.interaction-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.interaction-history-item:last-child { border-bottom: none; }

.interaction-history-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 26px;
    text-align: center;
}

.interaction-history-body {
    flex: 1;
    min-width: 0;
}

.interaction-history-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.interaction-history-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.interaction-history-delta {
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.interaction-history-delta.positive { color: #4ecfa3; }
.interaction-history-delta.negative { color: #ff6b6b; }
.interaction-history-delta.neutral  { color: var(--text-muted); }

.friend-actions-dropdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}
.friend-actions-dropdown.hidden { display: none; }

.friend-detail-delete-wrap { margin-top: 8px; }

.friend-detail-delete-btn {
    color: #ff6b6b;
    border-color: rgba(255,107,107,0.25);
}

/* ── Interaction / Dialogue Scene ───────────────────────────────────────── */
.interaction-modal-content {
    max-width: 360px;
    width: 94%;
    padding: 24px 20px;
}

.interaction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.interaction-header .modal-title {
    flex: 1;
}

.interaction-dismiss-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.interaction-dismiss-btn:hover {
    background: rgba(255,255,255,0.16);
    color: #fff;
}

/* ── Info button + tooltip ───────────────────────────────────────────────── */
.interaction-info-wrap {
    position: relative;
    flex-shrink: 0;
}

.interaction-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.55);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.interaction-info-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.interaction-info-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 252px;
    background: #1e2535;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 14px 14px 10px;
    z-index: 200;
    box-shadow: 0 8px 28px rgba(0,0,0,0.55);
    animation: fadeInDown 0.18s ease;
}

.interaction-info-tooltip p {
    margin: 0 0 9px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255,255,255,0.78);
}

.interaction-info-tooltip p:last-of-type {
    margin-bottom: 10px;
}

.interaction-info-tooltip strong {
    color: #f0c060;
}

.interaction-info-tooltip-close {
    display: block;
    width: 100%;
    padding: 7px 0;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.interaction-info-tooltip-close:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.interaction-pets-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.interaction-pet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.interaction-pet-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.interaction-pet-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interaction-vs {
    font-size: 26px;
    flex-shrink: 0;
}

/* Выбор темы разговора */
.interaction-topic-picker {
    padding: 4px 0 8px;
}

.interaction-topic-prompt {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.interaction-topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.interaction-topic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 22px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.interaction-topic-btn span {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.interaction-topic-btn:hover,
.interaction-topic-btn:active {
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.4);
}

.interaction-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.interaction-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent-color, #4ecfa3);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.interaction-dialogue {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 2px;
    margin-bottom: 12px;
}

/* Враппер сообщения: ник + пузырь */
.dialogue-msg {
    display: flex;
    flex-direction: column;
    max-width: 84%;
    gap: 3px;
}
.dialogue-msg-mine  { align-self: flex-end;  align-items: flex-end; }
.dialogue-msg-other { align-self: flex-start; align-items: flex-start; }

.dialogue-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

/* Мой питомец — зелёный */
.dialogue-bubble-mine {
    background: rgba(78, 207, 163, 0.15);
    border: 1px solid rgba(78, 207, 163, 0.3);
    border-bottom-right-radius: 4px;
    color: var(--text-color);
}

/* Чужой питомец — серый */
.dialogue-bubble-other {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom-left-radius: 4px;
    color: var(--text-color);
}

.dialogue-speaker {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dialogue-speaker-mine {
    opacity: 1;
    color: #4ecfa3;
}

.interaction-result-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
}

.interaction-result-bar.result-good {
    background: rgba(78, 207, 163, 0.15);
    border-color: rgba(78, 207, 163, 0.35);
    color: #4ecfa3;
}

.interaction-result-bar.result-neutral {
    background: rgba(255, 200, 80, 0.12);
    border-color: rgba(255, 200, 80, 0.3);
    color: #ffc850;
}

.interaction-result-bar.result-bad {
    background: rgba(255, 90, 90, 0.12);
    border-color: rgba(255, 90, 90, 0.3);
    color: #ff6b6b;
}

.interaction-result-bar.result-awkward {
    background: rgba(180, 140, 255, 0.12);
    border-color: rgba(180, 140, 255, 0.3);
    color: #b48cff;
}

.interaction-result-delta {
    font-size: 13px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.01em;
    margin-left: 2px;
}
.interaction-result-delta.delta-positive {
    color: #4ecfa3;
    background: rgba(78, 207, 163, 0.18);
}
.interaction-result-delta.delta-negative {
    color: #ff6b6b;
    background: rgba(255, 90, 90, 0.18);
}
.interaction-result-delta.delta-zero {
    color: #888;
    background: rgba(255, 255, 255, 0.07);
}

/* ==================== Toast-уведомления ==================== */

#toast-container {
    position: fixed;
    top: var(--section-top, 200px);
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    pointer-events: none;
    gap: 8px;
}

.toast {
    pointer-events: auto;
    background: #1e2340;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 13px 16px;
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
    transform: translateY(-110%) scale(0.96);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.22s ease;
    will-change: transform, opacity;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: pointer;
}

.toast.toast-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.toast.toast-hiding {
    transform: translateY(-110%) scale(0.96);
    opacity: 0;
    transition: transform 0.28s ease-in, opacity 0.22s ease;
}

.toast-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1.2;
    margin-top: 1px;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #eaeaea;
    line-height: 1.3;
}

.toast-text {
    font-size: 13px;
    color: rgba(234,234,234,0.65);
    margin-top: 3px;
    line-height: 1.4;
}

.toast-warning { border-left: 3px solid #ffc850; }
.toast-error   { border-left: 3px solid #ff6b6b; }
.toast-success { border-left: 3px solid #4ecfa3; }
.toast-info    { border-left: 3px solid #7b9cff; }

/* Совместная прогулка */
.joint-walk-pets-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

/* ==================== Выбор скина питомца ==================== */

/* Блок превью в форме создания */
.skin-select-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 4px 0 16px;
}

.skin-preview-wrap {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.skin-preview-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
}

.skin-pick-btn {
    background: rgba(78, 207, 163, 0.15);
    border: 1px solid rgba(78, 207, 163, 0.4);
    color: #4ecfa3;
    border-radius: 10px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.skin-pick-btn:active {
    background: rgba(78, 207, 163, 0.28);
}

.skin-selected-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Модал скин-пикера — bottom sheet */
.skin-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
}
.skin-picker-modal.hidden { display: none; }

.skin-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.skin-picker-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--card-bg, #1a1f2e);
    border-radius: 24px 24px 0 0;
    max-height: 72vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: skinSheetUp 0.22s ease-out;
}

@keyframes skinSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.skin-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.skin-picker-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.skin-picker-close {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-secondary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.skin-picker-loading,
.skin-picker-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
    font-size: 14px;
}

/* Карточка скина */
.skin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 10px 8px 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}
.skin-card:active { background: rgba(255,255,255,0.1); }
.skin-card--selected {
    border-color: #4ecfa3;
    background: rgba(78,207,163,0.1);
}

.skin-card-img-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-card-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
}

.skin-card-check {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #4ecfa3;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.skin-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
}
