/* ========== GLOBAL ========== */
:root {
    --ink: #f6eefe;
    --muted: #cbb9e8;
    --card: rgba(24, 16, 42, .82);
    --line: rgba(255, 255, 255, .12);
    --accent: #d7b4ff;
    --danger: #ff6b7a;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #120c22;
    color: var(--ink);
    font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100dvh;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .28;
}

.app {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 18px 24px;
    backdrop-filter: blur(10px);
}

h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.lead {
    margin: 0 0 16px;
    color: var(--muted);
}

.rules {
    padding-left: 18px;
    color: var(--muted);
}

.rules li {
    margin: 0 0 8px;
}

.form {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .25);
    color: var(--ink);
    border-radius: 12px;
    padding: 12px;
    font: inherit;
}

.btn {
    display: block;
    text-align: center;
    text-decoration: none;
    background: var(--accent);
    color: #1a1430;
    font-weight: 700;
    border: 0;
    border-radius: 14px;
    padding: 14px;
    margin-top: 10px;
    width: 100%;
}

.btn.ghost {
    background: #28a9d02e;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-remove-photo {
    background-color: #ed143d;
    color: aliceblue;
}

.link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--accent);
    text-decoration: none;
}

.btnLink {
    background: #28a9d02e;
    display: block;
    text-align: center;
    text-decoration: none;
    color: #7663bb;
    font-weight: 700;
    border: 0;
    border-radius: 14px;
    padding: 7px;
    margin-top: 10px;
    width: 100%;
}

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

.ok {
    color: #b8f0c8;
}

.back {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}

.flash {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.flash-err {
    background: rgba(90, 20, 40, .9);
}

.flash-done {
    background: rgb(37 90 20 / 82%);
}

.meta {
    color: var(--muted);
    margin: 0 0 10px;
}

.install {
    display: none;
    width: 100%;
    margin-bottom: 10px;
    border: 0;
    border-radius: 14px;
    padding: 12px;
    background: var(--accent);
    color: #1a1430;
    font-weight: 700;
}

.install.show {
    display: block;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: grid;
    place-items: center;
    z-index: 20;
    padding: 16px;
}

.modal[hidden] {
    display: none;
}

/* ========== SETTINGS / FORMS ========== */
.filebtn {
    display: block;
    text-align: center;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 16px;
    background: rgb(127 128 133 / 65%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.filebtn input {
    display: none;
}

.avatars {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.ava input {
    display: none;
}

.ava img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 14px;
    border: 2px solid transparent;
    background: rgba(0, 0, 0, .2);
}

.ava input:checked + img {
    border-color: var(--accent);
}

.setpic {
    width: 98%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
    border-radius: 18px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 15px;
}

.check input {
    width: auto;
}

/* ========== GALLERY ========== */
.filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
}

.filters select,
.filters input,
.filters button {
    margin: 0;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(24, 16, 42, .8);
    color: var(--ink);
    font: inherit;
}

.filters button {
    background: var(--accent);
    color: #1a1430;
    font-weight: 700;
}

.frow {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.frow select,
.frow input,
.frow button {
    min-width: 0;
}

.frow select[name="c"] {
    flex: 1;
}

.frow input[name="a1"],
.frow input[name="a2"] {
    width: 4.2em;
    flex: 0 0 4.2em;
}

.filter-label {
    text-align: center;
    color: #fff;
}

.mylist-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1px;
    font-size: 25px;
    border-radius: 999px;
    background: rgba(215, 180, 255, .2);
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.mylist-btn.dot {
    position: relative;
}

.mylist-btn.dot::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff0000f2;
}

.gal .dots {
    display: flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
}

.deck {
    position: relative;
}

.swipe {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px 18px;
    touch-action: pan-y;
    transition: transform .2s ease, opacity .2s ease;
}

.swipe-hint {
    text-align: center;
    margin: 0 0 8px;
    font-size: 13px;
    opacity: .7;
}

.arr {
    position: absolute;
    top: 42%;
    font-size: 36px;
    opacity: .28;
    pointer-events: none;
    z-index: 3;
}

.arr.l {
    left: 6px;
}

.arr.r {
    right: 6px;
}

.picwrap {
    position: relative;
}

.phico {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    font-size: 16px;
    line-height: 1;
    background: rgba(18, 12, 34, .72);
    border-radius: 8px;
    padding: 4px 6px;
}

.phico.on {
    background: #2f6f5a;
    color: #b8ffe0;
}

.phico.off {
    background: #2a2438;
    color: #6b6578;
    opacity: .85;
}

.galhint {
    text-align: center;
    margin: 12px 0 6px;
}

.empty {
    padding-top: 80px;
    text-align: center;
}

.swipe img {
    width: 42%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    margin: 10px auto 16px;
    border-radius: 20px;
}

.swipe h2 {
    margin: 0;
    text-align: center;
}

.swipe .meta,
.swipe .about {
    text-align: center;
    color: var(--muted);
}

.swipe.go-left {
    transform: translateX(-120%) rotate(-8deg);
    opacity: 0;
}

.swipe.go-right {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
}

/* ========== PERSON CARD ========== */
.person .picwrap {
    margin-bottom: 8px;
}

.person .bigava {
    width: 99%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    margin: 8px auto 12px;
    border-radius: 24px;
}

.rowbtns {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 10px;
}

.heart {
    font-size: 26px;
    padding: 10px;
    margin-top: 10px;
}

.heart.on {
    background: #ff6b8a;
    color: #fff;
    border-color: transparent;
}

.likebtn {
    background: none;
    border: 0;
    width: 100%;
    cursor: pointer;
}

/* ========== LISTS ========== */
.list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.list .row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .2);
    color: inherit;
    text-decoration: none;
}

