/* GoatLand — общие стили (вынесены из прототипа главной страницы) */

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    background-color: #17131a;
    color: #fffaf3;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Тёплый снежный закат в горах (Alpenglow) без центрального пересвета под текстом */
.alpine-sky {
    position: fixed;
    inset: 0;
    z-index: -3;
    background: 
        radial-gradient(circle at 85% 35%, rgba(249, 115, 22, 0.14) 0%, transparent 48%),
        radial-gradient(circle at 15% 32%, rgba(253, 186, 116, 0.12) 0%, transparent 48%),
        linear-gradient(180deg, #16111b 0%, #241926 38%, #43282f 72%, #171219 100%);
}

/* Эффект матового тёплого снежного стекла со скошенным акцентом */
.frost-panel {
    position: relative;
    background: linear-gradient(145deg, rgba(46, 36, 48, 0.78) 0%, rgba(28, 22, 32, 0.88) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(254, 243, 199, 0.16);
    box-shadow: 
        0 24px 60px rgba(10, 7, 14, 0.65),
        inset 0 1px 0 rgba(255, 250, 240, 0.18),
        inset 0 0 32px rgba(251, 191, 36, 0.04);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Снежная шапка / тёплый блик сверху на карточках */
.frost-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(254, 243, 199, 0.65), rgba(251, 146, 60, 0.55), transparent);
    opacity: 0.75;
    pointer-events: none;
    transition: opacity 0.35s ease, left 0.35s ease, right 0.35s ease;
}

/* Динамическое тёплое освещение внутри карточек при движении мыши */
.spotlight-warm {
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.spotlight-warm::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        480px circle at var(--mouse-x) var(--mouse-y),
        rgba(254, 215, 170, 0.16),
        rgba(251, 146, 60, 0.08) 40%,
        transparent 72%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.spotlight-warm:hover::before {
    opacity: 1;
}

.frost-interactive {
    cursor: pointer;
}

.frost-interactive:hover {
    transform: translateY(-5px);
    border-color: rgba(253, 224, 71, 0.42);
    box-shadow: 
        0 28px 65px rgba(8, 5, 12, 0.78),
        0 0 35px rgba(245, 158, 11, 0.18),
        inset 0 1px 0 rgba(254, 243, 199, 0.35);
}

.frost-interactive:hover::after {
    opacity: 1;
    left: 8px;
    right: 8px;
}

/* Главная кнопка "Играть" в стиле тёплого горного очага и латуни Create */
.btn-alpine-play {
    position: relative;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 55%, #be123c 100%);
    border: 1px solid rgba(254, 243, 199, 0.55);
    box-shadow: 
        0 10px 30px rgba(234, 88, 12, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.38);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-alpine-play:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #e11d48 100%);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 
        0 14px 36px rgba(245, 158, 11, 0.6),
        0 0 22px rgba(254, 243, 199, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.01);
}

.btn-alpine-play:active {
    transform: translateY(0) scale(0.99);
}

/* Вторичные кнопки */
.btn-alpine-secondary {
    background: rgba(255, 250, 243, 0.06);
    border: 1px solid rgba(254, 243, 199, 0.2);
    transition: all 0.25s ease;
}

.btn-alpine-secondary:hover {
    background: rgba(255, 250, 243, 0.13);
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-2px);
}

/* Анимации козла-маскота, шестерней и заклинаний */
@keyframes goatBounce {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-9px) rotate(-1.2deg); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.06); opacity: 1; }
}

.mascot-float {
    animation: goatBounce 5.2s ease-in-out infinite;
}

.cog-spin {
    transform-origin: center;
    transform-box: fill-box;
    animation: spinSlow 30s linear infinite;
}

.cog-spin-rev {
    transform-origin: center;
    transform-box: fill-box;
    animation: spinReverse 24s linear infinite;
}

.sun-glow {
    animation: sunPulse 6s ease-in-out infinite;
}

.pixelated {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Выпадающая панель резервных IP */
.ip-drawer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.25s ease;
}

.ip-drawer.open {
    max-height: 180px;
    opacity: 1;
    margin-top: 0.75rem;
}

/* Выпадающие окна-заглушки (Уведомления и Профиль) */
.popover-panel {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.popover-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Активный пункт верхней навигации */
.nav-active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.30), rgba(234, 88, 12, 0.22));
    box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.35), 0 0 16px rgba(245, 158, 11, 0.2);
}

/* ===== Формы, чипы и карточки городов (раздел «Города», вход, админка) ===== */
input, textarea, select { user-select: text; -webkit-user-select: text; }

.field {
    width: 100%;
    background: rgba(17, 13, 20, 0.9);
    color: #fffbeb;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    padding: 11px 14px;
    border: 1px solid rgba(254, 243, 199, 0.16);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field::placeholder { color: rgba(254, 243, 199, 0.38); }
.field:focus { border-color: rgba(251, 191, 36, 0.65); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14); }
select.field { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fcd34d' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select.field option { background: #1c1620; color: #fffbeb; }
.field-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(252, 211, 77, 0.8); margin-bottom: 6px; }

