/* Сайт PROFishing.
   Фон — розмитий і притемнений пейзаж із титульного екрана гри; вікна —
   темне «матове скло» з тонкою теплою рамкою. Один вигляд на всі вікна:
   вкладки — одна панель кнопок (.tabs), списки — одні рядки (.row). */

@font-face {
    font-family: "PF Roboto";
    src: url("/profishing/site/Roboto-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --ink: #140b05;
    --glass: rgba(24, 14, 8, 0.74);
    --glass-soft: rgba(44, 27, 15, 0.62);
    --glass-hover: rgba(66, 41, 22, 0.78);
    --popup: rgba(28, 17, 9, 0.97);
    --edge: rgba(255, 214, 150, 0.14);
    --edge-strong: rgba(255, 198, 43, 0.55);
    --text: #ffffff;
    --muted: #efdfcf;
    --faint: rgba(239, 223, 207, 0.66);
    --gold: #ffc62b;
    --gold-deep: #e0931a;
    --rare: #ff5a2e;
    --radius: 18px;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    --active: linear-gradient(180deg, #ffe07a, var(--gold) 55%, var(--gold-deep));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }

body {
    min-height: 100vh;
    background: var(--ink);
    color: var(--text);
    font-family: "PF Roboto", "Roboto", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Фон — окремим шаром: background-attachment: fixed не працює на iOS */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 170, 80, 0.10), transparent 60%),
        linear-gradient(180deg, rgba(20, 11, 5, 0.25), rgba(20, 11, 5, 0.75)),
        url("/profishing/site/scene.jpg") center / cover no-repeat;
}

body.locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }

img { -webkit-user-drag: none; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 10px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 40px; }

/* ── Шапка ─────────────────────────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(18, 10, 5, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--edge);
}

.bar {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; letter-spacing: 0.3px; flex: 0 0 auto; }

/* Логотип без власного тла — тінь іде за його обрисом, а не квадратом */
.brand img { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }

.brand b { color: #7fd0ff; }

/* Розділи — однакової ширини; довга назва переноситься */
.nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; flex: 1; }

/* ── Кнопки вкладок: шапка, панелі вкладок, вибір мови — одного вигляду ─ */

.nav a, .tabs > a, .tabs > button, .lang-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 12px 7px 8px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: none;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.12;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nav a img, .tabs > a img, .tabs > button img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }

.nav a:hover, .tabs > a:hover, .tabs > button:hover:not(:disabled), .lang-button:hover { background: var(--glass-hover); color: var(--text); }

.nav a.active, .tabs > a.active, .tabs > button.active {
    color: #2a1507;
    text-shadow: none;
    background: var(--active);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(224, 147, 26, 0.35);
}

.tabs > button:disabled { opacity: 0.4; cursor: default; }

/* Кнопки вкладок — однакової ширини в кожній панелі: сітка на стільки
   колонок, скільки вкладок (--cols і --n задає скрипт). Де вкладок більше чотирьох,
   на широкому екрані — по чотири в ряд, на вузькому — рядок, що гортається,
   але й там кнопки однакові */
