:root {
    --bg: #0b0f14;
    --gold: #e4c07a;
    --gold-dim: #b8924e;
    --ink: #f4efe4;
    --muted: rgba(244, 239, 228, 0.62);
    --plate: #f4f1ea;
    --plate-ink: #1a1c1f;
    --rus: #1d4d9a;
    --tabbar: 72px;
}

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

html, body {
    min-height: 100%;
    height: 100%;
}

body {
    font-family: "Manrope", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow: auto;
}

.stage {
    position: relative;
    min-height: 100%;
    padding: 12vh 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background:
        radial-gradient(1200px 420px at 50% -10%, rgba(228, 192, 122, 0.18), transparent 55%),
        linear-gradient(180deg, #10161e 0%, #0b0f14 45%, #080b10 100%);
}

.stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(228, 192, 122, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(228, 192, 122, 0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    pointer-events: none;
}

.glow {
    position: absolute;
    width: 220px;
    height: 220px;
    top: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(228, 192, 122, 0.28), transparent 70%);
    filter: blur(12px);
    pointer-events: none;
}

.eyebrow {
    position: relative;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 18px;
}

.title {
    position: relative;
    font-size: clamp(42px, 14vw, 64px);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: var(--ink);
    text-shadow: 0 0 40px rgba(228, 192, 122, 0.25);
    margin-bottom: 22px;
}

.plate {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    width: min(88vw, 370px);
    min-height: 78px;
    border: 3px solid #17191b;
    border-radius: 8px;
    background: #fdfdfb;
    color: var(--plate-ink);
    box-shadow:
        0 0 0 1px #f0f0eb,
        0 18px 40px rgba(0, 0, 0, 0.45),
        0 0 60px rgba(228, 192, 122, 0.2);
    margin-bottom: 22px;
    overflow: hidden;
}

.bolt {
    display: none;
}

.plate-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    padding: 5px 9px 5px 27px;
    font-family: "Roboto Condensed", "Manrope", sans-serif;
    font-weight: 700;
    letter-spacing: 0;
}

.plate-main::before,
.plate-region::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #777, #111 65%);
    border: 1px solid #555;
}

.plate-main::before {
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
}

.chars {
    font-size: clamp(25px, 8vw, 39px);
    font-weight: 800;
    letter-spacing: 0.045em;
    white-space: nowrap;
    line-height: 1;
    font-family: "Roboto Condensed", "Manrope", sans-serif;
}

.plate-region {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: center;
    justify-items: center;
    min-width: 76px;
    padding: 4px 7px 3px;
    border-left: 3px solid #17191b;
    color: #111;
    margin: 4px 0;
}

