/* ბლეფი — ხის მაგიდა, ძველი რუკის დაფა, ტყავის ჭიქები, სპილოსძვლის კამათლები */
:root {
  --wood1: #3a2413; --wood2: #4a2e18; --wood3: #2b1a0e;
  --parch: #f1e2bf; --parch2: #e3cc9c; --ink: #3b2716; --ink2: #6b4f33;
  --text: #f6ead2; --muted: #d6c2a0; --brass: #d9a441; --brass-d: #9c7020; --wax: #a8261b; --wax-d: #6e150e;
  --ivory: #fbf5e6; --pip: #2a1d17; --green: #2f6b3e;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --serif: "Noto Serif Georgian", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #3a2413; min-height: 100%; }
body {
  font-family: "Noto Sans Georgian", system-ui, sans-serif; color: var(--text); min-height: 100vh; -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,200,120,.10), transparent 60%),
    repeating-linear-gradient(94deg, rgba(0,0,0,.08) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(88deg, rgba(255,255,255,.03) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, var(--wood2), var(--wood1) 45%, var(--wood3));
  background-color: var(--wood1);  /* iOS: fixed ფონი არ მუშაობს, ფერი სტატუს-ბარის ქვეშაც ჩანს */
}
main { max-width: 560px; margin: 0 auto; padding: calc(12px + var(--sat)) 12px calc(96px + var(--sab)); }
h1 { font-family: var(--serif); font-size: 44px; font-weight: 900; margin: 6px 0 2px; color: var(--parch); text-shadow: 0 2px 0 #000a; }
h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 10px; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 700;
  color: var(--text); background: linear-gradient(180deg, #7a4a24, #5b3518); box-shadow: 0 3px 0 #2b1709, inset 0 1px 0 rgba(255,255,255,.15); }
button:disabled { opacity: .45; cursor: default; }
button.gold { color: #2b1a05; background: linear-gradient(180deg, #f0c460, var(--brass)); box-shadow: 0 4px 0 var(--brass-d), inset 0 1px 0 rgba(255,255,255,.5); }
button.red { color: #fff4e6; background: linear-gradient(180deg, #c8382b, var(--wax)); box-shadow: 0 4px 0 var(--wax-d), inset 0 1px 0 rgba(255,255,255,.25); }
button.big { width: 100%; font-size: 19px; padding: 17px; margin: 6px 0; font-family: var(--serif); }
button.ghost { width: 100%; background: transparent; box-shadow: inset 0 0 0 2px rgba(246,234,210,.35); margin-top: 10px; }
button.link { background: none; box-shadow: none; padding: 6px 8px; color: var(--brass); font-weight: 700; }
button:active:not(:disabled) { transform: translateY(2px); }
input, select { font: inherit; width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid #b89a68; background: #fbf1da; color: var(--ink); }
select option { color: #111; }
a.link { color: var(--brass); }
.center { text-align: center; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13.5px; margin: 4px 0 10px; }

/* პერგამენტის ბარათები */
.card {
  color: var(--ink); border-radius: 6px; padding: 16px; margin: 12px 0; position: relative;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(ellipse at 85% 90%, rgba(120,80,30,.22), transparent 55%),
    linear-gradient(135deg, var(--parch), var(--parch2));
  box-shadow: 0 6px 16px rgba(0,0,0,.45), inset 0 0 30px rgba(120,80,30,.35);
}
.card .muted, .card .hint { color: var(--ink2); }
.card button:not(.gold):not(.red):not(.link) { color: var(--text); }
.card button.link { color: var(--wax); }
.row2 { display: flex; gap: 10px; }
.row2 > * { flex: 1; }
.brand { text-align: center; padding: 8px 0 6px; }
.logo { display: flex; justify-content: center; gap: 6px; }
.logo .die { width: 48px; height: 48px; }
.logo .tilt { transform: rotate(14deg) translateY(4px); }
.sub { color: var(--muted); margin: 0; }
.pts { color: var(--brass); font-weight: 700; }
.lang { margin-top: 18px; color: var(--muted); }
.lobby .lrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px dashed #b89a68; }
.lobby .lrow:first-child { border-top: 0; }
.small-btn { padding: 9px 14px; color: #2b1a05; background: linear-gradient(180deg, #f0c460, var(--brass)); box-shadow: 0 3px 0 var(--brass-d); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--muted); }
.code { font-family: var(--serif); font-size: 56px; font-weight: 900; letter-spacing: 10px; font-variant-numeric: tabular-nums; color: var(--ink); }
.lbl { display: block; margin: 8px 0; font-size: 14px; color: var(--ink2); }
.lbl select { margin-top: 6px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px dashed #b89a68; }
.plist li:first-child { border-top: 0; }
.plist .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.dot.off { background: #9b8a70; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(90,61,34,.15); color: var(--ink); }
.tag.host { background: var(--ink); color: var(--parch); }
.tag.low { background: #f3c4bb; color: var(--wax-d); }

/* კამათელი */
.die { display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 40px; height: 40px; padding: 5px; gap: 1px;
  background: linear-gradient(145deg, #fffdf6, var(--ivory) 55%, #e2d6b8); border-radius: 22%; vertical-align: middle;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.14), inset 2px 2px 0 rgba(255,255,255,.7), 0 3px 5px rgba(0,0,0,.4); }
.die i { border-radius: 50%; }
.die i.on { background: radial-gradient(circle at 35% 35%, #4a352b, var(--pip)); margin: 12%; }
.die.d1 i.on { background: radial-gradient(circle at 35% 35%, #e05b4d, #a8261b); margin: 0; }
.die.red { background: linear-gradient(145deg, #e8574a, #b3281d 60%, #7d160f); }
.die.red i.on, .die.red.d1 i.on { background: radial-gradient(circle at 35% 35%, #fff, #f1e6d0); margin: 12%; }
.die.sm { width: 24px; height: 24px; padding: 3px; border-radius: 6px; }
.die.xs { width: 20px; height: 20px; padding: 2px; border-radius: 5px; gap: 0; }
.die.hit { outline: 3px solid var(--brass); outline-offset: 1px; }
.die.dim { opacity: .35; filter: grayscale(.4); }
.dice-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bidtxt { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--serif); }

/* სხდომები (მოწინააღმდეგეები) */
.roundbar { display: flex; gap: 8px; justify-content: center; margin: 2px 0 8px; }
.pill { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 99px; background: rgba(0,0,0,.35); color: var(--parch); }
.pill.pal { background: var(--wax); color: #fff1e0; }
.seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-bottom: 6px; }
.seat { width: calc(33.3% - 6px); min-width: 96px; text-align: center; position: relative; }
.cupwrap { position: relative; width: 64px; height: 70px; margin: 0 auto; }
.cupsvg { width: 64px; height: 70px; filter: drop-shadow(0 6px 5px rgba(0,0,0,.5)); transition: transform .5s cubic-bezier(.2,.9,.3,1.2), opacity .4s; position: relative; z-index: 2; }
.cupsvg.tipped { transform: rotate(-100deg) translate(-10px, 8px) scale(.85); opacity: .55; }
.cnt { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 3; font-family: var(--serif); font-weight: 900; font-size: 20px; color: #fff3dc; text-shadow: 0 1px 2px #000; }
.seat.lifted .cupsvg { transform: translateY(-34px) scale(.8); opacity: .35; }
.seat.lifted .cnt { opacity: 0; }
.under { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; width: 96px; z-index: 1; }
.plaque { display: inline-block; margin-top: 2px; max-width: 100%; padding: 2px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 800;
  color: #2b1a05; background: linear-gradient(180deg, #e9c36d, #b58531); box-shadow: 0 2px 0 #6e4c14; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.out { opacity: .55; }
.seat.out .plaque { background: #8e7c62; box-shadow: none; text-decoration: line-through; }
.chip { min-height: 30px; margin-top: 4px; font-size: 14px; color: var(--parch); }
.chip .bidtxt { background: rgba(241,226,191,.92); color: var(--ink); padding: 2px 8px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.think { font-size: 12.5px; color: var(--brass); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.ring { position: absolute; inset: -8px; width: 80px; height: 80px; z-index: 0; transform: rotate(-90deg); }
.ring circle { fill: rgba(217,164,65,.12); stroke: var(--brass); stroke-width: 5; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring circle.low { stroke: #e0483a; }

/* დაფა — ძველი რუკა */
.mat { position: relative; padding: 10px; border-radius: 10px; margin: 4px 0 12px;
  background: linear-gradient(135deg, #2c1a0c, #1c1007); box-shadow: 0 12px 26px rgba(0,0,0,.55), inset 0 0 0 2px #5a3a1c; }
.mat-inner { position: relative; aspect-ratio: 100 / 74; border-radius: 4px; overflow: hidden; color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(90,50,15,.45) 100%),
    radial-gradient(ellipse at 15% 20%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 80% 75%, rgba(140,90,30,.25), transparent 30%),
    radial-gradient(circle at 30% 85%, rgba(140,90,30,.18), transparent 25%),
    linear-gradient(160deg, #f4e6c4, #e6cf9f 60%, #d9bd86); }
.ship { position: absolute; left: 22%; top: 28%; width: 56%; pointer-events: none; }
.compass { position: absolute; right: 13%; top: 16%; width: 14%; pointer-events: none; }
.cell { position: absolute; transform: translate(-50%, -50%); width: 8.2%; aspect-ratio: 1; display: grid; place-items: center;
  font-family: var(--serif); font-size: clamp(10px, 2.9vw, 14px); font-weight: 700; color: var(--ink2);
  border: 1.5px solid rgba(90,61,34,.55); border-radius: 3px; background: rgba(255,248,230,.35); }
.cell.past { background: rgba(217,164,65,.28); }
.cell.on { border-color: var(--wax); color: var(--wax); }
.cell.lost { opacity: .35; text-decoration: line-through; border-style: dashed; }
.marker { position: absolute; transform: translate(-50%, -50%); z-index: 4; transition: left .45s cubic-bezier(.3,.9,.3,1.1), top .45s cubic-bezier(.3,.9,.3,1.1); }
.marker .die { width: clamp(26px, 8vw, 36px); height: clamp(26px, 8vw, 36px); padding: 4px; transform: rotate(-8deg); }
.mat-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70%; text-align: center; z-index: 3; }
.ink2 { color: var(--ink2); font-weight: 600; }
.bigbid { font-size: clamp(26px, 8vw, 36px); font-weight: 900; margin: 2px 0; color: var(--ink); }
.bigbid .die.sm { width: clamp(28px, 8vw, 38px); height: clamp(28px, 8vw, 38px); padding: 4px; }
.seal { width: 74px; height: 74px; margin: 4px auto; border-radius: 50%; display: grid; place-items: center; align-content: center; color: #fff1e0;
  background: radial-gradient(circle at 35% 30%, #d0463a, var(--wax) 55%, var(--wax-d)); box-shadow: 0 4px 8px rgba(0,0,0,.4), inset 0 0 0 4px rgba(0,0,0,.15);
  transform: rotate(-8deg); animation: stamp .5s cubic-bezier(.2,.9,.3,1.4) both; }
.seal.true { background: radial-gradient(circle at 35% 30%, #4f9460, var(--green) 55%, #1c4526); }
.seal b { font-family: var(--serif); font-size: 26px; line-height: 1; }
.seal small { font-size: 11px; font-weight: 800; }
@keyframes stamp { from { transform: scale(2.2) rotate(-20deg); opacity: 0; } to { transform: rotate(-8deg); opacity: 1; } }
.loser { font-family: var(--serif); font-weight: 900; font-size: clamp(14px, 4vw, 17px); color: var(--wax-d); }

/* ჩემი ადგილი */
.my-seat { text-align: center; }
.tray { position: relative; display: inline-block; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #5b3518, #3e2410); box-shadow: inset 0 3px 8px rgba(0,0,0,.6), 0 2px 0 #7a4a24; }
.tray .dice-row .die { width: 48px; height: 48px; }
.tray .ring.me { display: none; }
.my-seat.turn .tray { box-shadow: inset 0 3px 8px rgba(0,0,0,.6), 0 0 0 3px var(--brass), 0 0 18px rgba(217,164,65,.5); }
.plaque.me { margin-top: 8px; font-size: 13px; }
.wait { color: var(--muted); }

/* ფსონის ამრჩეველი — ხის ფიცარი */
.picker { margin-top: 12px; padding: 14px; border-radius: 14px;
  background: repeating-linear-gradient(92deg, rgba(0,0,0,.07) 0 2px, transparent 2px 11px), linear-gradient(180deg, #8a5a2e, #6a4220);
  box-shadow: 0 8px 18px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.2); }
.qty { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.qty button { width: 50px; height: 50px; padding: 0; font-size: 26px; border-radius: 50%; color: #2b1a05; background: linear-gradient(180deg, #f0c460, var(--brass)); box-shadow: 0 3px 0 var(--brass-d); }
.qty b { font-family: var(--serif); font-size: 38px; min-width: 50px; text-align: center; color: var(--parch); text-shadow: 0 2px 0 #0008; }
.faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.face { padding: 8px 0; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.face.sel { background: var(--parch); box-shadow: 0 0 0 3px var(--brass); }
.face .die.sm { width: 32px; height: 32px; }
.perr { color: #ffd6c9; min-height: 20px; text-align: center; margin: 8px 0; font-size: 14px; }

.winner { font-family: var(--serif); font-size: 32px; font-weight: 900; margin: 10px 0; }
.award { font-family: var(--serif); font-size: 46px; font-weight: 900; color: var(--brass-d); }

/* ჩატი */
.chatbtn { position: fixed; right: 16px; bottom: calc(16px + var(--sab)); width: 58px; height: 58px; border-radius: 50%; font-size: 24px; padding: 0; z-index: 20;
  color: #2b1a05; background: linear-gradient(180deg, #f0c460, var(--brass)); box-shadow: 0 4px 0 var(--brass-d), 0 8px 18px rgba(0,0,0,.5); }
.badge { position: absolute; top: -4px; right: -4px; background: var(--wax); color: #fff; font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 5px; }
.chatsheet { position: fixed; left: 0; right: 0; bottom: 0; height: min(70vh, 520px); z-index: 30; color: var(--ink);
  background: linear-gradient(160deg, #f4e6c4, #e3cc9c); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; padding-bottom: var(--sab);
  max-width: 560px; margin: 0 auto; box-shadow: 0 -10px 30px rgba(0,0,0,.6); }
.chatsheet[hidden] { display: none; }
.chead { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px dashed #b89a68; }
.chead .link { color: var(--wax); }
.clist { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.cmsg { background: rgba(255,255,255,.55); border-radius: 12px; padding: 7px 10px; max-width: 88%; align-self: flex-start; word-break: break-word; }
.cmsg.me { align-self: flex-end; background: rgba(217,164,65,.35); }
.cname { background: none; box-shadow: none; padding: 0 6px 0 0; color: var(--wax); font-size: 13px; font-weight: 800; border-radius: 0; }
.ctext { font-size: 15px; }
.cform { display: flex; gap: 8px; padding: 10px 12px 4px; }
.cform button { padding: 0 16px; color: #2b1a05; background: linear-gradient(180deg, #f0c460, var(--brass)); box-shadow: 0 3px 0 var(--brass-d); }
.chint { font-size: 11.5px; color: var(--ink2); margin: 4px 14px 10px; }

/* წესები */
.sheet { position: fixed; inset: 0; z-index: 40; color: var(--ink); display: flex; flex-direction: column; background: linear-gradient(160deg, #f4e6c4, #e0c995); }
.sheet[hidden] { display: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--sat)) 16px 10px; border-bottom: 1px dashed #b89a68; max-width: 720px; width: 100%; margin: 0 auto; }
.sheet-head h2 { margin: 0; }
.sheet-head .link { color: var(--wax); }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 18px calc(30px + var(--sab)); max-width: 720px; width: 100%; margin: 0 auto; line-height: 1.6; }
.rules h3 { font-family: var(--serif); margin: 22px 0 8px; font-size: 18px; }
.rules p, .rules li { margin: 0 0 8px; }
.rules ul, .rules ol { padding-left: 22px; }
.rules-tip { background: rgba(255,255,255,.45); border-radius: 10px; padding: 10px 14px; }

.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--wax); color: #fff; text-align: center; padding: calc(6px + var(--sat)) 0 6px; font-size: 14px; z-index: 50; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + var(--sab)); background: #1b0f07ee; color: var(--parch);
  padding: 10px 16px; border-radius: 12px; z-index: 60; max-width: 90vw; text-align: center; box-shadow: 0 4px 12px #0008; }
@media (prefers-reduced-motion: reduce) { .marker, .cupsvg, .ring circle { transition: none; } .seal, .think { animation: none; } }

/* დახვეწა */
.tb-actions { display: flex; align-items: center; }
.chat-top { position: relative; font-size: 20px; padding: 4px 8px; }
.chat-top .badge { top: -6px; right: -6px; }
.mat-center::before { content: ""; position: absolute; inset: -14% -10%; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(244,230,196,.92) 35%, rgba(244,230,196,0) 72%); }
.mat.revealing ~ * .seat { margin-top: 0; }
.seats { padding-top: 6px; }
.seat.lifted { padding-top: 26px; }

/* მობილური: iOS-ზე ორმაგი დაჭერით ზუმი და ტექსტის გადიდება არ მოხდეს */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, input, select, [role="button"] { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }

/* qeqe.app-ზე დაბრუნება */
.home-back { display: inline-block; margin: 2px 0 6px; font-weight: 700; font-size: 14px; text-decoration: none; color: inherit; opacity: .75; padding: 6px 2px; }
.home-back:hover { opacity: 1; }
.home-mini { font-weight: 800; text-decoration: none; color: inherit; letter-spacing: -.02em; }
.home-mini:hover { text-decoration: underline; }

/* ================= შეთქმულება: სამეფო კარი ================= */
:root { --wood1: #2a1027; --wood2: #3a1636; --wood3: #1a0a18; --brass: #e5b94e; --brass-d: #9b7420; --blue: #2d5bd1; --blue-d: #1a3a8f; }
html { background: #2a1027; }
body { background:
  radial-gradient(ellipse at 50% -10%, rgba(229,185,78,.18), transparent 55%),
  repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 1px, transparent 1px 34px),
  linear-gradient(180deg, var(--wood2), var(--wood1) 50%, var(--wood3)); background-color: var(--wood1); }
.crest { font-size: 54px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.crest.big { font-size: 64px; }
.rolecard { margin: 6px 0 10px; }
.rolebtn { width: 100%; background: linear-gradient(180deg, #5a2350, #3b1335); }
.rolebody { display: flex; gap: 14px; align-items: flex-start; margin-top: 8px; padding: 14px; border-radius: 12px; color: var(--ink);
  background: linear-gradient(135deg, var(--parch), var(--parch2)); box-shadow: inset 0 0 24px rgba(120,80,30,.3); animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.rolebody b { font-family: var(--serif); font-size: 22px; }
.rolebody p { margin: 6px 0; }
.role-loyal { border-left: 6px solid var(--blue); } .role-plotter, .role-usurper { border-left: 6px solid var(--wax); }
.ricon { font-size: 44px; }
.allies { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ally { background: rgba(168,38,27,.12); border-radius: 99px; padding: 3px 10px; font-weight: 700; font-size: 13px; }

.boards { display: grid; gap: 8px; margin: 6px 0 10px; }
.board { border-radius: 12px; padding: 10px; color: var(--ink); background: linear-gradient(135deg, var(--parch), var(--parch2)); box-shadow: 0 6px 14px rgba(0,0,0,.4), inset 0 0 22px rgba(120,80,30,.3); }
.bhead { display: flex; justify-content: space-between; font-family: var(--serif); font-weight: 900; font-size: 14px; margin-bottom: 8px; }
.b-loyal .bhead { color: var(--blue-d); } .b-treason .bhead { color: var(--wax-d); }
.slots { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.slot { aspect-ratio: 3 / 4; border-radius: 6px; border: 2px dashed rgba(90,61,34,.35); display: grid; place-items: center; font-size: 18px; background: rgba(255,255,255,.25); }
.slot em { font-style: normal; opacity: .7; }
.b-loyal .slot { border-color: rgba(45,91,209,.35); } .b-treason .slot { border-color: rgba(168,38,27,.35); }
.slot.on { border-style: solid; }
.veto-note { font-size: 12px; font-weight: 800; color: var(--wax-d); margin-top: 6px; text-align: center; }
.bfoot { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); padding: 0 4px; }
.tracker { display: flex; align-items: center; gap: 5px; }
.tracker i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--brass); }
.tracker i.on { background: var(--wax); border-color: var(--wax); }

.decree { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 74px; height: 96px; border-radius: 8px;
  background: linear-gradient(160deg, #fbf3dc, #e9d6aa); color: var(--ink); box-shadow: 0 4px 10px rgba(0,0,0,.35); position: relative; }
.decree i { font-style: normal; font-size: 30px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.decree.loyal i { background: radial-gradient(circle at 35% 30%, #5b85ea, var(--blue) 55%, var(--blue-d)); }
.decree.treason i { background: radial-gradient(circle at 35% 30%, #d0463a, var(--wax) 55%, var(--wax-d)); }
.decree b { font-size: 10px; font-weight: 900; }
.decree.mini { width: 100%; height: 100%; box-shadow: none; background: none; }
.decree.mini i { width: 70%; height: auto; aspect-ratio: 1; font-size: 15px; }
.decree.mini b { display: none; }
.decree.big { width: 110px; height: 144px; }
.decree.big i { width: 70px; height: 70px; font-size: 44px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-bottom: 10px; }
.pc { position: relative; text-align: left; padding: 9px 10px 22px; border-radius: 12px; background: rgba(0,0,0,.28); box-shadow: inset 0 0 0 1px rgba(246,234,210,.12); min-height: 62px; }
.pc.me { box-shadow: inset 0 0 0 2px rgba(229,185,78,.55); }
.pc.can { background: linear-gradient(180deg, #6b2a5f, #4a1a42); box-shadow: 0 0 0 2px var(--brass), 0 0 14px rgba(229,185,78,.45); animation: pulse2 1.4s infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 2px var(--brass), 0 0 4px rgba(229,185,78,.2); } }
.pc.dead { opacity: .45; text-decoration: line-through; }
.pn { display: block; font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { position: absolute; left: 10px; bottom: 5px; font-size: 14px; display: flex; gap: 3px; }
.vt { position: absolute; right: 7px; bottom: 5px; font-size: 11px; font-weight: 900; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.12); }
.vt.yes { background: #2f6b3e; } .vt.no { background: var(--wax); } .vt.done { background: rgba(229,185,78,.3); }

.panel { position: relative; border-radius: 14px; padding: 16px 14px 14px; margin-bottom: 10px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(246,234,210,.14); overflow: hidden; }
.panel.act { background: linear-gradient(180deg, rgba(229,185,78,.16), rgba(0,0,0,.3)); box-shadow: inset 0 0 0 2px var(--brass); }
.panel h3 { font-family: var(--serif); margin: 0 0 6px; font-size: 18px; }
.panel p { margin: 0 0 8px; }
.panel.result.ok { box-shadow: inset 0 0 0 2px #3f9460; } .panel.result.bad { box-shadow: inset 0 0 0 2px var(--wax); }
.panel.enact { text-align: center; }
.panel.enact .decree { animation: stampin .6s cubic-bezier(.2,.9,.3,1.4); margin-bottom: 8px; }
@keyframes stampin { from { transform: scale(2) rotate(-12deg); opacity: 0; } }
.panel .tbar { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: rgba(255,255,255,.1); }
.panel .tbar i { display: block; height: 100%; background: var(--brass); width: 100%; transition: width .3s linear; }
.panel .tbar i.low { background: #e0483a; }
.hand { display: flex; gap: 10px; justify-content: center; margin: 10px 0 4px; flex-wrap: wrap; }
.cardbtn { background: none; box-shadow: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--parch); }
.cardbtn:hover .decree { transform: translateY(-4px); }
.cardbtn small { font-size: 12px; font-weight: 800; }
.log { margin: 8px 0; color: var(--muted); }
.log summary { cursor: pointer; font-weight: 700; }
.log ul { padding-left: 18px; margin: 8px 0; font-size: 13.5px; }
.rolelist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rolelist li { font-weight: 700; }
.rtable { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 14px; text-align: center; }
.rtable th, .rtable td { border: 1px solid rgba(90,61,34,.3); padding: 5px; }
.rtable th { text-align: left; font-weight: 800; }
.testcard { border: 2px dashed #9b7420; }
.testbar { text-align: center; font-size: 13px; font-weight: 800; color: #2b1a05; background: repeating-linear-gradient(45deg, #e5b94e 0 10px, #d6a93c 10px 20px);
  border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; }
.testbar .link { color: #5a1020; padding: 2px 6px; }
.pc .tags + .vt { }

/* ================= ტალღა: ოკეანე ================= */
:root { --wood1: #0d2233; --wood2: #123149; --wood3: #081622; --brass: #f2b544; --brass-d: #b07d18; }
html { background: #0d2233; }
body { background: radial-gradient(ellipse at 50% -10%, rgba(59,130,246,.35), transparent 60%),
  repeating-radial-gradient(circle at 50% 120%, rgba(255,255,255,.025) 0 2px, transparent 2px 22px),
  linear-gradient(180deg, var(--wood2), var(--wood1) 55%, var(--wood3)); background-color: var(--wood1); }
.dialbox { margin: 8px 0 12px; padding: 12px 12px 8px; border-radius: 18px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.dialbox.can { box-shadow: inset 0 0 0 2px var(--brass), 0 0 18px rgba(242,181,68,.3); }
#dial { width: 100%; display: block; touch-action: none; user-select: none; }
.dialbox.can #dial { cursor: grab; }
#dial .face { stroke: #0b1a28; stroke-width: 2; }
#dial .z2 { fill: #f2b544; opacity: .85; } #dial .z3 { fill: #f97316; } #dial .z4 { fill: #c4174a; }
#needle line { stroke: #111827; stroke-width: 4; stroke-linecap: round; }
#needle circle { fill: #111827; }
#needle { transition: transform .08s linear; }
.mark circle { fill: #fff; stroke: #111827; stroke-width: 1.5; } .mark text { font-size: 7px; font-weight: 800; fill: #111827; }
.ends { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-weight: 800; font-size: 15px; }
.lend { color: #93c5fd; } .rend { color: #fdba74; text-align: right; }
.cluebig { text-align: center; margin: 6px 0 10px; }
.cluebig small { display: block; color: var(--muted); font-size: 12px; }
.cluebig b { display: block; font-family: var(--serif); font-size: 30px; color: var(--parch); margin: 2px 0; word-break: break-word; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.team { border-radius: 14px; padding: 10px 12px; background: rgba(0,0,0,.25); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.team.t0 .tname { color: #93c5fd; } .team.t1 .tname { color: #fdba74; }
.team.turn { box-shadow: inset 0 0 0 2px var(--brass); }
.tname { font-weight: 800; font-size: 13.5px; }
.tscore { font-family: var(--serif); font-size: 30px; font-weight: 900; } .tscore small { font-size: 14px; color: var(--muted); }
.tmembers { font-size: 12px; color: var(--muted); } .tmembers .psy { color: var(--brass); font-weight: 800; }
.ffa { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 4px; }
.ffa li { display: flex; justify-content: space-between; padding: 7px 12px; border-radius: 10px; background: rgba(0,0,0,.22); font-size: 14px; }
.ffa li.psy { box-shadow: inset 0 0 0 1.5px var(--brass); }
.card .ffa li { background: rgba(90,61,34,.1); }
.panel input { flex: 1.6; }

/* ჰორიზონტალური ეკრანი (ტელეფონი გვერდულად): დაფა მარცხნივ, მართვა მარჯვნივ */
@media (orientation: landscape) and (max-height: 620px) {
  main { max-width: 100%; padding: calc(6px + var(--sat)) max(12px, env(safe-area-inset-right, 0px)) calc(10px + var(--sab)) max(12px, env(safe-area-inset-left, 0px)); }
  .gwrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .gs { max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 2px; }
  .gm { min-width: 0; }
  .topbar { margin-bottom: 2px; }
  .brand .logo, .crest { display: none; }
}
@media (orientation: landscape) and (max-height: 620px) {
  #dial { max-height: calc(100dvh - 110px); }
}

/* ================= კომპიუტერი: ფართო ეკრანის დიზაინი ================= */
@media (min-width: 980px) {
  main { max-width: 1240px; padding: calc(22px + var(--sat)) 36px 56px; }
  main:not(:has(.gwrap)) { max-width: 760px; }
  .gwrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr); gap: 32px; align-items: start; }
  .gm { min-width: 0; }
  .gs { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; padding-right: 4px; }
  .topbar { margin-bottom: 14px; font-size: 15px; }
  .topbar .link { font-size: 15px; }
  h1 { font-size: 56px; }
  button { transition: transform .12s, box-shadow .12s, filter .12s; }
  button:hover:not(:disabled) { filter: brightness(1.07); }
  .panel { padding: 20px 20px 18px; }
  .panel h3 { font-size: 21px; }
  /* ჩატი მარჯვენა ქვედა კუთხეში, ფანჯრად */
  .chatsheet { left: auto; right: 28px; bottom: 28px; width: 400px; height: 560px; border-radius: 20px; margin: 0; }
  .sheet-body, .sheet-head { max-width: 860px; }
  .testbar { margin-bottom: 14px; }
}
@media (min-width: 1400px) { main { max-width: 1360px; } }
@media (min-width: 980px) {
  .dialbox { padding: 22px 28px 16px; } #dial { max-width: 760px; margin: 0 auto; }
  .ends { font-size: 20px; max-width: 760px; margin: 10px auto 0; }
  .cluebig b { font-size: 40px; }
  .team { padding: 14px 16px; } .tscore { font-size: 40px; } .tname { font-size: 15px; } .tmembers { font-size: 13px; }
  .ffa li { font-size: 15.5px; padding: 9px 14px; }
}

/* გრძელი ტექსტი არ იჭრება: სახელები მაქსიმუმ 2 ხაზზე, ღილაკები და ჩიპები იშლება */
.sn, .pn, .sname, .plaque, .hname, .plist .name, .tmembers, .oseat .sn, .chip .bidtxt {
  white-space: normal !important; overflow: hidden; text-overflow: clip !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; line-height: 1.25; }
.plaque { display: inline-block; -webkit-line-clamp: unset; }
button, .tag, .pill, .gmeta li { white-space: normal; overflow-wrap: anywhere; }
.row2 > * { min-width: 0; }

/* ზედა ზოლის ბმულები არ უნდა გაიყოს შუა სიტყვაზე */
.topbar .link, .tb-actions .link, button.link { white-space: nowrap; overflow-wrap: normal; }
.topbar { flex-wrap: wrap; row-gap: 2px; }

.guestcard { border: 2px dashed rgba(90,61,34,.45); }
.guestcard .row2 { margin-top: 8px; } .btnlink { display: grid; place-items: center; text-align: center; padding: 12px; border-radius: 12px; font-weight: 800; text-decoration: none; background: rgba(0,0,0,.08); color: inherit; }
