* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

:root {
    --forest-950: #132319;
    --forest-900: #1a3021;
    --forest-800: #27452e;
    --forest-700: #37623e;
    --forest-600: #4f7c52;
    --moss: #75945d;
    --sage: #a8b58d;
    --parchment: #eee3c5;
    --parchment-light: #f8f1dc;
    --ink: #233526;
    --muted: #687466;
    --gold: #d7ad4a;
    --danger: #a44138;
    --line: rgba(36, 65, 40, 0.2);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(rgba(12, 28, 17, 0.5), rgba(9, 19, 12, 0.7)),
        radial-gradient(circle at top, rgba(202, 218, 154, 0.22), transparent 34%),
        linear-gradient(135deg, #567359 0%, #263f2b 45%, #15251a 100%);
    background-attachment: fixed;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
}

/* Авторизация */

.auth-card {
    width: min(100%, 450px);
    max-height: calc(100vh - 30px);
    overflow: auto;
    padding: 34px 38px;
    color: #fff;
    background: rgba(20, 35, 25, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(12px);
}

.auth-logo {
    margin-bottom: 26px;
    text-align: center;
}

.auth-logo h1 {
    margin: 0;
    font-size: clamp(34px, 8vw, 48px);
}

.auth-logo p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.67);
    font-size: 14px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.tab-button {
    position: relative;
    padding: 13px 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
}

.tab-button.active,
.tab-button:hover {
    color: #fff;
}

.tab-button.active::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: -1px;
    left: 16px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--gold);
}

.auth-panel {
    animation: panel-appearance 180ms ease;
}

