:root {
    --bg: #070d18;
    --card: #121c2e;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f7fb;
    --muted: #8ea0b8;
    --blue: #2f89ff;
    --price: #7ec8ff;
    --ok: #3ddc97;
    --danger: #ff6b81;
    --app-top: calc(56px + env(safe-area-inset-top, 0px));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
    overscroll-behavior: none;
}
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(520px 240px at 100% -8%, rgba(47, 137, 255, 0.28), transparent 60%),
        var(--bg);
}
button, input { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; background: none; }
.wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding:
        0
        calc(16px + env(safe-area-inset-right, 0px))
        calc(28px + env(safe-area-inset-bottom, 0px))
        calc(16px + env(safe-area-inset-left, 0px));
}
main { flex: 1; }
.footer {
    margin-top: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.06em;
}
.footer a {
    color: #9ec9ff;
    font-weight: 700;
    text-decoration: none;
}
header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 calc(-16px - env(safe-area-inset-right, 0px)) 14px calc(-16px - env(safe-area-inset-left, 0px));
    padding:
        var(--app-top)
        calc(16px + env(safe-area-inset-right, 0px))
        8px
        calc(16px + env(safe-area-inset-left, 0px));
    background: rgba(7, 13, 24, 0.96);
    backdrop-filter: blur(12px);
}
.head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}
.head-actions .admin-link {
    color: #d7e7ff;
    text-decoration: none;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: #101826;
    box-shadow: 0 8px 18px rgba(10, 111, 232, 0.28);
}
.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
h1 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
.links {
    display: flex;
    gap: 8px;
    margin: -4px 0 14px;
}
.links a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: #d7e7ff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    padding: 8px 6px;
    border-radius: 12px;
    background: rgba(47, 137, 255, 0.12);
    border: 1px solid rgba(126, 200, 255, 0.18);
}
.cart-btn {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-btn.active { background: #0a6fe8; border-color: transparent; }
.cart-btn.bump { animation: cart-bump 0.45s ease; }
@keyframes cart-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.14); }
    100% { transform: scale(1); }
}
.added-toast {
    position: fixed;
    z-index: 40;
    left: 50%;
    top: calc(var(--app-top) + 62px);
    padding: 10px 14px;
    border-radius: 999px;
    background: #0a6fe8;
    color: white;
    font-size: 14px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.added-toast.on {
    opacity: 1;
    transform: translate(-50%, 0);
}
.cart-btn svg { width: 22px; height: 22px; display: block; flex: none; }
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff4d6d;
    color: white;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.search {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-field {
    position: relative;
    flex: 1;
    min-width: 0;
}
.search input {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(18, 28, 46, 0.92);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 42px 12px 14px;
    outline: none;
}
.search input:focus { border-color: rgba(94, 176, 255, 0.7); }
.search-clear {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 7px;
    width: 28px;
    height: 28px;
    margin: auto 0;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    color: #d7e7ff;
    line-height: 0;
}
.search-clear svg {
    display: block;
    width: 14px;
    height: 14px;
}
.done {
    flex: none;
    color: #9ec9ff;
    font-weight: 800;
    padding: 8px 4px;
}
.section { margin-top: 18px; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 10px;
}
.section-head h2 { margin: 0; font-size: 17px; }
.shelf, .results {
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.shelf {
    padding: 14px;
    overflow: hidden;
}
.rail {
    --rail-visible: 2;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto;
    grid-auto-columns: calc((100% - (var(--rail-visible) - 1) * 12px) / var(--rail-visible));
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0;
    padding: 0;
    scroll-padding-inline: 0;
    cursor: grab;
    user-select: none;
}
.rail img { -webkit-user-drag: none; user-select: none; }
.rail.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.rail button, .rail a { cursor: pointer; }
@media (min-width: 560px) {
    .rail { --rail-visible: 3; }
}
@media (min-width: 840px) {
    .rail { --rail-visible: 4; }
}
@media (min-width: 1100px) {
    .rail { --rail-visible: 5; }
}
.rail.rows-2 { grid-template-rows: auto auto; }
.rail::-webkit-scrollbar { display: none; }
.results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 12px;
}
.tile {
    scroll-snap-align: start;
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(186, 214, 255, 0.38);
    border-radius: 16px;
    background: rgba(7, 13, 24, 0.45);
}
.art {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #0c1626;
    aspect-ratio: 1;
}
.art img, .art .missing {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}
.discount {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(7, 18, 16, 0.82);
    color: #d8ffe9;
    border: 1px solid rgba(120, 235, 175, 0.55);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.01em;
}
.art .missing {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.buy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    column-gap: 8px;
    margin-top: 6px;
}
.price-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
.price-col .old { font-size: 11px; line-height: 1.1; }
.add {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    background: #0a6fe8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.add svg {
    width: 16px;
    height: 16px;
    display: block;
    flex: none;
}
.add.in { background: rgba(255, 255, 255, 0.12); }
.tile h3 {
    margin: 8px 0 2px;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    height: 2.5em;
    overflow: hidden;
}
.price {
    min-width: 0;
    color: var(--price);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}
.sale {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(61, 220, 151, 0.14);
    color: var(--ok);
    font-size: 10px;
    font-weight: 800;
}
.cart-list { display: grid; gap: 10px; margin-top: 8px; }
.cart-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
}
.cart-item img, .cart-item .missing {
    width: 64px;
    height: 64px;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    background: #0c1626;
    display: block;
}
.cart-item .missing { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.cart-item h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; height: auto; }
.remove { color: var(--muted); font-size: 13px; padding: 8px; }
.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 12px;
    color: var(--muted);
    font-size: 13px;
}
.linkish { color: #9ec9ff; font-weight: 700; }
.total, .pay, .panel {
    border-radius: 16px;
}
.total {
    margin-top: 14px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    background: rgba(47, 137, 255, 0.12);
    border: 1px solid rgba(126, 200, 255, 0.22);
    font-weight: 800;
}
.pay {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    color: white;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(180deg, #3b95ff, #0a6fe8);
}
.pay:disabled, .pay[aria-disabled="true"] { opacity: 0.55; }
.panel {
    text-align: center;
    padding: 34px 16px;
    background: rgba(18, 28, 46, 0.8);
    border: 1px solid var(--line);
}
.panel h2 { margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.err { color: var(--danger); }
.ghost, .more, .back {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}
.more, .back { width: 100%; color: #d7e7ff; }
.plans { display: grid; gap: 8px; }
.plan {
    padding: 14px;
    border-radius: 16px;
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
}
.plan-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    text-align: left;
}
.plan-cover {
    width: 48px;
    height: 48px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 10px;
    background: #0c1626;
}
.plan-copy { display: grid; gap: 2px; min-width: 0; }
.plan strong { display: block; font-size: 16px; }
.plan span { color: var(--muted); font-size: 12px; }
.periods { display: grid; gap: 8px; margin-top: 12px; }
.period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: center;
    column-gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(7, 13, 24, 0.35);
}
.period-info { display: grid; gap: 2px; }
.period .price { font-size: 14px; }
.tile { cursor: pointer; }
.plats {
    position: absolute;
    left: 6px;
    bottom: 6px;
    z-index: 1;
    display: flex;
    gap: 4px;
}
.plats span, .chip {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(7, 13, 24, 0.82);
    color: #d7e7ff;
    font-size: 10px;
    font-weight: 800;
}
.when {
    margin-top: 4px;
    color: #b7f3d4;
    font-size: 11px;
    font-weight: 700;
}
.game-back {
    margin: 0 0 14px;
    padding: 0;
    color: #9ec9ff;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.game-hero {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    align-items: end;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(126, 200, 255, 0.22);
}
.game-hero .art { border-radius: 18px 18px 6px 18px; box-shadow: 8px 10px 0 rgba(10, 111, 232, 0.28); }
.game-copy h2 {
    margin: 10px 0 0;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    background: rgba(7, 13, 24, 0.82);
    border: 1px solid rgba(126, 200, 255, 0.28);
    color: #d7e7ff;
}
.langs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}
.lang {
    padding: 10px 12px 12px;
    border-radius: 8px 18px 8px 18px;
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
}
.lang strong {
    display: block;
    margin-bottom: 8px;
    color: #d7e7ff;
    font-size: 12px;
    letter-spacing: 0.14em;
}
.lang-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}
.lang-line b { color: var(--text); font-weight: 750; }
.offers { display: grid; gap: 12px; }
.offer {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 92px;
    gap: 0;
    align-items: center;
    overflow: hidden;
    border-radius: 8px 22px 8px 22px;
    background: #17304d;
    border: 1px solid rgba(150, 196, 255, 0.2);
}
.offer-art {
    position: relative;
    width: 86px;
    height: 112px;
    align-self: center;
    background: #0c1626;
}
.offer-art img, .offer-art .missing {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.offer-art .missing { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.offer-badge {
    position: absolute;
    left: 0;
    bottom: 0;
    padding: 3px 7px;
    background: rgba(7, 18, 16, 0.82);
    color: #d8ffe9;
    border-top: 1px solid rgba(120, 235, 175, 0.55);
    border-right: 1px solid rgba(120, 235, 175, 0.55);
    font-size: 11px;
    font-weight: 800;
}
.offer-info {
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}
.offer-info h3 { margin: 0; font-size: 14px; line-height: 1.25; height: auto; }
.offer-plats { display: flex; flex-wrap: wrap; gap: 4px; }
.offer-plats span {
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(126, 200, 255, 0.28);
    background: rgba(7, 13, 24, 0.45);
    color: #d7e7ff;
    font-size: 10px;
    font-weight: 800;
}
.offer-until {
    color: #b7f3d4;
    font-size: 11px;
    font-weight: 700;
}
.offer-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding: 10px 10px 10px 0;
}
.offer-side .price {
    color: var(--price);
    font-size: 15px;
    text-align: right;
}
.offer .add {
    border-radius: 8px;
    background: #0a6fe8;
    color: white;
}
.offer .add.in { background: rgba(255, 255, 255, 0.12); color: white; }
.old {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 11px;
}
.order-hint {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 8px 18px;
    background: rgba(47, 137, 255, 0.12);
    border: 1px solid rgba(126, 200, 255, 0.22);
    color: #d7e7ff;
    font-size: 14px;
}
.order-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(4, 8, 16, 0.72);
}
.order-sheet {
    width: min(440px, 100%);
    margin-bottom: env(safe-area-inset-bottom, 0px);
    padding: 18px;
    border-radius: 20px;
    background: #121c2e;
    border: 1px solid rgba(150, 196, 255, 0.22);
}
.order-sheet h2 { margin: 0 0 8px; font-size: 18px; }
.order-sheet p { margin: 0 0 14px; }
.order-sheet input,
.order-sheet textarea {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(7, 13, 24, 0.72);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
    resize: none;
}
.order-sheet textarea { min-height: 96px; }
.order-sheet input:focus,
.order-sheet textarea:focus { border-color: rgba(94, 176, 255, 0.7); }
.order-sheet .err { margin: 0 0 10px; }
.order-cancel {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    color: #9ec9ff;
    font-weight: 700;
}