.list .row > span {
    flex: 1;
    min-width: 0;
}

.list img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.list i {
    display: block;
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.badge {
    min-width: 20px;
    text-align: center;
    height: 20px;
    margin-left: auto;
    margin-right: 5px;
    border-radius: 50%;
    background: #ff0000f2;
}

/* ========== CHAT ========== */
html.chat, body.chatbody {
    height: 100%;
    overflow: hidden;
}

body.chatbody .app,
body.chatbody .app-chat {
    height: 100svh;
    max-height: 100svh;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chatpage {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(18, 12, 34, .72);
}

.chatbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    position: relative;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
}

.chatname {
    font-weight: 700;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbar .dots {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 22px;
    width: 44px;
    height: 44px;
}

.drop {
    position: absolute;
    right: 8px;
    top: 46px;
    background: #241b3a;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    z-index: 5;
    min-width: 160px;
}

.drop button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: var(--ink);
}

.drop button.bad {
    color: var(--danger);
}

.thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bubble {
    max-width: 78%;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    align-self: flex-start;
    word-break: break-word;
}

.bubble.mine {
    align-self: flex-end;
    background: #7b5bb0;
}

.composer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 8px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(18, 12, 34, .92);
}

.composer input {
    margin: 0;
    border-radius: 18px;
}

.composer button {
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1430;
    font-size: 18px;
}

/* ========== GAMES HUB ========== */
.ggrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.gtile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    text-align: center;
}

.gico {
    font-size: 36px;
}

.btnGames {
    background: linear-gradient(to bottom, #ff9900, #ff5500);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 85, 0, 0.5);
}

/* =============== ABOUT PAGE =============== */
.about-screen {
    max-width: 28rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    color: #1a1a1a;
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.about-hero {
    margin-bottom: 1.5rem;
}

.eyebrow {
    margin: 0 0 .35rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .72rem;
    color: #7a6a4a;
}

.about-screen h1 {
    margin: 0 0 .6rem;
    font-size: 1.55rem;
    line-height: 1.2;
}

.about-screen .lead {
    margin: 0;
    color: #444;
}

.about-block {
    margin: 0 0 .85rem;
    padding: 1rem 1rem 1.05rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
    border: 1px solid #efe7d8;
}

.about-block.accent {
    background: #fff8ec;
}

.about-block.donate {
    background: #1c1915;
    color: #f6f0e6;
    border-color: #1c1915;
}

.about-screen h2 {
    margin: 0 0 .45rem;
    font-size: 1.05rem;
}

.about-screen p {
    margin: 0 0 .65rem;
}

.about-screen p:last-child {
    margin-bottom: 0;
}

.about-screen ul {
    margin: .2rem 0 .7rem;
    padding-left: 1.1rem;
}

.about-screen li {
    margin-bottom: .35rem;
}

.joke {
    font-size: .95rem;
    color: #5c4a2e;
}

.about-block.donate p {
    color: #f6f0e6;
}

.about-actions {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin: .9rem 0 .75rem;
}

.about-screen .btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: .8rem 1rem;
    border-radius: 12px;
    background: #f3c14a;
    color: #1c1915;
    font-weight: 650;
}

.about-screen .btnGhost {
    background: transparent;
    color: #f6f0e6;
    border: 1px solid #6b6256;
}

/* about page instalation instruction for android app */
.apk-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.info-q {
    flex: 0 0 52px;
    width: 52px;
    height: auto;
    min-height: 48px;
    border: none;
    border-radius: 16px;
    background: #5b8def;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
}

.apk-dialog {
    max-width: 440px;
    width: 94%;
    padding: 0;
    border: none;
    border-radius: 22px;
    background: #1a1430;
    color: #f6eefe;
}

.apk-dialog::backdrop {
    background: rgba(0, 0, 0, .7);
}

.apk-dialog-inner {
    padding: 28px 22px 26px;
    line-height: 1.45;
}

.apk-dialog h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.apk-dialog h3 {
    margin: 18px 0 10px;
    font-size: 17px;
}

.apk-dialog p {
    margin: 0 0 12px;
}

.apk-dialog ol {
    margin: 0 0 16px 20px;
    padding: 0;
}

.apk-dialog li {
    margin-bottom: 8px;
}

.apk-dialog .btn {
    width: 100%;
    margin-top: 8px;
}

.apk-info-btn {
    width: 4em;
    background: #5caaee !important;
    color: white !important;
    font-size: larger !important;
}

/* end of about - instruction dialog styles */
.sign {
    margin: .4rem 0 0;
    font-size: .9rem;
    opacity: .85;
}