@keyframes panel-appearance {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-panel form {
    display: grid;
    gap: 18px;
}

.auth-panel label {
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    font-weight: 600;
}

.auth-panel input,
.auth-panel select {
    width: 100%;
    padding: 10px 2px;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    outline: none;
}

.auth-panel select option {
    color: var(--ink);
}

.auth-panel input:focus,
.auth-panel select:focus {
    border-color: var(--gold);
    box-shadow: 0 1px 0 var(--gold);
}

.agreement {
    display: flex !important;
    align-items: flex-start;
    gap: 10px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.4;
}

.agreement input {
    width: 17px !important;
    height: 17px;
    accent-color: var(--gold);
}

.main-button {
    width: 100%;
    padding: 13px 20px;
    cursor: pointer;
    color: #332a18;
    background: linear-gradient(180deg, #f3cb67, #dca83e);
    border-radius: 30px;
    font-weight: 800;
}

.text-button {
    display: block;
    margin: 17px auto 0;
    padding: 5px;
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
    cursor: pointer;
}

.message {
    min-height: 22px;
    margin: 16px 0 0;
    text-align: center;
    font-size: 13px;
}

.message.success,
.mini-message.success {
    color: #77a966;
}

.message.error,
.mini-message.error {
    color: #d2675d;
}

/* Личный кабинет */

.dashboard {
    width: min(1240px, 100%);
    min-height: 750px;
    display: grid;
    grid-template-columns: 275px 1fr;
    overflow: hidden;
    background: rgba(241, 232, 203, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.profile-sidebar {
    padding: 28px 22px;
    color: #eef4e8;
    background:
        linear-gradient(rgba(25, 52, 31, 0.94), rgba(17, 39, 24, 0.97)),
        linear-gradient(135deg, #42664a, #16291b);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--forest-900);
    background: var(--parchment);
}

.avatar-block {
    margin-top: 26px;
    text-align: center;
}

.avatar-frame {
    width: 126px;
    height: 126px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 4px solid rgba(244, 235, 204, 0.8);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#avatar-placeholder {
    font-size: 52px;
    font-weight: 800;
    color: var(--parchment);
}

.upload-avatar-button {
    display: inline-block;
    padding: 8px 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    font-size: 12px;
}

.sidebar-user {
    margin-top: 15px;
    display: grid;
    gap: 5px;
    text-align: center;
}

.sidebar-user strong {
    font-size: 19px;
}

.sidebar-user span,
.profile-sidebar small {
    color: rgba(255, 255, 255, 0.7);
}

.level-progress {
    height: 7px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
}

.level-progress span {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--gold), #f0d982);
    transition: width 220ms ease;
}

#level-progress-text {
    display: block;
    margin-top: 7px;
    text-align: center;
}

.profile-nav {
    display: grid;
    gap: 5px;
    margin-top: 25px;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    border-radius: 9px;
    text-align: left;
}

.nav-button:hover,
.nav-button.active {
    color: var(--forest-950);
    background: var(--parchment);
}

.nav-button span {
    width: 20px;
    text-align: center;
}

.logout-button {
    width: 100%;
    margin-top: 22px;
    padding: 11px;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
}

.dashboard-content {
    padding: 36px;
    overflow: auto;
    background:
        linear-gradient(rgba(248, 241, 220, 0.93), rgba(238, 227, 197, 0.96)),
        repeating-linear-gradient(
            45deg,
            rgba(61, 83, 54, 0.02) 0,
            rgba(61, 83, 54, 0.02) 2px,
            transparent 2px,
            transparent 8px
        );
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.dashboard-header h1,
.section-title h2,
.profile-hero h2 {
    margin: 0;
    color: var(--forest-800);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--moss);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.online-badge,
.section-counter {
    padding: 8px 12px;
    color: var(--forest-700);
    background: rgba(117, 148, 93, 0.16);
    border: 1px solid rgba(79, 124, 82, 0.22);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.content-panel,
.message-tab {
    display: none;
}

.content-panel.active,
.message-tab.active {
    display: block;
    animation: panel-appearance 180ms ease;
}

.parchment-card,
.settings-card,
.stat-card,
.achievement-card,
.player-card,
.chat-card {
    background: rgba(255, 252, 239, 0.78);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(52, 68, 48, 0.07);
}

.profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
}

.profile-id {
    display: grid;
    gap: 4px;
    text-align: right;
}

.profile-id span,
.muted {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.stat-card {
    display: grid;
    gap: 7px;
    padding: 18px;
}

.stat-card > span {
    color: var(--moss);
    font-size: 13px;
    font-weight: 700;
}

.stat-card strong {
    color: var(--forest-800);
    font-size: 27px;
}

.stat-card small {
    color: var(--muted);
}

.profile-columns,
.friends-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.parchment-card {
    padding: 24px;
}

.parchment-card h3,
.settings-card h3 {
    margin-top: 0;
    color: var(--forest-800);
}

.profile-details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.profile-details > div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.profile-details dt {
    color: var(--muted);
}

.profile-details dd {
    margin: 0;
    font-weight: 700;
}

.privacy-note {
    margin-bottom: 0;
    font-size: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.achievement-grid,
.players-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.achievement-card {
    display: flex;
    gap: 15px;
    padding: 18px;
}

.achievement-card h3,
.achievement-card p {
    margin: 0;
}

.achievement-card p {
    margin-top: 6px;
    color: var(--muted);
}

.achievement-card.locked {
    opacity: 0.72;
    filter: grayscale(0.45);
}

.achievement-icon {
    font-size: 30px;
}

.search-field,
.settings-card label {
    display: grid;
    gap: 8px;
    color: var(--forest-700);
    font-size: 13px;
    font-weight: 700;
}

.search-field input,
.settings-card input,
.settings-card select,
.settings-card textarea,
.chat-compose textarea {
    width: 100%;
    padding: 12px;
    color: var(--ink);
    background: #fffdf4;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
}

.player-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    padding: 16px;
}

.player-avatar,
.mini-avatar {
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    color: #fff;
    background: var(--forest-600);
    border-radius: 50%;
    font-weight: 800;
}

.player-avatar {
    width: 54px;
    height: 54px;
    font-size: 22px;
}

.mini-avatar {
    width: 34px;
    height: 34px;
}

.player-avatar img,
.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    min-width: 0;
}

.player-info strong,
.player-info span {
    display: block;
}

.player-info span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.player-action {
    padding: 8px 10px;
    cursor: pointer;
    color: #fff;
    background: var(--forest-700);
    border-radius: 7px;
    font-size: 12px;
}

.player-action.secondary {
    color: var(--forest-700);
    background: rgba(79, 124, 82, 0.13);
}

.compact-player-list,
.stack-list {
    display: grid;
    gap: 10px;
}

.compact-player,
.stack-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.compact-player:last-child,
.stack-item:last-child {
    border-bottom: 0;
}

.stack-item {
    justify-content: space-between;
}

.stack-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stack-actions {
    display: flex;
    gap: 6px;
}

.link-button {
    padding: 0;
    cursor: pointer;
    color: var(--forest-700);
    background: transparent;
    text-decoration: underline;
}

.panel-link {
    margin-top: 12px;
}

.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.subtab-button {
    padding: 9px 13px;
    cursor: pointer;
    color: var(--forest-700);
    background: rgba(255, 252, 239, 0.58);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.subtab-button.active {
    color: #fff;
    background: var(--forest-700);
}

.chat-card {
    overflow: hidden;
}

.chat-list {
    height: 390px;
    padding: 18px;
    overflow-y: auto;
}

.chat-message {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.chat-message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chat-message-header strong {
    color: var(--forest-700);
}

.chat-message-header time {
    color: var(--muted);
    font-size: 11px;
}

.chat-message p {
    margin: 4px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--line);
}

.chat-compose textarea {
    min-height: 70px;
    resize: vertical;
}

.message-list {
    min-height: 300px;
}

.private-message {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.private-message:last-child {
    border-bottom: 0;
}

.private-message header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.private-message p {
    margin-bottom: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.settings-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 22px;
}

.forest-button {
    display: inline-block;
    padding: 11px 15px;
    cursor: pointer;
    color: #fff;
    background: var(--forest-700);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.danger-zone {
    grid-column: 1 / -1;
    border-color: rgba(164, 65, 56, 0.28);
}

.danger-button {
    width: fit-content;
    padding: 11px 15px;
    cursor: pointer;
    color: #fff;
    background: var(--danger);
    border-radius: 8px;
    font-weight: 700;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.mini-message {
    min-height: 18px;
    margin: 0;
    font-size: 12px;
}

/* Подтверждение почты */

.confirmation-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.confirmation-card {
    width: min(100%, 500px);
    padding: 42px;
    text-align: center;
    color: var(--ink);
    background: rgba(248, 241, 220, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.confirmation-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--forest-700);
    border-radius: 50%;
    font-size: 34px;
}

.confirmation-link {
    margin-top: 16px;
}

@media (max-width: 960px) {
    .page {
        padding: 0;
        place-items: stretch;
    }

    .dashboard {
        min-height: 100vh;
        grid-template-columns: 220px 1fr;
        border-radius: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-columns,
    .friends-columns,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .danger-zone {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .dashboard {
        display: block;
    }

    .profile-sidebar {
        padding: 15px;
    }

    .brand,
    .avatar-block,
    .sidebar-user,
    .level-progress,
    #level-progress-text {
        display: none;
    }

    .profile-nav {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
        margin-top: 0;
    }

    .nav-button {
        justify-content: center;
        padding: 9px 3px;
        font-size: 0;
    }

    .nav-button span {
        font-size: 19px;
    }

    .logout-button {
        margin-top: 9px;
    }

    .dashboard-content {
        padding: 22px 13px;
    }

    .dashboard-header,
    .profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-id {
        text-align: left;
    }

    .stats-grid,
    .achievement-grid,
    .players-grid {
        grid-template-columns: 1fr;
    }

    .chat-compose {
        grid-template-columns: 1fr;
    }
}


/* ClanGenRU v3 additions */
.welcome-layout{width:min(1120px,100%);display:grid;grid-template-columns:430px 1fr;overflow:hidden;border-radius:22px;box-shadow:0 30px 90px rgba(0,0,0,.44)}
.welcome-layout>.auth-card{width:auto;max-height:calc(100vh - 40px);overflow:auto;border-radius:0}
.welcome-info-card{min-height:650px;padding:70px 64px;display:flex;flex-direction:column;justify-content:center;background:linear-gradient(rgba(248,241,220,.92),rgba(238,227,197,.96));color:var(--ink)}
.welcome-kicker{color:var(--moss);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:1px}.welcome-info-card h1{margin:16px 0 20px;color:var(--forest-800);font:54px/1.08 Georgia,serif}.welcome-info-card p{font-size:17px;line-height:1.7}.welcome-note{padding-left:14px;border-left:3px solid var(--gold);color:var(--muted);font-size:14px!important}.welcome-actions,.welcome-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}.welcome-links{gap:18px;margin-top:34px}.welcome-links a{color:var(--forest-700);font-weight:700}.logo-link{color:#fff;font-size:48px;font-weight:800;text-decoration:none}.outline-button{display:inline-block;padding:11px 15px;border:1px solid var(--forest-700);border-radius:8px;color:var(--forest-700);font-weight:700;text-decoration:none}.cabinet-links{display:flex;justify-content:center;gap:10px;margin-top:15px;color:rgba(255,255,255,.67);font-size:12px}.cabinet-links a{color:#f0d57d}.nav-link{display:flex;align-items:center;gap:12px;padding:11px 14px;color:rgba(255,255,255,.72);text-decoration:none;border-radius:9px}.nav-link:hover{color:var(--forest-950);background:var(--parchment)}.nav-link span{width:20px;text-align:center}.profile-editor{display:grid;gap:14px}.profile-editor label{display:grid;gap:8px;color:var(--forest-700);font-size:13px;font-weight:700}.profile-editor input,.profile-editor textarea{width:100%;padding:12px;background:#fffdf4;border:1px solid var(--line);border-radius:8px}.profile-editor textarea{min-height:180px;resize:vertical}.players-table{display:grid;gap:10px}.player-row{display:grid;grid-template-columns:70px minmax(150px,1.4fr) 100px 100px minmax(180px,auto);align-items:center;gap:14px;padding:14px 16px;background:rgba(255,252,239,.78);border:1px solid var(--line);border-radius:14px}.player-identity{display:flex;align-items:center;gap:12px}.player-name-link{color:var(--forest-700);font-weight:800;text-decoration:underline}.player-actions{display:flex;justify-content:flex-end;gap:7px}.player-id-cell{color:var(--muted);font-weight:700}.self-label{color:var(--muted);font-size:12px;font-weight:700}.site-page,.public-profile-page{width:min(1100px,calc(100% - 28px));min-height:calc(100vh - 28px);margin:14px auto;overflow:hidden;background:rgba(243,233,203,.97);border-radius:20px;box-shadow:0 24px 70px rgba(0,0,0,.35)}.site-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 28px;color:#fff;background:var(--forest-900)}.site-header nav{display:flex;flex-wrap:wrap;gap:16px}.site-header a{text-decoration:none}.site-brand{font-size:21px;font-weight:800}.site-content{padding:48px}.site-content>h1{margin-top:0;color:var(--forest-800);font:58px Georgia,serif}.about-hero,.news-card,.legal-card,.placeholder-card,.public-profile-card{background:rgba(255,252,239,.78);border:1px solid var(--line);border-radius:14px}.about-hero,.legal-card,.public-profile-card{padding:28px}.news-card{margin-bottom:14px;padding:22px}.placeholder-card{padding:60px 30px;text-align:center}.placeholder-icon{font-size:70px}.legal-note{margin-top:30px;padding:16px;color:var(--muted);background:rgba(117,148,93,.12);border-radius:9px}.public-profile-card{margin:40px}.public-profile-top{display:flex;align-items:center;gap:24px;padding-bottom:24px;border-bottom:1px solid var(--line)}.public-profile-avatar{width:150px;height:150px;object-fit:cover;border-radius:14px}.public-profile-avatar.placeholder{display:grid;place-items:center;color:#fff;background:var(--forest-600);font-size:60px;font-weight:800}.public-profile-section{padding:22px 0;border-bottom:1px solid var(--line)}.public-profile-actions{display:flex;flex-wrap:wrap;gap:10px;padding-top:24px}.profile-description{white-space:pre-wrap;line-height:1.7}.back-link{margin:0 40px 40px}.mini-achievements{display:flex;flex-wrap:wrap;gap:10px}.mini-achievements span{padding:9px 12px;background:rgba(117,148,93,.13);border-radius:999px;color:var(--forest-700)}
@media(max-width:980px){.welcome-layout{grid-template-columns:1fr;border-radius:0}.welcome-info-card{min-height:auto;padding:45px 35px}.welcome-info-card h1{font-size:42px}.player-row{grid-template-columns:55px 1fr 70px}.player-level-cell{display:none}.player-actions{grid-column:2/-1;justify-content:flex-start}}
@media(max-width:720px){.player-row{grid-template-columns:44px 1fr}.player-actions{grid-column:1/-1}.site-header{align-items:flex-start;flex-direction:column}.site-content{padding:28px 18px}.public-profile-card{margin:18px}.public-profile-top{align-items:flex-start;flex-direction:column}.public-profile-avatar{width:110px;height:110px}}


/* ============================================================
   Сообщения, уведомления, присутствие и жалобы
   ============================================================ */

.nav-button-with-badge,
.subtab-with-badge {
    position: relative;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #b53232;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(120, 20, 20, 0.35);
}

.nav-badge[hidden] {
    display: none;
}

.subtab-with-badge .nav-badge {
    margin-left: 6px;
    vertical-align: middle;
}

.app-toast {
    position: fixed;
    z-index: 1000;
    top: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 15px 18px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: #34513a;
    color: #fff;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
}

.app-toast.error {
    background: #8d3030;
}

.app-toast[hidden] {
    display: none;
}

.app-toast button {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
}

.chat-presence {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(54, 82, 57, 0.18);
    border-radius: 14px;
    background: rgba(238, 232, 205, 0.72);
}

.viewer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.viewer-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid rgba(54, 82, 57, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.56);
}

.viewer-chip a {
    color: var(--forest, #35553b);
    font-weight: 700;
    text-decoration: none;
}

.viewer-chip button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.chat-list {
    min-height: 300px;
    max-height: 520px;
}

.chat-message {
    align-items: flex-start;
}

.chat-message-content {
    min-width: 0;
    flex: 1;
}

.chat-message-header a {
    color: var(--forest, #35553b);
    font-weight: 800;
    text-decoration: none;
}

.chat-message-actions,
.message-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

.chat-link,
.small-action {
    border: 0;
    padding: 3px 0;
    background: transparent;
    color: #46644d;
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.danger-text {
    color: #a23c3c !important;
}

.message-list {
    display: grid;
    gap: 0;
    max-height: 590px;
    overflow: auto;
    padding: 0;
}

.private-message-row {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(54, 82, 57, 0.18);
    background: rgba(255, 255, 255, 0.22);
}

.private-message-row:last-child {
    border-bottom: 0;
}

.private-message-row.unread {
    background: rgba(251, 235, 184, 0.72);
}

.private-message-summary {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.private-message-main {
    min-width: 0;
    flex: 1;
}

.private-message-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.private-message-heading a {
    color: #35553b;
    font-weight: 800;
    text-decoration: none;
}

.private-message-heading time,
.read-status {
    color: #7b806e;
    font-size: 12px;
}

.private-message-preview {
    margin: 5px 0 0;
    color: #51584d;
}

.private-message-full {
    margin-top: 12px;
    padding: 13px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.58);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.unread-dot {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-top: 7px;
    border-radius: 50%;
    background: #c83434;
    box-shadow: 0 0 0 4px rgba(200, 52, 52, 0.12);
}

.report-dialog {
    width: min(520px, calc(100vw - 28px));
    border: 0;
    border-radius: 18px;
    padding: 0;
    background: #f2ecd3;
    color: #28372d;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.report-dialog::backdrop {
    background: rgba(12, 20, 14, 0.68);
}

.report-dialog form {
    display: grid;
    gap: 15px;
    padding: 24px;
}

.report-dialog textarea {
    min-height: 150px;
    resize: vertical;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.secondary-button {
    border: 1px solid rgba(54, 82, 57, 0.32);
    border-radius: 10px;
    padding: 10px 16px;
    background: transparent;
    color: #35553b;
    cursor: pointer;
}

@media (max-width: 720px) {
    .app-toast {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .private-message-heading {
        display: grid;
        gap: 4px;
    }

    .chat-list,
    .message-list {
        max-height: 460px;
    }
}

/* =========================================================
   ClanGenRU: онлайн-статусы и административная панель
   ========================================================= */

.status-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 253, 244, 0.95);
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
}

.status-dot.online {
    background: #42a85a;
}

.status-dot.offline {
    background: #92978e;
}

.avatar-with-status {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.avatar-with-status .avatar-status-dot {
    position: absolute;
    right: -1px;
    bottom: 1px;
}

.avatar-with-status.compact .avatar-status-dot {
    width: 9px;
    height: 9px;
    right: -2px;
    bottom: -1px;
}

#own-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.player-row {
    grid-template-columns: 72px minmax(280px, 1fr) minmax(210px, auto) !important;
    align-items: center;
}

.player-identity {
    min-width: 0;
}

.player-info .player-name-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.player-info span {
    line-height: 1.45;
}

.player-actions {
    align-items: center;
    flex-wrap: wrap;
}

.player-state-label {
    display: inline-flex;
    align-items: center;
    min-height: 33px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.player-state-label.self {
    color: #536054;
    background: rgba(83, 96, 84, 0.12);
}

.player-state-label.friend {
    color: #315d39;
    background: rgba(66, 168, 90, 0.14);
}

.player-state-label.pending {
    color: #755d17;
    background: rgba(218, 177, 54, 0.18);
}

.admin-mini-badge,
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    color: #6b4a09;
    background: rgba(226, 184, 60, 0.22);
    font: 800 10px/1.2 Arial, sans-serif;
    text-decoration: none;
}

.admin-badge {
    padding: 7px 11px;
    font-size: 12px;
}

.stack-user-link {
    min-width: 0;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.stack-user-link:hover strong {
    text-decoration: underline;
}

.stack-item {
    gap: 14px;
}

.admin-nav-button {
    color: #f4d36d;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-grid textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-checkbox {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
}

.admin-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-ban-list-card {
    grid-column: 1 / -1;
}

.admin-ban-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.admin-ban-row:last-child {
    border-bottom: 0;
}

.admin-ban-row > div {
    display: grid;
    gap: 4px;
}

.admin-ban-row span,
.admin-ban-row small {
    color: var(--muted);
}

.blocked-panel {
    display: grid;
    place-items: center;
    min-height: 70vh;
    padding: 30px;
}

.blocked-card {
    width: min(680px, 100%);
    padding: 38px;
    border: 1px solid rgba(149, 55, 55, 0.28);
    border-radius: 22px;
    background: rgba(255, 246, 224, 0.94);
    box-shadow: 0 22px 60px rgba(44, 25, 20, 0.14);
    text-align: center;
}

.blocked-card h2 {
    margin: 8px 0 16px;
    color: #7f2f2f;
    font: 42px/1.1 Georgia, serif;
}

.blocked-icon {
    display: block;
    margin-bottom: 8px;
    font-size: 58px;
}

.blocked-until {
    font-weight: 800;
}

.blocked-reason {
    padding: 13px 16px;
    border-radius: 12px;
    background: rgba(154, 66, 56, 0.1);
    white-space: pre-wrap;
}

.account-blocked .dashboard-header,
.account-blocked .content-panel,
.account-blocked .profile-nav,
.account-blocked .avatar-block,
.account-blocked .sidebar-user,
.account-blocked .level-progress,
.account-blocked #level-progress-text,
.account-blocked .cabinet-links {
    display: none !important;
}

.account-blocked #blocked-panel {
    display: grid !important;
}

.public-profile-avatar {
    border-radius: 50% !important;
}

.public-avatar-wrap {
    position: relative;
    display: inline-flex;
}

.public-avatar-wrap .status-dot {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 17px;
    height: 17px;
    border-width: 3px;
}

.public-profile-meta {
    line-height: 1.65;
}

@media (max-width: 980px) {
    .player-row {
        grid-template-columns: 58px minmax(0, 1fr) !important;
    }

    .player-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-ban-list-card {
        grid-column: auto;
    }
}

@media (max-width: 720px) {
    .player-row {
        grid-template-columns: 1fr !important;
    }

    .player-id-cell,
    .player-actions {
        grid-column: 1;
    }

    .player-actions {
        justify-content: flex-start;
    }

    .stack-item,
    .admin-ban-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .blocked-panel {
        padding: 15px;
    }

    .blocked-card {
        padding: 26px 20px;
    }

    .blocked-card h2 {
        font-size: 32px;
    }
}

/* --------------------------------------------------------------------------
   ClanGenRU: профиль, игровой раздел, жалобы и расширенное администрирование
   -------------------------------------------------------------------------- */

.cabinet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.cabinet-links a {
    color: inherit;
    text-decoration: none;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
}

.cabinet-links a:hover,
.cabinet-links a.active {
    background: rgba(244, 237, 211, 0.16);
    color: #fff7dc;
}

.profile-game-grid,
.public-profile-game-grid,
.admin-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.game-profile-card,
.admin-wide-card {
    min-width: 0;
}

.game-profile-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.game-profile-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid rgba(63, 79, 54, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.42);
    color: inherit;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease;
}

.game-profile-row:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.7);
}

.game-profile-row.static:hover {
    transform: none;
}

.game-profile-row span:last-child {
    display: grid;
    gap: 0.15rem;
}

.game-profile-row small {
    color: var(--muted, #687263);
}

.game-profile-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(87, 105, 65, 0.12);
    font-size: 1.25rem;
}

.blocked-mini-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.12rem 0.42rem;
    border-radius: 999px;
    background: #a92f37;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    vertical-align: middle;
}

.blocked-mini-badge.large {
    font-size: 0.78rem;
    transform: translateY(-0.1rem);
}

.admin-report-list {
    display: grid;
    gap: 0.8rem;
    max-height: 720px;
    overflow: auto;
    padding-right: 0.2rem;
}

.admin-report-row {
    display: grid;
    gap: 0.55rem;
    padding: 0.95rem;
    border: 1px solid rgba(73, 83, 58, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
}

.admin-report-row.resolved {
    opacity: 0.72;
}

.admin-report-row p,
.admin-report-row blockquote {
    margin: 0;
}

.admin-report-row blockquote {
    padding: 0.7rem 0.8rem;
    border-left: 4px solid rgba(91, 105, 68, 0.45);
    background: rgba(87, 105, 65, 0.08);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-report-heading {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
}

.admin-report-heading span {
    flex: 0 0 auto;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(87, 105, 65, 0.11);
    font-size: 0.75rem;
}

.compact-danger {
    padding: 0.45rem 0.7rem;
}

.public-profile-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.public-profile-avatar,
.public-profile-avatar.placeholder,
.public-avatar-wrap {
    border-radius: 50% !important;
}

.public-profile-avatar {
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* Игровой центр */

.game-hub-content {
    max-width: 1180px;
}

.game-hub-intro {
    max-width: 760px;
    color: var(--muted, #677161);
    font-size: 1.08rem;
}

.game-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.game-mode-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 390px;
    padding: clamp(1.4rem, 4vw, 2.4rem);
    overflow: hidden;
    border: 1px solid rgba(64, 78, 53, 0.2);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(251, 246, 222, 0.96), rgba(231, 224, 192, 0.9));
    box-shadow: 0 22px 60px rgba(22, 31, 21, 0.16);
}

.game-mode-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -38% 30%;
    height: 65%;
    border-radius: 50%;
    background: rgba(86, 106, 65, 0.12);
    filter: blur(2px);
}

.game-mode-card.online-mode::after {
    background: rgba(191, 142, 42, 0.16);
}

.game-mode-card > * {
    position: relative;
    z-index: 1;
}

.game-mode-card h2 {
    margin: 0.3rem 0 0.7rem;
    font-size: clamp(1.55rem, 3vw, 2.3rem);
}

.game-mode-card p:not(.eyebrow) {
    max-width: 34rem;
    line-height: 1.7;
}

.game-mode-card .forest-button {
    margin-top: auto;
}

.game-mode-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 1rem;
    border-radius: 24px;
    background: rgba(70, 86, 57, 0.12);
    font-size: 2.2rem;
}

/* Онлайн-регистрация и локация */

.online-content,
.online-location-content {
    max-width: 1180px;
}

.online-cats-panel,
.online-register-panel {
    margin-top: 1.4rem;
}

.online-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.online-cat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: center;
    padding: 1.1rem;
    border: 1px solid rgba(64, 78, 53, 0.18);
    border-radius: 20px;
    background: rgba(248, 242, 216, 0.9);
    box-shadow: 0 16px 34px rgba(28, 37, 26, 0.12);
}

.online-cat-card .forest-button {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
}

.online-cat-symbol,
.online-character-avatar {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(82, 99, 64, 0.14);
    font-size: 2rem;
}

.online-cat-form {
    max-width: 760px;
    margin: 0 auto;
}

.generated-name-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
}

.online-location-page {
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(circle at top, rgba(201, 192, 147, 0.28), transparent 40%),
        linear-gradient(180deg, #1e2f23, #101a14);
}

.online-location-content {
    margin: 1rem auto 0;
}

.online-location-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 0.7fr);
    gap: 1rem;
}

.location-scenery,
.online-character-card {
    border: 1px solid rgba(231, 224, 194, 0.18);
    border-radius: 28px;
    color: #f8f1d7;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.location-scenery {
    display: flex;
    align-items: flex-end;
    min-height: 500px;
    padding: clamp(1.4rem, 5vw, 3rem);
    background:
        linear-gradient(180deg, rgba(17, 30, 20, 0.12), rgba(17, 30, 20, 0.82)),
        radial-gradient(circle at 68% 20%, rgba(244, 210, 112, 0.5), transparent 24%),
        linear-gradient(135deg, #617452, #283f31 58%, #14251c);
}

.location-scenery h1 {
    margin: 0.3rem 0;
    font-size: clamp(2rem, 5vw, 4rem);
}

.location-icon {
    align-self: flex-start;
    margin-right: 1rem;
    font-size: 4rem;
}

.online-character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    background: rgba(32, 46, 35, 0.92);
}

.online-character-card .outline-button {
    margin-top: 0.8rem;
    color: #f8f1d7;
    border-color: rgba(248, 241, 215, 0.5);
}

.location-actions {
    margin-top: 1rem;
}

.location-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.location-action-grid button {
    display: grid;
    gap: 0.2rem;
    min-height: 92px;
    padding: 0.8rem;
    border: 1px solid rgba(70, 86, 57, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    color: inherit;
    font: inherit;
}

.location-action-grid small {
    color: var(--muted, #687263);
}

@media (max-width: 900px) {
    .profile-game-grid,
    .public-profile-game-grid,
    .admin-review-grid,
    .game-mode-grid,
    .online-location-hero {
        grid-template-columns: 1fr;
    }

    .location-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .location-scenery {
        min-height: 390px;
    }
}

@media (max-width: 560px) {
    .generated-name-row,
    .location-action-grid {
        grid-template-columns: 1fr;
    }

    .admin-report-heading,
    .public-profile-footer-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ========================================================================== 
   ClanGenRU v7: соцсети, модераторы, сообщество и игровые привилегии
   ========================================================================== */

.social-editor-row,
.online-select-row,
.role-label-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.moderator-badge,
.moderator-mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(54, 92, 122, 0.28);
    border-radius: 999px;
    background: rgba(210, 228, 240, 0.78);
    color: #294e68;
    font-weight: 800;
    line-height: 1;
}

.moderator-badge {
    min-height: 34px;
    padding: 9px 14px;
}

.moderator-mini-badge {
    margin-left: 7px;
    padding: 5px 8px;
    font-size: 0.72rem;
}

.community-tabs {
    margin-bottom: 20px;
}

.compact-title {
    margin: 0 0 12px;
}

.compact-title h3 {
    margin: 0;
}

.community-clan-list {
    display: grid;
    gap: 14px;
}

.community-clan-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 20px;
    border: 1px solid rgba(80, 91, 65, 0.18);
    border-radius: 18px;
    background: rgba(255, 252, 237, 0.82);
    box-shadow: 0 10px 28px rgba(47, 56, 41, 0.07);
}

.community-clan-card h3,
.community-clan-card p {
    margin-top: 0;
}

.clan-rating-place {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    background: var(--forest, #435c3d);
    color: #fff;
    font-size: 1.12rem;
    font-weight: 900;
}

.static-badge {
    position: static;
    display: inline-flex;
    min-width: 28px;
    height: 28px;
}

.online-cat-card.detailed {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.online-cat-avatar,
.character-summary-avatar,
.online-character-avatar.image {
    overflow: hidden;
    border-radius: 50%;
}

.online-cat-avatar {
    display: grid;
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    place-items: center;
    border: 3px solid rgba(75, 96, 66, 0.18);
    background: rgba(225, 232, 210, 0.72);
    object-fit: cover;
    font-size: 2rem;
}

.online-cat-main h3,
.online-cat-main p {
    margin-top: 0;
}

.online-cat-card-actions,
.character-summary-actions,
.inline-actions,
.clan-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.online-cat-card-actions {
    justify-content: flex-end;
}

.character-page-content,
.admin-clans-content {
    display: grid;
    gap: 20px;
}

.character-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
}

.character-summary-avatar {
    display: grid;
    width: 118px;
    height: 118px;
    place-items: center;
    border: 4px solid rgba(70, 91, 61, 0.2);
    background: rgba(226, 233, 210, 0.75);
    font-size: 3.3rem;
}

.character-summary-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-summary-main h1,
.character-summary-main p {
    margin-top: 0;
}

.character-role-line {
    font-size: 1.06rem;
}

.character-section {
    display: grid;
    gap: 18px;
}

.subtle-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px dashed rgba(70, 91, 61, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.34);
}

.manager-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manager-form #manager-extra-fields,
.manager-form > button,
.manager-form > .mini-message {
    grid-column: 1 / -1;
}

.clan-roster,
.online-appeals-list,
.clan-application-list {
    display: grid;
    gap: 10px;
}

.clan-application-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(87, 95, 69, 0.18);
    border-radius: 16px;
    background: rgba(250, 247, 230, 0.68);
}

.clan-application-card h3,
.clan-application-card p {
    margin-top: 0;
}

.online-character-ban,
.online-blocked-card {
    max-width: none;
}

.online-clan-admin-card details,
.character-section details {
    border-top: 1px solid rgba(80, 91, 65, 0.16);
    padding-top: 12px;
}

.online-clan-admin-card summary,
.character-section summary {
    cursor: pointer;
    font-weight: 800;
}

.role-label-grid {
    margin-top: 14px;
}

.clan-review-row {
    align-items: flex-start;
}

@media (max-width: 900px) {
    .online-cat-card.detailed,
    .character-summary {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .online-cat-card-actions,
    .character-summary-actions {
        justify-content: flex-start;
    }

    .manager-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .social-editor-row,
    .online-select-row,
    .role-label-grid {
        grid-template-columns: 1fr;
    }

    .community-clan-card {
        grid-template-columns: 1fr;
    }

    .online-cat-avatar,
    .character-summary-avatar {
        width: 88px;
        height: 88px;
    }
}

/* ========================================================================== */
/* ClanGenRU v8: достижения, медали, особые статусы и боты                    */
/* ========================================================================== */

.achievement-progress-card {
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
}

.achievement-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.achievement-progress-track {
    height: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(45, 74, 47, 0.09);
}

.achievement-progress-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--moss), var(--gold));
    transition: width 0.45s ease;
}

.achievement-category-section {
    margin-top: 28px;
}

.compact-title {
    margin-bottom: 12px;
}

.achievement-card.unlocked {
    border-color: rgba(118, 139, 74, 0.7);
    background: linear-gradient(145deg, rgba(255, 252, 239, 0.95), rgba(226, 232, 191, 0.85));
    box-shadow: 0 9px 24px rgba(53, 71, 40, 0.12);
}

.achievement-card.unlocked .achievement-icon {
    filter: drop-shadow(0 4px 8px rgba(45, 74, 47, 0.22));
}

.achievement-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.achievement-popup {
    position: fixed;
    z-index: 1000;
    right: 24px;
    bottom: 24px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(430px, calc(100vw - 30px));
    padding: 16px 18px;
    border: 2px solid var(--gold);
    border-radius: 16px;
    color: var(--forest-950);
    background: linear-gradient(145deg, #fff8d8, #eadca8);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
    animation: achievement-pop-in 0.35s ease;
}

.achievement-popup[hidden] {
    display: none;
}

.achievement-popup-icon {
    font-size: 42px;
}

.achievement-popup small,
.achievement-popup strong,
.achievement-popup p {
    display: block;
    margin: 0;
}

.achievement-popup small {
    color: var(--moss);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.achievement-popup strong {
    margin-top: 3px;
    font-size: 18px;
}

.achievement-popup p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.achievement-popup button {
    align-self: start;
    border: 0;
    background: transparent;
    color: var(--forest-800);
    font-size: 22px;
    cursor: pointer;
}

@keyframes achievement-pop-in {
    from { transform: translateY(18px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.profile-honors-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.profile-medals-list,
.public-achievements-list,
.special-merits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.profile-medal {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(149, 119, 48, 0.45);
    border-radius: 999px;
    background: rgba(255, 244, 197, 0.78);
    color: var(--forest-800);
    cursor: help;
}

.profile-medal > span {
    font-size: 20px;
}

.profile-medal::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: 280px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #fff;
    background: var(--forest-950);
    font-size: 12px;
    line-height: 1.4;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    transition: 0.18s ease;
}

.profile-medal:hover::after,
.profile-medal:focus::after {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.special-merit-chip,
.public-achievement-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(117, 148, 93, 0.13);
    color: var(--forest-700);
    font-size: 13px;
}

.public-achievement-chip {
    border: 1px solid rgba(117, 148, 93, 0.3);
}

.golden-profile-name {
    color: #a97800 !important;
    background: linear-gradient(90deg, #795400, #d9a514, #fff1a5, #b77d00);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

.golden-profile-name .profile-title-status,
.golden-profile-name .admin-badge,
.golden-profile-name .blocked-mini-badge {
    -webkit-text-fill-color: initial;
}

.profile-title-status {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 3px 8px;
    border: 1px solid rgba(117, 148, 93, 0.35);
    border-radius: 999px;
    color: var(--forest-700);
    background: rgba(239, 236, 207, 0.9);
    font: 700 11px/1.3 Arial, sans-serif;
    vertical-align: middle;
    -webkit-text-fill-color: currentColor;
}

.bot-badge {
    display: inline-flex;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 999px;
    color: #fff;
    background: #6b5d88;
    font: 800 10px/1.3 Arial, sans-serif;
    vertical-align: middle;
}

.clan-privileges-card[hidden] {
    display: none;
}

.compact-button {
    padding: 7px 9px;
    font-size: 12px;
}

@media (max-width: 760px) {
    .profile-honors-grid {
        grid-template-columns: 1fr;
    }

    .achievement-popup {
        right: 15px;
        bottom: 15px;
    }

    .achievement-progress-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

.herb-gathering-content {
    width: min(1120px, calc(100% - 24px));
    margin: 28px auto 60px;
}

.herb-gathering-window {
    position: relative;
    padding: clamp(18px, 3vw, 34px);
    border: 14px solid #4c5b19;
    border-radius: 14px;
    background: #4c5b19;
    color: #f5f0d6;
    box-shadow: 0 24px 70px #0008;
}

.herb-window-close {
    position: absolute;
    z-index: 2;
    left: -28px;
    top: -34px;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 46% 54% 44% 56%;
    background: #34400f;
    color: #0c0f05;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

.herb-window-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.herb-window-heading label {
    display: grid;
    gap: 6px;
    min-width: min(340px, 70vw);
}

.herb-window-heading select {
    border: 1px solid #b3bf72;
    border-radius: 10px;
    background: #f2f5ce;
    color: #314010;
}

.herb-scene-frame {
    overflow: hidden;
    aspect-ratio: 3 / 2;
    border: 6px solid #3c4914;
    border-radius: 8px;
    background: #172411;
}

.herb-scene-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.herb-gather-button {
    display: block;
    width: min(620px, 82%);
    margin: 18px auto 0;
    padding: 14px 22px;
    border: 0;
    border-radius: 4px;
    background: #dce99b;
    color: #6b3c06;
    font: inherit;
    font-size: clamp(1.15rem, 3vw, 2rem);
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.herb-gather-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.herb-art-size {
    margin: 12px 0 0;
    color: #d9dfbb;
    text-align: center;
    font-size: .82rem;
}

.herb-gathering-dialog {
    width: min(620px, calc(100vw - 24px));
}

.herb-gathering-dialog-inner {
    max-height: min(86vh, 720px);
    overflow-y: auto;
}

.herb-gathering-dialog-inner :is(h2, p) {
    margin-top: 0;
}

.herb-modal-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.herb-modal-heading strong {
    color: var(--muted);
    font-size: .86rem;
    white-space: nowrap;
}

.herb-modal-select {
    display: grid;
    gap: 6px;
    margin: 10px 0 12px;
}

.herb-modal-scene {
    overflow: hidden;
    width: min(100%, 500px);
    margin: 0 auto;
    aspect-ratio: 3 / 2;
    border: 4px solid rgba(65, 84, 43, .5);
    border-radius: 12px;
    background: #172411;
}

.herb-modal-scene img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.herb-modal-gather {
    display: block;
    width: min(100%, 360px);
    margin: 14px auto 0;
}

.medicine-mixing-panel {
    display: grid;
    gap: 8px;
    margin: 12px 0 18px;
    padding: 16px;
    border: 1px solid #d2c590;
    border-radius: 14px;
    background: #e9e2bf;
}

.medicine-mixing-panel :is(h3, p) {
    margin: 0;
}

.medicine-mixing-panel .forest-button {
    justify-self: start;
}

.medicine-ingredient-check {
    display: flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    max-width: 100%;
    margin-top: 5px;
    font-size: .72rem;
}

.process-herb-button {
    background: #9d2530;
}

.privilege-summary-card,
.clan-privileges-v2-page .settings-card {
    margin-bottom: 18px;
}

.privilege-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.privilege-chip-list span {
    padding: 6px 10px;
    border: 1px solid #9ca66d;
    border-radius: 999px;
    background: #e6e9c7;
    color: #34402c;
    font-size: .84rem;
    font-weight: 800;
}

.privilege-roster {
    display: grid;
    gap: 9px;
}

.staff-privilege-roster-card {
    grid-column: 1 / -1;
}

.privilege-roster-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #d8ceb0;
    border-radius: 12px;
    background: #fffaf0;
}

.privilege-roster-row > div {
    display: grid;
    gap: 3px;
}

.privilege-roster-row small,
.privilege-roster-row > span {
    color: #6b705e;
}

.privilege-action-result {
    max-height: 320px;
    overflow: auto;
    padding: 12px;
    border-radius: 10px;
    background: #1e2d24;
    color: #eaf2db;
    font-size: .78rem;
    white-space: pre-wrap;
}

.profile-privilege-actions,
.visible-cat-conditions {
    display: grid;
    gap: 10px;
    margin: 14px 0;
    padding: 14px;
    border: 1px solid #d8ceb0;
    border-radius: 12px;
    background: #fffaf0;
}

.visible-cat-conditions article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    padding: 10px;
    border-radius: 10px;
    background: #efe7cb;
}

.visible-cat-conditions article p {
    grid-column: 1 / -1;
    margin: 0;
    color: #6c5e4b;
    font-style: italic;
}

@media (max-width: 720px) {
    .privilege-roster-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .herb-window-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .herb-window-heading label {
        min-width: 0;
    }

    .herb-gathering-window {
        border-width: 8px;
    }
}

/* ========================================================================== */
/* ClanGenRU v9: пиксельные модели онлайн-персонажей                          */
/* ========================================================================== */

.sprite-avatar,
.online-cat-avatar.sprite-avatar,
.online-character-avatar.sprite-avatar,
.character-summary-avatar.sprite-avatar {
    overflow: visible;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.78), transparent 52%),
        rgba(225, 232, 210, 0.72);
}

.clangen-cat-sprite {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    object-fit: contain;
}

.online-cat-avatar.sprite-avatar {
    padding: 4px;
}

.online-character-avatar.sprite-avatar {
    width: 104px;
    height: 104px;
    padding: 5px;
    border: 3px solid rgba(75, 96, 66, 0.18);
}

.online-character-avatar.sprite-avatar.large {
    width: 126px;
    height: 126px;
}

.character-summary-avatar.sprite-avatar {
    padding: 7px;
}

.cat-appearance-line {
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .online-character-avatar.sprite-avatar.large {
        width: 106px;
        height: 106px;
    }
}

.sprite-credit {
    width: min(920px, calc(100% - 32px));
    margin: 18px auto 28px;
    color: rgba(238, 242, 228, 0.75);
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: center;
}

.sprite-credit a {
    color: inherit;
    text-decoration: underline;
}

body:not(.online-location-page) > .sprite-credit,
.site-shell + .sprite-credit {
    color: var(--muted);
}

/* ========================================================================== 
   ClanGenRU v10: игровое время и сезонные лагеря
   ========================================================================== */

.game-clock-slot {
    display: flex;
    justify-content: flex-end;
    margin: 0 auto 14px;
}

.game-time-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, 520px);
    padding: 12px 16px;
    border: 1px solid rgba(75, 95, 64, 0.22);
    border-radius: 18px;
    background: rgba(247, 241, 216, 0.92);
    color: #34452f;
    box-shadow: 0 12px 28px rgba(24, 38, 25, 0.12);
    backdrop-filter: blur(8px);
}

.online-location-page .game-time-widget {
    border-color: rgba(240, 233, 203, 0.22);
    background: rgba(28, 43, 32, 0.9);
    color: #f6efd8;
}

.game-time-moon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-time-moon span:last-child {
    display: grid;
    gap: 2px;
}

.game-time-moon small,
.game-time-details span:last-child {
    opacity: 0.72;
}

.game-time-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: rgba(91, 111, 76, 0.14);
    font-size: 1.35rem;
}

.game-time-details {
    display: grid;
    gap: 4px;
    text-align: right;
    font-size: 0.9rem;
}

.camp-scenery {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-image:
        linear-gradient(180deg, rgba(16, 25, 18, 0.08), rgba(13, 22, 15, 0.84)),
        var(--camp-background, linear-gradient(135deg, #617452, #283f31 58%, #14251c));
    background-position: center;
    background-size: cover;
    image-rendering: pixelated;
}

.camp-scenery::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, transparent 48%, rgba(8, 15, 10, 0.64)),
        radial-gradient(circle at 50% 35%, transparent 0 48%, rgba(10, 18, 12, 0.2));
    content: "";
    pointer-events: none;
}

.camp-scenery-overlay {
    max-width: 720px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 249, 221, 0.18);
    border-radius: 18px;
    background: rgba(17, 29, 20, 0.66);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.camp-scenery-overlay h1,
.camp-scenery-overlay p {
    position: relative;
    z-index: 1;
}

.camp-meta-line {
    margin-bottom: 0;
    color: rgba(250, 244, 218, 0.76);
    font-size: 0.9rem;
}

.camp-background-error::after {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(130, 48, 38, 0.86);
    color: white;
    content: "Фон временно недоступен";
    font-size: 0.78rem;
}

.moon-age-control {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.moon-age-button {
    display: inline;
    padding: 0;
    border: 0;
    border-bottom: 1px dotted currentColor;
    background: transparent;
    color: inherit;
    cursor: help;
    font: inherit;
    font-weight: 700;
}

.moon-details-popover {
    position: absolute;
    z-index: 50;
    top: calc(100% + 8px);
    left: 50%;
    width: min(290px, 78vw);
    padding: 10px 12px;
    transform: translateX(-50%);
    border: 1px solid rgba(64, 79, 53, 0.2);
    border-radius: 12px;
    background: #f8f2da;
    color: #33422e;
    box-shadow: 0 14px 30px rgba(24, 36, 22, 0.22);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
}

.clan-camp-preview-wrap {
    display: grid;
    gap: 8px;
    overflow: hidden;
    padding: 10px;
    border: 1px solid rgba(72, 91, 61, 0.17);
    border-radius: 16px;
    background: rgba(236, 232, 208, 0.56);
}

.clan-camp-preview-wrap.compact {
    margin-top: 10px;
}

.camp-admin-preview {
    display: block;
    width: 100%;
    aspect-ratio: 345 / 304;
    border-radius: 12px;
    background: rgba(39, 57, 41, 0.12);
    object-fit: cover;
    image-rendering: pixelated;
}

.camp-select-row {
    align-items: end;
}

@media (max-width: 700px) {
    .game-clock-slot {
        justify-content: stretch;
    }

    .game-time-widget {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .game-time-details {
        text-align: left;
    }

    .camp-scenery {
        min-height: 360px;
        padding: 16px;
    }

    .camp-scenery-overlay {
        width: 100%;
    }
}

/* ========================================================================== */
/* ClanMod v11: локации, живой лагерь, профили котов и обновлённые списки    */
/* ========================================================================== */

/* Светлые подчёркнутые ссылки во всех разделах онлайн-игры. */
.online-game-header {
    border-radius: 18px;
    background: rgba(18, 40, 28, 0.94);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.online-game-header a,
.online-page .site-header a,
.online-character-page .site-header a,
.online-cat-profile-page .site-header a,
.online-duty-page .site-header a {
    color: #f4edd4 !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    -webkit-text-fill-color: currentColor;
}

.online-game-header .site-brand,
.online-page .site-header .site-brand,
.online-character-page .site-header .site-brand,
.online-cat-profile-page .site-header .site-brand,
.online-duty-page .site-header .site-brand {
    color: #f7f0d8 !important;
}

.game-time-details small {
    opacity: 0.68;
}

.game-time-details strong {
    font-size: 0.96rem;
}

/* v14.10: погода расположена между луной и сезоном. */
.game-time-weather {
    display: grid;
    min-width: 150px;
    gap: 2px;
    padding: 0 16px;
    border-inline: 1px solid rgba(78, 91, 54, .24);
}

.game-time-weather small,
.game-time-weather span {
    color: #687057;
    font-size: .72rem;
}

.game-time-weather strong {
    color: #33432d;
    font-size: .92rem;
}

.online-location-page .game-time-weather :is(small, strong, span) {
    color: #f6efd8;
}

.world-weather-effect-layer {
    position: absolute;
    inset: 0;
    z-index: 19;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.location-scenery[data-weather-effect="sun"] .world-weather-effect-layer {
    background: radial-gradient(circle at 78% 10%, #fff7a04c, transparent 37%);
}

.location-scenery[data-weather-effect="rain"] .world-weather-effect-layer,
.location-scenery[data-weather-effect="storm"] .world-weather-effect-layer {
    background: transparent;
}

.location-scenery[data-weather-effect="storm"] .world-weather-effect-layer {
    background: linear-gradient(180deg, rgba(17, 28, 39, .17), rgba(31, 42, 49, .06));
}

.world-rain-drop {
    position: absolute;
    top: -12%;
    left: var(--weather-x);
    width: 1px;
    height: var(--weather-length);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(223, 243, 255, .12), rgba(188, 225, 247, .94));
    opacity: var(--weather-opacity);
    animation: world-rain-drop var(--weather-duration) linear infinite;
    animation-delay: var(--weather-delay);
    will-change: transform;
}

.world-snow-flake {
    position: absolute;
    top: -10%;
    left: var(--weather-x);
    width: var(--weather-size);
    height: var(--weather-size);
    background: rgba(255, 255, 255, .97);
    clip-path: polygon(48% 0, 62% 31%, 100% 39%, 70% 59%, 78% 100%, 49% 75%, 23% 100%, 30% 62%, 0 46%, 35% 33%);
    opacity: var(--weather-opacity);
    filter: drop-shadow(0 0 1px rgba(239, 249, 255, .55));
    animation: world-snow-flake var(--weather-duration) linear infinite;
    animation-delay: var(--weather-delay);
    will-change: transform;
}

.world-fog-cloud {
    position: absolute;
    left: -72%;
    top: var(--weather-y);
    width: var(--weather-width);
    height: var(--weather-height);
    border-radius: 999px;
    background:
        radial-gradient(ellipse at 14% 61%, rgba(236, 243, 241, .72) 0 14%, transparent 38%),
        radial-gradient(ellipse at 34% 42%, rgba(229, 239, 237, .82) 0 17%, transparent 43%),
        radial-gradient(ellipse at 57% 58%, rgba(238, 244, 242, .76) 0 18%, transparent 45%),
        radial-gradient(ellipse at 79% 39%, rgba(225, 236, 234, .74) 0 15%, transparent 41%),
        radial-gradient(ellipse at 91% 64%, rgba(236, 243, 241, .62) 0 12%, transparent 36%);
    filter: blur(17px);
    opacity: var(--weather-opacity);
    animation: world-fog-cloud var(--weather-duration) linear infinite;
    animation-delay: var(--weather-delay);
    will-change: transform, opacity;
}

@keyframes world-rain-drop {
    from { transform: translate3d(0, -16vh, 0) rotate(12deg); }
    to { transform: translate3d(-42px, 128vh, 0) rotate(12deg); }
}

@keyframes world-snow-flake {
    0% { transform: translate3d(0, -12vh, 0) rotate(0deg); }
    48% { transform: translate3d(var(--weather-drift), 54vh, 0) rotate(var(--weather-mid-rotation)); }
    100% { transform: translate3d(var(--weather-end-drift), 118vh, 0) rotate(var(--weather-rotation)); }
}

@keyframes world-fog-cloud {
    0% { transform: translate3d(-20%, 0, 0) scale(.92); opacity: 0; }
    9% { opacity: var(--weather-opacity); }
    52% { transform: translate3d(155%, var(--weather-drift-y), 0) scale(1.04); }
    92% { opacity: var(--weather-opacity); }
    100% { transform: translate3d(330%, 0, 0) scale(.95); opacity: 0; }
}

.housecat-bowls-layer {
    position: absolute;
    inset: 0;
    z-index: 23;
    pointer-events: none;
}

.housecat-bowls-token {
    position: absolute;
    left: 3%;
    bottom: 3%;
    width: clamp(100px, 18vw, 168px);
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 7px 7px #0009);
    pointer-events: auto;
}

.housecat-bowls-token:hover,
.housecat-bowls-token:focus-visible {
    transform: translateY(-4px);
    filter: brightness(1.08) drop-shadow(0 9px 8px #000a);
}

.housecat-bowls-token img,
.housecat-bowls-preview {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    image-rendering: pixelated;
}

.housecat-bowls-token span {
    display: inline-block;
    margin-top: -16px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #283e31e8;
    font-weight: 800;
    font-size: .76rem;
}

.housecat-bowls-dialog {
    width: min(560px, calc(100vw - 24px));
    border: 0;
    padding: 0;
    background: transparent;
}

.housecat-bowls-dialog-inner {
    position: relative;
    padding: 28px;
    border: 1px solid #d9d0ad;
    border-radius: 20px;
    background: #f7f0d8;
    color: #263a2d;
}

.housecat-bowls-preview {
    max-width: 300px;
    margin: 8px auto;
}

.housecat-bowls-meter {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #d5ccb0;
}

.housecat-bowls-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9f7b4e, #e0b66e);
}

@media (max-width: 760px) {
    .game-time-weather {
        width: 100%;
        padding: 10px 0;
        border-inline: 0;
        border-block: 1px solid rgba(78, 91, 54, .24);
    }
}

/* Верхняя строка: локация слева, игровое время справа. */
.online-location-topbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 520px);
    gap: 14px;
    align-items: stretch;
}

.online-location-topbar .game-clock-slot {
    width: 100%;
    margin: 0;
}

.online-location-topbar .game-time-widget {
    width: 100%;
    height: 100%;
}

.location-summary-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 12px 16px;
    border: 1px solid rgba(240, 233, 203, 0.22);
    border-radius: 18px;
    background: rgba(28, 43, 32, 0.9);
    color: #f6efd8;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.location-summary-widget > span:last-child {
    display: grid;
    gap: 3px;
}

.location-summary-widget small {
    opacity: 0.72;
}

.location-summary-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 50%;
    background: rgba(239, 231, 196, 0.14);
    font-size: 1.35rem;
}

.v11-location-hero {
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.72fr);
}

.interactive-camp {
    position: relative;
    min-height: clamp(430px, 63vw, 720px);
    cursor: crosshair;
    touch-action: manipulation;
}

.interactive-camp::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(8, 18, 11, 0.24));
}

.camp-cat-layer {
    position: absolute;
    z-index: 3;
    inset: 0;
}

.camp-cat-token {
    position: absolute;
    z-index: 4;
    width: clamp(64px, 7vw, 96px);
    transform: translate(-50%, -50%);
    transition: left 0.42s ease, top 0.42s ease, filter 0.18s ease;
    text-align: center;
}

.camp-cat-token:hover,
.camp-cat-token:focus-within {
    z-index: 8;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.5));
}

