/* KupujPL Gry — PlayStation Blue theme */

:root {
    --bg: #000000;
    --surface: #1f1f1f;
    --surface-2: #2a2a2a;
    --border: #333333;
    --border-strong: #444444;
    --text: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #aaaaaa;
    --brand: #0070d1;
    --brand-hover: #005fa8;
    --brand-soft: rgba(0, 112, 209, 0.15);
    --blue-light: #2d9cff;
    --price: #2d9cff;
    --price-bg: rgba(45, 156, 255, 0.12);
    --link: #2d9cff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 32px rgba(0, 112, 209, 0.3);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --wrap: 1180px;
}

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

[hidden] {
    display: none !important;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* Układ 24 — split screen */
body.layout-split {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.layout-split .header {
    flex-shrink: 0;
    position: relative;
}

.layout-split .split-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(240px, 280px) 1fr;
}

.layout-split .split-left {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.layout-split .split-left-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.layout-split .split-stats {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.layout-split .split-cats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout-split .split-cats .cat {
    display: block;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 0;
    white-space: normal;
    line-height: 1.35;
    word-break: break-word;
}

.split-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.split-info-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.info-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.info-btn:hover {
    border-color: var(--brand);
    color: var(--blue-light);
    background: var(--brand-soft);
}

.info-btn--donate {
    border-color: rgba(0, 112, 209, 0.45);
    color: var(--blue-light);
}

.info-btn--donate:hover {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.layout-split .split-right {
    overflow-y: auto;
    padding: 24px 24px 32px;
    -webkit-overflow-scrolling: touch;
}

.layout-split .sections {
    gap: 32px;
}

.layout-split .catalog-head {
    margin-bottom: 20px;
}

.layout-split .catalog-head h1 {
    font-size: 22px;
}

.layout-split .grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.layout-split .footer {
    flex-shrink: 0;
    margin-top: 0;
    display: block;
    padding: 8px 0;
}

.layout-split .wrap {
    max-width: none;
    padding: 0 20px;
}

.layout-split .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.layout-split .footer-inner p {
    margin-top: 0;
    text-align: left;
    font-size: 11px;
}

.layout-split .footer-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.layout-split .footer-nav {
    justify-content: flex-start;
    gap: 8px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--link); }

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.header-dev-banner {
    border-top: 1px solid var(--border);
    background: rgba(0, 120, 255, 0.06);
    padding: 7px 0;
    text-align: center;
}

.header-dev-banner p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.header-dev-banner a {
    color: var(--blue-light);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.header-dev-banner a:hover {
    color: var(--link);
}

.tg-promo-banner {
    margin: 12px auto 0;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 180, 255, 0.35);
    background: linear-gradient(90deg, rgba(0, 120, 255, 0.12), rgba(0, 200, 120, 0.08));
}

.tg-promo-banner p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.tg-promo-banner a {
    color: var(--blue-light);
    font-weight: 600;
    text-decoration: none;
    margin-left: 6px;
}

.tg-promo-banner a:hover {
    text-decoration: underline;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.brand-accent { color: var(--blue-light); font-weight: 400; }

.brand-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--blue-light);
    background: transparent;
    padding: 0;
    border: none;
}

.search-wrap { flex: 1; max-width: 480px; min-width: 0; }

.header-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.header-info-btn:hover {
    border-color: var(--brand);
    color: var(--blue-light);
    background: var(--brand-soft);
}

.header-info-btn--donate {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.header-info-btn--donate:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    color: #fff;
}

#search-input {
    width: 100%;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    font: inherit;
    font-size: 15px;
    color: var(--text);
    transition: border-color 0.15s;
}

#search-input::placeholder { color: var(--text-muted); }

#search-input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--surface);
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Top bar */
.topbar {
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.topbar-text { opacity: 0.9; }

.topbar-stats {
    font-weight: 600;
    white-space: nowrap;
}

/* Main */
.main { padding: 28px 20px 64px; }

.cats-wrap {
    margin-bottom: 28px;
}

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

.cat {
    padding: 10px 20px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cat:hover {
    border-color: var(--brand);
    color: var(--blue-light);
}

.cat.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--blue-light);
}

.cat-curated {
    font-weight: 600;
    border-color: rgba(45, 156, 255, 0.35);
}

.layout-split .cat-curated.active {
    background: rgba(0, 112, 209, 0.22);
}

.cats-meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* Sections (home) */
.sections {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.home-section-block { /* kept for JS */ }

.home-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.home-section-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.home-section-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-see-more,
.btn.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-see-more {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.btn-see-more:hover {
    border-color: var(--brand);
    color: var(--blue-light);
}

.home-section-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.home-section-row::-webkit-scrollbar { height: 6px; }
.home-section-row::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* Game cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.game-card {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: transform 0.25s, box-shadow 0.25s;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.game-card-row {
    flex: 0 0 196px;
    min-width: 196px;
    scroll-snap-align: start;
}

.card-cover {
    aspect-ratio: 460 / 215;
    background: var(--surface-2);
    overflow: hidden;
    position: relative;
}

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

.card-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
}

.card-rank.silver { background: #607d8b; }
.card-rank.bronze { background: #8d6e63; }

.card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}

.card-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.card-from {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--price);
    margin-left: auto;
}

.card-price.empty {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.card-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--price-bg);
    color: var(--price);
}

/* Catalog */
.catalog-head { margin-bottom: 20px; }

.catalog-head h1,
.page-heading {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.catalog-head p,
.page-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.catalog-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.meta { font-size: 14px; color: var(--text-muted); }

.btn-outline {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--blue-light);
}

.btn-outline:disabled { opacity: 0.6; cursor: wait; }

/* Loading / empty */
.loading-spinner {
    grid-column: 1 / -1;
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    margin: 48px auto;
    animation: spin 0.7s linear infinite;
}

.no-results,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.error-message { color: var(--brand); }

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

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

.modal[hidden] { display: none !important; }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.modal-panel {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 24px auto 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 64px rgba(0, 112, 209, 0.2);
    padding: 28px;
    z-index: 1;
}

.modal:not([hidden]) .modal-overlay {
    animation: modalOverlayIn 0.5s ease both;
}

.modal:not([hidden]) .modal-panel {
    animation: modalPanelSlideIn 1.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal--opening:not([hidden]) .modal-overlay {
    animation: modalOverlayIn 1.1s ease both;
}

.modal--opening:not([hidden]) .modal-panel {
    animation: modalPanelSlideIn 1.5s cubic-bezier(0.16, 1, 0.22, 1) both;
    will-change: transform, opacity;
}

.modal--opening .modal-aside {
    animation: modalCoverIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.modal--opening .modal-cover {
    animation: none;
}

.modal--opening .modal-main {
    animation: modalMainIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.modal--opening .offers-title {
    animation: modalFadeUp 0.65s ease 0.75s both;
}

.modal--opening .offers-scan.is-active {
    animation: scanFadeIn 0.6s ease 0.95s both;
}

.modal--opening .offers .offer-row {
    animation: offerEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(1.05s + var(--enter-i, 0) * 55ms);
}

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

@keyframes modalPanelSlideIn {
    0% {
        opacity: 0;
        transform: translateX(calc(100% + 48px)) scale(0.94);
    }
    55% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes modalPanelIn {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes modalCoverIn {
    from {
        opacity: 0;
        transform: translateX(-18px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes modalMainIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes modalFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal--loading .modal-cover img {
    opacity: 0.55;
    filter: blur(2px);
    transition: opacity 0.35s ease, filter 0.35s ease;
}

.modal:not(.modal--loading) .modal-cover img {
    opacity: 1;
    filter: none;
    transition: opacity 0.45s ease, filter 0.45s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover { color: var(--blue-light); border-color: var(--brand); }

.modal-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}

.modal-aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.modal-cover {
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-cover img {
    width: 100%;
    display: block;
    aspect-ratio: 460 / 215;
    object-fit: cover;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-head h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.modal-desc--pending {
    color: var(--text-muted);
    background: linear-gradient(
        90deg,
        var(--surface-2) 0%,
        rgba(45, 156, 255, 0.12) 50%,
        var(--surface-2) 100%
    );
    background-size: 200% 100%;
    animation: descShimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
    min-height: 1.2em;
}

@keyframes descShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.offers-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 12px;
}

.offers-head .offers-title {
    margin-bottom: 0;
}

.offers-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.offers-updated-at {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.offer-warn-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #f5d76e;
    background: rgba(245, 215, 110, 0.12);
    border: 1px solid rgba(245, 215, 110, 0.35);
}

.offers-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.offers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Price scan animation */
.offers-scan {
    display: none;
    margin-bottom: 14px;
    padding: 20px 18px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #1a1a1a 0%, #1f2a3a 55%, #0d1f33 100%);
    text-align: center;
    overflow: hidden;
    position: relative;
}

.offers-scan.is-active {
    display: block;
    animation: scanFadeIn 0.35s ease;
}

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

.offers-scan-core {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
}

.offers-scan-orbit {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed #3a4a5a;
    animation: scanSpin 4s linear infinite;
}

.offers-scan-orbit::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    border-radius: 50%;
    background: var(--blue-light);
    box-shadow: 0 0 10px rgba(45, 156, 255, 0.5);
}

.offers-scan-pulse {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 112, 209, 0.2) 0%, transparent 70%);
    animation: scanPulse 1.8s ease-in-out infinite;
}

.offers-scan-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    animation: scanBob 1.8s ease-in-out infinite;
}

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

@keyframes scanPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.55; }
    50% { transform: scale(1.08); opacity: 1; }
}

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

.offers-scan-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.offers-scan-info {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0 0 10px;
    max-width: 36em;
    margin-left: auto;
    margin-right: auto;
}

.offers-scan-countdown {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-light);
    margin: 0 0 14px;
    font-variant-numeric: tabular-nums;
}

.offers-scan-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.offers-scan-shops {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.offers-scan-shop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.offers-scan-shop.is-scanning {
    border-color: var(--blue-light);
    color: var(--blue-light);
    background: rgba(45, 156, 255, 0.12);
    animation: shopScan 1.4s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 0.12s);
}

.offers-scan-shop.is-found {
    border-color: var(--blue-light);
    color: var(--price);
    background: var(--price-bg);
    transform: scale(1.02);
}

.offers-scan-shop.is-found::before {
    content: '✓';
    font-size: 11px;
    font-weight: 700;
}

.offers-scan-shop.is-idle {
    opacity: 0.55;
}

@keyframes shopScan {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45, 156, 255, 0); }
    50% { box-shadow: 0 0 0 4px rgba(45, 156, 255, 0.18); }
}

.modal--scanning .offers-title {
    color: var(--text-secondary);
}

.offer-row--enter {
    animation: offerEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes offerEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.offer-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.offer-row.cheapest {
    border-color: var(--blue-light);
    background: var(--price-bg);
}

.offer-shop { font-weight: 600; font-size: 15px; }

.shop-steam { color: #66c0f4; }
.shop-gog { color: #c77dff; }
.shop-epicgames { color: #e0e0e0; }
.shop-humblestore { color: #ff8a65; }
.shop-kinguin { color: #ffb74d; }
.shop-eneba { color: #69f0ae; }
.shop-cdkeys { color: #ff6b6b; }
.shop-g2a { color: #f59e0b; }
.shop-instantgaming { color: #3b82f6; }

.offer-type {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.offer-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--price);
    white-space: nowrap;
}

.btn-buy {
    display: inline-block;
    padding: 9px 18px;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-buy:hover { background: var(--brand-hover); }

.blik-badge {
    display: inline-block;
    background: #ff0055;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.offer-row-missing {
    opacity: 0.75;
    background: var(--surface);
}

.offer-unavailable {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-buy-disabled {
    display: inline-block;
    padding: 9px 18px;
    background: var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    pointer-events: none;
    cursor: default;
}

.offers-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    font-size: 14px;
}

.offers-empty-hint {
    margin: 0 0 12px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    background: rgba(255, 180, 60, 0.08);
    border: 1px solid rgba(255, 180, 60, 0.25);
    border-radius: var(--radius-sm);
}

.btn-fav {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-fav.favorited {
    color: var(--blue-light);
    border-color: var(--brand);
    background: var(--brand-soft);
}

.btn-watch {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-watch:hover {
    border-color: var(--brand);
    color: var(--blue-light);
}

.btn-watch.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--blue-light);
}

.btn-watch-card {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.btn-unwatch {
    margin-top: 10px;
    width: 100%;
}

.panel-count {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Auth */
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover { color: var(--blue-light); }

.nav-user {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-nav {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-login {
    background: transparent;
    color: var(--blue-light);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
}

.btn-register {
    background: var(--brand);
    color: #fff;
    border-radius: 20px;
}

.btn-logout {
    background: var(--brand-soft);
    color: var(--blue-light);
    border: 1px solid var(--brand);
    border-radius: 20px;
}

.auth-page {
    display: flex;
    justify-content: center;
    padding: 48px 20px;
    min-height: calc(100vh - 200px);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-sub {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.auth-form label {
    display: block;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-form input {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 15px;
    background: var(--surface-2);
    color: var(--text);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.btn-primary {
    width: 100%;
    padding: 13px;
    margin-top: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary:hover { background: var(--brand-hover); }

.btn-secondary {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: var(--surface);
}

.form-error { color: var(--brand); font-size: 14px; margin: 8px 0; }

.form-success { color: #059669; font-size: 14px; margin: 8px 0; }

.auth-forgot {
    margin: -4px 0 8px;
    text-align: right;
    font-size: 13px;
}

.auth-forgot a { color: var(--brand); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }

.auth-switch {
    margin-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-switch a { color: var(--link); font-weight: 600; }

.auth-legal {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
}

.auth-legal a { color: var(--link); }

.panel-page { padding: 32px 20px 64px; }

.panel-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0 28px;
}

@media (max-width: 768px) {
    .panel-stats { grid-template-columns: repeat(2, 1fr); }
}

.panel-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-stat-wide { grid-column: span 2; }

@media (max-width: 768px) {
    .panel-stat-wide { grid-column: span 2; }
}

.panel-stat-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.panel-stat-val-sm {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
}

.panel-stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.panel-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 860px) {
    .panel-layout { grid-template-columns: 1fr; }
}

.panel-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-nav-btn {
    text-align: left;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.panel-nav-btn:hover { background: var(--surface); color: var(--text); }

.panel-nav-btn.active {
    background: var(--surface);
    border-color: var(--border);
    color: var(--brand);
    font-weight: 600;
}

.panel-aside-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-link-btn {
    display: block;
    text-align: center;
    text-decoration: none;
}

.panel-muted-link {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.panel-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-section-head h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.panel-sort-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.panel-select {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
}

.panel-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.panel-account-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.panel-account-card h3 {
    font-size: 16px;
    margin: 0 0 14px;
}

.panel-dl {
    margin: 0;
    display: grid;
    gap: 12px;
}

.panel-dl div {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    font-size: 14px;
}

.panel-dl dt {
    color: var(--text-muted);
    font-weight: 500;
}

.panel-dl dd { margin: 0; color: var(--text); }

.panel-password-form { max-width: 360px; }

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

.card-shop {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.panel-hero h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.panel-section { margin-top: 28px; }

.panel-empty { padding: 48px 20px; }

.btn-remove-fav {
    margin-top: 8px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}

.btn-remove-fav:hover {
    border-color: var(--brand);
    color: var(--blue-light);
}

.footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-inner p {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.footer-btn:hover {
    border-color: var(--brand);
    color: var(--blue-light);
    background: var(--brand-soft);
}

.footer-btn--donate {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.footer-btn--donate:hover {
    background: var(--brand-hover);
    color: #fff;
    border-color: var(--brand-hover);
}

.footer-nav a[aria-current="page"] {
    border-color: var(--brand);
    color: var(--blue-light);
}

.layout-split .footer {
    flex-shrink: 0;
    margin-top: 0;
}

.legal-page {
    padding: 40px 20px 56px;
    max-width: 820px;
}

.legal-doc h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.legal-meta,
.legal-lead {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.legal-doc h2 {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 10px;
    color: var(--text);
}

.legal-doc p,
.legal-doc li {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.legal-doc ol,
.legal-doc ul {
    padding-left: 1.35rem;
    margin-bottom: 12px;
}

.legal-doc a {
    color: var(--link);
}

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

.contact-cards {
    display: grid;
    gap: 16px;
    margin: 24px 0 32px;
}

@media (min-width: 640px) {
    .contact-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.contact-card h2 {
    font-size: 15px;
    margin: 0 0 8px;
}

.contact-highlight {
    font-size: 15px;
    font-weight: 600;
}

.contact-highlight a {
    color: var(--blue-light);
}

.contact-qr {
    margin: 14px 0 0;
}

.contact-qr a {
    display: inline-block;
}

.contact-qr img {
    display: block;
    width: 168px;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.donate-hero {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 24px;
    margin: 24px 0 32px;
}

.donate-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.btn-donate {
    display: inline-block;
    padding: 14px 28px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 16px;
}

.btn-donate:hover {
    background: var(--brand-hover);
}

.donate-contact {
    margin-top: 32px;
    font-size: 14px;
    color: var(--text-muted);
}

.donate-contact a {
    color: var(--link);
}

/* Legacy class aliases for JS */
.logo-link { text-decoration: none; color: inherit; }
.cat-chip { /* mapped to .cat in HTML */ }

@media (max-width: 768px) {
    body.layout-split {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    .layout-split .split-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .layout-split .split-left {
        max-height: 132px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .layout-split .split-cats {
        flex-direction: row;
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }
    .layout-split .split-cats .cat {
        width: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .split-info {
        display: none;
    }
    .layout-split .footer {
        display: block;
    }
    .layout-split .split-stats {
        margin-bottom: 8px;
    }
    .layout-split .split-right {
        padding: 16px;
    }
}

@media (max-width: 720px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }
    .search-wrap { order: 3; flex: 1 1 100%; max-width: none; }
    .header-info {
        order: 4;
        flex: 1 1 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding-top: 4px;
    }
    .header-info-btn {
        font-size: 11px;
        padding: 8px 10px;
    }
    .modal-grid { grid-template-columns: 1fr; }
    .offer-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