.plate-region::after {
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.region-code,
.region {
    font-size: 24px;
    font-weight: 800;
    font-family: "Roboto Condensed", sans-serif;
    line-height: 1;
}

.region-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.region-flag {
    width: 19px;
    height: 12px;
    margin: 0;
    background: linear-gradient(#fff 0 33%, #1d4d9a 33% 66%, #c62828 66% 100%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.region-rus {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.lead {
    position: relative;
    max-width: 280px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
    font-weight: 400;
    margin-bottom: 28px;
}

.actions {
    position: relative;
    width: min(86vw, 340px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-primary {
    border: 0;
    color: #1a1408;
    background: linear-gradient(180deg, #f0d7a0 0%, #e4c07a 48%, #c9a054 100%);
    box-shadow: 0 10px 24px rgba(228, 192, 122, 0.28);
}

.btn-ghost {
    border: 1px solid rgba(228, 192, 122, 0.55);
    color: var(--gold);
    background: rgba(228, 192, 122, 0.06);
}

.hidden {
    display: none !important;
}

.screen {
    position: relative;
    width: min(86vw, 340px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-small {
    font-size: 28px;
    letter-spacing: 0.06em;
    margin-bottom: 20px;
}

.form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.field input {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(228, 192, 122, 0.35);
    background: rgba(8, 11, 16, 0.7);
    color: var(--ink);
    padding: 0 14px;
    font-family: inherit;
    font-size: 16px;
    letter-spacing: 0;
    text-transform: none;
}

.field input:focus {
    outline: 1px solid var(--gold);
}

.error {
    color: #f0a3a3;
    font-size: 14px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: 0;
}

.app {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 320px at 50% -8%, rgba(228, 192, 122, 0.16), transparent 55%),
        linear-gradient(180deg, #10161e 0%, #0b0f14 100%);
    padding: 18px 20px calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-y: auto;
}

.app-head {
    width: min(92vw, 420px);
    text-align: center;
    margin-bottom: 8px;
}

.app-title {
    font-size: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.app-sub,
.attempts {
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 18px;
}

.plate-live {
    width: min(92vw, 430px);
    min-height: 92px;
    margin: 12px auto 16px;
}

.plate-live .plate-main {
    padding-left: 30px;
}

.slot {
    display: inline-flex;
    width: 0.61em;
    justify-content: center;
    overflow: hidden;
    line-height: 1;
}

.slot-gap {
    margin-left: 0.13em;
}

.slot.spinning {
    filter: blur(0.6px);
    opacity: 0.86;
}

.slot.landed {
    animation: land 180ms ease-out;
}

@keyframes land {
    from { transform: translateY(10px); opacity: 0.3; }
    to { transform: translateY(0); opacity: 1; }
}

.region-input {
    width: 56px;
    border: 0;
    background: transparent;
    color: var(--rus);
    font-family: "Roboto Condensed", sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    padding: 0;
}

.region-input:focus {
    outline: none;
}

.region-input:disabled {
    opacity: 1;
}

.app-actions {
    width: min(92vw, 380px);
}

.collection {
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collection .plate,
.event-card .plate,
.lot-card .plate,
.player-plates .plate {
    width: min(100%, 340px);
    margin: 0 auto;
    min-height: 66px;
}

.collection .plate-main,
.event-card .plate-main,
.lot-card .plate-main,
.player-plates .plate-main {
    font-size: clamp(22px, 7vw, 32px);
}

.empty {
    color: var(--muted);
    text-align: center;
    margin-top: 40px;
    line-height: 1.5;
}

.shop-stub {
    margin-top: 48px;
    text-align: center;
    color: var(--muted);
    max-width: 260px;
}

.shop-icon {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 12px;
}

.shop-stub p {
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.search-row {
    width: min(92vw, 420px);
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.search-row input {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(228, 192, 122, 0.35);
    background: rgba(8, 11, 16, 0.7);
    color: var(--ink);
    padding: 0 14px;
    font-family: inherit;
    font-size: 16px;
}

.search-btn {
    width: auto;
    min-width: 110px;
    padding: 0 14px;
}

.shop-list,
.sell-box {
    width: min(92vw, 420px);
}

.shop-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
    overflow-x: hidden;
}

.lot-card {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.lot-card .plate {
    width: min(100%, 200px);
    max-width: 100%;
    margin: 0 auto 8px;
    min-height: 48px;
    box-sizing: border-box;
}

.lot-card .chars,
.lot-card .plate-main {
    font-size: 15px;
}

.lot-card .region-code,
.lot-card .region {
    font-size: 14px;
}

.lot-card .plate-region {
    min-width: 40px;
    padding: 4px;
}

.lot-meta {
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.lot-action {
    color: var(--muted);
    font-size: 12px;
}

.sell-box {
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(228, 192, 122, 0.25);
    background: rgba(8, 11, 16, 0.45);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sell-title {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--gold);
}

.field select {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(228, 192, 122, 0.35);
    background: rgba(8, 11, 16, 0.7);
    color: var(--ink);
    padding: 0 12px;
    font-family: inherit;
    font-size: 16px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 24px;
}

.modal-card {
    width: min(86vw, 340px);
    padding: 22px 18px 18px;
    border-radius: 18px;
    background: #141b24;
    border: 1px solid rgba(228, 192, 122, 0.35);
    text-align: center;
}

.modal-card p {
    margin-bottom: 18px;
    line-height: 1.45;
}

.events-list {
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-card {
    width: 100%;
    padding: 16px 14px 8px;
    border-radius: 18px;
    border: 1px solid rgba(228, 192, 122, 0.22);
    background:
        radial-gradient(180px 80px at 50% 0%, rgba(228, 192, 122, 0.16), transparent 70%),
        rgba(8, 11, 16, 0.55);
}

.event-who {
    text-align: center;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
}

.event-who strong {
    color: var(--gold);
    font-size: 16px;
    letter-spacing: 0.04em;
}

.event-time {
    color: #8b93a0;
    font-size: 12px;
}

.invite-title {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.invite-link {
    width: 100%;
    margin-bottom: 14px;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(228, 192, 122, 0.3);
    background: rgba(8, 11, 16, 0.7);
    color: var(--ink);
    padding: 0 10px;
    font-size: 12px;
}

.invite-copied {
    color: var(--gold);
    font-size: 12px;
    margin-top: 10px;
}

.event-card .plate {
    width: 100%;
    margin: 0 auto 8px;
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 20, 0.94);
    border-top: 1px solid rgba(228, 192, 122, 0.2);
    backdrop-filter: blur(12px);
    z-index: 8;
}

.tab-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    justify-content: start;
    gap: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
}

.tab-btn.active {
    color: var(--gold);
}

.tabbar .menu-toggle {
    width: min(92vw, 480px);
    min-height: 54px;
    border: 1px solid rgba(228, 192, 122, 0.4);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(228, 192, 122, 0.16), rgba(18, 24, 32, 0.98));
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.menu-toggle-glyph {
    color: var(--gold);
    font-size: 22px;
}

.menu-panel {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px);
    transform: translateX(-50%);
    width: min(94vw, 500px);
    max-height: min(62vh, 480px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(228, 192, 122, 0.3);
    border-radius: 22px;
    background: rgba(11, 15, 20, 0.97);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.menu-panel .tab-btn {
    min-height: 56px;
    padding: 8px 10px;
    border: 1px solid rgba(244, 239, 228, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    text-align: left;
}

.menu-icon {
    color: var(--gold);
    font-size: 22px;
    text-align: center;
}

.sell-ways {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rating-list {
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-row {
    width: 100%;
    border: 1px solid rgba(228, 192, 122, 0.25);
    background: rgba(8, 11, 16, 0.55);
    color: inherit;
    font: inherit;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.rating-nick {
    font-weight: 800;
    text-align: left;
}

.rating-title {
    color: #8b93a0;
    font-weight: 600;
    font-size: 12px;
}

.rating-balance {
    color: var(--gold);
    font-weight: 700;
}

.modal-card-wide {
    width: min(92vw, 360px);
    max-height: 80vh;
    overflow: auto;
}

.player-title {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.player-plates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.policy-screen {
    width: min(92vw, 560px);
    align-items: stretch;
    text-align: left;
    margin: auto;
}

.policy-screen .eyebrow,
.policy-screen .title {
    text-align: center;
}

.policy-copy {
    display: grid;
    gap: 12px;
    max-height: 48vh;
    overflow-y: auto;
    padding: 16px;
    border: 1px solid rgba(228, 192, 122, 0.22);
    border-radius: 16px;
    background: rgba(8, 11, 16, 0.58);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.policy-copy strong {
    color: var(--gold);
}

.policy-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 16px 2px;
    font-size: 13px;
    line-height: 1.45;
}

.policy-check input {
    width: 19px;
    height: 19px;
    accent-color: var(--gold);
    flex: 0 0 auto;
}

.policy-screen > .btn {
    width: 100%;
}

.plate-live .slot {
    font-size: clamp(25px, 8vw, 39px);
    font-weight: 800;
    font-family: "Roboto Condensed", "Manrope", sans-serif;
}

.meetup-stage {
    position: relative;
    width: min(96vw, 900px);
    height: clamp(250px, 42vh, 380px);
    overflow: hidden;
    border: 1px solid rgba(228, 192, 122, 0.34);
    border-radius: 24px;
    background: linear-gradient(180deg, #192d3d 0%, #405462 62%, #7a6c57 63%, #493d34 100%);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38), inset 0 0 50px rgba(0, 0, 0, 0.2);
    touch-action: pan-y;
}

.meetup-skyline {
    position: absolute;
    inset: 22% 0 26%;
    opacity: 0.75;
    background:
        linear-gradient(90deg, transparent 0 4%, #18232d 4% 13%, transparent 13% 17%, #202b34 17% 29%, transparent 29% 34%, #18232d 34% 45%, transparent 45% 51%, #202b34 51% 63%, transparent 63% 68%, #18232d 68% 82%, transparent 82% 87%, #202b34 87% 97%, transparent 97%),
        linear-gradient(0deg, transparent 0 62%, rgba(228, 192, 122, 0.2) 62% 64%, transparent 64%);
    clip-path: polygon(0 35%, 7% 35%, 7% 0, 18% 0, 18% 22%, 27% 22%, 27% 8%, 38% 8%, 38% 34%, 49% 34%, 49% 3%, 62% 3%, 62% 28%, 70% 28%, 70% 0, 82% 0, 82% 18%, 90% 18%, 90% 7%, 100% 7%, 100% 100%, 0 100%);
}

.meetup-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28%;
    border-top: 3px solid rgba(228, 192, 122, 0.42);
    background: repeating-linear-gradient(175deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 22px), linear-gradient(#564a3e, #2e2928);
}

.meetup-avatar {
    position: absolute;
    bottom: 8%;
    width: 64px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: left 180ms ease-out;
    z-index: 2;
}

.meetup-avatar.is-self {
    filter: drop-shadow(0 0 9px rgba(228, 192, 122, 0.75));
    z-index: 3;
}

.meetup-name {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(9, 13, 18, 0.8);
    color: white;
    font-size: 10px;
    font-weight: 800;
}

.meetup-art {
    display: block;
    width: 54px;
    height: 92px;
}

.meetup-art svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.meetup-level {
    color: #f3d48f;
    font-size: 9px;
    font-weight: 800;
    text-shadow: 0 2px 5px #000;
}

.meetup-hint,
.characters-intro {
    width: min(92vw, 600px);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    margin: 12px auto;
}

.meetup-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.meetup-move {
    width: 58px;
    height: 50px;
    border: 1px solid rgba(228, 192, 122, 0.5);
    border-radius: 16px;
    background: rgba(228, 192, 122, 0.1);
    color: var(--gold);
    font-family: inherit;
    font-size: 25px;
    font-weight: 800;
    touch-action: none;
}

.character-cards {
    width: min(94vw, 800px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 14px;
}

.character-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 210px;
    padding: 16px;
    border: 1px solid rgba(244, 239, 228, 0.1);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(26, 36, 44, 0.92), rgba(9, 13, 18, 0.94));
}

.character-card.selected {
    border-color: rgba(228, 192, 122, 0.72);
    box-shadow: 0 0 28px rgba(228, 192, 122, 0.12);
}

.character-art {
    height: 174px;
    display: flex;
    align-items: end;
    justify-content: center;
    border-radius: 18px;
    background: radial-gradient(circle at 50% 36%, rgba(228, 192, 122, 0.2), transparent 65%), #111920;
}

.character-art svg {
    width: 95px;
    height: 145px;
}

.character-info h3 {
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 20px;
}

.character-info p {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.character-info .character-price {
    margin: 12px 0;
    color: var(--gold);
    font-size: 15px;
    font-weight: 800;
}

.character-info .btn {
    min-height: 42px;
    font-size: 12px;
}

@media (min-width: 700px) {
    .app {
        padding-top: 28px;
    }
    .meetup-stage {
        height: min(48vh, 420px);
    }
}
