/* ============================================================
   Walium — стили. Тёмная фэнтези-тема: пергамент на тёмном фоне,
   золото и пурпур. Мобильные-first, все блоки адаптивные.
   ============================================================ */

:root {
    --bg: #17121d;
    --bg-2: #221a2b;
    --panel: #2b2136;
    --panel-2: #342941;
    --gold: #c9a227;
    --gold-2: #e6c65c;
    --ink: #f0e8d8;
    --muted: #b3a6c4;
    --ok: #67c17a;
    --fail: #d96a6a;
    --danger: #b34747;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --font-head: Georgia, 'PT Serif', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Якоря (#quests, #oracle и т.д.) не прячутся под липкой шапкой при переходе по ссылке */
[id] { scroll-margin-top: 76px; }
::selection { background: rgba(201, 162, 39, .45); color: #1c1426; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh; /* корректная высота в мобильных браузерах с адресной строкой */
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(201, 162, 39, .08), transparent 60%),
        radial-gradient(900px 420px at -10% 30%, rgba(120, 60, 180, .10), transparent 55%),
        var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--gold-2); margin: .2em 0 .5em; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
.page-head h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(255, 255, 255, .08); padding: .1em .4em; border-radius: 6px; }
img { max-width: 100%; }

/* ---------- Шапка ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px clamp(12px, 4vw, 32px);
    background: rgba(23, 18, 29, .92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(201, 162, 39, .25);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.3rem; color: var(--gold-2); }
.brand img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.nav { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink); white-space: nowrap; }
.nav a:hover { background: rgba(201, 162, 39, .12); text-decoration: none; }
.nav a.active { background: rgba(201, 162, 39, .2); color: var(--gold-2); }
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--panel); border-radius: 10px; }
.nav-toggle {
    margin-left: auto;
    display: none;
    background: none;
    border: 1px solid var(--gold);
    color: var(--gold-2);
    font-size: 1.2rem;
    border-radius: 10px;
    padding: 6px 12px;
    cursor: pointer;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5a5a66; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }

/* ---------- Контент ---------- */
.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(14px, 3vw, 32px); }
.page-head { margin-bottom: 18px; }
.muted { color: var(--muted); font-size: .92em; }
.empty { color: var(--muted); font-style: italic; }
.notice { background: rgba(103, 193, 122, .15); border: 1px solid var(--ok); border-radius: var(--radius); padding: 10px 14px; }
.error { background: rgba(217, 106, 106, .15); border: 1px solid var(--fail); border-radius: var(--radius); padding: 10px 14px; }
.hint { color: var(--muted); font-size: .9rem; }
.panel-inset { background: var(--panel-2); border-radius: var(--radius); padding: 12px 14px; }

/* Сетка панелей */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.grid-2 .panel.wide { grid-column: 1 / -1; }
.panel {
    background: var(--panel);
    border: 1px solid rgba(201, 162, 39, .18);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 4px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid rgba(201, 162, 39, .18); border-radius: var(--radius); padding: 16px; }
.card h3 { margin-top: 0; font-size: 1.05rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; margin-top: 26px; }
.benefits li { margin-bottom: 6px; }

/* Списки */
.list { list-style: none; margin: 8px 0; padding: 0; }
.list li { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .06); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.list li:last-child { border-bottom: none; }
.list.mono li { font-family: ui-monospace, Consolas, monospace; }
.list a.active { color: var(--gold-2); }
.forum-list a { flex: 1; min-width: 180px; }
.chips { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid rgba(201, 162, 39, .25); font-size: .85rem; }
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.fail { border-color: var(--fail); color: var(--fail); }
.inline { display: inline-flex; gap: 6px; }