.pill-tab {
    padding: 8px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 700; white-space: nowrap;
    color: rgba(254, 243, 199, 0.75); background: rgba(255, 250, 243, 0.05); border: 1px solid rgba(254, 243, 199, 0.14);
    transition: all 0.2s ease; cursor: pointer;
}
.pill-tab:hover { color: #fff; background: rgba(251, 191, 36, 0.14); }
.pill-tab.active { color: #fff; background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(234, 88, 12, 0.28)); border-color: rgba(252, 211, 77, 0.5); box-shadow: 0 0 16px rgba(245, 158, 11, 0.2); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; }
.chip-green { color: #6ee7b7; background: rgba(16, 185, 129, 0.14); border-color: rgba(52, 211, 153, 0.35); }
.chip-gray  { color: rgba(254, 243, 199, 0.65); background: rgba(255, 255, 255, 0.06); border-color: rgba(254, 243, 199, 0.18); }
.chip-amber { color: #fcd34d; background: rgba(245, 158, 11, 0.14); border-color: rgba(251, 191, 36, 0.38); }
.chip-rose  { color: #fda4af; background: rgba(244, 63, 94, 0.13); border-color: rgba(251, 113, 133, 0.35); }
.chip-sky   { color: #7dd3fc; background: rgba(14, 165, 233, 0.13); border-color: rgba(56, 189, 248, 0.35); }
.chip-violet{ color: #c4b5fd; background: rgba(139, 92, 246, 0.14); border-color: rgba(167, 139, 250, 0.38); }
.chip-mono  { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(254, 243, 199, 0.85); background: rgba(0, 0, 0, 0.35); border-color: rgba(254, 243, 199, 0.12); }

.city-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: rgba(22, 17, 26, 0.7); border: 1px solid rgba(254, 243, 199, 0.12);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
.city-card:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, 0.45); box-shadow: 0 20px 44px rgba(8, 5, 12, 0.6), 0 0 26px rgba(245, 158, 11, 0.12); }
.city-cover { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* Растягиваем на всю обложку только саму обложку: маленький аватар города в углу (.city-avatar) лежит в том же блоке и сохраняет свой размер */
.city-cover img:not(.city-avatar) { width: 100%; height: 100%; object-fit: cover; }
.city-cover .city-avatar { position: absolute; top: 12px; left: 12px; z-index: 10; width: 48px; height: 48px; max-width: 48px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(254, 243, 199, 0.5); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); background: #1d1520; }
.city-cover .letter { font-family: 'Unbounded', 'Inter', sans-serif; font-weight: 900; font-size: 64px; color: rgba(255, 250, 240, 0.9); text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
.city-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(22, 17, 26, 0.6)); pointer-events: none; }

.btn-danger { background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(251, 113, 133, 0.4); color: #fecdd3; transition: all 0.2s ease; }
.btn-danger:hover { background: rgba(244, 63, 94, 0.26); }
.btn-ok { background: rgba(16, 185, 129, 0.16); border: 1px solid rgba(52, 211, 153, 0.4); color: #a7f3d0; transition: all 0.2s ease; }
.btn-ok:hover { background: rgba(16, 185, 129, 0.28); }

/* ---------- Аватар-плитка (буква ника на цветном фоне; пока нет загрузки скинов) ---------- */
.avatar-tile { display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 16px; color: #fff8ee;
    font-family: 'Unbounded', 'Inter', sans-serif; font-weight: 900; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(254, 243, 199, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 22px rgba(8, 5, 12, 0.5); }

/* ---------- Окно подтверждения (GoatUI.confirm) ---------- */
.gl-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: rgba(10, 7, 14, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s ease; }
.gl-overlay.show { opacity: 1; }
.gl-modal.frost-panel { width: 100%; max-width: 460px; border-radius: 24px; padding: 26px; background: rgba(26, 20, 30, 0.97);
    border: 1px solid rgba(252, 211, 77, 0.3); transform: translateY(12px) scale(0.98); transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.gl-overlay.show .gl-modal { transform: none; }

/* ---------- Уведомления: страница истории и значок в шапке ---------- */
.notif-row { display: flex; gap: 14px; padding: 16px 18px; border-radius: 18px; background: rgba(22, 17, 26, 0.6); border: 1px solid rgba(254, 243, 199, 0.1);
    transition: background-color 0.2s ease, border-color 0.2s ease; }
.notif-row.unread { background: rgba(48, 34, 46, 0.7); border-color: rgba(251, 191, 36, 0.3); }
.notif-row:hover { border-color: rgba(251, 191, 36, 0.4); }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; background: rgba(22, 17, 26, 0.6);
    border: 1px solid rgba(254, 243, 199, 0.1); transition: border-color 0.2s ease, transform 0.2s ease; }
a.stat-card:hover { border-color: rgba(251, 191, 36, 0.45); transform: translateY(-2px); }
.stat-card .num { font-family: 'Unbounded', 'Inter', sans-serif; font-weight: 800; font-size: 26px; color: #fffbeb; line-height: 1.1; }
.stat-card.hot .num { color: #fcd34d; }

/* ---------- Переключатель (настройки) ---------- */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(254, 243, 199, 0.2); transition: all 0.2s ease; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff7e6; transition: transform 0.2s ease; }
.switch input:checked + .track { background: linear-gradient(135deg, #f59e0b, #ea580c); border-color: rgba(252, 211, 77, 0.6); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .track { opacity: 0.5; }
.switch input:focus-visible + .track { outline: 2px solid rgba(251, 191, 36, 0.75); outline-offset: 2px; }

/* ---------- Опасная зона ---------- */
.danger-zone { border: 1px solid rgba(251, 113, 133, 0.32); background: rgba(244, 63, 94, 0.06); border-radius: 18px; }

/* ---------- Голова скина (лицо + шляпа из развёртки 64x64) ---------- */
/* Лицо — клетка 8×8 пикселей со смещением (8, 8), шляпа — со смещением (40, 8). Размеры считаются от размера аватарки (cqw/cqh), а не от высоты картинки:
   так голова одинаково правильная и у скинов 64×64, и у старого формата 64×32 (раньше у 64×32 лицо растягивалось и съезжало). */
.skin-box { position: absolute; inset: 0; container-type: size; }
.skin-head { position: absolute; inset: 0; background-repeat: no-repeat; background-size: 800% 800%; background-position: 14.2857% 14.2857%; image-rendering: pixelated; }   /* запасной вариант для старых браузеров */
.skin-head.skin-hat { background-position: 71.4286% 14.2857%; }
@supports (width: 1cqw) {
    .skin-head { background-size: 800cqw auto; background-position: -100cqw -100cqh; }
    .skin-head.skin-hat { background-position: -500cqw -100cqh; }
}

/* ---------- Предпросмотр скина (canvas масштабируется без размытия) ---------- */
.skin-canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; margin: 0 auto; }

/* ---------- Шаги на странице скинов ---------- */
.step-dot { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 9px; flex-shrink: 0;
    background: rgba(245, 158, 11, 0.2); border: 1px solid rgba(252, 211, 77, 0.4); color: #fcd34d; font-family: 'Unbounded', 'Inter', sans-serif; font-weight: 800; font-size: 12px; }
.skin-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 12px; border-radius: 18px; cursor: pointer; text-align: center;
    background: rgba(22, 17, 26, 0.6); border: 1px solid rgba(254, 243, 199, 0.1); transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease; }
.skin-card:hover { border-color: rgba(251, 191, 36, 0.4); transform: translateY(-2px); }
.skin-card.selected { border-color: rgba(251, 191, 36, 0.85); background: rgba(48, 34, 46, 0.85); box-shadow: 0 0 22px rgba(245, 158, 11, 0.18); }

/* ---------- Боковое меню кабинета ---------- */
.acc-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 700;
    color: rgba(254, 243, 199, 0.8); border: 1px solid transparent; transition: all 0.2s ease; flex-shrink: 0; }
.acc-link:hover { color: #fff; background: rgba(251, 191, 36, 0.14); }
.acc-link.active { color: #fff; background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(234, 88, 12, 0.28)); border-color: rgba(252, 211, 77, 0.5); box-shadow: 0 0 16px rgba(245, 158, 11, 0.2); }

/* ===== v8: поле ввода 6-значного кода из игры (окно и страница «Вход в игру») ===== */
.otp { display: flex; justify-content: center; gap: 8px; }
.otp input { width: 46px; height: 58px; text-align: center; font-family: 'Unbounded', 'Inter', sans-serif; font-weight: 800; font-size: 24px; color: #fff;
    background: rgba(17, 13, 20, 0.9); border: 1px solid rgba(254, 243, 199, 0.2); border-radius: 14px; outline: none; caret-color: #fbbf24;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.otp input:focus { border-color: rgba(251, 191, 36, 0.8); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); transform: translateY(-1px); }
.otp input.filled { border-color: rgba(251, 191, 36, 0.5); }
.otp.error input { border-color: rgba(251, 113, 133, 0.7); animation: otp-shake .35s ease; }
.otp.ok input { border-color: rgba(52, 211, 153, 0.8); }
.otp input:disabled { opacity: .6; }
@keyframes otp-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width: 380px) { .otp { gap: 5px; } .otp input { width: 40px; height: 52px; font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .otp input, .otp.error input { transition: none; animation: none; } }


/* Кнопка «Наверх» — одна на сайте (на страницах базы знаний подключается через kb.css, вид тот же) */
.kb-fab-top {
    position: fixed; z-index: 40; right: 1.5rem; bottom: 5.25rem; width: 44px; height: 44px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; color: #fde68a;
    background: rgba(32, 24, 36, 0.92); border: 1px solid rgba(252, 211, 77, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    opacity: 0; transform: translateY(10px); pointer-events: none; cursor: pointer;
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.kb-fab-top.kb-visible { opacity: 1; transform: none; pointer-events: auto; }
.kb-fab-top:hover { background: rgba(60, 40, 44, 0.95); border-color: rgba(252, 211, 77, 0.7); transform: translateY(-2px); }