.camp-cat-token.is-current::before {
    content: "Вы";
    position: absolute;
    z-index: 2;
    top: -8px;
    right: -4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e8d878;
    color: #213523;
    font: 800 10px/1.3 Arial, sans-serif;
}

.camp-cat-token a {
    display: grid;
    justify-items: center;
    color: #fff7d8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.camp-cat-token canvas {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.38));
}

.camp-cat-token span {
    max-width: 130px;
    padding: 2px 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(18, 31, 22, 0.78);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 800;
}

.camp-cat-token small {
    color: rgba(255, 247, 216, 0.8);
    font-size: 0.62rem;
    text-decoration: none;
}

.camp-move-hint {
    position: absolute;
    z-index: 5;
    right: 14px;
    bottom: 12px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(11, 24, 15, 0.72);
    color: rgba(255, 248, 221, 0.86);
    font-size: 0.72rem;
    pointer-events: none;
}

/* Карточка собственного персонажа справа. */
.v11-character-card {
    align-content: start;
    gap: 12px;
    padding: 20px;
}

.v11-character-card h2 {
    margin: 0;
    line-height: 1.2;
}

.v11-character-card h2 small {
    display: block;
    margin-top: 5px;
    color: rgba(247, 240, 216, 0.74);
    font-size: 0.72rem;
    font-weight: 600;
}

.character-ground-preview,
.public-cat-ground {
    position: relative;
    display: grid;
    min-height: 180px;
    place-items: end center;
    overflow: hidden;
    border: 1px solid rgba(247, 239, 207, 0.2);
    border-radius: 22px;
    background-position: center;
    background-size: cover;
    isolation: isolate;
}

.character-ground-preview::before,
.public-cat-ground::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(180deg, rgba(19, 35, 24, 0.05), rgba(18, 36, 23, 0.56));
}

.character-ground-preview canvas {
    width: 145px;
    height: 145px;
    margin-bottom: 6px;
    image-rendering: pixelated;
    filter: drop-shadow(0 9px 5px rgba(0, 0, 0, 0.35));
}

.cat-thought-line {
    margin: 0;
    padding: 8px 10px;
    border-left: 3px solid rgba(228, 216, 153, 0.62);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    font-style: italic;
}

.character-facts-list,
.cat-profile-facts,
.clan-leadership-list {
    display: grid;
    gap: 7px;
    margin: 0;
}

.character-facts-list > div,
.cat-profile-facts > div,
.clan-leadership-list > div {
    display: grid;
    grid-template-columns: minmax(96px, 0.7fr) minmax(0, 1.3fr);
    gap: 10px;
    align-items: baseline;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(239, 231, 199, 0.15);
}

.character-facts-list dt,
.cat-profile-facts dt,
.clan-leadership-list dt {
    opacity: 0.72;
    font-size: 0.78rem;
}

.character-facts-list dd,
.cat-profile-facts dd,
.clan-leadership-list dd {
    margin: 0;
    font-weight: 750;
}

.character-description-block {
    padding-top: 4px;
    border-top: 1px solid rgba(239, 231, 199, 0.18);
}

.character-description-block h3 {
    margin: 8px 0;
}

.character-description-block p {
    margin: 5px 0;
    font-size: 0.86rem;
}

.character-side-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.character-side-actions a {
    text-align: center;
}

/* Карточки живых котов. */
.online-cat-grid {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.online-cat-card.v11-card {
    display: flex;
    min-height: 365px;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
}

.online-cat-card-top {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.online-cat-card.v11-card .online-cat-avatar {
    width: 94px;
    height: 94px;
}

.online-cat-detail-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(66, 83, 57, 0.12);
}

.online-cat-detail-row > span {
    color: var(--muted);
    font-size: 0.78rem;
}

.online-cat-detail-row strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.online-cat-detail-row small {
    font-weight: 500;
}

.v11-actions {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(190px, 1.3fr);
    width: 100%;
    margin-top: auto;
    padding-top: 18px;
}

.v11-actions a {
    display: grid;
    min-height: 46px;
    place-items: center;
    text-align: center;
}

/* Информация о племени. */
.centered-clan-name {
    margin-top: 0;
    text-align: center;
}

.clan-place-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.clan-place-grid p {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    background: rgba(83, 102, 70, 0.08);
}

.clan-leadership-list {
    padding: 14px;
    border-radius: 14px;
    background: rgba(79, 99, 67, 0.08);
}

.clan-leadership-list > div {
    border-color: rgba(73, 91, 62, 0.12);
}

.clan-leader-link {
    color: var(--forest-700);
    text-decoration: underline;
}

/* Отдельный профиль кота. */
.online-cat-profile-content {
    max-width: 1050px;
}

.cat-profile-sheet {
    padding: clamp(18px, 4vw, 34px);
    background: linear-gradient(180deg, rgba(221, 211, 176, 0.97), rgba(202, 190, 151, 0.97));
}

.cat-profile-heading {
    text-align: center;
}

.cat-profile-heading h1 {
    margin: 5px 0 22px;
}

.cat-profile-heading h1 small {
    color: #59634f;
    font-size: 0.76rem;
}

.cat-profile-thought {
    margin: 0;
    color: #374532;
    font-style: italic;
}

.cat-profile-body {
    display: grid;
    grid-template-columns: minmax(240px, 0.95fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 26px;
    align-items: center;
}

.public-cat-ground {
    min-height: 300px;
}

.public-cat-ground canvas {
    width: 230px;
    height: 230px;
    margin-bottom: 34px;
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.32));
}

.cat-role-plaque {
    position: absolute;
    bottom: 12px;
    padding: 7px 16px;
    border: 2px solid rgba(46, 55, 35, 0.56);
    border-radius: 7px;
    background: rgba(89, 79, 48, 0.88);
    color: #f4ebcf;
    font-weight: 850;
}

.cat-profile-facts {
    color: #303a2c;
}

.cat-profile-facts > div {
    grid-template-columns: 100px minmax(0, 1fr);
    border-color: rgba(64, 76, 52, 0.18);
}

.cat-profile-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 26px;
    overflow: hidden;
    border: 2px solid rgba(57, 65, 42, 0.66);
    border-radius: 999px;
    background: #6f683e;
}

.cat-profile-tabs button {
    min-height: 44px;
    border: 0;
    border-right: 2px solid rgba(46, 52, 34, 0.58);
    color: #eee5c6;
    background: transparent;
    font-weight: 850;
    cursor: default;
}

.cat-profile-tabs button:last-child {
    border-right: 0;
}

/* Друзья: четыре самостоятельных списка. */
.v11-friends-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

/* Список игроков, близкий к табличному виду, без прыгающих карточек. */
.players-table-shell {
    overflow: hidden;
    border: 1px solid rgba(69, 85, 59, 0.17);
    border-radius: 20px;
    background: rgba(248, 243, 218, 0.78);
}

.players-table-header,
.player-table-row {
    display: grid;
    grid-template-columns: 88px minmax(240px, 1.2fr) minmax(250px, 1fr) minmax(180px, 0.75fr);
    gap: 14px;
    align-items: center;
}

.players-table-header {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(68, 80, 57, 0.2);
    background: rgba(174, 151, 87, 0.25);
    color: #48523f;
    font-size: 0.77rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.player-table-row {
    min-height: 98px;
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid rgba(72, 86, 61, 0.13);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.player-table-row:last-child {
    border-bottom: 0;
}

.player-table-row:hover {
    background: rgba(255, 255, 255, 0.34);
}

.player-presence-cell {
    display: grid;
    gap: 4px;
}

.player-presence-cell span {
    color: var(--muted);
    font-size: 0.78rem;
}

.player-role-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.admin-mini-badge,
.moderator-mini-badge {
    display: inline-flex;
    padding: 3px 8px;
    border: 1px solid rgba(104, 71, 4, 0.35);
    border-radius: 999px;
    color: #4a3505 !important;
    background: #f2d56e;
    font: 800 10px/1.25 Arial, sans-serif;
    -webkit-text-fill-color: currentColor !important;
}

.moderator-mini-badge {
    border-color: rgba(51, 74, 103, 0.32);
    color: #243b54 !important;
    background: #c9def1;
}

.golden-profile-name {
    display: inline-block;
    font-weight: 900;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.72)) drop-shadow(0 0 4px rgba(201, 145, 0, 0.25));
}

.players-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    border-top: 1px solid rgba(72, 86, 61, 0.14);
}

.players-pagination span {
    min-width: 130px;
    color: var(--muted);
    text-align: center;
    font-size: 0.82rem;
}

@media (max-width: 980px) {
    .online-location-topbar,
    .v11-location-hero,
    .cat-profile-body {
        grid-template-columns: 1fr;
    }

    .interactive-camp {
        min-height: 520px;
    }

    .cat-profile-body {
        align-items: stretch;
    }

    .public-cat-ground {
        min-height: 330px;
    }

    .players-table-header {
        display: none;
    }

    .player-table-row {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .player-presence-cell,
    .player-table-row .player-actions {
        grid-column: 2;
    }

    .clan-place-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .online-location-page {
        padding: 7px;
    }

    .online-location-topbar,
    .online-location-hero {
        gap: 8px;
    }

    .online-location-topbar .game-time-widget,
    .location-summary-widget {
        border-radius: 13px;
    }

    .interactive-camp {
        min-height: 390px;
        border-radius: 18px;
    }

    .camp-cat-token {
        width: 66px;
    }

    .camp-move-hint {
        display: none;
    }

    .online-cat-grid,
    .v11-friends-grid {
        grid-template-columns: 1fr;
    }

    .online-cat-card-top {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .online-cat-card.v11-card .online-cat-avatar {
        width: 78px;
        height: 78px;
    }

    .online-cat-detail-row {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .v11-actions,
    .character-side-actions,
    .cat-profile-tabs {
        grid-template-columns: 1fr;
    }

    .cat-profile-tabs {
        border-radius: 16px;
    }

    .cat-profile-tabs button {
        border-right: 0;
        border-bottom: 1px solid rgba(46, 52, 34, 0.58);
    }

    .cat-profile-tabs button:last-child {
        border-bottom: 0;
    }

    .player-table-row {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .player-table-row > *,
    .player-presence-cell,
    .player-table-row .player-actions {
        grid-column: 1;
    }

    .player-id-cell {
        font-size: 0.76rem;
    }
}

.character-ground-preview,
.public-cat-ground {
    background-image:
        linear-gradient(180deg, rgba(16, 25, 18, 0.02), rgba(13, 22, 15, 0.42)),
        var(--camp-background, linear-gradient(135deg, #73805d, #3f5845));
}


/* ========================================================================== */
/* ClanMod v12: лагерь, быстрый список, поиск и исправления интерфейса         */
/* ========================================================================== */

/* Обычные страницы проекта больше не показывают фиолетовые посещённые ссылки. */
.site-header a,
.site-header a:visited {
    color: #f4edd4;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    -webkit-text-fill-color: currentColor;
}

.site-header .site-brand,
.site-header .site-brand:visited {
    color: #fff6d8;
}

.settings-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* Точный поиск игрока: поле не перерисовывает список во время набора. */
.players-direct-search {
    margin-bottom: 14px;
}

.players-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 8px;
}

.players-search-row input,
.players-search-row button {
    min-height: 46px;
}

/* Статус, награды и действия остаются в своих колонках. */
.player-info {
    min-width: 0;
}

.player-name-line {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.player-name-line .player-name-link {
    min-width: 0;
    overflow-wrap: anywhere;
}

.player-name-line .profile-title-status {
    flex: 0 0 auto;
    margin: 0;
}

.player-table-row .player-actions {
    display: flex;
    grid-column: 4;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    justify-self: stretch;
    gap: 7px;
}

.player-table-row .player-state-label {
    max-width: 100%;
    margin: 0;
    white-space: normal;
    text-align: center;
}

.player-table-row .player-state-label.pending {
    color: #67490b;
    background: rgba(235, 209, 127, 0.55);
    border-color: rgba(125, 88, 12, 0.22);
}

.player-role-badges {
    align-items: center;
}

.admin-mini-badge,
.moderator-mini-badge,
.blocked-mini-badge,
.profile-title-status {
    position: static;
    transform: none;
}

/* Мгновенное перемещение: никакой анимации и курсора-прицела. */
.interactive-camp {
    cursor: default;
}

.camp-cat-token {
    transition: filter 0.16s ease;
}

.camp-cat-token.is-current::before,
.camp-move-hint {
    display: none !important;
}

.camp-cat-token > a {
    position: relative;
    isolation: isolate;
}

.camp-cat-ground {
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 24px;
    width: 62%;
    height: 16%;
    min-height: 10px;
    border: 1px solid rgba(225, 226, 190, 0.26);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(237, 231, 184, 0.42), rgba(24, 43, 26, 0.28) 67%, transparent 72%);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.24);
    transform: translateX(-50%);
    pointer-events: none;
}

.camp-cat-token canvas {
    position: relative;
    z-index: 1;
}

.camp-cat-name {
    position: relative;
    z-index: 2;
}

.camp-cat-token.is-sleeping canvas {
    opacity: 0.88;
}

.camp-cat-token.is-sleeping::after {
    content: "Zzz";
    position: absolute;
    z-index: 3;
    top: 4px;
    right: 0;
    color: #f5edc8;
    font: 800 0.67rem/1 Arial, sans-serif;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

/* Чат и действия локации. */
.location-social-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
    gap: 18px;
    margin-bottom: 16px;
    padding: 18px;
}

.location-social-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.location-social-heading h2,
.location-say-card h2 {
    margin: 3px 0 0;
}

.location-chat-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 150px;
    max-height: 290px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid rgba(67, 83, 57, 0.16);
    border-radius: 14px;
    background: rgba(255, 252, 235, 0.58);
}

.location-chat-message {
    padding: 9px 10px;
    border-bottom: 1px dotted rgba(61, 72, 52, 0.28);
}

.location-chat-message:last-child {
    border-bottom: 0;
}

.location-chat-message p {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.location-chat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.location-chat-meta a {
    color: var(--forest-700);
    font-weight: 850;
    text-decoration: underline;
}

.location-chat-meta small,
.location-chat-meta time {
    color: var(--muted);
    font-size: 0.72rem;
}

.location-chat-meta time {
    margin-left: auto;
}

.location-say-card {
    display: grid;
    align-content: start;
    gap: 11px;
    padding: 15px;
    border: 1px solid rgba(67, 83, 57, 0.17);
    border-radius: 15px;
    background: rgba(234, 224, 187, 0.38);
}

.location-say-card label {
    display: grid;
    gap: 6px;
    color: var(--forest-700);
    font-size: 0.8rem;
    font-weight: 750;
}

.location-say-card input,
.location-say-card select {
    width: 100%;
    min-height: 43px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fffdf4;
}

/* Карточки персонажей: обе кнопки закреплены внизу и имеют равную ширину. */
.online-cat-card.v11-card {
    min-width: 0;
}

.online-cat-card-actions.v11-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
}

.online-cat-card-actions.v11-actions a {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    overflow-wrap: anywhere;
}

/* Профиль кота использует фон его лагеря; кнопка сообщения не ломает заголовок. */
.cat-profile-message-button {
    margin: -6px 0 22px;
}

.public-cat-ground {
    background-position: center;
    background-size: cover;
}

.public-cat-ground::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 28px;
    width: 62%;
    height: 19%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(239, 231, 183, 0.34), rgba(20, 33, 22, 0.1) 65%, transparent 72%);
    transform: translateX(-50%);
    pointer-events: none;
}

.public-cat-ground canvas,
.public-cat-ground .cat-role-plaque {
    position: relative;
    z-index: 1;
}

.cat-message-dialog textarea {
    min-height: 170px;
}

/* Верхняя панель остаётся читаемой даже после посещения ссылок. */
.online-game-header a:visited,
.online-game-header a:hover,
.online-game-header a:focus-visible {
    color: #fff6d8 !important;
}

@media (max-width: 980px) {
    .player-table-row .player-actions {
        grid-column: 2;
    }

    .location-social-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .players-search-row {
        grid-template-columns: 1fr;
    }

    .player-table-row .player-actions {
        grid-column: 1;
    }

    .online-cat-card-actions.v11-actions {
        grid-template-columns: 1fr;
    }

    .location-social-panel {
        padding: 11px;
    }

    .location-chat-meta time {
        width: 100%;
        margin-left: 0;
    }
}

/* ========================================================================== */
/* ClanMod v13: большое обновление профилей, чатов и управления                */
/* ========================================================================== */

/* Приветствие показывается только на главной вкладке профиля. */
body:not(.profile-panel-open) .dashboard-header {
    display: none;
}

/* Юридические ссылки и удаление аккаунта — широкие и по центру. */
.settings-legal-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 12px;
}