/* Формы */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label, .grid-2 label { display: flex; flex-direction: column; gap: 5px; font-size: .92rem; color: var(--muted); }
input, select, textarea {
    background: var(--panel-2);
    color: var(--ink);
    border: 1px solid rgba(201, 162, 39, .3);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.row-form label { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mod { font-weight: bold; color: var(--gold-2); }

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(201, 162, 39, .5);
    background: var(--panel-2);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform .1s ease, background .2s ease;
}
.btn:hover { background: rgba(201, 162, 39, .18); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, .die:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #221a00; font-weight: 700; border-color: var(--gold); }
.btn-gold:hover { background: linear-gradient(180deg, #f1d377, var(--gold-2)); color: #221a00; }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn.danger, .btn-sm.danger { border-color: var(--danger); color: #ffb3b3; }

/* ---------- Визитка ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; padding: 24px 0; }
.hero-text .lead { font-size: 1.08rem; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.hero-img img { width: 100%; border-radius: var(--radius); border: 1px solid rgba(201, 162, 39, .35); box-shadow: var(--shadow); }
.cta { text-align: center; margin: 40px 0 10px; padding: 26px; background: linear-gradient(180deg, rgba(201,162,39,.10), rgba(201,162,39,.02)); border: 1px solid rgba(201, 162, 39, .25); border-radius: var(--radius); }
.auth-card { max-width: 430px; margin: 6vh auto; }
.toc { margin: 14px 0; }
.toc a { margin-right: 8px; }
.rule { background: var(--panel); border: 1px solid rgba(201, 162, 39, .15); border-radius: var(--radius); padding: 4px 18px 14px; margin-bottom: 16px; }
.rule .formula { background: var(--panel-2); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 8px; }
.rule .tip { color: var(--gold-2); }
/* Таблицы: обёртка даёт горизонтальную прокрутку на узких экранах, зебра — читаемость */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; border-radius: var(--radius); }
.table-wrap .table { margin: 0; }
.table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.table th, .table td { border: 1px solid rgba(201, 162, 39, .25); padding: 8px 10px; text-align: left; }
.table th { background: rgba(201, 162, 39, .12); }
.table tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }

/* Табы */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tabs a { padding: 8px 14px; background: var(--panel); border: 1px solid rgba(201, 162, 39, .25); border-radius: 999px; }
.tabs a:hover { border-color: var(--gold); text-decoration: none; }

/* Персонажи */
.char-card { background: var(--panel-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.calc-preview { margin-top: 8px; }
.calc-preview strong { color: var(--gold-2); }

/* Кубики */
.dice-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.die {
    width: 64px; height: 64px;
    border-radius: 14px;
    border: 2px solid rgba(201, 162, 39, .45);
    background: radial-gradient(circle at 30% 25%, #4a3a5c, var(--panel-2));
    color: var(--gold-2);
    cursor: pointer;
    font: bold 1rem var(--font-head);
    transition: transform .12s ease, border-color .2s ease;
}
.die:hover { transform: translateY(-3px) rotate(-4deg); border-color: var(--gold); }
.die:active { transform: scale(.92); }
.die.selected { border-color: var(--ok); box-shadow: 0 0 12px rgba(103, 193, 122, .5); }
.dice-result {
    min-height: 64px;
    margin-top: 14px;
    padding: 14px;
    background: var(--panel-2);
    border-radius: var(--radius);
    border: 1px solid rgba(201, 162, 39, .25);
    font-size: 1.4rem;
    font-family: var(--font-head);
    text-align: center;
    opacity: 0;
    transition: opacity .3s ease;
}
.dice-result.show { opacity: 1; }
.dice-result .big { font-size: 2.2rem; color: var(--gold-2); }
.dice-result .crit { color: var(--ok); }
.dice-result .fumble { color: var(--fail); }

/* Чат */
.chat-switch { margin-bottom: 12px; }
.chat-wrap { display: flex; flex-direction: column; gap: 10px; }
.chat-log {
    height: min(56vh, 480px);
    height: min(56dvh, 480px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 162, 39, .4) transparent;
}
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, .4); border-radius: 3px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: var(--panel-2); }
.msg .who { display: block; font-size: .8rem; color: var(--gold-2); margin-bottom: 3px; overflow-wrap: anywhere; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: rgba(201, 162, 39, .16); }
.msg.veil { border: 1px solid rgba(201, 162, 39, .35); }
.msg.offline-user .who { color: var(--muted); }
.msg .ts { font-size: .75rem; color: var(--muted); }

/* Карта */
.map-field {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(201, 162, 39, .3);
    background: #0e0b12;
    aspect-ratio: 4 / 3;
    touch-action: none;
    cursor: grab;
    margin-bottom: 10px;
}
.map-field:active { cursor: grabbing; }
#mapInner { position: absolute; transform-origin: 0 0; will-change: transform; }
#mapImg { display: block; user-select: none; -webkit-user-drag: none; }
.map-marker {
    position: absolute;
    transform: translate(-50%, -100%);
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
    cursor: pointer;
    text-align: center;
}
.map-marker small { display: block; font-size: .7rem; background: rgba(23, 18, 29, .85); color: var(--gold-2); border-radius: 6px; padding: 1px 5px; white-space: nowrap; }
.map-list img.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 6px; }
.map-list a { display: inline-flex; align-items: center; }
.initiative li { font-size: 1.02rem; }
.initiative li.current-turn { background: rgba(201, 162, 39, .14); border-radius: 10px; }
.init-val { font-family: var(--font-head); font-weight: bold; color: var(--gold-2); width: 2.2em; display: inline-block; }
.jbody { padding: 6px 0; }

/* Посты форума */
.post { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.post:last-child { border-bottom: none; }

/* Сюжетные арки */
.quest { background: var(--panel-2); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.progress { height: 10px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; transition: width .4s ease; }
.quest-stages { margin: 8px 0 8px 18px; padding: 0; }
.quest-stages li { color: var(--muted); padding: 2px 0; }
.quest-stages li.done { color: var(--ink); text-decoration: line-through; text-decoration-color: rgba(103, 193, 122, .7); }
.quest-stages li.current { color: var(--gold-2); font-weight: 700; }

/* Мини-карта кампании */
.campmap-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(201, 162, 39, .3); }
.campmap-wrap img { display: block; width: 100%; }
.campmap-markers { position: absolute; inset: 0; pointer-events: none; }

/* Боевая доска: фишки и инструменты */
.map-token {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    text-align: center;
    cursor: default;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
    line-height: 1.15;
}
.map-token.clickable { cursor: pointer; }
.map-token .tk-ic {
    font-size: 1.35rem;
    display: inline-flex;
    width: 34px; height: 34px;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(23, 18, 29, .82);
    border: 2px solid rgba(201, 162, 39, .5);
}
.map-token.k-player .tk-ic { border-color: #8fd0ff; }
.map-token.k-ally .tk-ic { border-color: #9be6b0; }
.map-token.k-monster .tk-ic { border-color: #ff9a8a; }
.map-token.k-boss .tk-ic { border-color: #ff7a7a; box-shadow: 0 0 10px rgba(255, 122, 122, .6); }
.map-token.k-npc .tk-ic { border-color: #d9c69a; }
.map-token small {
    display: block;
    max-width: 140px;
    margin: 2px auto 0;
    font-size: .68rem;
    background: rgba(23, 18, 29, .85);
    color: var(--gold-2);
    border-radius: 6px;
    padding: 1px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.map-token .tk-hp { color: var(--fail); }
.map-token { transition: left .8s ease, top .8s ease; }
/* Туман войны: канва поверх доски, клики проходят мимо неё */
.campfog { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fog-brush.selected { border-color: var(--gold); color: var(--gold-2); }
.beast-note { margin-top: 6px; font-size: .85rem; }
#tokenBeast { max-width: 300px; }
.board-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }

/* Пинги «смотри сюда!» */
.map-ping { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%;
    border: 3px solid var(--fail); box-shadow: 0 0 14px rgba(224, 90, 71, .8); pointer-events: none;
    animation: ping-pulse 1.6s ease-out 5; }
@keyframes ping-pulse {
    0% { transform: scale(.4); opacity: 1; }
    70% { transform: scale(2.2); opacity: .35; }
    100% { transform: scale(2.6); opacity: 0; }
}
.campmap-wrap.pinging { cursor: crosshair; }
#pingMode.selected { border-color: var(--fail); color: var(--fail); }

/* Реакции в чате */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; align-items: center; }
.react-chip { background: rgba(201, 162, 39, .12); border: 1px solid rgba(201, 162, 39, .3); color: var(--text);
    border-radius: 999px; padding: 1px 8px; font-size: .8rem; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.react-chip:hover { border-color: var(--gold); }
.react-chip.mine { background: rgba(201, 162, 39, .3); border-color: var(--gold-2); }
.react-add { background: transparent; border: 1px dashed rgba(201, 162, 39, .4); color: var(--gold-2);
    border-radius: 999px; padding: 1px 8px; font-size: .8rem; cursor: pointer; }
.react-palette { display: inline-flex; gap: 4px; }

/* Таймер проверки */
.check-timer { display: inline-block; padding: 2px 10px; border-radius: 8px; background: rgba(201, 162, 39, .15);
    border: 1px solid rgba(201, 162, 39, .35); font-weight: 600; font-variant-numeric: tabular-nums; }
.check-timer.urgent { background: rgba(224, 90, 71, .18); border-color: var(--fail); animation: timer-blink 1s steps(2) infinite; }
.check-timer.over { background: rgba(224, 90, 71, .12); border-color: var(--fail); }
@keyframes timer-blink { 50% { opacity: .55; } }

/* Баннер «Ваш ход!» */
.turn-banner { font-size: 1.05rem; font-weight: 700; text-align: center; animation: banner-glow 1.6s ease-in-out infinite; }
@keyframes banner-glow { 50% { box-shadow: 0 0 18px rgba(201, 162, 39, .5); } }
.board-tools .btn.selected { border-color: var(--ok); box-shadow: 0 0 10px rgba(103, 193, 122, .5); color: var(--gold-2); }
#tokenInfo { margin-top: 10px; }
.campmap-wrap.placing { cursor: crosshair; }
.campmap-wrap.moving { cursor: move; }
@media (max-width: 480px) {
    .map-token .tk-ic { width: 28px; height: 28px; font-size: 1.1rem; }
    .map-token small { max-width: 90px; font-size: .62rem; }
    .board-tools .btn-sm { padding: 5px 8px; }
}

/* NPC */
.npc-result { margin-top: 14px; }

/* Бестиарий */
#beastFilter { width: 100%; max-width: 420px; }

/* Подписка «Мастер-плюс» */
.premium-hero { text-align: center; padding: 26px 16px; margin-bottom: 22px; border: 1px solid rgba(201, 162, 39, .35); border-radius: var(--radius); background: linear-gradient(180deg, rgba(201, 162, 39, .14), rgba(120, 60, 180, .10)); }
.premium-hero .lead { max-width: 640px; margin: 0 auto 14px; }
.premium-hero .notice { display: inline-block; margin-bottom: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Подвал ---------- */
.footer {
    margin-top: auto;
    padding: 18px clamp(12px, 4vw, 32px);
    border-top: 1px solid rgba(201, 162, 39, .25);
    background: rgba(23, 18, 29, .9);
}
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.footer-brand { color: var(--muted); font-size: .9rem; }
.footer-brand a { color: var(--gold-2); }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(23, 18, 29, .98);
        border-bottom: 1px solid rgba(201, 162, 39, .25);
        padding: 10px 16px 16px;
        gap: 2px;
    }
    .nav.open {
        display: flex;
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav a { padding: 12px 10px; }
    .hero { grid-template-columns: 1fr; gap: 16px; }
    .hero-img { order: -1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .die { width: 56px; height: 56px; }
    .msg { max-width: 94%; }
}
@media (min-width: 861px) and (max-width: 1100px) {
    .nav a { padding: 8px 8px; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dice-picker { justify-content: center; }
    .row-form input, .row-form select { flex: 1 1 120px; }
}
@media (max-width: 480px) {
    /* Кнопки-действия на телефонах — в столбик на всю ширину: крупнее и удобнее для пальца */
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { text-align: center; }
    .panel { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Анимации кубиков */
@keyframes dice-shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-4px) rotate(-2deg); }
    75% { transform: translateX(4px) rotate(2deg); }
}
.dice-result.rolling { animation: dice-shake .22s linear infinite; }
@keyframes result-pop {
    0% { transform: scale(.7); opacity: .3; }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}
.dice-result.pop { animation: result-pop .45s ease; }
@keyframes fire-glow {
    0%, 100% { box-shadow: 0 0 14px rgba(230, 198, 92, .5); }
    50% { box-shadow: 0 0 34px rgba(230, 198, 92, .95); }
}
.dice-result.crit-fire { border-color: var(--gold-2); animation: fire-glow 1.1s ease 3; }

/* Ачивки */
.ach-icon { font-size: 1.9rem; line-height: 1; margin-bottom: 6px; }
.ach-card.unlocked { border-color: var(--gold); box-shadow: 0 0 18px rgba(201, 162, 39, .16); }
.ach-card.locked { opacity: .6; }

/* Звание рядом с именем в чате */
.ach-title { color: var(--gold-2); font-size: .75rem; }

/* Вкладки гида */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs .tab {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
}
.tabs .tab.active { background: var(--gold); color: #1c1426; border-color: var(--gold); font-weight: 700; }
.guide-steps li { margin-bottom: 8px; }

/* Обучающий блок на дашборде */
.onboard { border-color: var(--gold); box-shadow: 0 0 18px rgba(201, 162, 39, .12); }

/* Таблицы в админке */
.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { padding: 7px 9px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: left; font-size: .9rem; }
.table th { color: var(--muted); font-weight: 600; }
.check-inline { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-size: .85rem; white-space: nowrap; }

/* Профиль */
.profile-head { display: flex; gap: 16px; align-items: center; }

/* Каталог мастеров */
.stars { color: var(--gold-2); font-weight: 700; }
.stars.big { font-size: 1.2rem; }
.master-card { transition: transform .15s ease, border-color .2s ease; }
.master-card:hover { transform: translateY(-3px); border-color: rgba(201, 162, 39, .45); }
.master-card h3 a { color: var(--gold-2); }
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex: 0 0 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 25%, #4a3a5c, var(--panel-2));
    border: 2px solid var(--gold);
    font: bold 1.6rem var(--font-head);
    color: var(--gold-2);
}

/* Голосовой стол */
.voice-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.voice-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(201, 162, 39, .25); border-radius: 10px; background: var(--panel-2); transition: border-color .2s ease, box-shadow .2s ease; }
.voice-chip.speaking { border-color: var(--ok); box-shadow: 0 0 12px rgba(103, 193, 122, .5); }
.voice-chip .vc-ic { font-size: 1.15rem; }
.voice-chip .vc-name { font-weight: 600; }
.voice-chip .vc-note { margin-left: auto; font-size: .8rem; }
.check-privacy { flex-direction: row !important; align-items: flex-start; gap: 8px; font-size: .9rem; }
.check-privacy input { margin-top: 3px; }

/* Тосты */
.toast {
    position: fixed;
    right: 18px;
    bottom: 74px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 320px;
    background: var(--panel);
    border: 1px solid var(--gold);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    opacity: 0;
    transition: transform .35s ease, opacity .35s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.t-ic { font-size: 1.9rem; }
@media (max-width: 480px) {
    .toast { left: 12px; right: 12px; max-width: none; }
}
