/* App styles on top of style.css */

[hidden] { display: none !important; }
main#app { min-height: 50vh; }
.top.wide, main.wide { width: min(1320px, calc(100% - 32px)); }
.page .decor { display: block; }
@media (max-width: 1240px) { .page .decor { display: none; } }

/* Images inside avatars */
.ava img, .gava img, .p-photo img, .ava-big img, .join-photo img, .f-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
}
.ava { overflow: hidden; }
.gava.has-img { padding: 0; overflow: hidden; }
.me-ava .me-in { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: none; }
.me-ava { overflow: hidden; }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.nav .badge { font-size: 10px; }
.badge.req { background: var(--pink); color: var(--ink); }

/* Modal */
#modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; pointer-events: none; }
#modal:empty { display: none; }
.mback { position: fixed; inset: 0; background: #1e1b3a99; pointer-events: auto; }
.mcard { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; pointer-events: auto; display: flex; flex-direction: column; gap: 12px; }
.mcard h3 { font: 900 26px var(--sans); letter-spacing: -.04em; margin: 0; }
.mx { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--ink-2); }
.modal-open { overflow: hidden; }

.auth-tabs { display: flex; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; }
.auth-tabs button { flex: 1; font: 800 14px var(--sans); padding: 9px; background: #fff; border: 0; cursor: pointer; }
.auth-tabs button + button { border-left: 2.5px solid var(--ink); }
.auth-tabs button.on { background: var(--lime); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.auth-form input:not([type=checkbox]), .auth-form select, .inline-form input {
  font: 15px var(--sans); padding: 10px 12px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--cream); color: var(--ink);
}
.auth-form .reg-check { flex-direction: row; align-items: center; gap: 10px; font: 700 14px var(--sans); text-transform: none; letter-spacing: 0; color: var(--ink); }
.auth-form .reg-check input { width: 20px; height: 20px; accent-color: var(--purple); flex: none; }
.auth-form .btn { justify-content: center; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }
.inline-form { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 140px; }
.secret { display: block; font: 700 16px var(--mono); letter-spacing: .08em; background: var(--cream); border: 2px dashed var(--ink); border-radius: 10px; padding: 10px; margin: 8px 0; word-break: break-all; }
.link-small { background: none; border: 0; padding: 0; font: 700 13px var(--sans); color: var(--purple); cursor: pointer; text-decoration: underline; }

/* Popovers */
.pop { position: absolute; z-index: 70; padding: 6px; display: flex; flex-direction: column; min-width: 200px; max-width: calc(100vw - 16px); }
.pop-item { display: block; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: 700 14px var(--sans); color: var(--ink); cursor: pointer; text-decoration: none; }
.pop-item:hover { background: var(--cream); }
.pop-item.cur { color: var(--purple); }
.pop-item.cur::before { content: '● '; }
.pop-title { font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin: 8px 10px 4px; }
.pop-emo { grid-template-columns: repeat(6, 40px); padding: 4px; }
.ctx-reacts button { background: none; border: 0; cursor: pointer; padding: 2px; }
.ctx-reacts .more { font: 900 18px var(--sans); width: 30px; }

/* Chat */
.chat-row { text-decoration: none; color: inherit; }
.c-ava, .g-ico { overflow: hidden; }
.bubble-m { cursor: pointer; overflow-wrap: anywhere; }
.bubble-m.deleted { cursor: default; opacity: .7; }
.bubble-m em { color: var(--ink-2); }
.m-link { flex: none; }
.poster { position: relative; border-bottom: 2.5px solid var(--ink); background: var(--ink); max-height: 220px; overflow: hidden; transition: max-height .2s; }
.poster img { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.poster.folded { max-height: 34px; }
.poster.folded img { opacity: .5; }
.poster-fold { position: absolute; right: 10px; bottom: 8px; width: 30px; height: 26px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; font-weight: 900; cursor: pointer; }
.poster.folded .poster-fold { transform: rotate(180deg); top: 3px; bottom: auto; }
.poster-solo { width: 100%; border: 2.5px solid var(--ink); border-radius: 14px; }
.reply-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 16px; background: var(--lav); border-top: 2.5px solid var(--ink); font-size: 13px; }
.mx-s { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink-2); margin-left: auto; }
.composer .emo { background: none; border: 0; padding: 0; cursor: pointer; }
.composer input { min-width: 0; }
.pinned { display: flex; align-items: center; gap: 8px; }
.pinned span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.react { cursor: pointer; }
.who-faces .wf { width: 22px; height: 22px; padding: 1px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; margin-left: -6px; display: block; }
.who-faces .wf:first-child { margin-left: 0; }
.online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3ddc97; border: 1.5px solid var(--ink); margin-left: 6px; vertical-align: middle; }
.members .mem { cursor: pointer; }
.members h4 { margin-top: 10px; }
.req-row button { width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 8px; font-weight: 900; cursor: pointer; }
.req-row .ok { background: var(--lime); }
.req-row .no { background: #fff; }
.g-admin { display: flex; gap: 6px; flex-wrap: wrap; }
.small-btn { font-size: 12px; padding: 6px 10px; }
.leave { margin-top: auto; justify-content: center; }
.members { overflow: auto; }
.empty, .narrow, .group-solo { max-width: 520px; margin: 30px auto; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; position: relative; z-index: 2; }
.narrow { text-align: left; align-items: stretch; }
.solo-ava { width: 120px; height: 120px; padding: 18px; border: 3px solid var(--ink); border-radius: 26px; background: var(--lime); display: block; }
.solo-ava.has-img { padding: 0; }
.set-h { font: 900 24px var(--sans); letter-spacing: -.03em; margin: 0 0 12px; }

/* Profile and photos */
.p-photo { overflow: hidden; }
.p-photo:has(img) { padding: 0; }
.p-actions { display: flex; gap: 14px; }
.p-actions .report { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.p-groups a { font-size: 12.5px; font-weight: 700; background: var(--cream); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 9px; text-decoration: none; color: var(--ink); }
.photo.real { padding: 0; }
.photo.real img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption:empty { display: none; }
.react-btn, .del-btn { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font: 900 18px var(--sans); cursor: pointer; display: grid; place-items: center; padding: 3px; }
.react-btn .pe { width: 24px; height: 24px; }

/* Duels */
.fighter { cursor: pointer; font: inherit; }
.fighter.win { box-shadow: 9px 9px 0 var(--lime); transform: translate(-3px, -3px); }
.f-photo { padding: 0; overflow: hidden; background: var(--lav); }
.join-photo { padding: 0; overflow: hidden; background: var(--lav); }
.join-photo svg { padding: 14px; }
.duel-side .seg { width: 100%; }
.duel-side .seg i { flex: 1; text-align: center; }
.skip { background: none; border: 0; cursor: pointer; font: 800 15px var(--sans); text-decoration: underline; }
.top-list li .m-ava { width: 30px; height: 30px; }

/* Settings */
.ava-big { overflow: hidden; }
.ava-big:has(img) { padding: 0; }
.big-pick { width: 64px; height: 64px; }
.onb-photo { display: flex; align-items: center; gap: 16px; }
.onb-photo .btn { justify-content: center; }
.onb-photo p { margin: 6px 0 0; }
.onb-ava { width: 88px; height: 88px; padding: 10px; flex: none; }
.onb-ava:has(img) { padding: 0; }
.seg i { cursor: pointer; user-select: none; }
.switch { cursor: pointer; flex: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--lime); font: 800 14px var(--sans); padding: 12px 18px; border-radius: 12px; box-shadow: 4px 4px 0 var(--purple); max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }
.legal { max-width: 760px; padding: 32px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.legal h1 { font: 900 34px var(--sans); letter-spacing: -.04em; margin: 10px 0 0; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.foot-links { position: relative; z-index: 2; display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 40px; font-size: 13px; }
.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; }
.lang button { font: 800 12px var(--sans); padding: 5px 12px; border: 0; background: none; cursor: pointer; }
.lang button + button { border-left: 2px solid var(--ink); }
.lang button.on { background: var(--lime); }

@media (max-width: 1000px) {
  .messenger { display: flex; flex-direction: column; height: calc(100vh - 100px); }
  .thread { flex: 1; }
}