.settings-legal-links a {
    display: grid;
    min-height: 48px;
    place-items: center;
    padding: 10px 16px;
    border: 1px solid rgba(66, 83, 57, 0.22);
    border-radius: 12px;
    background: rgba(252, 248, 224, 0.62);
    color: var(--forest-700);
    text-align: center;
    font-weight: 800;
}

#delete-account-button {
    display: block;
    min-width: min(100%, 320px);
    margin-inline: auto;
    text-align: center;
}

/* Небольшая площадка ClanGen под котом вместо затемнения всей карточки. */
.profile-platform,
.character-ground-preview {
    --platform-light: rgba(239, 232, 191, 0.88);
    --platform-mid: rgba(113, 116, 75, 0.5);
    --platform-dark: rgba(42, 48, 34, 0.2);
    min-height: 286px;
    border: 0;
    background: transparent !important;
    isolation: isolate;
}

.profile-platform::before,
.character-ground-preview::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 29px;
    width: min(88%, 330px);
    height: 43%;
    inset: auto auto 29px 50%;
    border: 1px solid rgba(69, 72, 48, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 50% 36%, var(--platform-light), var(--platform-mid) 58%, var(--platform-dark) 72%, transparent 74%);
    box-shadow: 0 12px 18px rgba(38, 42, 29, 0.12);
    transform: translateX(-50%);
    pointer-events: none;
}

.profile-platform::after,
.character-ground-preview::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 68px;
    width: min(70%, 260px);
    height: 23%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255,255,238,.44), transparent 70%);
    transform: translateX(-50%);
    pointer-events: none;
}

.profile-platform.platform-forest,
.character-ground-preview.platform-forest {
    --platform-light: rgba(183, 194, 127, 0.96);
    --platform-mid: rgba(91, 119, 68, 0.67);
    --platform-dark: rgba(40, 64, 42, 0.24);
}

.profile-platform.platform-moor,
.character-ground-preview.platform-moor {
    --platform-light: rgba(211, 193, 135, 0.95);
    --platform-mid: rgba(142, 110, 73, 0.62);
    --platform-dark: rgba(68, 55, 40, 0.22);
}

.profile-platform.platform-beach,
.profile-platform.platform-coast,
.character-ground-preview.platform-beach,
.character-ground-preview.platform-coast {
    --platform-light: rgba(235, 219, 164, 0.97);
    --platform-mid: rgba(169, 144, 96, 0.6);
    --platform-dark: rgba(76, 94, 91, 0.18);
}

.profile-platform.platform-swamp,
.character-ground-preview.platform-swamp {
    --platform-light: rgba(159, 184, 132, 0.95);
    --platform-mid: rgba(74, 109, 78, 0.65);
    --platform-dark: rgba(36, 63, 47, 0.24);
}

.profile-platform.platform-mountain,
.character-ground-preview.platform-mountain {
    --platform-light: rgba(211, 214, 206, 0.96);
    --platform-mid: rgba(126, 138, 135, 0.62);
    --platform-dark: rgba(55, 68, 72, 0.2);
}

.profile-platform canvas,
.character-ground-preview canvas,
.profile-platform .cat-role-plaque,
.character-ground-preview .cat-role-plaque {
    position: relative;
    z-index: 2;
}

.public-cat-ground.profile-platform canvas {
    margin-bottom: 42px;
}

.cat-owner-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin: -12px 0 18px;
    color: #59634f;
    font-size: .82rem;
}

.cat-owner-link {
    color: var(--forest-700);
    font-weight: 850;
    text-decoration: underline;
}

/* Вкладки профиля кота стали интерактивными и раскрывают панели. */
.cat-profile-tabs button {
    cursor: pointer;
}

.cat-profile-tabs button.active,
.cat-profile-tabs button:hover,
.cat-profile-tabs button:focus-visible {
    background: rgba(245, 237, 199, 0.18);
    color: #fff7d7;
}

.cat-tab-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(62, 73, 49, 0.24);
    border-radius: 16px;
    background: rgba(255, 251, 225, 0.45);
    color: #303a2c;
}

.relationship-action-grid,
.relationship-requests,
.family-tree-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.relationship-request,
.family-tree-branch,
.family-tree-current {
    padding: 12px;
    border: 1px solid rgba(65, 78, 54, 0.2);
    border-radius: 12px;
    background: rgba(255, 253, 238, 0.68);
}

.family-tree-board {
    display: grid;
    gap: 14px;
}

.family-tree-current {
    justify-self: center;
    min-width: 190px;
    text-align: center;
    font-weight: 850;
}

.family-tree-branch h4 {
    margin: 0 0 8px;
}

/* Чаты компактнее; новые сообщения находятся сверху. */
.location-social-panel {
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, .62fr);
    gap: 12px;
    padding: 14px;
}

.location-chat-list,
.chat-list {
    max-height: 220px;
    min-height: 120px;
    overscroll-behavior: contain;
}

.location-chat-message,
.chat-message {
    scroll-margin-top: 8px;
}

.location-chat-message.is-weather {
    border: 1px dashed rgba(74, 101, 77, .28);
    border-radius: 12px;
    background: rgba(177, 204, 178, .23);
}

.weather-meta {
    color: #4d6a50;
    font-weight: 850;
}

.weather-message-text {
    color: #405943;
    font-weight: 700;
}

.location-say-card {
    padding: 12px;
}

.location-say-card .forest-button {
    min-height: 42px;
}

/* Выровненные племенные/АМС-функции и редактор внешности. */
.character-side-actions,
.character-summary-actions,
.inline-actions {
    align-items: stretch;
    justify-content: center;
}

.character-side-actions a,
.character-summary-actions a,
.character-summary-actions button,
.inline-actions button,
.inline-actions a {
    min-width: 0;
    text-align: center;
}

.appearance-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.appearance-editor-grid label {
    min-width: 0;
}

.manager-form,
.subtle-form {
    max-width: 100%;
    overflow: hidden;
}

/* Новости сайта: хранится не более 10 строк в базе. */
.site-announcements-card {
    margin: 18px 0;
}

.site-announcements-list {
    display: grid;
    gap: 10px;
}

.site-announcement {
    padding: 12px 14px;
    border-left: 4px solid rgba(81, 112, 67, .58);
    border-radius: 10px;
    background: rgba(250, 246, 220, .58);
}

.site-announcement h4 {
    margin: 0 0 5px;
}

.site-announcement p {
    margin: 0;
    white-space: pre-wrap;
}

.site-announcement time {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: .72rem;
}

/* Убираем визуальный рывок и потемнение при телепортации по лагерю. */
.camp-cat-token,
.camp-cat-token canvas,
.camp-cat-token > a {
    transition: none !important;
    animation: none !important;
}

.camp-cat-token:active,
.camp-cat-token:focus,
.camp-cat-token:hover {
    filter: none;
}

.camp-cat-token.is-current .camp-cat-ground {
    border-color: rgba(255, 246, 188, .62);
    box-shadow: 0 0 0 2px rgba(255, 249, 203, .17), 0 5px 8px rgba(0,0,0,.16);
}

@media (max-width: 760px) {
    .settings-legal-links,
    .appearance-editor-grid {
        grid-template-columns: 1fr;
    }

    .location-chat-list,
    .chat-list {
        max-height: 190px;
    }

    .profile-platform,
    .character-ground-preview {
        min-height: 240px;
    }
}

.admin-grid,
.admin-wide-card,
.admin-wide-card > *,
.admin-wide-card label,
.admin-wide-card input,
.admin-wide-card select,
.admin-wide-card textarea {
    min-width: 0;
    max-width: 100%;
}

.admin-wide-card {
    overflow: visible;
}

/* ======================================================================
   ClanGenRU Online — обновление 14
   Пошаговое рождение, настоящий лист платформ, профиль персонажа и игры.
   ====================================================================== */
:root {
    --v14-forest: #254f34;
    --v14-forest-dark: #112f21;
    --v14-parchment: #f4efd9;
    --v14-parchment-2: #e8dfbd;
    --v14-line: rgba(91, 72, 38, .24);
    --v14-danger: #9b3838;
}

/* Официальный лист platforms.png ClanGen. Отображается как sprite sheet 8×6. */
.platform-sheet-platform {
    --platform-x: 0%;
    --platform-y: 80%;
    position: relative;
    background-image: url("assets/clangen-sprites/platforms.png") !important;
    background-repeat: no-repeat !important;
    background-size: 800% 600% !important;
    background-position: var(--platform-x) var(--platform-y) !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}
.platform-sheet-platform.platform-forest { --platform-x: 0%; --platform-y: 80%; }
.platform-sheet-platform.platform-moor { --platform-x: 14.285%; --platform-y: 60%; }
.platform-sheet-platform.platform-mountain { --platform-x: 28.57%; --platform-y: 40%; }
.platform-sheet-platform.platform-coast { --platform-x: 28.57%; --platform-y: 100%; }
.platform-sheet-platform.platform-swamp { --platform-x: 57.14%; --platform-y: 100%; }
.profile-platform.platform-sheet-platform,
.character-ground-preview.platform-sheet-platform,
.clangen-platform.platform-sheet-platform {
    width: min(210px, 100%);
    min-height: 184px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    overflow: visible;
}
.profile-platform.platform-sheet-platform canvas,
.character-ground-preview.platform-sheet-platform canvas,
.clangen-platform.platform-sheet-platform canvas {
    width: 112px;
    height: 112px;
    image-rendering: pixelated;
    transform: translateY(-4px);
    position: relative;
    z-index: 2;
}
.camp-cat-ground.platform-sheet-platform {
    position: absolute !important;
    left: 50%;
    top: 49%;
    width: 92px !important;
    height: 81px !important;
    transform: translate(-50%, -50%);
    opacity: .96;
    pointer-events: none;
    z-index: 0;
}
.camp-cat-token canvas { position: relative; z-index: 2; }

/* Режимы игры в профиле */
.profile-mode-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 0 0 24px;
}
.game-mode-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px 18px;
    align-items: start;
    overflow: hidden;
}
.mode-round-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--v14-forest);
    color: #fff7d0;
    font-size: 28px;
    box-shadow: inset 0 0 0 5px rgba(255,255,255,.08);
}
.mode-play-button { grid-column: 1 / -1; text-align: center; border-radius: 999px; }
.game-mode-card .game-profile-list,
.mode-live-cats { grid-column: 1 / -1; }
.mode-live-cats h3 { margin: 8px 0 10px; }

/* Регистрация персонажа */
.character-wizard { max-width: 980px; margin: 0 auto; }
.wizard-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 20px; }
.wizard-progress span { padding: 10px 6px; border-radius: 14px; text-align: center; background: rgba(255,255,255,.45); color: #6f735f; font-weight: 700; }
.wizard-progress span.active { background: var(--v14-forest); color: white; }
.wizard-step { animation: v14Fade .25s ease; }
@keyframes v14Fade { from { opacity: 0; transform: translateY(8px); } }
.personality-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; max-height: 460px; overflow: auto; padding: 4px; }
.personality-choice, .appearance-choice { cursor: pointer; }
.personality-choice input, .appearance-choice input { accent-color: var(--v14-forest); }
.appearance-choice-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.appearance-choice { display: grid; gap: 8px; justify-items: center; padding: 14px 8px; border: 1px solid var(--v14-line); border-radius: 18px; background: rgba(255,255,255,.42); }
.appearance-choice:has(input:checked) { outline: 3px solid #5d884f; background: rgba(211,229,190,.72); }
.appearance-choice canvas { width: 96px; height: 96px; image-rendering: pixelated; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* Профиль выбранного персонажа */
.character-home-card { display: grid; grid-template-columns: minmax(250px, 34%) 1fr; gap: 30px; align-items: center; }
.character-home-info h1 { margin-block: 6px; font-size: clamp(34px,5vw,58px); }
.character-home-portrait { text-align: center; }
.two-column-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
.kitten-invites-section, .active-games-card { margin-top: 20px; }
.play-invite-list { display: grid; gap: 12px; }
.play-invite-card { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--v14-line); border-radius: 14px; background: rgba(255,255,255,.38); }
.request-sent-square { border-radius: 8px !important; padding: 12px 14px; }
.kitten-play-offer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--v14-line); }
.kitten-play-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.kitten-play-choice { display: grid; gap: 5px; min-height: 90px; border-radius: 12px !important; }
.kitten-play-choice small { white-space: normal; font-weight: 400; }