.tabs {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    margin-bottom: 14px;
    scrollbar-width: none;
    background: var(--glass);
    border: 1px solid var(--edge);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tabs::-webkit-scrollbar { display: none; }

.tabs > a, .tabs > button { width: 100%; }

.tabs > a span, .tabs > button span { min-width: 0; overflow-wrap: anywhere; }

.dialog .tabs { background: var(--glass-soft); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Розділ із підвкладками — одна панель: розділи вгорі, під рискою —
   підвкладки. Обрана підвкладка не заливається золотом, як розділ, а лише
   підсвічується: так видно, що вона всередині обраного розділу */
.tab-group {
    margin-bottom: 14px;
    background: var(--glass);
    border: 1px solid var(--edge);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tab-group > .tabs { margin: 0; background: none; border: 0; border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }

.tab-group > .subtabs { padding: 6px 6px 7px; border-top: 1px solid var(--edge); border-radius: 0 0 20px 20px; background: rgba(0, 0, 0, 0.16); }

.subtabs > a { padding: 5px 10px 5px 6px; font-size: 14px; }

.subtabs > a img { width: 26px; height: 26px; }

.subtabs > a.active {
    color: var(--gold);
    background: rgba(255, 198, 43, 0.1);
    border-color: rgba(255, 198, 43, 0.45);
    box-shadow: none;
    text-shadow: none;
}

/* ── Вибір мови ────────────────────────────────────────────────────────── */

.language { position: relative; flex: 0 0 auto; }

.lang-button { border-color: var(--edge); background: var(--glass-soft); color: var(--text); padding: 6px 30px 6px 8px; position: relative; }

.lang-button img, .lang-menu img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }

.lang-button::after {
    content: "";
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -6px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
}

.lang-button[aria-expanded="true"] { border-color: var(--edge-strong); }

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 30;
    width: 230px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 6px;
    display: grid;
    gap: 2px;
    background: var(--popup);
    border: 1px solid var(--edge-strong);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 15px;
}

.lang-menu a:hover, .lang-menu a:focus { background: var(--glass-hover); color: var(--text); outline: none; }

.lang-menu a.active { background: var(--active); color: #2a1507; text-shadow: none; }

/* ── Вікна ─────────────────────────────────────────────────────────────── */

.panel {
    padding: 22px;
    background: var(--glass);
    border: 1px solid var(--edge);
    border-radius: 26px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.title { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.15; }

.count { color: var(--faint); font-size: 16px; }

.subtitle { font-size: clamp(20px, 3vw, 26px); margin: 28px 0 14px; display: flex; align-items: center; gap: 10px; }

.subtitle .count { font-size: 15px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 15px; color: var(--faint); }

.crumbs a { color: var(--muted); padding: 4px 10px; border-radius: 10px; background: var(--glass-soft); border: 1px solid var(--edge); }

.crumbs a:hover { border-color: var(--edge-strong); color: var(--text); }

.crumbs .sep { opacity: 0.6; }

html[dir="rtl"] .crumbs .sep { transform: scaleX(-1); }

/* ── Пошук ─────────────────────────────────────────────────────────────── */

.search { margin-bottom: 14px; }

.search input {
    width: 100%;
    padding: 13px 16px 13px 46px;
    border-radius: 14px;
    border: 1px solid var(--edge);
    background: var(--glass-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23efdfcf' d='M10 2a8 8 0 0 1 6.3 12.9l5.4 5.4-1.4 1.4-5.4-5.4A8 8 0 1 1 10 2Zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z'/%3E%3C/svg%3E") no-repeat 16px center;
    color: var(--text);
    font: inherit;
    font-size: 17px;
}

html[dir="rtl"] .search input { padding: 13px 46px 13px 16px; background-position: calc(100% - 16px) center; }

.search input::placeholder { color: var(--faint); }

.search input:focus { outline: none; border-color: var(--edge-strong); }

/* ── Рядки — один вигляд для всіх списків ─────────────────────────────── */

.list { display: grid; gap: 8px; }

.row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 10px 14px;
    background: var(--glass-soft);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    text-align: start;
    transition: background 0.15s, border-color 0.15s;
}

.row.link { cursor: pointer; }

.row.link:hover { background: var(--glass-hover); border-color: var(--edge-strong); }

/* Рядок, що кудись веде, — зі стрілкою праворуч */
.row.link::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-inline: 4px 6px;
    border-right: 3px solid var(--faint);
    border-top: 3px solid var(--faint);
    transform: rotate(45deg);
}

html[dir="rtl"] .row.link::after { transform: rotate(-135deg); }

.row .thumb {
    flex: 0 0 auto;
    width: 96px;
    height: 64px;
    display: grid;
    place-items: center;
}

.row .thumb img { max-width: 96px; max-height: 64px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }

.row .thumb.map img { width: 64px; height: 64px; max-height: none; filter: none; border-radius: 6px; }

.row .thumb.square img { width: 56px; height: 56px; }

.row .thumb.avatar img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.25); filter: none; }

