:root {
  --bg: #0a0d12;
  --bg2: #10151d;
  --line: #1f2733;
  --text: #e8edf3;
  --muted: #8b97a8;
  --green: #4ade80;
  --green2: #22c55e;
  --gold: #ffd23f;
  --pink: #ff5fa2;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, Vazirmatn, system-ui, sans-serif; line-height: 1.65;
  background-image: radial-gradient(60rem 30rem at 85% -10%, #12351f55, transparent), radial-gradient(50rem 30rem at 0% 30%, #2a1a4a33, transparent);
  min-height: 100vh;
}
a { color: var(--green); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.w100 { width: 100%; }
[hidden] { display: none !important; }

/* buttons */
.btn { border: 1px solid transparent; border-radius: 12px; padding: .55rem 1.1rem; font-weight: 700; color: var(--text); background: #1a212c; transition: transform .12s, background .15s, border-color .15s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-green { background: var(--green); color: #052e14; }
.btn-green:hover { background: #6ee79a; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-sm { padding: .3rem .7rem; font-size: .9rem; border-radius: 10px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 3rem); background: #0a0d12d9; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: .55rem; color: var(--text); }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--green), #16a34a); display: grid; place-items: center; color: #052e14; box-shadow: 0 0 24px #4ade8055; }
.logo-mark svg { width: 24px; height: 24px; }
.logo b { font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; display: block; line-height: 1; }
.logo small { font-size: .58rem; letter-spacing: .22em; color: var(--muted); }
.nav { display: flex; gap: 1.2rem; margin-inline-start: auto; }
.nav a { color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); }
.me-box { display: flex; align-items: center; gap: .5rem; }
.me-chip { display: flex; align-items: center; gap: .5rem; background: #141a23; border: 1px solid var(--line); padding: .25rem .4rem .25rem .8rem; border-radius: 999px; color: var(--text); }
.me-chip .av { width: 30px; height: 30px; }
.me-chip b { font-size: .9rem; }
@media (max-width: 760px) { .nav { display: none; } .me-box { margin-inline-start: auto; } }

/* avatars */
.av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--avbg, #222); border: 2px solid #ffffff22; }
.av svg, .av .mimg { width: 100%; height: 100%; }
.av.bot { font-size: 1.2em; }
.holder-badge { color: var(--gold); font-size: .85em; }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 2rem; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) 2rem; max-width: 1200px; margin: 0 auto; }
.pill { display: inline-block; background: #4ade801a; color: var(--green); border: 1px solid #4ade8044; padding: .2rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); line-height: 1.25; margin: .8rem 0; font-weight: 900; }
.grad { background: linear-gradient(90deg, var(--green), #a3e635 40%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #c3ccd8; font-size: 1.08rem; max-width: 34rem; }
.cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.4rem 0; }
.stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.4rem; color: var(--green); }
.stats span { color: var(--muted); font-size: .85rem; }
.hero-cards { position: relative; height: 380px; }
.hero-cards .card { --cw: 150px; position: absolute; left: 50%; top: 50%; transform-origin: 50% 120%; transition: transform .5s cubic-bezier(.2, .8, .2, 1.2); }
.hero-cards:hover .card { filter: brightness(1.05); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .cta, .stats { justify-content: center; }
  .hero-cards { height: 270px; order: -1; }
  .hero-cards .card { --cw: 108px; }
}

.resume { max-width: 1200px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; gap: 1rem; background: #4ade8014; border: 1px solid #4ade8044; border-radius: var(--radius); padding: .8rem; }

/* blocks */
.block { max-width: 1200px; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 3rem); scroll-margin-top: 60px; }
.block h2 { font-size: 1.9rem; font-weight: 900; margin: 0 0 1.2rem; }
.block h2::before { content: '♠ '; color: var(--green); }
.lead { color: #c3ccd8; margin-top: -.6rem; }

.modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 980px) { .modes { grid-template-columns: 1fr; } }
.mode { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.mode-head { display: flex; gap: .8rem; align-items: flex-start; }
.mode-head .ico { font-size: 1.6rem; width: 48px; height: 48px; display: grid; place-items: center; background: #ffffff0a; border-radius: 12px; flex: none; }
.mode h3 { margin: 0; font-size: 1.2rem; }
.mode p { margin: 0; color: var(--muted); font-size: .9rem; }
.row { display: flex; flex-direction: column; gap: .5rem; }
.row > label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.seg { display: flex; background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: .4rem; border-radius: 9px; font-weight: 700; }
.seg button.on { background: #1f2a37; color: var(--text); box-shadow: inset 0 0 0 1px #4ade8055; }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.chk { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.join { display: flex; gap: .5rem; }
.join input, .chat-form input { flex: 1; min-width: 0; background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: .55rem .8rem; outline: none; }
.join input:focus, .chat-form input:focus { border-color: var(--green); }
#joinCode { text-transform: uppercase; letter-spacing: .2em; text-align: center; }
.open-rooms { display: flex; flex-direction: column; gap: .5rem; max-height: 330px; overflow: auto; }
.oroom { display: flex; align-items: center; gap: .7rem; background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .8rem; }
.oroom .meta { flex: 1; min-width: 0; }
.oroom b { display: block; }
.oroom small { color: var(--muted); }
.seats-dots { display: flex; gap: 3px; }
.seats-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3442; }
.seats-dots i.f { background: var(--green); }

/* suits showcase */
.suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 860px) { .suits { grid-template-columns: repeat(2, 1fr); } }
.suit { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; }
.suit .mini-fan { display: flex; justify-content: center; height: 130px; position: relative; width: 100%; }
.suit .mini-fan .card { --cw: 84px; position: absolute; top: 4px; left: calc(50% - 42px); }
.suit b { font-size: 1.05rem; }
.suit small { color: var(--muted); }

/* leaderboard */
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: .35rem 1rem; font-weight: 700; }
.tabs button.on { color: #052e14; background: var(--green); border-color: var(--green); }
.lb { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lb table { width: 100%; border-collapse: collapse; }
.lb th, .lb td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb th { color: var(--muted); font-size: .8rem; font-weight: 600; background: #0d1219; }
.lb tr:last-child td { border-bottom: 0; }
.lb .rk { width: 3rem; font-weight: 900; color: var(--muted); }
.lb tr:nth-child(1) .rk { color: var(--gold); }
.lb tr:nth-child(2) .rk { color: #cbd5e1; }
.lb tr:nth-child(3) .rk { color: #f59e0b; }
.lb .who { display: flex; align-items: center; gap: .6rem; }
.lb .who .av { width: 32px; height: 32px; }
.lb .who small { color: var(--muted); display: block; font-size: .75rem; }
.lb .num { font-weight: 800; color: var(--green); }
.lb p { padding: 1.5rem; margin: 0; text-align: center; }
@media (max-width: 600px) { .lb .hide-sm { display: none; } }

/* chat */
.chatbox { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; height: 460px; }
.chat-msgs { flex: 1; overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.msg { display: flex; gap: .55rem; align-items: flex-start; }
.msg .av { width: 30px; height: 30px; }
.msg .bubble { background: #161d27; border-radius: 14px 14px 14px 4px; padding: .35rem .75rem; max-width: 80%; }
.msg .bubble .n { font-weight: 800; font-size: .8rem; color: var(--green); }
.msg .bubble .n small { color: var(--muted); font-weight: 400; margin-inline-start: .4rem; }
.msg .bubble .t { word-wrap: break-word; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.msg.mine .bubble { background: #133222; }
.msg.sys { justify-content: center; color: var(--muted); font-size: .8rem; }
.chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }

/* rules + token */
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .rule-grid { grid-template-columns: 1fr; } }
.rule-grid > div { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.rule-grid h3 { margin: 0 0 .3rem; color: var(--green); font-size: 1.05rem; }
.rule-grid p { margin: 0; color: #c3ccd8; font-size: .95rem; }
.token-card, .token-perks { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem; }
.token-card .ca { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.token-card code { background: #0a0d12; border: 1px solid var(--line); padding: .35rem .7rem; border-radius: 10px; direction: ltr; font-size: .85rem; overflow-wrap: anywhere; }
.token-perks h3 { margin: 0 0 .4rem; }
.token-perks ul { margin: 0; padding-inline-start: 1.2rem; }

.foot { border-top: 1px solid var(--line); padding: 2rem clamp(1rem, 4vw, 3rem); text-align: center; }
.links { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: .6rem; }
.links a { border: 1px solid var(--line); border-radius: 999px; padding: .3rem 1rem; color: var(--text); }
.links a:hover { border-color: var(--green); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: #000a; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 1rem; }
.modal-card { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 1.4rem; width: min(420px, 100%); display: flex; flex-direction: column; gap: .8rem; }
.modal-card h3 { margin: 0; }
.modal-card p { margin: 0; }
.x { position: absolute; top: .7rem; right: .7rem; background: transparent; border: 0; color: var(--muted); font-size: 1.1rem; }
.wallet-list { display: flex; flex-direction: column; gap: .5rem; }
.wallet-list .btn { justify-content: space-between; width: 100%; padding: .75rem 1rem; }
.wallet-list .btn small { color: var(--muted); font-weight: 400; }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.pstats div { background: #0a0d12; border-radius: 12px; padding: .5rem; }
.pstats b { display: block; color: var(--green); font-size: 1.2rem; }
.pstats span { font-size: .75rem; color: var(--muted); }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 100; background: #1d2633; border: 1px solid var(--line); padding: .6rem 1.2rem; border-radius: 12px; box-shadow: 0 10px 30px #0008; max-width: 90vw; text-align: center; }

/* ======================== CARDS ======================== */
/* classic playing-card face: cream paper, corner indices, pips; every pip is a meme coin */
.card {
  --cw: 90px; --sc: #059669;
  position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); flex: none;
  font-size: calc(var(--cw) / 6); border-radius: .55em; overflow: hidden; user-select: none;
  background: linear-gradient(160deg, #fffdf7, #f3ecdc);
  border: .05em solid #d6ccb4;
  box-shadow: 0 .3em .8em #000a, inset 0 0 0 .18em #fffdf7, inset 0 0 0 .23em color-mix(in srgb, var(--sc) 35%, transparent);
  color: var(--sc); direction: ltr; font-family: Inter, Vazirmatn, system-ui, sans-serif; line-height: 1;
}
.card .cr { position: absolute; top: .36em; left: .3em; z-index: 2; display: flex; flex-direction: column; align-items: center; width: .9em; }
.card .cr b { font-size: .95em; font-weight: 900; letter-spacing: -.07em; }
.card .cr i { font-style: normal; font-size: .72em; margin-top: .08em; }
.card .cr2 { top: auto; left: auto; bottom: .36em; right: .3em; transform: rotate(180deg); }
/* pips */
.card .pip { position: absolute; width: 19.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; background: var(--sc); box-shadow: 0 0 0 .07em var(--sc), 0 .06em .14em #0005; }
.card .pip.down { transform: translate(-50%, -50%) rotate(180deg); }
.card .pip svg, .card .pip img, .card .acecoin svg, .card .acecoin img, .card .portrait svg, .card .portrait img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
/* ace: one big coin */
.card .acecoin { position: absolute; left: 50%; top: 45%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; background: var(--sc); box-shadow: 0 0 0 .12em var(--sc), 0 0 0 .22em #fffdf7, 0 0 0 .28em color-mix(in srgb, var(--sc) 45%, transparent), 0 .2em .5em #0004; }
.card.ace .cname { position: absolute; left: 0; right: 0; top: 74%; text-align: center; font-weight: 900; font-size: .62em; letter-spacing: .02em; }
/* J Q K: framed portrait */
.card .portrait { position: absolute; left: 19%; right: 19%; top: 12%; bottom: 12%; border-radius: .3em; overflow: hidden; background: var(--sc); box-shadow: 0 0 0 .08em var(--sc), 0 0 0 .16em #fffdf7, 0 0 0 .21em color-mix(in srgb, var(--sc) 50%, transparent); }
.card .ptitle { position: absolute; left: 0; right: 0; bottom: 0; padding: .2em 0 .16em; text-align: center; font-size: .42em; font-weight: 900; letter-spacing: .1em; color: #fff; background: linear-gradient(transparent, #000c 45%); }
.card .crib { position: absolute; top: .5em; right: -1.9em; transform: rotate(35deg); background: var(--gold); color: #3b2500; font-size: .4em; font-weight: 900; padding: .15em 2.3em; z-index: 3; letter-spacing: .1em; box-shadow: 0 .1em .3em #0005; }
.card.trump { border-color: #e0b100; box-shadow: 0 .3em .8em #000a, 0 0 .8em #ffd23f88, inset 0 0 0 .18em #fffdf7, inset 0 0 0 .26em #f2c200; }
/* small cards (crowded mobile hands): bigger index, no bottom index */
.card.mini .cr { width: 1.25em; }
.card.mini .cr b { font-size: 1.25em; }
.card.mini .cr i { font-size: 1em; }
.card.mini .cr2, .card.mini .ptitle, .card.mini.ace .cname { display: none; }
.mimg { width: 100%; height: 100%; object-fit: cover; display: block; }
/* back */
.card.back { background: radial-gradient(circle at 50% 50%, #1b5e36, #0b2817 70%); border-color: #4ade8077; }
.card.back::before { content: ''; position: absolute; inset: .35em; border-radius: .4em; border: .08em dashed #4ade8066; background: repeating-linear-gradient(45deg, #ffffff08 0 .3em, transparent .3em .6em); }
.card.back .bk { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.card.back .bk span { font-weight: 900; font-size: 1.3em; color: var(--green); text-shadow: 0 0 .6em #4ade80aa; }
.card.back .bk small { font-size: .42em; letter-spacing: .3em; color: #b7f7cf; }
.card.back.gold { background: radial-gradient(circle at 50% 50%, #7a5b00, #2c2000 72%); border-color: #ffd23faa; }
.card.back.gold::before { border-color: #ffd23f77; }
.card.back.gold .bk span { color: var(--gold); text-shadow: 0 0 .6em #ffd23faa; }
.card.back.gold .bk small { color: #ffe9a3; }

/* ======================== GAME ======================== */
body.in-game { overflow: hidden; }
.game { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 45%, #123a24 0%, #0b1d13 45%, #070b09 100%); }
.g-top { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; padding-top: max(.5rem, env(safe-area-inset-top)); background: #0008; border-bottom: 1px solid #ffffff12; }
.g-score { flex: 1; display: flex; justify-content: center; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .9rem; }
.g-score .sc { display: flex; align-items: center; gap: .35rem; background: #ffffff0d; border-radius: 10px; padding: .15rem .6rem; }
.g-score .sc b { font-size: 1.1rem; }
.g-score .us b { color: var(--green); }
.g-score .them b { color: #f87171; }
.g-score .trumpi { display: flex; align-items: center; gap: .3rem; background: #ffd23f22; color: var(--gold); border-radius: 10px; padding: .1rem .6rem; font-weight: 800; }
.g-score .trumpi svg { width: 22px; height: 22px; }
.g-tools { display: flex; gap: .4rem; position: relative; }
.dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }

.table { position: relative; flex: 1; min-height: 0; }
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; z-index: 3; width: 120px; }
.seat .av { width: 48px; height: 48px; position: relative; }
.seat .av .ring { position: absolute; inset: -6px; border-radius: 50%; }
.seat .nm { font-size: .8rem; font-weight: 800; background: #000a; padding: .05rem .55rem; border-radius: 8px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .info { font-size: .72rem; color: #cbd5e1; display: flex; gap: .35rem; align-items: center; justify-content: center; }
.seat .hk { position: absolute; top: -12px; right: -8px; width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 0 4px #000); }
.seat .tm { font-size: .65rem; padding: 0 .4rem; border-radius: 6px; }
.seat .tm.us { background: #4ade8033; color: var(--green); }
.seat .tm.them { background: #f8717133; color: #fca5a5; }
.seat.turn .av { box-shadow: 0 0 0 3px var(--green), 0 0 18px #4ade80aa; }
.seat.off .av { opacity: .45; }
.seat .backs { display: flex; height: 40px; margin-top: .2rem; align-items: center; position: relative; padding-left: 6px; }
.seat .backs .card { --cw: 26px; margin-left: -18px; box-shadow: 0 2px 4px #0008; transform-origin: 50% 100%; }
.seat .backs .cnt { margin-left: 8px; font-size: .8rem; font-weight: 800; color: #cbd5e1; }
.seat .backs .card:first-child { margin-left: 0; }
.seat .backs .card .bk { display: none; }
.pos-top { top: 10px; left: 50%; transform: translateX(-50%); }
.pos-left { left: 8px; top: 42%; transform: translateY(-50%); }
.pos-right { right: 8px; top: 42%; transform: translateY(-50%); }
.pos-bottom { bottom: 6px; left: 50%; transform: translateX(-50%); flex-direction: row; width: auto; gap: .5rem; }
.pos-bottom .av { width: 36px; height: 36px; }

.timer { width: 64px; height: 4px; background: #ffffff22; border-radius: 4px; overflow: hidden; }
.timer span { display: block; height: 100%; background: var(--green); transition: width .25s linear; }
.timer.warn span { background: #f87171; }

.trick { position: absolute; left: 50%; top: 45%; width: 0; height: 0; }
.trick .card { --cw: 78px; position: absolute; left: calc(var(--cw) / -2); top: calc(var(--cw) * -0.7); transition: transform .35s ease, opacity .35s; }
.trick .t-bottom { transform: translate(0, 40%); }
.trick .t-top { transform: translate(0, -40%); }
.trick .t-left { transform: translate(-58%, 0) rotate(-8deg); }
.trick .t-right { transform: translate(58%, 0) rotate(8deg); }
.trick.two .t-bottom { transform: translate(18%, 22%) rotate(6deg); }
.trick.two .t-top { transform: translate(-18%, -22%) rotate(-6deg); }
.trick .card.win { box-shadow: 0 0 0 .14em var(--green), 0 0 1.4em #4ade80cc; z-index: 5; }
.trick .card.enter { animation: enter .3s ease-out; }
@keyframes enter { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
.trick.collect .card { opacity: 0; }

.center-msg { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); text-align: center; z-index: 6; width: min(440px, 92%); }
.panel { background: #0b120ee6; border: 1px solid #4ade8044; border-radius: 18px; padding: 1rem 1.2rem; box-shadow: 0 20px 50px #000a; }
.panel h3 { margin: 0 0 .5rem; }
.panel p { margin: .2rem 0 .6rem; color: #c3ccd8; }
.suit-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.suit-pick button { background: #0a0d12; border: 2px solid var(--line); border-radius: 14px; padding: .4rem .2rem .3rem; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.suit-pick button:hover { border-color: var(--sc); box-shadow: 0 0 14px color-mix(in srgb, var(--sc) 50%, transparent); }
.suit-pick svg { width: 54px; height: 54px; }
.suit-pick b { color: var(--sc); font-size: 1rem; }
.suit-pick small { font-size: .7rem; color: var(--muted); }
.draw-box { display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.draw-box .card { --cw: 104px; }
.draw-box .btns2 { width: 100%; }
.waiting-seats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .6rem 0; }
.wseat { display: flex; align-items: center; gap: .5rem; background: #ffffff08; border-radius: 12px; padding: .4rem .6rem; font-size: .9rem; text-align: left; }
.wseat .av { width: 30px; height: 30px; }
.wseat.empty { color: var(--muted); border: 1px dashed #ffffff22; }
.code-big { font-size: 1.8rem; letter-spacing: .3em; font-weight: 900; color: var(--green); direction: ltr; }
.share-row { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .4rem 0 .6rem; }

.hand { display: flex; justify-content: center; align-items: flex-end; padding: .4rem .5rem; padding-bottom: max(.6rem, env(safe-area-inset-bottom)); min-height: 120px; background: linear-gradient(transparent, #0008); }
.hand .card { transition: transform .15s, filter .15s, margin .2s; }
.hand .card.ok { cursor: pointer; }
.hand .card.ok:hover { transform: translateY(-14px); }
.hand.myturn .card.ok { box-shadow: 0 .35em .9em #0009, 0 0 0 .1em var(--green); }
.hand .card.no { filter: brightness(.45) saturate(.6); }
.hand .card.sent { transform: translateY(-30px); opacity: .5; }

.g-over { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: #0007; backdrop-filter: blur(2px); padding: 1rem; }
.g-over .panel { text-align: center; max-width: 420px; width: 100%; }
.big-res { font-size: 2rem; font-weight: 900; margin: .2rem 0; }
.big-res.win { color: var(--green); }
.big-res.lose { color: #f87171; }
.kot { display: inline-block; background: var(--pink); color: #fff; padding: .1rem .7rem; border-radius: 8px; font-weight: 900; animation: pop .5s; }
@keyframes pop { 0% { scale: .3; } 70% { scale: 1.2; } 100% { scale: 1; } }

.tchat { position: absolute; z-index: 35; top: 52px; right: .6rem; width: min(340px, calc(100% - 1.2rem)); max-height: 60%; display: flex; flex-direction: column; background: #0b0f14f2; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px #000a; }
.tchat-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid var(--line); position: relative; }
.tchat-head .x { position: static; }
.tchat-msgs { flex: 1; overflow: auto; padding: .6rem; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; min-height: 120px; }
.tchat-msgs .m b { color: var(--green); margin-inline-end: .3rem; }
.tchat-msgs .m.sys { color: var(--muted); font-size: .78rem; text-align: center; }
.tchat-msgs .m span { unicode-bidi: plaintext; overflow-wrap: anywhere; }
.quick { display: flex; gap: .3rem; flex-wrap: wrap; padding: .4rem .6rem 0; }
.quick button { background: #ffffff0d; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; }
.bubble-float { position: absolute; z-index: 32; background: #fff; color: #111; padding: .2rem .6rem; border-radius: 12px; font-size: .8rem; font-weight: 700; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: fadeup 3.5s forwards; pointer-events: none; }
@keyframes fadeup { 0% { opacity: 0; translate: 0 6px; } 10%, 80% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -8px; } }

@media (max-width: 600px) {
  .trick .card { --cw: 62px; }
  .seat { width: 92px; }
  .seat .av { width: 40px; height: 40px; }
  .seat .nm { font-size: .72rem; max-width: 92px; }
  .pos-left, .pos-right { top: 36%; }
  .pos-left { left: 2px; } .pos-right { right: 2px; }
  .g-score { font-size: .78rem; gap: .4rem; }
  .suit-pick svg { width: 44px; height: 44px; }
}
@media (max-height: 560px) {
  .trick .card { --cw: 56px; }
  .hand { min-height: 90px; }
}
body.in-game .toast { bottom: auto; top: 64px; }
.hand { padding-bottom: max(.9rem, env(safe-area-inset-bottom)); }
/* English typography */
h1, h2, h3, .big-res, .code-big { font-family: "Space Grotesk", Inter, Vazirmatn, sans-serif; letter-spacing: -.01em; }
.hero h1 { line-height: 1.08; }
.mode-head .ico svg { width: 30px; height: 30px; }
.faces { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.faces div { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .45rem .9rem; display: flex; gap: .5rem; align-items: baseline; }
.faces b { color: var(--gold); font-size: .9rem; }
.faces span { color: var(--muted); font-size: .85rem; }
.card.back .bk span { font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.05em; letter-spacing: .04em; }
.card.back .bk small { letter-spacing: .15em; margin-top: .3em; }
.suit-pick .mimg { width: 54px; height: 54px; border-radius: 12px; }
.g-score .trumpi .mimg { width: 22px; height: 22px; border-radius: 6px; }
@media (max-width: 600px) { .suit-pick .mimg { width: 44px; height: 44px; } }
.seat .info { flex-wrap: wrap; }
/* matchmaking */
.find { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.find .btn { flex-direction: column; gap: .1rem; padding: 1rem .5rem; }
.find .btn small { font-weight: 600; font-size: .78rem; opacity: .75; }
.panel.search { text-align: center; }
.radar { position: relative; width: 84px; height: 84px; margin: .2rem auto .6rem; display: grid; place-items: center; }
.radar .av { width: 56px; height: 56px; position: relative; z-index: 1; }
.radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green); opacity: 0; animation: ping 2s ease-out infinite; }
.radar span + span { animation-delay: 1s; }
@keyframes ping { from { transform: scale(.6); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }
.dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.msg.sys { text-align: center; }
.msg.sys small { opacity: .6; margin-inline-start: .3rem; }
/* ===== market + studio ===== */
.sub { font-size: 1.1rem; margin: 1.6rem 0 .8rem; display: flex; align-items: center; gap: .5rem; }
.shop-pane > .sub:first-child { margin-top: .4rem; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.mk-item { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.mk-item.official { border-color: #ffd23f66; box-shadow: 0 0 24px #ffd23f14; }
.mk-fan { position: relative; height: 122px; }
.mk-fan .card { position: absolute; left: calc(50% - 37px); top: 4px; }
.mk-meta { display: flex; flex-direction: column; gap: .1rem; }
.mk-meta b { font-size: 1.02rem; }
.mk-tk { font-weight: 800; font-size: .88rem; }
.mk-meta small { color: var(--muted); font-size: .78rem; }
.mk-buy { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.mk-price { font-weight: 900; color: var(--green); }
.mk-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.mk-report { position: absolute; top: .5rem; right: .6rem; background: none; border: 0; color: var(--muted); font-size: .72rem; opacity: .6; }
.mk-report:hover { opacity: 1; color: #f87171; }
.mk-sales { display: flex; flex-direction: column; gap: .3rem; }
.mk-sales > div { display: flex; justify-content: space-between; gap: .8rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .8rem; font-size: .88rem; flex-wrap: wrap; }
.note { margin-top: 1.4rem; background: #4ade800d; border: 1px solid #4ade8033; border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .9rem; color: #c3ccd8; }
.inp { width: 100%; background: #0a0d12; border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: .6rem .8rem; outline: none; }
.inp:focus { border-color: var(--green); }
.pay-rows { display: flex; flex-direction: column; gap: .3rem; background: #0a0d12; border-radius: 12px; padding: .6rem .8rem; }
.pay-rows div { display: flex; justify-content: space-between; font-size: .92rem; }
.studio { display: grid; grid-template-columns: minmax(0, 520px); gap: 1rem; }
.st-step { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.st-step h3 { margin: 0; }
.drop { display: grid; place-items: center; min-height: 190px; border: 2px dashed #ffffff26; border-radius: 14px; cursor: pointer; text-align: center; color: var(--muted); overflow: hidden; background: #0a0d12; }
.drop:hover { border-color: var(--green); }
.drop img { max-width: 100%; max-height: 260px; display: block; }
.st-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.st-opt { padding: 0; border: 3px solid transparent; border-radius: 16px; overflow: hidden; background: #0a0d12; aspect-ratio: 1; }
.st-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-opt.on { border-color: var(--green); box-shadow: 0 0 18px #4ade8066; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg[data-name="stSuit"] button { font-size: .85rem; }
.adm-row { display: flex; gap: .8rem; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; margin-bottom: .5rem; }
.adm-row img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.adm-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .seg[data-name="stSuit"] button { font-size: .72rem; padding: .4rem .1rem; } }
.logo b i { font-style: normal; color: var(--green); font-weight: 600; }
.adm-models { display: flex; flex-direction: column; gap: .4rem; }
.adm-models label { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; cursor: pointer; }
.cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; margin-top: .8rem; }
.cmp { display: flex; flex-direction: column; gap: .2rem; }
.cmp img, .cmp-err { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #0a0d12; }
.cmp-err { display: grid; place-items: center; padding: .6rem; font-size: .8rem; color: #f87171; text-align: center; }