/* Сцена рождения */
.birth-scene-page { min-height: 100svh; background: #050707; color: #f4ecd4; overflow: hidden; }
.birth-scene { min-height: 100svh; display: grid; place-items: center; position: relative; transition: background 2.4s ease; }
.birth-scene.is-light { background: radial-gradient(circle at center, rgba(244,224,174,.42), rgba(28,38,28,.93) 70%), linear-gradient(#61755e,#182819); }
.birth-heartbeat { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(28px,6vw,64px); letter-spacing: .18em; }
.birth-dialogue-box { width: min(760px, calc(100% - 32px)); min-height: 230px; padding: 28px; border: 5px double #59452d; background: rgba(225,226,211,.94); color: #30342c; box-shadow: 0 16px 50px #0008; }
.birth-speaker { display: flex; gap: 16px; align-items: center; }
.birth-speaker canvas { width: 100px; height: 100px; image-rendering: pixelated; }
.birth-dialogue-text { font-size: clamp(20px,3vw,30px); line-height: 1.5; }

/* Мини-игры */
.kitten-game-page { min-height: 100svh; background: radial-gradient(circle at top,#355f3e,#10241a 68%); }
.kitten-game-shell { max-width: 1280px; }
.kitten-game-header { position: sticky; top: 0; z-index: 30; }
.game-timer { min-width: 92px; text-align: center; padding: 9px 15px; border-radius: 999px; background: #f0e4b4; color: #2e3e2d; font-weight: 900; font-variant-numeric: tabular-nums; }
.kitten-game-title { color: #f7f0d6; text-align: center; margin-bottom: 15px; }
.kitten-game-board { border: 3px solid rgba(238,225,183,.8); border-radius: 26px; overflow: hidden; box-shadow: 0 18px 60px #0008; }
.kitten-game-instructions { display: flex; justify-content: space-between; gap: 20px; padding: 14px 20px; background: rgba(244,239,217,.94); color: #263527; }
.tag-arena, .bug-arena { position: relative; min-height: min(68vh,650px); background-color:#527d43; background-image:linear-gradient(#9dbe7955,#345b3155),var(--camp-background); background-position:center; background-size:cover; overflow: hidden; touch-action: none; }
.tag-player { position: absolute; transform: translate(-50%,-50%); display: grid; justify-items: center; border: 0; background: transparent; color: #fff; text-shadow: 0 2px 4px #000; cursor: grab; z-index: 4; }
.tag-player canvas { width: 120px; height: 120px; image-rendering: pixelated; filter: drop-shadow(0 5px 5px #0007); }
.tag-player.is-tagger::before { content:""; position:absolute; width:118px; height:72px; top:45px; border-radius:50%; background:#e2353566; box-shadow:0 0 24px #f22; z-index:-1; }
.hunt-scorebar { display: grid; grid-template-columns: repeat(2,1fr); background:#f1e9ca; }
.kitten-player-summary { display:flex; gap:12px; align-items:center; padding:12px 18px; }
.kitten-player-summary:last-child { justify-content:flex-end; text-align:right; }
.kitten-player-summary canvas { width:72px;height:72px;image-rendering:pixelated; }
.kitten-player-summary div { display:grid; }
.hunt-bug { position:absolute; transform:translate(-50%,-50%); width:64px;height:64px;border-radius:50%;border:2px solid #fff9;background:#f2e4a8dd;font-size:34px;cursor:pointer;animation:bugBob .8s ease-in-out infinite alternate; }
@keyframes bugBob { to { transform:translate(-50%,-58%) rotate(6deg); } }
.battle-game-board { background:#eee5c9; color:#263527; }
.battle-stage { min-height:420px; padding:30px; display:grid; grid-template-columns:1fr auto 1fr; gap:20px; align-items:center; background:linear-gradient(#7fc1dc 0 45%,#77a950 45% 100%); }
.battle-cat { display:grid; gap:8px; }
.battle-cat-right { text-align:right; justify-items:end; }
.battle-cat canvas { width:180px;height:180px;image-rendering:pixelated;filter:drop-shadow(0 8px 5px #0006); }
.battle-cat-left canvas { transform:scaleX(-1); }
.battle-name { display:flex; justify-content:space-between; gap:15px; width:min(100%,380px); padding:9px 13px; background:#f5f5e8; border:3px solid #425046; }
.fatigue-track { width:min(100%,380px);height:20px;background:#333;border:3px solid #e9eadf; }
.fatigue-track i { display:block;height:100%;background:linear-gradient(90deg,#b03030,#edbd35,#50a947);transition:width .2s; }
.battle-versus { font-size:42px;font-weight:900;color:white;text-shadow:0 3px 8px #000; }
.battle-console { display:grid; grid-template-columns:1.25fr 1fr; gap:16px; padding:18px; }
.battle-log { min-height:220px; padding:16px; border:3px solid #4c534b; background:#f7f7ed; overflow:auto; }
.battle-log p { margin:6px 0; border-top:1px dotted #aaa; padding-top:6px; }
.battle-actions { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.battle-actions button { display:grid; gap:4px; min-height:88px; }
.kitten-game-result { max-width:700px;margin:10vh auto;text-align:center; }
.kitten-game-toast { position:fixed; right:20px; bottom:20px; z-index:100; max-width:440px; padding:14px 18px; background:#f4efd9; box-shadow:0 8px 30px #0007; }

/* Новости проекта */
.project-news-section { margin-top: 24px; }

/* Более аккуратные ссылки Правила/Конфиденциальность/Удалить аккаунт */
.settings-links, .delete-account-card { text-align:center; }
.settings-links a, .delete-account-card button { margin-inline:auto; }

@media (max-width: 820px) {
    .profile-mode-choice, .character-home-card, .battle-console { grid-template-columns:1fr; }
    .appearance-choice-grid { grid-template-columns:repeat(2,1fr); }
    .personality-grid { grid-template-columns:repeat(2,1fr); }
    .kitten-play-choice-grid { grid-template-columns:1fr; }
    .play-invite-card { align-items:stretch; flex-direction:column; }
    .battle-stage { min-height:360px; padding:12px; gap:7px; }
    .battle-cat canvas { width:112px;height:112px; }
    .battle-name { display:grid; font-size:12px; }
    .battle-versus { font-size:24px; }
    .battle-actions { grid-template-columns:1fr 1fr; }
    .kitten-game-header { gap:8px; }
    .kitten-game-header .site-brand { display:none; }
}
@media (max-width: 520px) {
    .personality-grid { grid-template-columns:1fr; }
    .wizard-progress span { font-size:0; }
    .wizard-progress span::first-letter { font-size:14px; }
    .appearance-choice-grid { grid-template-columns:1fr 1fr; }
    .two-column-facts { grid-template-columns:1fr; }
    .tag-player canvas { width:88px;height:88px; }
    .battle-actions { grid-template-columns:1fr; }
}
.location-chat-list { max-height: 310px !important; overflow: auto; }
.compact-location-character { align-self: start; padding: 18px !important; text-align: center; }
.compact-location-character .profile-platform { min-height: 150px; width: 172px; }
.compact-location-character .profile-platform canvas { width: 82px; height: 82px; }
.compact-location-character h2 { margin: 5px 0; }
.compact-location-character p:not(.eyebrow) { margin: 0 0 12px; }
.location-play-notice { margin-bottom: 14px; display:flex; justify-content:space-between; gap:18px; align-items:center; border:2px solid #8ca46b; }
.location-play-notice h3,.location-play-notice p { margin:4px 0; }
@media(max-width:680px){.location-play-notice{align-items:stretch;flex-direction:column;}}

/* Дополнительные классы разметки v14 */
.v14-wizard-shell { margin-top: 26px; }
.wizard-progress { list-style:none; padding:0; }
.choice-chip-grid,
.faction-choice-grid,
.parent-choice-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.choice-chip,
.faction-choice,
.parent-choice { display:block; }
.choice-chip input,
.faction-choice input,
.parent-choice input { position:absolute; opacity:0; pointer-events:none; }
.choice-chip span,
.faction-choice span,
.parent-choice span { display:grid; gap:5px; min-height:70px; padding:13px 14px; border:1px solid var(--v14-line); border-radius:13px; background:rgba(255,255,255,.5); cursor:pointer; }
.choice-chip input:checked + span,
.faction-choice input:checked + span,
.parent-choice input:checked + span { outline:3px solid #567d4b; background:#dfe8c8; }
.generated-name-row { display:grid; grid-template-columns:1fr auto; gap:10px; }
.wizard-question { font-size:clamp(22px,3.5vw,34px); font-weight:800; color:#3b4e36; }
.appearance-preview-platform { width:130px; min-height:105px; display:grid; place-items:center; border-radius:50%; background:radial-gradient(ellipse,#d7e8aa 0 38%,transparent 70%); }

.character-home-page { min-height:100svh; background:radial-gradient(circle at top,#345c3d,#10241a 70%); }
.character-home-shell { max-width:1200px; }
.character-home-header { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:14px; padding:16px 22px; border-radius:0 0 22px 22px; background:#143824; box-shadow:0 8px 30px #0004; }
.character-home-header > :last-child { justify-self:end; }
.round-play-button { width:104px; height:104px; border-radius:50% !important; display:grid !important; place-items:center; font-size:22px; box-shadow:0 0 0 8px rgba(255,255,255,.08); }
.character-home-page .site-content { padding-top:28px; }

.birth-scene.dark { background:#020303; }
.birth-scene.light { background:radial-gradient(circle at 50% 36%,rgba(244,224,174,.55),rgba(30,46,31,.95) 70%),linear-gradient(#6f8767,#172b1c); }
.heartbeat-text { color:#f5ead0; font-size:clamp(28px,6vw,64px); letter-spacing:.15em; text-align:center; padding:25px; }
.birth-dialogue-stage { width:100%; min-height:100svh; display:grid; place-items:end center; padding:6vh 16px; position:relative; }
.birth-dialogue-stage .birth-speaker { position:absolute; left:max(4vw,20px); bottom:210px; display:grid; justify-items:center; }
.birth-dialogue-stage .birth-speaker canvas { width:160px; height:160px; image-rendering:pixelated; filter:drop-shadow(0 9px 8px #0007); }
.birth-dialogue-stage .birth-dialogue-box { width:min(850px,96%); }
.birth-dialogue-box #birth-next { float:right; margin-top:16px; }

@media(max-width:760px){
  .choice-chip-grid,.faction-choice-grid,.parent-choice-grid{grid-template-columns:1fr 1fr;}
  .character-home-header{grid-template-columns:auto 1fr auto;}
  .round-play-button{width:auto;height:auto;border-radius:999px !important;}
  .birth-dialogue-stage .birth-speaker{left:15px;bottom:300px;}
  .birth-dialogue-stage .birth-speaker canvas{width:100px;height:100px;}
}
@media(max-width:500px){
  .choice-chip-grid,.faction-choice-grid,.parent-choice-grid{grid-template-columns:1fr;}
  .character-home-header{padding:10px;}
  .character-home-header .outline-button{padding:9px 10px;font-size:12px;}
}
.wizard-progress li { padding:10px 6px; border-radius:14px; text-align:center; background:rgba(255,255,255,.45); color:#6f735f; font-weight:700; }
.wizard-progress li.active { background:var(--v14-forest); color:white; }


/* ======================================================================
   ClanGenRU Online v14.2 — исправления списка, профиля, лагеря и возраста
   ====================================================================== */

/* Карточки списка персонажей: модель сверху/слева, информация справа,
   кнопки всегда отдельной строкой внизу. */
.online-cat-card.v14-cat-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    min-height: 390px;
    padding: 18px;
}
.online-cat-card.v14-cat-card .online-cat-card-top {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    width: 100%;
}
.online-cat-card.v14-cat-card .online-cat-avatar {
    width: 96px;
    height: 96px;
    align-self: start;
}
.online-cat-card.v14-cat-card .online-cat-avatar canvas {
    width: 88px;
    height: 88px;
    image-rendering: pixelated;
}
.online-cat-card.v14-cat-card .online-cat-main {
    min-width: 0;
}
.online-cat-card.v14-cat-card .online-cat-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: auto;
    padding-top: 18px;
}
.online-cat-card.v14-cat-card .online-cat-card-actions a {
    display: grid;
    place-items: center;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px;
    overflow-wrap: anywhere;
}

/* В живом лагере под перемещающимися котами нет platforms.png и травы. */
.online-location-page .camp-cat-ground,
.online-location-page .camp-cat-token .platform-sheet-platform {
    display: none !important;
}
.location-character-sprite {
    display: grid;
    place-items: center;
    min-height: 128px;
    margin: 6px auto;
    background: transparent;
}
.location-character-sprite canvas {
    width: 112px;
    height: 112px;
    image-rendering: pixelated;
    filter: drop-shadow(0 7px 5px rgba(0,0,0,.28));
}
.compact-location-character .location-character-sprite {
    width: 160px;
}

/* Основной профиль персонажа повторяет структуру открываемого профиля. */
.character-home-profile {
    max-width: 1100px;
    margin-inline: auto;
}
.character-home-profile .cat-profile-heading {
    text-align: center;
}
.character-home-profile .cat-profile-heading h1 {
    margin: 0 0 10px;
    font-size: clamp(36px, 5vw, 58px);
}
.character-home-profile-body {
    align-items: center;
}
.character-home-profile .profile-platform {
    min-height: 184px;
}
.character-home-profile .cat-owner-caption {
    margin-top: 0;
}
.cat-role-plaque {
    display: none !important;
}

/* Верх профиля: маленькие боковые кнопки и квадратная кнопка «Играть». */
.character-home-header {
    grid-template-columns: 1fr auto 1fr;
    padding: 12px 18px;
}
.character-home-header .outline-button {
    width: fit-content;
    min-height: 38px;
    padding: 8px 12px;
    font-size: .86rem;
}
.character-home-header #leave-character {
    justify-self: start;
}
.character-home-header > :last-child {
    justify-self: end;
}
.round-play-button {
    width: 142px !important;
    height: 54px !important;
    border-radius: 10px !important;
    place-items: center;
    font-size: 1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.2) !important;
}

/* В профиле аккаунта остаются только две круглые зелёные кнопки режимов. */
.profile-mode-choice.compact-mode-choice {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(20px, 5vw, 52px);
    margin: 8px 0 30px;
}
.round-mode-button {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: 150px;
    color: var(--forest-800);
    text-align: center;
    text-decoration: none;
}
.round-mode-button:visited {
    color: var(--forest-800);
}
.round-mode-icon {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    color: #fff7d0;
    background: var(--forest-700);
    box-shadow: 0 12px 28px rgba(22, 52, 34, .24), inset 0 0 0 6px rgba(255,255,255,.08);
    font-size: 36px;
    transition: transform .16s ease, box-shadow .16s ease;
}
.round-mode-button:hover .round-mode-icon,
.round-mode-button:focus-visible .round-mode-icon {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(22, 52, 34, .3), inset 0 0 0 6px rgba(255,255,255,.12);
}
.round-mode-button strong {
    font-size: .98rem;
}

/* Правила и конфиденциальность выше форм и на всю ширину, как удаление. */
.settings-grid .legal-settings-card {
    grid-column: 1 / -1;
    text-align: center;
}
.settings-grid .legal-settings-card .settings-legal-links {
    width: min(100%, 720px);
    margin-inline: auto;
}

@media (max-width: 720px) {
    .online-cat-grid {
        grid-template-columns: 1fr;
    }
    .online-cat-card.v14-cat-card {
        min-height: 0;
    }
    .online-cat-card.v14-cat-card .online-cat-card-top {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 12px;
    }
    .online-cat-card.v14-cat-card .online-cat-avatar {
        width: 82px;
        height: 82px;
    }
    .online-cat-card.v14-cat-card .online-cat-avatar canvas {
        width: 76px;
        height: 76px;
    }
    .online-cat-card.v14-cat-card .online-cat-card-actions {
        grid-template-columns: 1fr;
    }
    .character-home-header {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 10px;
    }
    .round-play-button {
        width: 112px !important;
        height: 46px !important;
        border-radius: 9px !important;
    }
    .character-home-header .outline-button {
        padding: 8px 9px;
        font-size: .74rem;
    }
    .settings-grid .legal-settings-card,
    .settings-grid .danger-zone {
        grid-column: auto;
    }
}

/* ======================================================================
   ClanGenRU Online v14.3 — навигация, профили, племя и привилегии
   ====================================================================== */

/* Кнопки выбора режима отображаются только внутри вкладки «Профиль». */
.profile-mode-choice.compact-mode-choice {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 24px;
}
.profile-mode-choice .profile-mode-button {
    display: inline-grid;
    place-items: center;
    width: min(220px, 100%);
    min-height: 56px;
    padding: 12px 22px;
    border-radius: 10px;
    color: #fff !important;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
}

/* Список котов: модель сверху, затем информация и одна кнопка «Выбрать». */
.online-cat-card.v14-cat-card {
    min-height: 0;
}
.online-cat-card.v14-cat-card .online-cat-card-top {
    display: flex;
    justify-content: center;
    width: 100%;
}
.online-cat-card.v14-cat-card .online-cat-avatar {
    width: 112px;
    height: 112px;
}
.online-cat-card.v14-cat-card .online-cat-avatar canvas {
    width: 104px;
    height: 104px;
}
.online-cat-card.v14-cat-card .online-cat-main {
    width: 100%;
    margin-top: 14px;
}
.online-cat-card.v14-cat-card .online-cat-card-actions {
    grid-template-columns: 1fr;
    padding-top: 14px;
}

/* В живой локации больше нет отдельного блока «Ваш персонаж». */
.online-location-hero.location-without-character-card {
    grid-template-columns: minmax(0, 1fr);
}
.online-location-hero.location-without-character-card .location-scenery {
    width: 100%;
}

/* Ссылки на страницу племени в профилях котов. */
.clan-profile-link {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Вкладки собственного персонажа и встроенные племенные полномочия. */
.own-cat-profile-tabs {
    margin-top: 24px;
}
.own-cat-tab-panel {
    min-height: 150px;
}
.character-duty-privileges,
.rogue-clan-applications {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(77, 94, 66, .22);
}
.character-duty-privileges .manager-form,
.rogue-clan-applications .subtle-form {
    margin-top: 0;
}

/* Отдельная страница «О племени»: только персонаж и сведения о племени. */
.clan-page-character-card {
    display: grid;
    grid-template-columns: minmax(190px, 30%) minmax(0, 1fr);
    gap: 26px;
    align-items: center;
}
.clan-page-character-sprite {
    min-height: 190px;
}
.clan-page-character-card h1 {
    margin: 4px 0 10px;
    font-size: clamp(34px, 5vw, 56px);
}
.clan-info-page .character-page-content {
    max-width: 1100px;
}

@media (max-width: 720px) {
    .profile-mode-choice.compact-mode-choice {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .profile-mode-choice .profile-mode-button {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
    }
    .online-cat-card.v14-cat-card .online-cat-avatar {
        width: 100px;
        height: 100px;
    }
    .online-cat-card.v14-cat-card .online-cat-avatar canvas {
        width: 92px;
        height: 92px;
    }
    .clan-page-character-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .profile-mode-choice.compact-mode-choice {
        grid-template-columns: 1fr;
    }
    .online-game-header nav {
        gap: 10px;
    }
    .online-game-header nav a {
        font-size: .78rem;
    }
}

/* ========================================================================== */
/* ClanGenRU v14.4: уведомления, адаптивная версия и тёмная тема              */
/* ========================================================================== */

.cat-tab-panel[hidden],
[data-tab-content][hidden] {
    display: none !important;
}

.appearance-reroll-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}
.appearance-reroll-counter {
    min-width: 72px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--forest-800);
    background: rgba(255,255,255,.58);
    font-weight: 800;
    text-align: center;
}

.family-tree-names-only {
    display: grid;
    gap: 12px;
}
.family-tree-name-row {
    display: grid;
    grid-template-columns: minmax(120px, .38fr) 1fr;
    gap: 16px;
    align-items: start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.45);
}
.family-tree-name-row > strong {
    color: var(--forest-800);
}
.family-tree-name-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.family-tree-name-list a {
    color: var(--forest-700);
    font-weight: 750;
}

.character-notification-stack {
    position: fixed;
    z-index: 1100;
    top: 18px;
    right: 18px;
    display: grid;
    width: min(390px, calc(100vw - 28px));
    gap: 10px;
    pointer-events: none;
}
.character-notification-toast {
    position: relative;
    display: grid;
    gap: 8px;
    padding: 18px 48px 18px 18px;
    border: 1px solid rgba(215,173,74,.45);
    border-radius: 16px;
    background: rgba(248,241,220,.97);
    box-shadow: 0 18px 55px rgba(0,0,0,.28);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    animation: notification-enter .2s ease-out;
}
.character-notification-toast.is-closing {
    opacity: 0;
    transform: translateX(18px);
    transition: .16s ease;
}
.character-notification-toast p,
.character-notification-toast strong { margin: 0; }
.character-notification-close {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(35,53,38,.08);
    cursor: pointer;
    font-size: 22px;
}
.character-notification-open { justify-self: start; }
@keyframes notification-enter {
    from { opacity: 0; transform: translateY(-10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.location-report-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    margin-left: auto;
    border: 1px solid rgba(164,65,56,.4);
    border-radius: 50%;
    color: var(--danger);
    background: rgba(164,65,56,.08);
    cursor: pointer;
    font-weight: 900;
}
.location-report-button:hover { color: #fff; background: var(--danger); }
.location-chat-meta { gap: 8px; }

.clan-privileges-warning {
    margin: 0 0 12px;
}

/* Тёмная тема. Сохраняет зелёно-пергаментную стилистику, но убирает яркий фон. */
html[data-site-theme="dark"] {
    --forest-950: #07100a;
    --forest-900: #0d1b12;
    --forest-800: #183321;
    --forest-700: #28563a;
    --forest-600: #3f7550;
    --moss: #79946f;
    --sage: #9cac91;
    --parchment: #252820;
    --parchment-light: #303329;
    --ink: #edf1e6;
    --muted: #b2bbaa;
    --gold: #d5b65d;
    --line: rgba(223,232,211,.17);
    color-scheme: dark;
}
html[data-site-theme="dark"] body {
    color: var(--ink);
    background:
        linear-gradient(rgba(2,7,4,.72), rgba(2,7,4,.88)),
        radial-gradient(circle at top, rgba(84,125,78,.25), transparent 35%),
        linear-gradient(135deg, #183021, #0a140e 55%, #030704);
}
html[data-site-theme="dark"] :is(
    .parchment-card,.settings-card,.character-section,.cat-profile-sheet,
    .online-cat-card,.game-profile-card,.location-social-panel,.location-say-card,
    .modal-dialog,.dialog-form,.site-announcement,.admin-report-row,
    .character-notification-toast,.auth-card,.profile-panel,.message-panel
) {
    color: var(--ink);
    border-color: var(--line);
    background-color: rgba(38,42,33,.96);
    background-image: none;
}
html[data-site-theme="dark"] :is(input,select,textarea) {
    color: var(--ink);
    border-color: rgba(230,237,220,.2);
    background: #181c16;
}
html[data-site-theme="dark"] :is(input,select,textarea)::placeholder { color: #8f998b; }
html[data-site-theme="dark"] :is(.muted,small,dt,.cat-owner-caption,.cat-profile-thought) { color: var(--muted); }
html[data-site-theme="dark"] :is(.online-cat-detail-row,.cat-profile-facts > div,.game-profile-row,.location-chat-message) {
    border-color: var(--line);
}
html[data-site-theme="dark"] :is(.family-tree-name-row,.appearance-reroll-counter,.pending-relation-card) {
    color: var(--ink);
    background: rgba(255,255,255,.04);
}
html[data-site-theme="dark"] a { color: #b9d2ab; }
html[data-site-theme="dark"] .site-header,
html[data-site-theme="dark"] .online-game-header { background: rgba(6,18,11,.95); }
html[data-site-theme="dark"] .cat-profile-tabs button,
html[data-site-theme="dark"] .own-cat-profile-tabs button { color: #f5f1dc; }
html[data-site-theme="dark"] .outline-button,
html[data-site-theme="dark"] .secondary-button { color: var(--ink); border-color: rgba(232,237,224,.26); background: rgba(255,255,255,.04); }
html[data-site-theme="dark"] dialog::backdrop { background: rgba(0,0,0,.7); }

/* Принудительная версия для телефона. Работает и на широком экране для проверки. */
html[data-display-version="phone"] body {
    overflow-x: hidden;
}
html[data-display-version="phone"] :is(
    .dashboard,.dashboard-shell,.dashboard-main,.site-main,.online-page,.online-location-page,
    .online-content,.online-location-content,.character-home-page,.cat-profile-page,
    main,.page-shell
) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
html[data-display-version="phone"] :is(.site-header,.online-game-header) {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
}
html[data-display-version="phone"] :is(.site-header nav,.online-game-header nav) {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
    gap: 8px;
}
html[data-display-version="phone"] :is(.site-header nav a,.online-game-header nav a) {
    overflow-wrap: anywhere;
    text-align: center;
}
html[data-display-version="phone"] :is(
    .admin-review-grid,.admin-grid,.profile-grid,.online-grid,.online-cats-list,
    .cat-profile-body,.location-social-panel,.game-mode-grid,.settings-grid,
    .online-register-layout,.battle-stage,.battle-console
) {
    grid-template-columns: minmax(0,1fr) !important;
}
html[data-display-version="phone"] :is(.parchment-card,.settings-card,.cat-profile-sheet,.character-section) {
    min-width: 0;
    padding: 18px;
    border-radius: 16px;
}
html[data-display-version="phone"] .cat-profile-heading h1 { font-size: clamp(30px,10vw,48px); overflow-wrap: anywhere; }
html[data-display-version="phone"] .cat-profile-body { gap: 18px; }
html[data-display-version="phone"] :is(.cat-profile-tabs,.own-cat-profile-tabs) {
    display: grid;
    grid-template-columns: 1fr !important;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
}
html[data-display-version="phone"] :is(.cat-profile-tabs button,.own-cat-profile-tabs button) {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(18,40,25,.35);
}
html[data-display-version="phone"] .family-tree-name-row { grid-template-columns: 1fr; gap: 7px; }
html[data-display-version="phone"] .appearance-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
html[data-display-version="phone"] .appearance-choice { min-width: 0; padding: 10px; }
html[data-display-version="phone"] .online-cat-card.v14-cat-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100%;
    min-width: 0;
}
html[data-display-version="phone"] .online-cat-card.v14-cat-card .online-cat-card-top {
    display: grid;
    place-items: center;
    width: 100%;
}
html[data-display-version="phone"] .online-cat-card.v14-cat-card .online-cat-main { width: 100%; min-width: 0; }
html[data-display-version="phone"] .online-cat-card.v14-cat-card .online-cat-card-actions {
    display: grid;
    width: 100%;
}
html[data-display-version="phone"] .online-cat-detail-row {
    grid-template-columns: minmax(85px,.42fr) minmax(0,1fr);
}
html[data-display-version="phone"] .online-cat-detail-row strong { overflow-wrap: anywhere; }
html[data-display-version="phone"] :is(.inline-actions,.stack-actions,.clan-review-actions) {
    align-items: stretch;
    flex-direction: column;
}
html[data-display-version="phone"] :is(.inline-actions > *,.stack-actions > *,.clan-review-actions > *) { width: 100%; }
html[data-display-version="phone"] .online-location-topbar { grid-template-columns: 1fr !important; }
html[data-display-version="phone"] .location-social-panel { padding: 12px; }
html[data-display-version="phone"] .location-chat-meta { align-items: flex-start; flex-wrap: wrap; }
html[data-display-version="phone"] .location-chat-meta time { width: 100%; }
html[data-display-version="phone"] .interactive-camp { min-height: 430px; }
html[data-display-version="phone"] .camp-cat-token { transform: translate(-50%,-50%) scale(.86); }
html[data-display-version="phone"] .hunt-scorebar { grid-template-columns: 1fr 1fr; gap: 6px; }
html[data-display-version="phone"] .kitten-player-summary { min-width: 0; padding: 8px; }
html[data-display-version="phone"] .kitten-player-summary canvas { width: 42px; height: 42px; }
html[data-display-version="phone"] .bug-arena,
html[data-display-version="phone"] .tag-arena { min-height: 430px; }
html[data-display-version="phone"] .character-notification-stack { top: 8px; right: 8px; width: calc(100vw - 16px); }
html[data-display-version="phone"] .modal-dialog { width: calc(100vw - 24px); max-width: none; }
html[data-display-version="phone"] table { display: block; max-width: 100%; overflow-x: auto; }

@media (max-width: 780px) {
    html:not([data-display-version="desktop"]) body { overflow-x: hidden; }
    html:not([data-display-version="desktop"]) .appearance-choice-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    html:not([data-display-version="desktop"]) .family-tree-name-row { grid-template-columns: 1fr; }
    html:not([data-display-version="desktop"]) .character-notification-stack { top: 8px; right: 8px; width: calc(100vw - 16px); }
}

/* ========================================================================== 
   ClanGenRU v14.5.1 — цельная тёмная тема и стабильная загрузка привилегий
   ========================================================================== */
html[data-site-theme="dark"] {
    --dark-page: #090e0b;
    --dark-page-soft: #0e1510;
    --dark-surface: #151c17;
    --dark-surface-2: #1c241e;
    --dark-surface-3: #242e26;
    --dark-text: #eef4ea;
    --dark-muted: #aeb9ae;
    --dark-heading: #f3f6ed;
    --dark-accent: #a9c99d;
    --dark-border: rgba(225, 235, 223, 0.16);
    --dark-border-strong: rgba(225, 235, 223, 0.26);
    --dark-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
    --parchment: var(--dark-surface-2);
    --parchment-light: var(--dark-surface-3);
    --ink: var(--dark-text);
    --muted: var(--dark-muted);
    --line: var(--dark-border);
}

html[data-site-theme="dark"],
html[data-site-theme="dark"] body {
    background-color: var(--dark-page);
}

html[data-site-theme="dark"] body,
html[data-site-theme="dark"] :is(.page,.site-page,.online-page,.online-location-page,.cat-profile-page,.admin-clans-page) {
    color: var(--dark-text);
    background:
        radial-gradient(circle at 50% -12%, rgba(77, 119, 79, 0.22), transparent 38%),
        linear-gradient(180deg, var(--dark-page-soft), var(--dark-page));
}

html[data-site-theme="dark"] .dashboard {
    color: var(--dark-text);
    background: var(--dark-surface);
    border-color: var(--dark-border);
    box-shadow: var(--dark-shadow);
}

html[data-site-theme="dark"] .dashboard-content {
    color: var(--dark-text);
    background:
        radial-gradient(circle at top right, rgba(76, 111, 75, 0.11), transparent 34%),
        linear-gradient(180deg, #111812, #0d130f);
}

html[data-site-theme="dark"] .profile-sidebar {
    color: var(--dark-text);
    background:
        linear-gradient(rgba(12, 35, 21, 0.97), rgba(7, 21, 13, 0.99)),
        linear-gradient(135deg, #244a31, #09130d);
    border-right: 1px solid var(--dark-border);
}

html[data-site-theme="dark"] .nav-button:hover,
html[data-site-theme="dark"] .nav-button.active {
    color: #f4faef;
    background: rgba(139, 177, 126, 0.18);
}

html[data-site-theme="dark"] :is(
    .site-content,.online-content,.online-location-content,.game-hub-content,
    .character-page-content,.admin-clans-content,.online-cat-profile-content,
    .character-home-page .site-content
) {
    color: var(--dark-text);
}

html[data-site-theme="dark"] :is(
    .parchment-card,.settings-card,.stat-card,.achievement-card,.player-card,.chat-card,
    .profile-hero,.message-list,.message-panel,.profile-panel,.friends-panel,
    .community-clan-card,.players-table-shell,.game-mode-card,.online-cat-card,
    .online-cats-panel,.online-register-panel,.character-section,.cat-profile-sheet,
    .character-home-card,.character-home-profile,.location-social-panel,.location-say-card,
    .admin-report-row,.admin-wide-card,.site-announcement,.subtle-form,.dialog-form,
    .modal-dialog,.pending-relation-card,.family-tree-name-row,.legal-settings-card,
    .delete-account-card,.profile-mode-choice,.location-play-notice,.blocked-card
) {
    color: var(--dark-text);
    background-color: var(--dark-surface-2);
    background-image: none;
    border-color: var(--dark-border);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

html[data-site-theme="dark"] :is(
    .game-profile-row,.location-action-grid button,.clan-place-grid p,.clan-leadership-list,
    .players-table-header,.player-table-row:hover,.appearance-reroll-counter,
    .online-cat-detail-row,.profile-details > div,.cat-profile-facts > div,
    .character-facts-list > div,.clan-leadership-list > div,.game-profile-row,
    .private-message,.stack-item,.compact-player,.admin-ban-row,.location-chat-message
) {
    color: var(--dark-text);
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] :is(
    .game-profile-row,.location-action-grid button,.clan-place-grid p,.clan-leadership-list,
    .appearance-reroll-counter,.pending-relation-card,.family-tree-name-row
) {
    background: rgba(255, 255, 255, 0.045);
}

html[data-site-theme="dark"] .game-profile-row:hover,
html[data-site-theme="dark"] .player-table-row:hover,
html[data-site-theme="dark"] .location-action-grid button:hover {
    background: rgba(153, 192, 139, 0.1);
}

html[data-site-theme="dark"] .players-table-header {
    color: #dfe9da;
    background: rgba(141, 166, 117, 0.14);
}

html[data-site-theme="dark"] .player-table-row {
    color: var(--dark-text);
    background: transparent;
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] :is(
    h1,h2,h3,h4,h5,h6,
    .dashboard-header h1,.section-title h2,.profile-hero h2,
    .parchment-card h3,.settings-card h3,.stat-card strong,
    .cat-profile-heading h1,.character-home-info h1
) {
    color: var(--dark-heading);
}

html[data-site-theme="dark"] :is(
    p,dd,.profile-details dd,.cat-profile-facts,.cat-profile-facts dd,
    .character-facts-list dd,.clan-leadership-list dd,.online-cat-detail-row strong,
    .game-profile-row strong,.online-cat-main,.character-summary-main
) {
    color: var(--dark-text);
}

html[data-site-theme="dark"] :is(
    .muted,small,dt,.profile-details dt,.cat-profile-facts dt,
    .character-facts-list dt,.clan-leadership-list dt,.online-cat-detail-row > span,
    .player-info span,.game-profile-row small,.cat-profile-heading h1 small,
    .cat-owner-caption,.cat-profile-thought,.game-hub-intro
) {
    color: var(--dark-muted);
}

html[data-site-theme="dark"] .eyebrow,
html[data-site-theme="dark"] :is(.search-field,.settings-card label,.location-say-card label) {
    color: var(--dark-accent);
}

html[data-site-theme="dark"] :is(input,select,textarea,.search-field input,.chat-compose textarea) {
    color: var(--dark-text);
    background: #0f1511;
    border-color: var(--dark-border-strong);
    box-shadow: none;
}

html[data-site-theme="dark"] :is(input,select,textarea):focus {
    border-color: rgba(154, 196, 139, 0.62);
    box-shadow: 0 0 0 3px rgba(116, 164, 103, 0.13);
    outline: none;
}

html[data-site-theme="dark"] select option {
    color: var(--dark-text);
    background: #111813;
}

html[data-site-theme="dark"] :is(input,textarea)::placeholder {
    color: #7f8b80;
}

html[data-site-theme="dark"] :is(.site-header,.online-game-header,.character-home-header) {
    color: #f4f7ef;
    background: rgba(5, 15, 9, 0.97);
    border-color: var(--dark-border);
    box-shadow: 0 9px 28px rgba(0, 0, 0, 0.28);
}

html[data-site-theme="dark"] :is(.site-header a,.online-game-header a,.character-home-header a) {
    color: #e6eee1;
}

html[data-site-theme="dark"] :is(.site-header a:hover,.online-game-header a:hover,.character-home-header a:hover) {
    color: #fff;
}

html[data-site-theme="dark"] .location-chat-list {
    color: var(--dark-text);
    background: #101612;
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] .location-chat-message {
    background: rgba(255, 255, 255, 0.025);
}

html[data-site-theme="dark"] .location-chat-message.is-weather {
    background: rgba(116, 151, 104, 0.09);
}

html[data-site-theme="dark"] .cat-profile-sheet {
    background: linear-gradient(180deg, #202820, #171e18);
}

html[data-site-theme="dark"] .cat-profile-facts,
html[data-site-theme="dark"] .cat-profile-thought {
    color: var(--dark-text);
}

html[data-site-theme="dark"] .cat-profile-tabs,
html[data-site-theme="dark"] .own-cat-profile-tabs {
    border-color: rgba(222, 204, 132, 0.38);
    background: #4b482b;
}

html[data-site-theme="dark"] :is(.cat-profile-tabs button,.own-cat-profile-tabs button) {
    color: #f4edd4;
    border-color: rgba(239, 224, 166, 0.24);
}

html[data-site-theme="dark"] :is(.cat-profile-tabs button.active,.own-cat-profile-tabs button.active) {
    background: rgba(218, 186, 90, 0.16);
}

html[data-site-theme="dark"] :is(.outline-button,.secondary-button,.text-button) {
    color: var(--dark-text);
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--dark-border-strong);
}

html[data-site-theme="dark"] :is(.outline-button,.secondary-button):hover {
    background: rgba(145, 185, 132, 0.12);
}

html[data-site-theme="dark"] :is(.online-badge,.section-counter,.nav-badge) {
    color: #cfe3c6;
    background: rgba(117, 159, 104, 0.14);
    border-color: rgba(153, 190, 141, 0.25);
}

html[data-site-theme="dark"] :is(.subtab-button,.message-tab) {
    color: #dce7d7;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] :is(.subtab-button.active,.message-tab.active) {
    color: #fff;
    background: #315d3f;
}

html[data-site-theme="dark"] :is(dialog,.modal-dialog) {
    color: var(--dark-text);
    background: var(--dark-surface-2);
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] :is(table,thead,tbody,tr,th,td) {
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] th {
    color: #dfe9da;
    background: rgba(143, 171, 128, 0.1);
}

html[data-site-theme="dark"] hr {
    border-color: var(--dark-border);
}

html[data-site-theme="dark"] footer,
html[data-site-theme="dark"] .site-footer {
    color: var(--dark-muted);
    border-color: var(--dark-border);
    background: rgba(6, 12, 8, 0.72);
}

html[data-site-theme="dark"] ::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

html[data-site-theme="dark"] ::-webkit-scrollbar-track {
    background: #0b100d;
}

html[data-site-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #354438;
    border: 2px solid #0b100d;
    border-radius: 999px;
}

html[data-site-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #49604e;
}

.clan-privileges-loading,
.clan-privileges-error-card {
    max-width: 920px;
    width: 100%;
    margin-inline: auto;
}

.loading-line {
    position: relative;
    height: 5px;
    margin-top: 15px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(79, 124, 82, 0.14);
}

.loading-line::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, var(--forest-600), transparent);
    animation: clan-privileges-loading 1.15s linear infinite;
}

@keyframes clan-privileges-loading {
    from { left: -38%; }
    to { left: 104%; }
}

/* ========================================================================== 
   ClanGenRU v14.5.3: точечное исправление тёмной темы
   ========================================================================== */

/* Виджет игрового времени на страницах персонажей раньше сохранял светлый
   пергаментный фон, хотя остальная страница уже была тёмной. */
html[data-site-theme="dark"] .game-time-widget {
    color: var(--dark-text, #eef4ea);
    background:
        radial-gradient(circle at 15% 20%, rgba(116, 164, 103, 0.12), transparent 42%),
        linear-gradient(180deg, #222b24, #171e19);
    border-color: var(--dark-border-strong, rgba(225, 235, 223, 0.26));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

html[data-site-theme="dark"] .game-time-widget :is(small, .game-time-details span:last-child) {
    color: var(--dark-muted, #aeb9ae);
}

html[data-site-theme="dark"] .game-time-widget :is(strong, span) {
    color: inherit;
}

html[data-site-theme="dark"] .game-time-icon {
    color: #dce9d6;
    background: rgba(154, 196, 139, 0.12);
    border: 1px solid rgba(222, 235, 216, 0.1);
}

/* ========================================================================== 
   ClanGenRU v14.5.3: тёмная тема публичного профиля игрока
   ========================================================================== */

/* Страница player.html раньше оставляла светлый пергаментный контейнер и
   светлую карточку поверх тёмной темы. Из-за этого текст становился почти
   невидимым. Затемняем и оболочку страницы, и все внутренние элементы. */
html[data-site-theme="dark"] .public-profile-page {
    color: var(--dark-text, #e8efe5);
    background:
        radial-gradient(circle at 14% 8%, rgba(102, 147, 91, 0.13), transparent 34%),
        linear-gradient(180deg, #151d17, #0d130f);
    border: 1px solid var(--dark-border, rgba(222, 235, 216, 0.13));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

html[data-site-theme="dark"] .public-profile-card {
    color: var(--dark-text, #e8efe5);
    background:
        radial-gradient(circle at top left, rgba(111, 154, 98, 0.08), transparent 38%),
        linear-gradient(180deg, #222a23, #171e19);
    border-color: var(--dark-border-strong, rgba(225, 235, 223, 0.24));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

html[data-site-theme="dark"] :is(
    .public-profile-top,
    .public-profile-section
) {
    border-color: var(--dark-border, rgba(222, 235, 216, 0.13));
}

html[data-site-theme="dark"] .public-profile-card :is(
    h1, h2, h3,
    .profile-description,
    .public-profile-actions strong,
    .game-profile-row strong
) {
    color: var(--dark-heading, #f1f6ee);
}

html[data-site-theme="dark"] .public-profile-card :is(
    .muted,
    .public-profile-meta,
    small
) {
    color: var(--dark-muted, #aeb9ae);
}

html[data-site-theme="dark"] .public-profile-card :is(
    .public-achievement-chip,
    .special-merit-chip,
    .profile-medal,
    .player-state-label
) {
    color: #dfead9;
    background: rgba(143, 181, 130, 0.1);
    border-color: rgba(166, 199, 154, 0.22);
}

html[data-site-theme="dark"] .public-profile-card .profile-title-status {
    color: #dce8d6;
    background: rgba(139, 177, 126, 0.11);
    border-color: rgba(166, 199, 154, 0.24);
}

html[data-site-theme="dark"] .public-profile-card .game-profile-row {
    color: var(--dark-text, #e8efe5);
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--dark-border, rgba(222, 235, 216, 0.13));
}

html[data-site-theme="dark"] .public-profile-card .game-profile-row:hover {
    background: rgba(142, 184, 128, 0.09);
}

html[data-site-theme="dark"] .public-profile-card .player-name-link,
html[data-site-theme="dark"] .public-profile-card a:not(.forest-button):not(.danger-button) {
    color: #b9d6ad;
}

html[data-site-theme="dark"] .public-profile-card .public-profile-avatar.placeholder {
    color: #eef5ea;
    background: linear-gradient(145deg, #31553a, #1b3222);
    border: 1px solid rgba(185, 214, 173, 0.18);
}

html[data-site-theme="dark"] .public-profile-card .status-dot {
    box-shadow: 0 0 0 3px #202820;
}

html[data-site-theme="dark"] .public-profile-footer-actions {
    color: var(--dark-text, #e8efe5);
}

/* ======================================================================
   ClanGenRU Online v14.6 — семья, параметры, FAQ и модерация
   ====================================================================== */

/* Параметры по краям игровой */
.online-location-hero.location-without-character-card.game-with-needs {
    position: relative;
    display: grid;
    grid-template-columns: clamp(34px, 4.2vw, 54px) minmax(0, 1fr) clamp(34px, 4.2vw, 54px);
    align-items: stretch;
    gap: clamp(8px, 1.2vw, 16px);
    isolation: isolate;
    overflow: visible;
}
.game-with-needs .location-scenery {
    grid-column: 2;
    width: 100%;
    min-width: 0;
}
.needs-column {
    position: relative;
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding-block: 18px;
    pointer-events: none;
}
.needs-left { grid-column: 1; }
.needs-right { grid-column: 3; }
.need-meter {
    position: relative;
    width: 34px;
    height: min(34vh, 188px);
    min-height: 126px;
    overflow: hidden;
    border: 3px solid rgba(245, 238, 209, .93);
    border-radius: 12px;
    background: rgba(18, 29, 21, .82);
    box-shadow: 0 8px 20px rgba(0,0,0,.45), inset 0 0 0 2px rgba(0,0,0,.2);
}
.need-fill {
    position: absolute;
    right: 3px;
    bottom: 3px;
    left: 3px;
    height: var(--need-percent, 100%);
    max-height: calc(100% - 6px);
    border-radius: 6px;
    opacity: .9;
}
.need-health .need-fill { background: linear-gradient(0deg,#8e1414,#d63a35); }
.need-fatigue .need-fill { background: linear-gradient(0deg,#b27a10,#f0c537); }
.need-thirst .need-fill { background: linear-gradient(0deg,#25779b,#69c4e7); }
.need-satiety .need-fill { background: linear-gradient(0deg,#2f7c38,#71ba57); }
.need-percent {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%) rotate(-90deg);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    text-shadow: 0 1px 3px #000, 0 0 4px #000;
    white-space: nowrap;
}
.need-icon {
    position: absolute;
    z-index: 3;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff7d5;
    font-size: 15px;
    font-weight: 900;
    text-shadow: 0 1px 4px #000;
}

/* Имена родственников идут одной строкой с запятыми, а не отдельными плитками. */
.family-tree-name-row .family-tree-cats {
    display: block;
    min-width: 0;
    line-height: 1.8;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}
.family-tree-name-row .family-tree-cats a {
    display: inline;
}
.is-blind-view {
    filter: blur(6px) saturate(.7);
    transform: translateZ(0);
}

/* Заявка на удаление */
.online-cat-card.is-pending-deletion,
.character-home-card.is-pending-deletion {
    opacity: .74;
    filter: grayscale(.35);
}
.deletion-badge,
.pending-deletion-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid rgba(129,64,54,.32);
    border-radius: 999px;
    color: #7b2c27;
    background: #f1d8cf;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.online-cat-card button:disabled,
.online-cat-card a[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .55;
}

/* Зафиксированные окрасы */
.character-wizard.is-appearance-locked .wizard-progress li:not(:last-child) {
    opacity: .55;
}
#appearance-lock-note {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #b98d42;
    border-radius: 10px;
    background: #fff1c9;
    color: #674b1a;
}

/* Системные сообщения Почемулап / Защитолап */
.system-message-row {
    border-color: rgba(83,111,72,.42) !important;
    background: linear-gradient(135deg,rgba(232,239,211,.88),rgba(255,249,227,.88)) !important;
}
.system-message-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    color: #fff9da;
    background: #3e6645;
    font-size: 20px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}

/* Исправленная сцена рождения: портрет закреплён слева, текст не заезжает */
.birth-dialogue-stage {
    align-items: end;
    padding: 24px clamp(12px,3vw,36px) clamp(28px,7vh,76px);
}
.birth-dialogue-frame {
    display: grid;
    grid-template-columns: clamp(130px,20vw,220px) minmax(0,850px);
    align-items: end;
    width: min(1120px,100%);
    margin-inline: auto;
}
.birth-speaker-portrait {
    position: relative;
    z-index: 2;
    display: grid;
    align-content: end;
    justify-items: center;
    min-height: 230px;
    margin-right: -18px;
    padding: 10px 8px 18px;
    color: #f9f0cf;
    text-align: center;
    text-shadow: 0 2px 4px #000;
}
.birth-speaker-platform {
    display: grid;
    place-items: end center;
    width: 100%;
    min-height: 180px;
}
.birth-speaker-portrait canvas {
    width: clamp(132px,18vw,205px);
    height: clamp(132px,18vw,205px);
    image-rendering: pixelated;
    filter: drop-shadow(0 10px 7px rgba(0,0,0,.55));
}
.birth-speaker-portrait strong {
    width: 100%;
    padding: 7px 10px;
    border: 3px double #59452d;
    border-radius: 7px;
    color: #2f382d;
    background: rgba(225,226,211,.96);
    text-shadow: none;
}
.birth-dialogue-frame .birth-dialogue-box {
    box-sizing: border-box;
    width: 100%;
    min-height: 210px;
    padding: 28px 30px 22px 42px;
}
.birth-dialogue-frame .birth-dialogue-box p {
    margin: 0;
    color: #30342c;
    font-size: clamp(18px,2.4vw,28px);
    line-height: 1.55;
}

/* FAQ */
.faq-content { max-width: 980px; margin-inline: auto; }
.faq-lead { max-width: 760px; margin: -20px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.faq-question-card,
.faq-history-card { padding: 24px; margin-bottom: 24px; }
.faq-alias-badge {
    padding: 7px 11px;
    border-radius: 999px;
    color: #37503a;
    background: rgba(106,144,86,.18);
    font-size: 12px;
    font-weight: 800;
}
.faq-list { display: grid; gap: 12px; margin: 24px 0; }
.faq-item {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,252,239,.8);
    box-shadow: 0 7px 18px rgba(49,64,43,.08);
}
.faq-item summary {
    padding: 17px 20px;
    color: var(--forest-800);
    font-weight: 850;
    cursor: pointer;
    list-style-position: inside;
}
.faq-item[open] summary { border-bottom: 1px solid var(--line); background: rgba(117,148,93,.1); }
.faq-item p { margin: 0; padding: 18px 22px 22px; line-height: 1.7; }
.faq-history-card { margin-top: 28px; }
#faq-history-list { display: grid; gap: 12px; }
.faq-history-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.38);
}
.faq-history-heading { display: flex; justify-content: space-between; gap: 12px; }
.faq-history-heading span { color: #8b651e; font-size: 12px; font-weight: 900; }
.faq-history-item.answered .faq-history-heading span { color: #35663c; }
.faq-history-item small { color: var(--muted); }
.faq-answer { margin-top: 13px; padding: 13px; border-left: 4px solid #658455; border-radius: 0 9px 9px 0; background: rgba(111,145,83,.12); }
.faq-answer p { margin: 7px 0; white-space: pre-wrap; }

/* Карточки новых разделов АМС */
.admin-wide-card { grid-column: 1 / -1; }
.admin-report-row .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 760px) {
    .online-location-hero.location-without-character-card.game-with-needs { grid-template-columns: 27px minmax(0, 1fr) 27px; gap: 5px; }
    .needs-column { gap: 5px; }
    .need-meter { width: 25px; height: 124px; min-height: 110px; border-width: 2px; border-radius: 9px; }
    .need-percent { font-size: 10px; }
    .need-icon { top: 3px; font-size: 12px; }
    .birth-dialogue-frame { grid-template-columns: 108px minmax(0,1fr); align-items: end; }
    .birth-speaker-portrait { min-height: 150px; margin-right: -10px; padding-bottom: 12px; }
    .birth-speaker-platform { min-height: 112px; }
    .birth-speaker-portrait canvas { width: 112px; height: 112px; }
    .birth-speaker-portrait strong { padding: 5px 6px; font-size: 11px; }
    .birth-dialogue-frame .birth-dialogue-box { min-height: 180px; padding: 22px 18px 18px 28px; }
    .faq-question-card,.faq-history-card { padding: 18px; }
}

@media (max-width: 480px) {
    .online-location-page { padding-inline: 0; }
    .game-with-needs { border-radius: 0; }
    .game-with-needs .location-scenery { border-radius: 0; }
    .online-location-hero.location-without-character-card.game-with-needs { grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 2px; }
    .need-meter { width: 22px; height: 108px; min-height: 96px; }
    .birth-dialogue-stage { padding: 12px 6px 26px; }
    .birth-dialogue-frame { grid-template-columns: 88px minmax(0,1fr); }
    .birth-speaker-portrait { min-height: 130px; margin-right: -8px; }
    .birth-speaker-platform { min-height: 90px; }
    .birth-speaker-portrait canvas { width: 90px; height: 90px; }
    .birth-dialogue-frame .birth-dialogue-box { min-height: 160px; padding: 18px 12px 14px 22px; }
    .birth-dialogue-frame .birth-dialogue-box p { font-size: 16px; }
    .birth-dialogue-box #birth-next { margin-top: 10px; padding: 9px 13px; }
}

/* ======================================================================
   ClanGenRU Online v14.7.2 — восстановление интерфейса, HUD и два вида слепоты
   ====================================================================== */
.online-location-hero.location-without-character-card.game-with-needs {
    grid-template-columns: clamp(30px, 3.5vw, 42px) minmax(0, 1fr) clamp(30px, 3.5vw, 42px);
    gap: clamp(5px, .8vw, 10px);
}
.needs-column {
    gap: 12px;
    padding-block: 12px;
}
.need-meter {
    width: 30px;
    height: min(29vh, 172px);
    min-height: 116px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.need-track {
    position: relative;
    display: block;
    width: 11px;
    flex: 1 1 auto;
    min-height: 76px;
    overflow: hidden;
    border: 2px solid rgba(22, 18, 13, .96);
    border-radius: 999px;
    background: rgba(40, 42, 39, .92);
    box-shadow:
        0 0 0 1px rgba(244, 224, 170, .78),
        0 3px 8px rgba(0, 0, 0, .48),
        inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.need-fill {
    position: absolute;
    right: 1px;
    bottom: 1px;
    left: 1px;
    height: var(--need-percent, 100%);
    max-height: calc(100% - 2px);
    border-radius: 999px;
    opacity: 1;
}
.need-health .need-fill { background: linear-gradient(0deg,#7e090d,#e5393f); }
.need-fatigue .need-fill { background: linear-gradient(0deg,#9d6808,#f0c029); }
.need-thirst .need-fill { background: linear-gradient(0deg,#176080,#4bbbe7); }
.need-satiety .need-fill { background: linear-gradient(0deg,#286331,#65b955); }
.need-percent, .need-meter > .sr-only { display: none !important; }
.need-icon {
    position: static;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: grid;
    place-items: center;
    transform: none;
    border: 2px solid rgba(19, 18, 14, .95);
    border-radius: 50%;
    color: #fff8dd;
    background: #273027;
    box-shadow: 0 0 0 1px rgba(244,224,170,.78), 0 4px 9px rgba(0,0,0,.45);
    font-size: 13px;
    line-height: 1;
    font-family: system-ui, sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,.9);
}
.need-health .need-icon { background: #9d191c; }
.need-fatigue .need-icon { background: #a97712; }
.need-thirst .need-icon { background: #247da0; font-size: 12px; }
.need-satiety .need-icon { background: #47723c; font-size: 12px; }

/* Врождённая слепота: фон недоступен, а силуэты котов видны нечётко. */
.location-scenery.is-congenital-blind-view {
    filter: none !important;
    transform: none;
    background: #000 !important;
    background-image: none !important;
}
.location-scenery.is-congenital-blind-view::before,
.location-scenery.is-congenital-blind-view::after {
    background: transparent !important;
}
.location-scenery.is-congenital-blind-view .camp-cat-token canvas {
    filter: blur(5px) grayscale(.35);
    opacity: .62;
}
.location-scenery.is-congenital-blind-view .camp-cat-token .camp-cat-name {
    opacity: .42;
    filter: blur(.8px);
}

/* Обычная возрастная слепота: фон остаётся, но вся игровая сцена размыта. */
.location-scenery.is-age-blind-view {
    filter: blur(6px) saturate(.75);
    transform: scale(1.012);
    transform-origin: center;
}

.appearance-choice.is-selected {
    outline: 3px solid #5d884f;
    background: rgba(211,229,190,.72);
}
.draft-name-button { margin-top: 8px; }
#draft-name-dialog .dialog-form { width: min(92vw, 480px); }
.loading-inline { color: var(--muted); font-size: .94rem; }

@media (max-width: 760px) {
    .online-location-hero.location-without-character-card.game-with-needs {
        grid-template-columns: 27px minmax(0, 1fr) 27px;
        gap: 4px;
    }
    .needs-column { gap: 8px; padding-block: 8px; }
    .need-meter { width: 25px; height: min(24vh, 138px); min-height: 92px; gap: 5px; }
    .need-track { width: 9px; border-width: 1.5px; }
    .need-icon { width: 23px; height: 23px; flex-basis: 23px; font-size: 11px; }
}

@media (max-width: 480px) {
    .online-location-hero.location-without-character-card.game-with-needs {
        grid-template-columns: 24px minmax(0, 1fr) 24px;
        gap: 2px;
    }
    .need-meter { width: 22px; height: min(22vh, 122px); min-height: 82px; }
    .need-track { width: 8px; }
    .need-icon { width: 21px; height: 21px; flex-basis: 21px; font-size: 10px; }
}

/* ======================================================================
   ClanGenRU Online v14.7.3 — быстрый кабинет, компактный выбор и древо
   ====================================================================== */

/* Родственники: пять имён в строке, затем перенос вниз. Горизонтальная
   прокрутка больше не появляется. */
.family-tree-name-row .family-tree-cats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px 12px;
    min-width: 0;
    line-height: 1.45;
    white-space: normal;
    overflow: visible;
}
.family-tree-name-item {
    min-width: 0;
    overflow-wrap: anywhere;
}
.family-tree-name-item a {
    display: inline;
}

/* Характер выбирается в компактной таблице, а не растягивает всю страницу. */
.personality-picker-box {
    overflow: hidden;
    border: 1px solid var(--v14-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .43);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.personality-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--v14-line);
    background: rgba(81, 111, 72, .1);
}
.personality-picker-heading span {
    color: #67705f;
    font-size: .82rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.personality-picker-heading strong {
    color: var(--v14-forest);
}
.personality-choice-table {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    scrollbar-width: thin;
}
.personality-choice-table .choice-chip span {
    min-height: 52px;
    align-content: center;
    padding: 9px 10px;
    text-align: center;
    font-size: .9rem;
}
.personality-choice-table .choice-chip.is-selected span {
    outline: 3px solid #567d4b;
    background: #dfe8c8;
}

/* Пока каталог загружается, таблица не выглядит как пустая/сломанная. */
.players-loading-row {
    padding: 28px 20px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 900px) {
    .family-tree-name-row .family-tree-cats,
    .personality-choice-table {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .family-tree-name-row .family-tree-cats,
    .personality-choice-table {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .personality-choice-table {
        max-height: 300px;
    }
    .personality-picker-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
html[data-site-theme="dark"] .personality-picker-box {
    background: rgba(255,255,255,.035);
    border-color: rgba(225,235,223,.18);
}
html[data-site-theme="dark"] .personality-picker-heading {
    background: rgba(139,177,126,.09);
    border-color: rgba(225,235,223,.13);
}
html[data-site-theme="dark"] .personality-picker-heading span {
    color: #aeb9ae;
}
html[data-site-theme="dark"] .personality-picker-heading strong {
    color: #c8dfbf;
}

/* ======================================================================
   ClanGenRU Online v14.8 — игры, локации, инвентарь и компактные формы
   ====================================================================== */

/* FAQ: первая строка закрыта в HTML, а поле вопроса занимает всю карточку. */
.faq-question-card,
.faq-question-card .subtle-form,
.faq-question-card .subtle-form label,
.faq-question-card textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.faq-question-card textarea { min-height: 150px; resize: vertical; }

/* Пять родственников в одной строке, затем нормальный перенос вниз. */
.family-tree-name-row .family-tree-cats {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(110px, 1fr)) !important;
    gap: 8px 14px !important;
    width: 100%;
    min-width: 0;
    overflow: visible !important;
    white-space: normal !important;
}
.family-tree-name-row .family-tree-name-item {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Компактная таблица характеров. */
.personality-choice-table {
    display: grid;
    grid-template-columns: repeat(5, minmax(115px, 1fr)) !important;
    max-height: 340px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    align-content: start;
}

/* Быстрый ответ на приглашение прямо в красном уведомлении. */
.character-notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.character-notification-actions button { min-width: 88px; }
.character-notification-status:empty { display: none; }

/* Ожидание обоих игроков и пятисекундный отсчёт. */
.kitten-game-waiting {
    max-width: 760px;
    margin: 24px auto;
    text-align: center;
}
.kitten-waiting-count {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin: 12px auto;
    border: 3px solid rgba(57, 91, 49, .58);
    border-radius: 50%;
    background: rgba(238, 240, 211, .8);
    color: var(--v14-forest, #244e32);
    font-size: 2.6rem;
    font-weight: 900;
}
.kitten-waiting-players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.kitten-waiting-player {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 14px;
    border: 1px solid rgba(70, 85, 58, .28);
    border-radius: 14px;
    opacity: .58;
}
.kitten-waiting-player.is-here {
    opacity: 1;
    border-color: #4f7c47;
    box-shadow: 0 0 0 3px rgba(79, 124, 71, .12);
}
.kitten-waiting-player canvas { image-rendering: pixelated; width: 100px; height: 100px; }
.kitten-waiting-player span { color: var(--muted); }

.hunt-bug img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    image-rendering: pixelated;
    pointer-events: none;
}
.hunt-bug > span { font-size: 29px; line-height: 1; pointer-events: none; }

/* Форма «Сказать или сделать» находится сверху, кнопка инвентаря — под ней. */
.location-social-panel {
    align-items: start;
}
.location-chat-column { grid-column: 1; grid-row: 1 / span 2; }
.location-inventory-launch {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid rgba(61, 78, 52, .2);
    border-radius: 14px;
    background: rgba(255, 252, 229, .42);
}
.location-say-card { grid-column: 2; grid-row: 1; }
.inventory-open-button { width: 100%; text-transform: uppercase; letter-spacing: .04em; }
.inventory-dialog { width: min(760px, calc(100vw - 24px)); }
.inventory-dialog-inner { max-height: min(82vh, 760px); overflow-y: auto; }
.inventory-capacity-text {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(76, 108, 65, .1);
    font-weight: 800;
}
.location-inventory-list { display: grid; gap: 10px; }
.location-inventory-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(61, 78, 52, .2);
    border-radius: 13px;
    background: rgba(255,255,255,.42);
}
.inventory-item-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}
.inventory-item-copy strong,
.inventory-item-copy small {
    overflow-wrap: anywhere;
}
.location-inventory-item small { color: var(--muted); }
.inventory-item-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-start;
}
.inventory-item-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(232, 239, 211, .72);
    font-size: 28px;
}
.inventory-item-icon img { width: 42px; height: 42px; object-fit: contain; image-rendering: pixelated; }
.inventory-item-icon.ground { width: 38px; height: 38px; background: rgba(255,255,255,.7); }
.inventory-item-icon.ground img { width: 32px; height: 32px; }

/* Кнопки переходов и предметы располагаются поверх лагеря. */
.location-scenery { position: relative; }
.location-transition-layer,
.location-item-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.location-transition-layer { z-index: 40; }
.location-item-layer { z-index: 10; }
.camp-cat-layer { z-index: 8; }
.camp-location-transition {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: grid;
    gap: 0;
    min-width: 104px;
    padding: 6px 10px;
    border: 2px solid #9f8a45;
    border-radius: 5px;
    background: linear-gradient(#756529, #53471f);
    color: #f4f0ca;
    box-shadow: 0 3px 0 rgba(37, 31, 15, .65), 0 5px 14px rgba(0,0,0,.28);
    font: inherit;
    font-size: .78rem;
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    pointer-events: auto;
    cursor: pointer;
}
.camp-location-transition:hover,
.camp-location-transition:focus-visible { filter: brightness(1.13); transform: translate(-50%, -52%); }
.camp-location-transition:disabled { cursor: wait; filter: saturate(.72) brightness(.92); }
.camp-location-transition span { pointer-events: none; }
.location-ground-item {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,.45));
}
.location-ground-item:hover { transform: translate(-50%, -56%) scale(1.07); }
.location-ground-item > span:last-child { color: #fff; font-weight: 900; text-shadow: 0 1px 3px #000; }

.simple-play-invite { position: relative; }
.play-invite-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(68, 78, 58, .12);
    font-size: 1.3rem;
    cursor: pointer;
}

/* Редактор локаций в племенных привилегиях. */
.clan-location-manager { margin-top: 22px; }
.location-manager-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.location-editor-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
}
.transition-editor-canvas {
    position: relative;
    min-height: 420px;
    margin: 12px 0 20px;
    overflow: hidden;
    border: 2px solid rgba(66, 82, 55, .35);
    border-radius: 18px;
    background-color: #20372b;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 50px rgba(0,0,0,.24);
}
.transition-editor-token {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 7px 11px;
    border: 2px solid #a18d4d;
    border-radius: 5px;
    background: #665824;
    color: #fffbd8;
    font-weight: 850;
    cursor: grab;
    touch-action: none;
}
.transition-editor-token:active { cursor: grabbing; }
.location-manager-list,
.transition-manager-list { display: grid; gap: 12px; }
.location-manager-card {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(65, 78, 54, .23);
    border-radius: 14px;
    background: rgba(255,255,255,.3);
}
.edit-location-form { display: grid; gap: 9px; }
.transition-manager-card {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) 90px 90px auto auto;
    align-items: end;
    gap: 8px;
    padding: 11px;
    border: 1px solid rgba(65, 78, 54, .22);
    border-radius: 12px;
    background: rgba(255,255,255,.28);
}
.transition-manager-card > div { display: grid; gap: 3px; }
.transition-manager-card .mini-message { grid-column: 1 / -1; }
.location-log-list { display: grid; gap: 7px; margin-top: 12px; }
.location-log-list article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(65, 78, 54, .15);
}
.location-log-list small { grid-column: 1 / -1; color: var(--muted); }

html[data-site-theme="dark"] .location-inventory-launch,
html[data-site-theme="dark"] .location-inventory-item,
html[data-site-theme="dark"] .location-manager-card,
html[data-site-theme="dark"] .transition-manager-card {
    background: rgba(255,255,255,.035);
    border-color: rgba(230,240,225,.15);
}

@media (max-width: 980px) {
    .family-tree-name-row .family-tree-cats,
    .personality-choice-table { grid-template-columns: repeat(3, minmax(105px, 1fr)) !important; }
    .location-manager-grid { grid-template-columns: 1fr; }
    .location-manager-card { grid-template-columns: 1fr; }
    .transition-manager-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .transition-manager-card > div,
    .transition-manager-card .mini-message { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .location-social-panel { grid-template-columns: 1fr; }
    .location-chat-column,
    .location-inventory-launch,
    .location-say-card { grid-column: 1; grid-row: auto; }
    .kitten-waiting-players { grid-template-columns: 1fr; }
    .transition-editor-canvas { min-height: 320px; }
    .location-editor-toolbar { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
    .family-tree-name-row .family-tree-cats,
    .personality-choice-table { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .location-inventory-item { grid-template-columns: 48px minmax(0, 1fr); }
    .inventory-item-actions { grid-column: 1 / -1; justify-content: stretch; }
    .inventory-item-actions button { flex: 1; }
    .herb-modal-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .herb-modal-heading strong { white-space: normal; }
    .camp-location-transition { min-width: 82px; padding: 5px 7px; font-size: .68rem; }
}

/* ========================================================================== */
/* ClanGenRU Online v14.9 — навыки, действия, особые локации и Звёздное племя */
/* ========================================================================== */
.personal-action-buttons,
.location-control-launchers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.location-control-launchers .forest-button { width: 100%; }

.active-location-action {
    margin-top: 12px;
    display: grid;
    gap: 10px;
    padding: 16px;
}
.active-location-action h3,
.active-location-action p { margin: 0; }
.action-progress-track {
    display: block;
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(31, 53, 35, .17);
    border: 1px solid rgba(51, 75, 46, .25);
}
.action-progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #789960, #b4cf85);
    transition: width .35s linear;
}
.location-actions-dialog { width: min(920px, calc(100vw - 24px)); }
.location-actions-dialog-inner { max-height: min(88vh, 820px); overflow: auto; }
.location-action-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.location-action-cards article {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(92, 111, 77, .28);
    border-radius: 18px;
    background: rgba(255, 255, 255, .48);
}
.location-action-cards h3,
.location-action-cards p { margin: 0; }
.location-action-cards button { margin-top: auto; }

.skills-dialog { width: min(820px, calc(100vw - 24px)); }
.skills-dialog-inner { max-height: min(88vh, 820px); overflow: auto; }
.skills-info-button { width: 100%; }
.skills-info-box {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(87, 114, 72, .09);
    border: 1px solid rgba(72, 96, 59, .22);
}
.skills-info-box p { margin: 0 0 10px; }
.skills-accordion-list { display: grid; gap: 12px; }
.skill-details {
    border: 1px solid rgba(78, 99, 65, .25);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, .43);
}
.skill-details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 17px;
    font-weight: 800;
}
.skill-details summary::-webkit-details-marker { display: none; }
.skill-details summary::after { content: "⌄"; margin-left: auto; font-size: 1.2rem; }
.skill-details[open] summary::after { transform: rotate(180deg); }
.skill-details-body { padding: 0 17px 17px; display: grid; gap: 10px; }
.skill-meter-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
}
.skill-meter-row i {
    grid-column: 1 / -1;
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(38, 60, 42, .13);
}
.skill-meter-row i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6a8f59, #aec77d);
}
.location-feature-form { margin-top: 12px; }
.location-feature-form h4 { margin: 0; }

.is-starclan-cat {
    box-shadow: 0 0 24px rgba(94, 179, 255, .34);
    border-color: rgba(93, 174, 238, .55) !important;
}
.starclan-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #e4f7ff;
    background: rgba(21, 70, 118, .82);
    box-shadow: 0 0 18px rgba(90, 193, 255, .55);
    font-weight: 800;
    font-size: .78rem;
}

.death-scene-page {
    min-height: 100vh;
    margin: 0;
    background: #000;
    color: #eef3f7;
    display: grid;
    place-items: center;
}
.death-scene-shell {
    width: min(760px, calc(100vw - 36px));
    text-align: center;
    padding: 40px 0;
}
.death-scene-text {
    display: grid;
    gap: 22px;
    justify-items: center;
    animation: deathTextAppear 2.3s ease both;
}
.death-scene-text h1 { font-size: clamp(2rem, 8vw, 4.4rem); margin: 0; }
.death-scene-text p { max-width: 650px; font-size: clamp(1.05rem, 2.5vw, 1.35rem); line-height: 1.8; margin: 0; }
.death-dots { letter-spacing: .8em; opacity: .6; }
.starclan-button {
    border: 1px solid rgba(167, 220, 255, .72);
    border-radius: 999px;
    padding: 14px 28px;
    color: #eaf9ff;
    background: rgba(46, 117, 171, .28);
    box-shadow: 0 0 28px rgba(86, 186, 255, .42);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}
@keyframes deathTextAppear { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

.starclan-page {
    min-height: 100vh;
    background: #020b19;
    color: #edf8ff;
}
.starclan-header { background: rgba(2, 10, 24, .86); border-bottom-color: rgba(97, 174, 235, .25); }
.starclan-shell { width: min(1040px, calc(100vw - 24px)); margin: 24px auto 60px; }
.starclan-game { display: grid; gap: 18px; }
.starclan-scenery {
    position: relative;
    width: min(100%, 780px);
    aspect-ratio: 345 / 304;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 24px;
    background: #03111f url("assets/starclan/starclan-clearing.png") center / cover no-repeat;
    box-shadow: 0 0 55px rgba(37, 135, 221, .36);
}
.starclan-cat-aura {
    position: absolute;
    left: 50%;
    top: 68%;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: 4px;
    color: #effcff;
    text-shadow: 0 1px 3px #002448, 0 0 10px #66d8ff;
}
.starclan-cat-aura::before {
    content: "";
    position: absolute;
    inset: -45px -55px -28px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(125, 224, 255, .58), rgba(61, 150, 255, .18) 45%, transparent 72%);
    filter: blur(8px);
    animation: starAura 2.6s ease-in-out infinite alternate;
}
.starclan-cat-aura canvas {
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 8px #b9f3ff) drop-shadow(0 0 20px #4cb8ff);
}
@keyframes starAura { to { transform: scale(1.14); opacity: .72; } }
.starclan-controls {
    width: min(780px, 100%);
    margin: 0 auto;
    padding: 18px;
    text-align: center;
    border-radius: 20px;
    background: rgba(6, 25, 49, .86);
    border: 1px solid rgba(101, 185, 238, .28);
}
.dissipate-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #000;
    color: #fff;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 2rem);
    animation: deathTextAppear 1.2s ease both;
}
.dissipate-overlay[hidden] { display: none; }

@media (max-width: 720px) {
    .location-action-cards { grid-template-columns: 1fr; }
    .location-control-launchers { grid-template-columns: 1fr 1fr; }
    .personal-action-buttons { grid-template-columns: 1fr; }
    .starclan-cat-aura canvas { width: 100px; height: 100px; }
}
.starclan-other-cat {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: 2px;
    color: #e8f8ff;
    text-decoration: none;
    font-size: .78rem;
    text-shadow: 0 1px 3px #00182e, 0 0 7px #5cc8ff;
}
.starclan-other-cat canvas {
    width: 82px;
    height: 82px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 6px #b9f3ff) drop-shadow(0 0 13px #4cb8ff);
}
.starclan-cat-aura { text-decoration: none; }

/* ClanGenRU Online v14.9.2 — охота на дичь */
.skill-level-requirement {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) repeat(2, minmax(120px, auto));
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--forest) 30%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--paper) 88%, var(--forest) 12%);
}
.skill-level-requirement span { color: var(--muted); }

.hunt-opportunity-notice {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.hunt-opportunity-notice h3 { margin: 2px 0 5px; }
.hunt-opportunity-notice .play-invite-dismiss { position: absolute; top: 8px; right: 8px; }

.hunting-page {
    min-height: 100svh;
    background: radial-gradient(circle at top, #273d35, #0b1713 72%);
}
.hunting-shell { width: min(1460px, 100%); margin: 0 auto; padding: 18px; }
.hunting-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.hunting-header > :last-child { justify-self: end; }
.hunting-header > strong { color: var(--paper); font-size: clamp(16px, 2vw, 24px); }
.hunting-content { min-height: 70vh; }
.hunting-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    gap: 16px;
    align-items: stretch;
}
.hunting-main-column { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.hunting-wind {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 18px;
    border: 3px solid #85b4ff;
    border-radius: 18px;
    background: rgba(235, 246, 255, .95);
    color: #183453;
    text-align: center;
}
.hunting-wind.is-danger { border-color: #e59167; background: #fff0e8; color: #6d2917; }
.hunting-wind.is-calm { border-color: #b9c8d0; }
.hunting-wind-arrow { color: #4f8ff4; font-size: 50px; line-height: 1; font-weight: 900; }
.hunting-wind div { display: grid; gap: 3px; }
.hunting-wind strong { text-transform: uppercase; letter-spacing: .05em; }
.hunting-wind span { font-size: 14px; }

.hunting-arena {
    position: relative;
    min-height: min(72vh, 760px);
    overflow: hidden;
    border: 5px solid #83da45;
    border-radius: 22px;
    background:
        radial-gradient(circle at 50% 50%, rgba(251,247,221,.92), rgba(213,229,183,.88) 52%, rgba(107,153,87,.9)),
        repeating-linear-gradient(15deg, transparent 0 22px, rgba(47,92,51,.08) 23px 25px);
    box-shadow: inset 0 0 70px rgba(19,58,34,.35), 0 16px 50px rgba(0,0,0,.35);
}
.hunting-prey, .hunting-cat {
    position: absolute;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    text-align: center;
    z-index: 5;
}
.hunting-prey { left: 50%; top: 50%; }
.hunting-prey > span {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(181, 35, 23, .92);
    font-size: 54px;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,.4));
}
.hunting-prey strong, .hunting-cat strong {
    margin-top: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(18, 39, 31, .86);
    color: white;
    font-size: 13px;
    white-space: nowrap;
}
.hunting-cat { transition: left .32s ease, top .32s ease; }
.hunting-cat canvas { width: 90px; height: 90px; image-rendering: pixelated; filter: drop-shadow(0 5px 6px rgba(0,0,0,.42)); }

.hunting-tactics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100svh - 130px);
    overflow-y: auto;
}
.hunting-tactics h2 { margin: 0 0 4px; }
.hunting-tactic {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 14px;
    border: 2px solid color-mix(in srgb, var(--forest) 45%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--paper) 93%, var(--forest) 7%);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}
.hunting-tactic:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.hunting-tactic span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.hunting-tactic:disabled { opacity: .52; cursor: not-allowed; }
.hunting-tactic.forest-button, .hunting-tactic.danger-button { color: white; }
.hunting-tactic.forest-button span, .hunting-tactic.danger-button span { color: rgba(255,255,255,.82); }
.hunting-finished { max-width: 720px; margin: 10vh auto; text-align: center; }

@media (max-width: 850px) {
    .hunting-shell { padding: 8px; }
    .hunting-header { grid-template-columns: 1fr auto; }
    .hunting-header .site-brand { display: none; }
    .hunting-header > strong { justify-self: start; }
    .hunting-layout { grid-template-columns: 1fr; }
    .hunting-arena { min-height: 62svh; }
    .hunting-tactics { max-height: none; }
    .hunt-opportunity-notice { align-items: flex-start; flex-direction: column; }
    .skill-level-requirement { grid-template-columns: 1fr; }
}


/* ========================================================================== */
/* ClanGenRU Online v14.9.2 — завершение действий, навыки и семейное древо */
/* ========================================================================== */
.location-social-panel > .active-location-action,
.location-social-panel > .active-location-action-slot {
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}
.active-location-action.is-complete {
    border-color: rgba(82, 128, 66, .42);
    background: rgba(222, 239, 202, .78);
}
.location-action-toast-stack {
    position: fixed;
    z-index: 1500;
    top: 18px;
    right: 18px;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}
.location-action-toast {
    display: grid;
    gap: 4px;
    padding: 13px 15px;
    border: 1px solid rgba(76, 117, 61, .45);
    border-radius: 14px;
    background: rgba(232, 244, 216, .97);
    color: #263b26;
    box-shadow: 0 12px 32px rgba(20, 35, 20, .22);
}
.location-action-toast span { font-size: .88rem; }
.family-tree-name-row .family-tree-cats {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline;
    gap: 8px 14px !important;
    overflow: visible !important;
    white-space: normal !important;
}
.family-tree-name-row .family-tree-name-item {
    display: inline-flex !important;
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
}
.family-tree-name-row .family-tree-name-item a { white-space: nowrap !important; }
.admin-skill-editor { display: grid; gap: 10px; }
@media (max-width: 760px) {
    .location-action-toast-stack { top: 10px; right: 10px; width: calc(100vw - 20px); }
}


/* v14.9.4 — точные значения параметров и компактное управление локацией */
.need-meter { position: relative; }
.need-meter .need-icon {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.need-value-popover {
    position: absolute;
    z-index: 80;
    left: 50%;
    bottom: -2.15rem;
    transform: translateX(-50%);
    min-width: 4.6rem;
    padding: .35rem .55rem;
    border: 1px solid rgba(236, 222, 172, .8);
    border-radius: .55rem;
    background: rgba(17, 35, 27, .96);
    color: #fff;
    text-align: center;
    font-weight: 800;
    font-size: .82rem;
    white-space: nowrap;
    box-shadow: 0 .35rem 1rem rgba(0,0,0,.35);
}
.need-value-popover::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -.38rem;
    width: .7rem;
    height: .7rem;
    transform: translateX(-50%) rotate(45deg);
    background: rgba(17, 35, 27, .96);
    border-left: 1px solid rgba(236, 222, 172, .8);
    border-top: 1px solid rgba(236, 222, 172, .8);
}
.location-id-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}
.location-id-picker .mini-message { grid-column: 1 / -1; margin: 0; }
.selected-location-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
    min-width: 0;
}
.selected-location-card > * {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.selected-location-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.compact-location-tools { margin-top: 1rem; }
.selected-transition-list { margin-top: 1rem; }
#admin-cat-target-preview { margin-top: -.45rem; }
@media (max-width: 720px) {
    .location-id-picker { grid-template-columns: 1fr; }
    .location-id-picker .mini-message { grid-column: auto; }
}

/* ========================================================================== */
/* ClanGenRU Online v14.9.5 — окно охоты, каталоги, тестеры и Звёздное племя */
/* ========================================================================== */
.hunt-opportunity-dialog {
    width: min(560px, calc(100vw - 24px));
}
.hunt-opportunity-dialog-inner {
    position: relative;
    display: grid;
    gap: 14px;
}
.hunt-opportunity-modal-body h2 { margin: 4px 0 8px; }
.hunt-opportunity-actions { margin-top: 18px; }
.hunt-opportunity-actions > * { flex: 1 1 180px; }

.location-catalog-picker {
    display: grid;
    gap: 10px;
    min-width: 0;
}
.location-catalog-picker > .field-label {
    font-weight: 800;
    color: var(--forest, #294f35);
}
.location-catalog-group {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(70, 91, 56, .22);
    border-radius: 14px;
    background: rgba(255, 255, 255, .34);
}
.location-catalog-group legend {
    padding: 0 7px;
    font-weight: 800;
}
.location-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding: 2px;
}
.location-catalog-choice {
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(65, 89, 54, .18);
    border-radius: 11px;
    background: rgba(247, 244, 224, .72);
    cursor: pointer;
}
.location-catalog-choice:has(input:checked) {
    border-color: rgba(56, 108, 62, .55);
    background: rgba(210, 232, 199, .88);
}
.location-catalog-choice input { flex: 0 0 auto; }
.location-catalog-choice span { display: grid; min-width: 0; }
.location-catalog-choice strong { overflow-wrap: anywhere; }
.location-catalog-choice small { color: var(--muted); font-size: .72rem; }

.starclan-scenery {
    cursor: crosshair;
    touch-action: none;
}
.starclan-cat-token {
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    z-index: 3;
}
.starclan-cat-token.is-own { cursor: grab; }
.starclan-cat-token.is-own.is-dragging { cursor: grabbing; z-index: 8; }
.starclan-cat-token strong { pointer-events: none; }
.starclan-cat-token canvas { pointer-events: none; }

.tester-shell { width: min(1120px, calc(100vw - 24px)); margin: 24px auto 60px; }
.tester-intro { display: grid; gap: 12px; }
.tester-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.tester-cat-summary {
    display: grid;
    gap: 5px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.36);
}
.tester-cat-summary h3,
.tester-cat-summary p { margin: 0; }

@media (max-width: 760px) {
    .location-catalog-grid { grid-template-columns: 1fr; max-height: 230px; }
    .tester-tools-grid { grid-template-columns: 1fr; }
}


/* ClanGenRU Online v14.9.6 — Звёздное племя и охота */
.starclan-scenery { cursor: pointer; }
.starclan-cat-token.is-own { cursor: grab; }

.hunting-wind-arrow {
    min-width: 78px;
    font-size: clamp(72px, 8vw, 118px);
    line-height: .72;
    text-shadow: 0 4px 0 rgba(255,255,255,.78), 0 0 18px rgba(56,132,255,.55);
}
.hunting-wind-edge-arrow {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: clamp(74px, 9vw, 126px);
    height: clamp(74px, 9vw, 126px);
    border-radius: 50%;
    color: #3d8cff;
    background: rgba(235, 246, 255, .9);
    border: 4px solid rgba(80, 149, 255, .88);
    font-size: clamp(62px, 8vw, 108px);
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(23, 70, 130, .25), inset 0 0 18px rgba(255,255,255,.8);
    text-shadow: 0 3px 0 white;
}
.hunting-tactic:disabled,
.hunting-tactic.forest-button:disabled,
.hunting-tactic.danger-button:disabled {
    opacity: 1;
    cursor: not-allowed;
    background: #d9dbd5 !important;
    border-color: #969c93 !important;
    color: #555b54 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.hunting-tactic:disabled strong,
.hunting-tactic:disabled span,
.hunting-tactic.forest-button:disabled span,
.hunting-tactic.danger-button:disabled span {
    color: #626861 !important;
}

/* ClanGenRU Online v14.9.7 — компактный указатель ветра на рамке охоты */
.hunting-main-column,
.hunting-arena {
    overflow: visible;
}
.hunting-wind-arrow {
    display: none;
}
.hunting-wind-edge-arrow {
    position: absolute;
    z-index: 12;
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #4aa9ff;
    font-size: clamp(34px, 4vw, 54px);
    font-weight: 900;
    line-height: .72;
    pointer-events: none;
    text-shadow:
        0 2px 0 rgba(255,255,255,.95),
        0 0 8px rgba(38,111,219,.62),
        0 0 2px #123b69;
}
.hunting-wind-edge-arrow.wind-from-n  { left: 50%; top: 0; transform: translate(-50%, -42%); }
.hunting-wind-edge-arrow.wind-from-ne { right: 0; top: 0; left: auto; transform: translate(32%, -34%); }
.hunting-wind-edge-arrow.wind-from-e  { right: 0; top: 50%; left: auto; transform: translate(38%, -50%); }
.hunting-wind-edge-arrow.wind-from-se { right: 0; bottom: 0; top: auto; left: auto; transform: translate(32%, 34%); }
.hunting-wind-edge-arrow.wind-from-s  { left: 50%; bottom: 0; top: auto; transform: translate(-50%, 42%); }
.hunting-wind-edge-arrow.wind-from-sw { left: 0; bottom: 0; top: auto; transform: translate(-32%, 34%); }
.hunting-wind-edge-arrow.wind-from-w  { left: 0; top: 50%; transform: translate(-38%, -50%); }
.hunting-wind-edge-arrow.wind-from-nw { left: 0; top: 0; transform: translate(-32%, -34%); }

@media (max-width: 760px) {
    .hunting-wind-edge-arrow {
        font-size: 34px;
    }
}

/* ========================================================================== */
/* ClanGenRU Online v14.9.8 — Звёздное племя, каталоги и найденные действия */
/* ========================================================================== */
.starclan-scenery {
    cursor: pointer;
    touch-action: auto;
}
.starclan-cat-token,
.starclan-cat-aura,
.starclan-other-cat {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    justify-items: center;
    text-align: center;
}
.starclan-cat-token canvas,
.starclan-cat-aura canvas,
.starclan-other-cat canvas {
    width: 96px !important;
    height: 96px !important;
    flex: 0 0 96px;
    image-rendering: pixelated;
}
.starclan-cat-token.is-own {
    cursor: default;
    pointer-events: none;
    touch-action: auto;
}
.starclan-cat-token.is-own.is-dragging { cursor: default; }
.starclan-cat-token strong {
    display: block;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.starclan-cat-aura::before {
    inset: -30px -32px -22px;
}

.location-feature-form,
.location-feature-form > *,
.location-catalog-picker,
.location-catalog-group,
.location-catalog-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.location-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: hidden;
    overflow-y: auto;
}
.location-catalog-choice {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal !important;
}
.location-catalog-choice span,
.location-catalog-choice strong {
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}
.location-catalog-empty {
    padding: 12px;
    border: 1px dashed rgba(84, 99, 70, .32);
    border-radius: 12px;
}

.location-discovery-dialog {
    width: min(620px, calc(100vw - 24px));
}
.location-discovery-dialog-inner {
    position: relative;
    display: grid;
    gap: 14px;
}
.location-discovery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.location-discovery-actions button { width: 100%; }

.location-ground-item.is-picking-up {
    pointer-events: none;
    opacity: .7;
}

@media (max-width: 720px) {
    .starclan-cat-token,
    .starclan-cat-aura,
    .starclan-other-cat {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }
    .starclan-cat-token canvas,
    .starclan-cat-aura canvas,
    .starclan-other-cat canvas {
        width: 76px !important;
        height: 76px !important;
        flex-basis: 76px;
    }
    .starclan-cat-token strong { max-width: 88px; }
    .location-catalog-grid,
    .location-discovery-actions { grid-template-columns: 1fr; }
}


/* v14.9.8 — окончательная геометрия каталога и моделей Звёздного племени */
.starclan-cat-token,
.starclan-cat-token.is-own,
.starclan-other-cat {
    display: grid !important;
    grid-template-rows: 96px auto;
    align-items: start;
    justify-content: center;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    transform: translate(-50%, -50%) !important;
    overflow: visible;
}
.starclan-cat-token canvas,
.starclan-cat-token.is-own canvas,
.starclan-other-cat canvas {
    display: block;
    align-self: center;
    justify-self: center;
    max-width: none !important;
    max-height: none !important;
}
.location-catalog-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch !important;
    align-items: stretch !important;
}
.location-catalog-choice {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    width: 100% !important;
    justify-self: stretch !important;
}
.location-catalog-choice span,
.location-catalog-choice strong {
    display: block !important;
    width: 100% !important;
    line-height: 1.35;
}
.location-discovery-actions button strong,
.location-discovery-actions button small {
    display: block;
}
.location-discovery-actions button small {
    margin-top: 4px;
    opacity: .84;
    font-weight: 500;
}
@media (max-width: 720px) {
    .starclan-cat-token,
    .starclan-cat-token.is-own,
    .starclan-other-cat { grid-template-rows: 76px auto; }
}

.starclan-cat-token, .starclan-cat-token * {
    user-select: none;
    -webkit-user-drag: none;
}


/* ======================================================================
   ClanGenRU Online v14.9.10 — сцена рождения и центрирование насекомых
   ====================================================================== */
.birth-speaker-portrait[hidden] {
    display: none !important;
}
.birth-dialogue-frame.without-portrait {
    grid-template-columns: minmax(0, 850px);
    justify-content: center;
}
.birth-dialogue-frame.without-portrait .birth-dialogue-box {
    width: min(850px, 100%);
    padding-inline: clamp(22px, 4vw, 42px);
}
.hunt-bug {
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 0;
}
.hunt-bug img,
.hunt-bug > span {
    grid-area: 1 / 1;
    align-self: center;
    justify-self: center;
    margin: 0;
}
@media (max-width: 760px) {
    .birth-dialogue-frame.without-portrait { grid-template-columns: minmax(0, 1fr); }
}

/* ClanGenRU v14.9.13 — племенная куча с добычей, одиночные жучки и рыбалка. */
.prey-pile-layer{position:absolute;inset:0;z-index:22;pointer-events:none}.camp-prey-pile{position:absolute;transform:translate(-50%,-50%);z-index:2;width:clamp(112px,18vw,190px);padding:0;border:0;background:transparent;color:#fff;pointer-events:auto;cursor:pointer;filter:drop-shadow(0 7px 7px #0008)}.camp-prey-pile:hover,.camp-prey-pile:focus-visible{transform:translate(-50%,-53%);filter:brightness(1.08) drop-shadow(0 9px 8px #0009)}.camp-prey-pile img{display:block;width:100%;aspect-ratio:3/2;object-fit:contain;image-rendering:pixelated}.camp-prey-pile span{display:inline-block;margin-top:-12px;padding:4px 9px;border-radius:999px;background:#283e31e8;font-weight:800;font-size:.76rem;box-shadow:0 2px 8px #0007}.prey-pile-dialog{width:min(880px,calc(100vw - 24px));border:0;border-radius:20px;padding:0;background:transparent}.prey-pile-dialog::backdrop{background:#07110bc4}.prey-pile-dialog-inner{position:relative;max-height:min(88vh,820px);overflow:auto;padding:28px;border:1px solid #d9d0ad;border-radius:20px;background:#f7f0d8;color:#263a2d;box-shadow:0 26px 80px #0009}.prey-pile-dialog .dialog-close,.solo-opportunity-dialog .dialog-close{position:absolute;right:13px;top:10px;z-index:3;border:0;background:transparent;font-size:30px;cursor:pointer}.prey-pile-deposit{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end;margin:20px 0;padding:16px;border-radius:14px;background:#e8e1c7}.prey-pile-deposit label{display:grid;gap:7px}.prey-pile-list{display:grid;gap:10px}.prey-pile-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;border:1px solid #d8ceb0;border-radius:13px;background:#fffaf0}.prey-pile-row div{display:grid;gap:4px}.prey-pile-row small{color:#6d715f}.prey-pile-art-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.prey-pile-art-field{display:grid;gap:7px;padding:10px;border:1px solid #d5ccb0;border-radius:12px;background:#fffaf0}.prey-pile-art-field img{width:100%;aspect-ratio:3/2;object-fit:contain;image-rendering:pixelated;background:#dde5d2;border-radius:8px}.prey-pile-placement-preview{position:relative;min-height:360px;margin-top:16px;border:2px dashed #7d8d54;border-radius:16px;background-color:#718064;background-size:cover;background-position:center;overflow:hidden;cursor:crosshair}.prey-pile-placement-preview>img{position:absolute;width:clamp(110px,20%,180px);aspect-ratio:3/2;object-fit:contain;transform:translate(-50%,-50%);image-rendering:pixelated;filter:drop-shadow(0 6px 5px #0008);pointer-events:none}.prey-pile-placement-preview>span{position:absolute;left:12px;bottom:10px;padding:5px 9px;border-radius:999px;background:#102417d8;color:#fff;font-size:.78rem;pointer-events:none}
.solo-opportunity-dialog{width:min(560px,calc(100vw - 24px));border:0;padding:0;border-radius:18px;background:transparent}.solo-opportunity-dialog::backdrop{background:#07110bbf}.solo-opportunity-inner{position:relative;padding:28px;border-radius:18px;background:#f6efd8;color:#263a2d;box-shadow:0 24px 80px #0009}.solo-opportunity-content h2{padding-right:28px}.solo-bug-page,.fishing-page{min-height:100vh;background:#10281b}.solo-bug-shell,.fishing-shell{width:min(1200px,calc(100% - 24px));margin:auto;padding:18px 0 40px}.solo-bug-header,.fishing-header{margin-bottom:18px}.solo-bug-game,.fishing-game{padding:20px}.solo-bug-title,.fishing-instructions{display:flex;align-items:center;justify-content:space-between;gap:20px}.solo-bug-arena{position:relative;min-height:min(68vh,680px);overflow:hidden;border-radius:18px;background:radial-gradient(circle at 50% 35%,#cbd49d 0 13%,transparent 14%),linear-gradient(135deg,#9fb477,#557548);background-size:cover;background-position:center}.solo-bug-cat{position:absolute;left:50%;bottom:5%;display:grid;justify-items:center;transform:translateX(-50%);pointer-events:none}.solo-bug-cat canvas{width:82px;height:82px;image-rendering:pixelated}.solo-moving-bug{position:absolute;transform:translate(-50%,-50%);width:68px;height:68px;border:2px solid #f4efd5;border-radius:50%;background:#fff8;box-shadow:0 4px 16px #0005;cursor:pointer;transition:left .75s linear,top .75s linear}.solo-moving-bug img{width:48px;height:48px;object-fit:contain;image-rendering:pixelated}.solo-bug-result,.fishing-result{max-width:680px;margin:12vh auto;text-align:center;padding:34px}.fishing-scene{position:relative;overflow:hidden;min-height:min(70vh,700px);border-radius:18px;background:#8db56d}.fishing-bank{position:absolute;z-index:3;left:0;right:0;top:0;height:32%;background:linear-gradient(#abc97f,#668e4d);border-bottom:12px solid #765b37}.fishing-cat{position:absolute;left:15%;bottom:5px;display:grid;justify-items:center}.fishing-cat canvas{width:110px;height:110px;image-rendering:pixelated}.fishing-water{position:absolute;left:0;right:0;bottom:0;height:68%;border:0;background:linear-gradient(#43a8d3,#1974ad);overflow:hidden;cursor:crosshair}.water-glint{position:absolute;width:16%;height:4px;border-radius:99px;background:#dffaff88}.water-glint.one{left:12%;top:20%}.water-glint.two{right:12%;top:45%}.water-glint.three{left:35%;bottom:18%}.fishing-fish{position:absolute;left:-12%;top:45%;display:grid;place-items:center;width:80px;height:52px;font-size:44px;filter:brightness(.35) saturate(1.6);opacity:0;pointer-events:none}.fishing-fish.is-visible{opacity:.86;pointer-events:auto;animation:fish-swim-left 4.4s linear forwards}.fishing-fish.is-visible.from-right{left:auto;right:-12%;transform:scaleX(-1);animation-name:fish-swim-right}@keyframes fish-swim-left{to{left:108%}}@keyframes fish-swim-right{to{right:108%}}
@media(max-width:760px){.prey-pile-art-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.prey-pile-deposit{grid-template-columns:1fr}.prey-pile-row{align-items:flex-start;flex-direction:column}.prey-pile-placement-preview{min-height:260px}.solo-bug-title,.fishing-instructions{align-items:flex-start;flex-direction:column}.camp-prey-pile{width:120px}.fishing-cat canvas{width:80px;height:80px}}

/* ========================================================================== 
   ClanGenRU v14.9.13 — рыбалка, тактики, уведомления и точечные UI-исправления
   ========================================================================== */

/* Собственная модель выглядит как остальные, но не является ссылкой. */
.camp-cat-token > :is(a, .camp-cat-self) {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    color: #fff7d8;
}

.camp-cat-token > .camp-cat-self {
    cursor: default;
    text-decoration: none;
    pointer-events: none;
}

/* Подпись к куче располагается ближе к самой картинке. Наведение больше не
   меняет координату кнопки, поэтому куча и текст не подпрыгивают. */
.camp-prey-pile span {
    margin-top: -30px;
    transform: translateY(-2px);
}

.camp-prey-pile:hover,
.camp-prey-pile:focus-visible,
.camp-prey-pile:active {
    transform: translate(-50%, -50%);
    filter: brightness(1.08) drop-shadow(0 9px 8px #0009);
}

/* Тактики сгруппированы по уровням; закрытые остаются видимыми и объясняют,
   когда откроются, а не исчезают из интерфейса. */
.hunting-tactic-level {
    display: grid;
    gap: 8px;
    margin: 12px 0 16px;
}

.hunting-tactic-level h3 {
    margin: 0;
    color: var(--forest-700, #315d3f);
    font-size: .83rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hunting-tactic.is-locked {
    opacity: .56;
    filter: grayscale(.35);
    cursor: not-allowed;
}

.hunting-tactic:disabled:not(.is-locked) {
    opacity: .68;
    cursor: not-allowed;
}

html[data-site-theme="dark"] .hunting-tactic-level h3 {
    color: #bdd9b5;
}


/* ==========================================================================
   ClanGenRU v14.9.14 — направление рыбы, читаемость тактик и подпись кучи
   ========================================================================== */

/* Стандартный эмодзи рыбы смотрит влево. При движении слева направо его
   отражаем, а при движении справа налево оставляем в обычном направлении. */
.fishing-fish.is-visible {
    transform: scaleX(-1);
    transform-origin: center;
}
.fishing-fish.is-visible.from-right {
    transform: scaleX(1);
}

/* Текст тактик должен оставаться читаемым даже у временно недоступных кнопок. */
.hunting-tactic {
    color: #27382d;
    background: #fffaf0;
    border-color: #c7c2ad;
}
.hunting-tactic strong { color: #27382d; }
.hunting-tactic span { color: #4d5b50; }
.hunting-tactic:disabled,
.hunting-tactic.forest-button:disabled,
.hunting-tactic.danger-button:disabled,
.hunting-tactic.is-locked {
    opacity: 1 !important;
    filter: none !important;
    background: #dfe3da !important;
    border-color: #8f998d !important;
    color: #354238 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.58) !important;
}
.hunting-tactic:disabled strong,
.hunting-tactic:disabled span,
.hunting-tactic.forest-button:disabled strong,
.hunting-tactic.forest-button:disabled span,
.hunting-tactic.danger-button:disabled strong,
.hunting-tactic.danger-button:disabled span,
.hunting-tactic.is-locked strong,
.hunting-tactic.is-locked span {
    color: #455248 !important;
    text-shadow: none !important;
}
html[data-site-theme="dark"] .hunting-tactic {
    color: #f3f0df;
    background: #263a2d;
    border-color: #60735f;
}
html[data-site-theme="dark"] .hunting-tactic strong { color: #fff9e7; }
html[data-site-theme="dark"] .hunting-tactic span { color: #d4dccf; }
html[data-site-theme="dark"] .hunting-tactic:disabled,
html[data-site-theme="dark"] .hunting-tactic.is-locked {
    background: #3a463d !important;
    border-color: #7b887c !important;
}
html[data-site-theme="dark"] .hunting-tactic:disabled strong,
html[data-site-theme="dark"] .hunting-tactic:disabled span,
html[data-site-theme="dark"] .hunting-tactic.is-locked strong,
html[data-site-theme="dark"] .hunting-tactic.is-locked span {
    color: #e0e5dc !important;
}

/* Изображения куч имеют большой внутренний холст, поэтому подпись размещается
   поверх нижней части холста — визуально сразу под самой добычей. */
.camp-prey-pile {
    display: grid;
    justify-items: center;
    overflow: visible;
}
.camp-prey-pile span {
    position: absolute;
    left: 50%;
    top: 61%;
    margin: 0 !important;
    transform: translateX(-50%) !important;
    white-space: nowrap;
    pointer-events: none;
}