.row .info { min-width: 0; flex: 1; display: grid; gap: 3px; }

.row .main { font-size: 19px; overflow-wrap: anywhere; }

.row .sub { font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }

.row .sub.faint { color: var(--faint); }

.row .side { flex: 0 0 auto; width: 72px; height: 54px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }

.value { color: var(--gold); }

.rare { color: var(--rare); }

.nowrap { white-space: nowrap; }

img.sprite { width: 22px; height: 22px; vertical-align: -5px; margin: 0 3px; }

.place {
    flex: 0 0 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 17px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--edge);
}

.place img { width: 50px; height: 50px; object-fit: contain; }

.place.medal { background: none; border: 0; }

/* ── Сторінка запису ───────────────────────────────────────────────────── */

.head { display: flex; align-items: center; gap: 24px; }

.head .big { flex: 0 0 auto; width: 280px; max-width: 40%; height: auto; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); }

.head .big.map { width: 200px; filter: none; border-radius: 10px; }

.head .big.square { width: 170px; }

.head .facts { flex: 1; min-width: 0; display: grid; gap: 8px; font-size: 18px; }

.head .facts .name { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; }

.head .facts .line { color: var(--muted); }

/* Картка водойми одразу під описом (завдання промислу) — з відступом, як .story */
.head + .list { margin-top: 18px; }

.head .side { flex: 0 0 auto; width: 110px; height: 84px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.4)); }

.story {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--glass-soft);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
    white-space: pre-line;
}

/* Опис над пошуком чи списком (промисли, квести) — не впритул до них */
.story + .search, .story + .list, .story + div > .list:first-child { margin-top: 14px; }

.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }

.spot {
    display: block;
    width: 100%;
    padding: 0;
    background: var(--glass-soft);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, transform 0.15s;
}

.spot:hover { border-color: var(--edge-strong); transform: translateY(-2px); }

.dialog-title { margin-top: 0; padding-inline-end: 48px; }

.spot-image { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); }

.spot img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

.spot span { display: block; padding: 10px 12px; font-size: 15px; text-align: center; }

.empty { padding: 28px 16px; text-align: center; background: var(--glass-soft); border: 1px solid var(--edge); border-radius: var(--radius); font-size: 17px; color: var(--muted); }

.loading { opacity: 0.7; }

.more {
    display: block;
    margin: 16px auto 0;
    padding: 12px 26px;
    border-radius: 14px;
    border: 1px solid var(--edge-strong);
    background: var(--glass-soft);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

.more:hover { background: var(--glass-hover); }

/* ── Оновлення: згорнуті плашки ────────────────────────────────────────── */

.news-item { background: var(--glass-soft); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }

.news-item[open] { border-color: var(--edge-strong); }

.news-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
}

.news-item summary::-webkit-details-marker { display: none; }

.news-item summary::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-inline-start: 4px;
    border-right: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.news-item[open] summary::after { transform: rotate(-135deg); }

.news-item summary:hover { background: var(--glass-hover); }

.news-title { flex: 1; font-size: 19px; }

.news-date { color: var(--faint); font-size: 15px; }

.news-body { padding: 4px 22px 18px; color: var(--muted); font-size: 16.5px; line-height: 1.55; }

.news-body p { margin: 10px 0; }

.news-body p.lead { color: var(--gold); margin-bottom: 6px; }

.news-body ul { margin: 6px 0 10px; padding-inline-start: 22px; display: grid; gap: 5px; }

.news-body li::marker { color: var(--gold); }

/* ── Вікно складу рейтингу ─────────────────────────────────────────────── */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
    align-items: center;
    padding: 16px;
    height: 100vh;
    height: 100dvh;
    background: rgba(8, 4, 2, 0.66);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.dialog {
    position: relative;
    width: 100%;
    min-width: 0;
    max-height: calc(100vh - 32px);
    /* На телефоні 100vh — висота без панелі адреси браузера: з видимою
       панеллю низ вікна, а з ним і кінець списку, опинявся за екраном.
       dvh — справжня видима висота */
    max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    background: var(--popup);
    border: 1px solid var(--edge-strong);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.dialog-body { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; min-width: 0; min-height: 0; padding: 22px; }

/* Перший рядок вікна (картка гравця) — не під кнопкою «×». width: auto, бо
   з width: 100% відступ виштовхував рядок за край, і той ліз під кнопку */
.dialog-body > .row:first-child { width: auto; margin-inline-end: 48px; }

.close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--edge);
    background: var(--glass-soft);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.close:hover { border-color: var(--edge-strong); }

/* ── Головна ───────────────────────────────────────────────────────────── */

.hero {
    height: clamp(210px, 40vw, 400px);
    border-radius: 30px;
    background: url("/profishing/site/hero.jpg") center 68% / cover no-repeat;
    box-shadow: var(--shadow);
    border: 1px solid var(--edge);
}

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }

/* Головна: останнє оновлення й скріни під входами в розділи */
.home-block { margin-top: 20px; }

.home-title { margin: 0 0 14px; }

.home-update-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.home-update .news-body { padding: 4px 0 0; }

.home-more { display: inline-block; margin-top: 8px; color: var(--gold); font-size: 16px; }

.home-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.shots {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
}

.shot {
    display: block;
    border: 1px solid var(--edge);
    border-radius: 18px;
    overflow: hidden;
    background: var(--glass-soft);
    scroll-snap-align: start;
}

.shot img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 20; object-fit: cover; transition: transform 0.18s; }

.shot:hover { border-color: var(--edge-strong); }

.shot:hover img { transform: scale(1.025); }

.shot-full { display: block; max-width: 100%; max-height: calc(92dvh - 90px); margin: 0 auto; border-radius: 14px; object-fit: contain; }

@media (max-width: 640px) { .shots { grid-auto-columns: 140px; } }

/* Входи в розділи — ті самі скляні панелі, що й решта сайту */
.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    min-height: 210px;
    padding: 22px 14px;
    background: var(--glass);
    border: 1px solid var(--edge);
    border-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.feature:hover { transform: translateY(-3px); border-color: var(--edge-strong); background: var(--glass-hover); }

.feature img { width: 88px; height: 88px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); }

.feature .name { font-size: 21px; }

.feature .sub { font-size: 14.5px; color: var(--muted); }

/* ── Підвал ─────────────────────────────────────────────────────────────── */

footer {
    padding: 26px 16px 40px;
    text-align: center;
    background: rgba(14, 8, 4, 0.78);
    border-top: 1px solid var(--edge);
    display: grid;
    gap: 14px;
    justify-items: center;
}

.stores { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    border-radius: 14px;
    font-size: 16px;
    background: rgba(63, 208, 107, 0.12);
    border: 1px solid rgba(63, 208, 107, 0.45);
    transition: background 0.15s, border-color 0.15s;
}

.play svg { color: #3fd06b; }

.play:hover { background: rgba(63, 208, 107, 0.22); border-color: rgba(63, 208, 107, 0.75); }

.play.tg { background: rgba(34, 158, 217, 0.12); border-color: rgba(34, 158, 217, 0.5); }

.play.tg svg { color: #37b3ec; }

.play.tg:hover { background: rgba(34, 158, 217, 0.22); border-color: rgba(34, 158, 217, 0.8); }

.links { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; font-size: 15px; color: var(--muted); }

.links a:hover { text-decoration: underline; }

.copy { font-size: 13px; color: var(--faint); }

/* ── Планшет і телефон ─────────────────────────────────────────────────── */

@media (max-width: 1000px) and (min-width: 641px) {
    .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .bar { flex-wrap: wrap; gap: 8px 12px; }
    .nav { order: 3; flex: 1 1 100%; }
    .nav a { padding: 6px; font-size: 13px; gap: 6px; }
    .nav a img { width: 26px; height: 26px; }
    .language { margin-inline-start: auto; }
}

@media (max-width: 640px) {
    .wrap { padding: 12px 10px 28px; }
    .bar { padding: 8px 10px; }
    .brand { font-size: 18px; }
    .brand img { width: 34px; height: 34px; }
    .nav a { flex-direction: column; gap: 2px; font-size: 11.5px; line-height: 1.1; }
    .tabs > a, .tabs > button { flex-direction: column; gap: 3px; font-size: 12.5px; padding: 6px 4px; }
    .tabs > a img, .tabs > button img { width: 28px; height: 28px; }
    .tabs { overflow-x: auto; }
    .tabs[style*="--n: 5"], .tabs[style*="--n: 6"], .tabs[style*="--n: 7"], .tabs[style*="--n: 8"] {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 104px;
    }
    /* Розділи довідника — усі п'ять в один ряд, без прокрутки: прогорнута
       панель ховала частину розділів за краєм і їхала при кожному виборі */
    .tabs.guide {
        grid-auto-flow: row;
        grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
        gap: 4px;
        overflow: visible;
    }
    .tabs.guide > a { padding: 6px 2px; font-size: 11.5px; }
    .panel { padding: 14px; border-radius: 20px; }
    .row { gap: 10px; padding: 8px 10px; min-height: 68px; }
    .row .thumb { width: 72px; height: 52px; }
    .row .thumb img { max-width: 72px; max-height: 52px; }
    .row .thumb.square img, .row .thumb.avatar img, .row .thumb.map img { width: 50px; height: 50px; }
    .row .main { font-size: 16px; }
    .row .sub { font-size: 13.5px; }
    .row .side { width: 48px; height: 36px; }
    .place { flex-basis: 38px; height: 38px; font-size: 14px; }
    .place img { width: 40px; height: 40px; }
    .head { flex-direction: column; text-align: center; gap: 12px; }
    .head .big, .head .big.map, .head .big.square { max-width: 70%; }
    .head .facts { font-size: 16px; }
    .head .side { display: none; }
    .story { font-size: 15.5px; }
    .spots { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .features { grid-template-columns: 1fr; gap: 10px; }
    .feature { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: start; gap: 14px; padding: 14px 16px; border-radius: 20px; }
    .feature img { width: 64px; height: 64px; }
    .feature .name { font-size: 18px; }
    .feature .sub { font-size: 13px; }
    .hero { border-radius: 20px; }
    .dialog-body { padding: 16px; }
    .news-title { font-size: 16.5px; }
    .news-body { padding: 2px 16px 14px; font-size: 15px; }
    .lang-button span { display: none; }
    .lang-button { padding-inline-end: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Нагороди квесту; списки використовують спільні .list та .row довідника. */
.quest-rewards + .list { margin-top: 14px; }
.quest-rewards { display: flex; flex-wrap: wrap; gap: 10px; }
.quest-reward { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--edge); border-radius: 12px; background: var(--glass-soft); }

a.quest-reward:hover { background: var(--glass-hover); border-color: var(--edge-strong); }
a.quest-reward .sprite { flex: 0 0 22px; object-fit: contain; }

.rod-reward .sprite { flex-basis: 30px; width: 30px; height: 30px; }

.reward-note { color: var(--faint); font-size: 0.9em; }
.skin-reward { padding: 6px; }
.skin-icon { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; display: block; }

/* ── Акаунт: кнопка в шапці, вікно входу, нотатки гравців ──────────────── */

/* Смуга студії над шапкою: ліворуч — PROGames, звідки гра, і посилання на
   інші ігри студії; праворуч, у самому куті, — акаунт. Розділи й вибір мови
   лишаються на своєму рівні. Висота стала, тож поки сайт дізнається, хто
   увійшов, нічого не стрибає */
.topline { background: rgba(0, 0, 0, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.topline-inner {
    max-width: 1080px;
    height: 34px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.studio-link, .account-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 9px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.studio-link { min-width: 0; margin-inline-start: -9px; }

.studio-link:hover, .account-button:hover, .account-button[aria-expanded="true"] { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.studio-link img { width: 18px; height: 18px; flex: 0 0 auto; }

.studio-link b { font-size: 13.5px; letter-spacing: 0.5px; color: var(--text); }

.studio-link b span { color: var(--gold); }

.studio-link em { font-style: normal; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }

/* Тонка риска між назвою студії й підписом */
.studio-link em::before { content: ""; display: inline-block; width: 1px; height: 12px; margin-inline-end: 7px; vertical-align: -1px; background: rgba(255, 255, 255, 0.16); }

.account { position: relative; flex: 0 0 auto; }

.account-button { padding-inline-start: 4px; }

.account-button span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-button.sign-in { padding-inline-start: 8px; color: var(--gold); font-weight: bold; }

.account-button.sign-in:hover { color: var(--text); }

.account-button svg { flex: 0 0 auto; }

.account-chevron { display: inline-flex; margin-inline-start: -2px; opacity: 0.7; transition: transform 0.15s; }

.account-button[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }

/* Від вибору мови кнопка бере лише меню — стрілки й прихованого на телефоні підпису не треба */
.account-button::after { display: none; }

.account-avatar { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(0, 0, 0, 0.25); }

.account-menu { width: 180px; z-index: 31; }

.account-menu button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 15px;
    text-align: start;
    cursor: pointer;
}

.account-menu button:hover, .account-menu button:focus { background: var(--glass-hover); color: var(--text); outline: none; }

.form { display: grid; gap: 14px; }

.form-hint { margin: -4px 0 16px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.field { display: grid; gap: 6px; }

.field-label { font-size: 14px; color: var(--faint); }

.field input, .note-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--edge);
    background: var(--glass-soft);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.field input:focus, .note-form textarea:focus { outline: none; border-color: var(--edge-strong); }

.note-form textarea { resize: vertical; min-height: 92px; line-height: 1.45; }

.note-form textarea::placeholder { color: var(--faint); }

.form-error { color: var(--rare); font-size: 15px; min-height: 1em; }

.form-error:empty { display: none; }

.primary-button {
    justify-self: start;
    padding: 11px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: var(--active);
    color: #2a1507;
    font: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(224, 147, 26, 0.35);
    transition: filter 0.15s, opacity 0.15s;
}

.primary-button:hover:not(:disabled) { filter: brightness(1.06); }

.primary-button:disabled { opacity: 0.55; cursor: default; }

/* «Забули пароль?» і «попросити новий лист» — тихе посилання під формою */
.link-button {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: var(--faint);
    font: inherit;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-button:hover { color: var(--muted); }

.dialog-body > .primary-button, .dialog-body > .link-button { margin-top: 6px; }

.primary-button.ghost { background: var(--glass-soft); color: var(--text); border-color: var(--edge-strong); box-shadow: none; }

.notes .list { margin-bottom: 14px; }

.row.note { align-items: flex-start; min-height: 0; }

.row.note .thumb { width: 56px; height: 56px; }

.note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }

.note-date { color: var(--faint); font-size: 13.5px; }

.note-text { color: var(--muted); font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.note-remove {
    justify-self: start;
    margin-top: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid var(--edge);
    background: none;
    color: var(--faint);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
}

.note-remove:hover:not(:disabled) { color: var(--rare); border-color: var(--rare); }

.note-form-footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.note-counter { color: var(--faint); font-size: 13.5px; }

.note-form-footer .form-error { flex: 1; }

.note-form-footer .primary-button { margin-inline-start: auto; }

@media (max-width: 640px) {
    .topline-inner { padding: 0 6px; }
    .studio-link { margin-inline-start: 0; }
    .account-button span { display: inline; max-width: 130px; }
    .row.note .thumb { width: 44px; height: 44px; }
    .row.note .thumb.avatar img { width: 44px; height: 44px; }
    .note-text { font-size: 15px; }
}
