.card {
  --suit: #3c4368;
  position: relative; width: var(--w); aspect-ratio: 5 / 7;
  font-size: calc(var(--w) / 10); flex: none;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .45s var(--ease);
  text-shadow: none;
}
.card.held { transition: transform .06s linear; z-index: 5; }
.card[data-suit="1"] { --suit: #f03464; }
.card[data-suit="2"] { --suit: #f06b3f; }
.card[data-suit="3"] { --suit: #235955; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform .5s var(--ease); }
.card.up .flip { transform: rotateY(0deg); }
.front, .back { position: absolute; inset: 0; border-radius: .8em; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 .4em 0 rgba(0, 0, 0, .35); overflow: hidden; }
.front { background: #fbf8f1; border: .12em solid #d6cfc0; color: var(--suit); }
.back {
  transform: rotateY(180deg);
  border: .35em solid #f2ebdd;
  background:
    radial-gradient(circle, #ff8a7e 0 .18em, transparent .2em) 0 0 / 1.2em 1.2em,
    repeating-conic-gradient(#c43d38 0 25%, #db4a43 0 50%) 0 0 / 1.2em 1.2em;
}
.back::after { content: ""; position: absolute; inset: .35em; border: .12em solid rgba(255, 255, 255, .35); border-radius: .4em; }
.card.held .front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .5) 45%, transparent 60%);
  mix-blend-mode: overlay;
}

.corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .9; }
.corner b { font-size: 2.3em; font-weight: 700; letter-spacing: -.05em; }
.corner i { font-size: 1.7em; font-style: normal; }
.corner.tl { left: .45em; top: .4em; }
.corner.br { right: .45em; bottom: .4em; rotate: 180deg; }
.pips { position: absolute; inset: 11% 16%; }
.pips i { position: absolute; translate: -50% -50%; font-size: 2.5em; font-style: normal; line-height: 1; }
.pips i.down { rotate: 180deg; }
.ace { position: absolute; inset: 0; display: grid; place-items: center; font-size: 6.5em; line-height: 1; }
.royal {
  position: absolute; inset: 15% 20%;
  border: .14em solid var(--suit); border-radius: .4em;
  background: color-mix(in srgb, var(--suit) 12%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: .9;
}
.royal b { font-size: 5em; font-weight: 700; }
.royal i { font-size: 2.6em; font-style: normal; }

.card.compact .corner.br { display: none; }
.card.compact .corner.tl { left: .5em; top: .45em; align-items: flex-start; }
.card.compact .corner b { font-size: 4em; }
.card.compact .corner i { font-size: 2.6em; }
.card.compact .big { position: absolute; right: .35em; bottom: .1em; font-size: 5.4em; line-height: 1; }

#chat-act { grid-row: 2; }
body:not([data-o-chatlayout="overlay"]) #chat.tabs-up #chat-act { margin-top: calc(52px + var(--safe-top)); }
#chat-act {
  position: relative; z-index: 2; margin: 0 8px; padding: 6px 8px;
  display: flex; flex-direction: column; gap: 6px;
  font-family: "Pixelify Sans", system-ui, sans-serif; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); -webkit-user-select: none; user-select: none;
}
.ca-hand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.ca-cards { display: flex; gap: 3px; --w: 28px; }
.ca-cards.mine { --w: 38px; gap: 4px; }
.ca-cards .card .front { box-shadow: none; }
.ca-empty { width: 28px; aspect-ratio: 5 / 7; border-radius: 3px; border: 1px dashed rgba(255, 255, 255, .18); }
.ca-mid { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ca-name { font-size: 15px; font-weight: 600; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-time { height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.ca-time i { display: block; height: 100%; background: var(--gold); }
.ca-time.late i { background: var(--red); }
#chat-act .u-btn { height: 44px; font-size: 19px; white-space: nowrap; }
#chat-act .row, .ca-time { max-height: 60px; transition: max-height .26s var(--ease), opacity .18s var(--ease), margin .26s var(--ease); }
#chat-act .row { overflow: hidden; padding-bottom: 5px; margin-bottom: -5px; }
#chat-act.decided .row, #chat-act.decided .ca-time { max-height: 0; opacity: 0; margin-top: -6px; pointer-events: none; }
#chat-act.decided .row { margin-bottom: 0; padding-bottom: 0; }
.ca-state { margin-left: auto; flex: none; font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.ca-state:empty { display: none; }
.ca-state.stayed { background: var(--blue); }
.ca-state.folded { background: #1f1d36; color: var(--muted); }
.ca-state.won { background: var(--gold); color: #2b1a00; text-shadow: none; }
.ca-cards.mine { transition: filter .3s, opacity .3s; }
#chat-act.folded .ca-cards.mine { filter: grayscale(.9); opacity: .5; }

.raise-btn { position: relative; }
.raise-btn.open { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.raise-panel {
  display: grid; gap: 8px; padding: 10px;
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: 0 5px 0 var(--drop);
}
.raise-panel[hidden] { display: none; }
.raise-panel.inline { position: static; margin-top: 6px; }
.rz-head { display: flex; align-items: baseline; gap: 8px; }
.rz-amt { font-size: 26px; font-weight: 700; color: var(--gold); min-width: 3ch; }
.rz-amt::before { content: "+"; font-size: 18px; margin-right: 1px; }
.rz-tot { margin-left: auto; font-size: 13px; color: var(--muted); }
.rz-tot.allin { color: var(--gold); font-weight: 700; }
.rz-quick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.rz-q {
  height: 40px; padding: 0 4px; border: 2px solid var(--edge); border-radius: 8px;
  background: var(--panel-2); color: #fff; font: 700 15px var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--drop);
  transition: translate .06s, box-shadow .06s;
}
.rz-q:active { translate: 0 2px; box-shadow: 0 1px 0 var(--drop); }
.rz-q.on { background: var(--orange); border-color: var(--orange); color: #2b1a00; text-shadow: none; }
.rz-q.allin { border-color: var(--gold); }
.rz-q { position: relative; }
.rz-q kbd { display: none; position: absolute; top: -7px; right: -5px; padding: 0 4px; font: 500 10px/1.4 var(--font); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; color: var(--muted); }
.rz-q.on kbd { border-color: rgba(43, 26, 0, .5); }
.rz-fine { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.rz-step {
  height: 40px; border: 2px solid var(--edge); border-radius: 8px; background: var(--panel-2); color: #fff;
  font: 700 22px var(--font); cursor: pointer; box-shadow: 0 3px 0 var(--drop);
}
.rz-step:active { translate: 0 2px; box-shadow: 0 1px 0 var(--drop); }
.rz-fine input { width: 100%; height: 40px; margin: 0; }
.raise-btn.open.allin { background: var(--gold); color: #2b1a00; text-shadow: none; box-shadow: 0 5px 0 #8a5c12; }
#chat-act .rz-q, #chat-act .rz-step { height: 36px; }

#chat-act .row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
#chat-act .row.three { grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr); gap: 8px; }
#chat-act .u-btn { padding: 0 4px; font: 400 19px/1 var(--font); }
#chat-act .u-btn b { font-weight: 400; opacity: .8; margin-left: 2px; }
#chat-act kbd { display: none; }

.rz-head { display: none; }
.rz-show { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 4px; }
.rz-bank { display: grid; justify-items: center; gap: 3px; }
.rz-pile { height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.rz-pile canvas { image-rendering: pixelated; display: block; }
.rz-pill, .rz-q em { display: inline-flex; align-items: center; gap: 4px; font-style: normal; white-space: nowrap; }
.rz-pill { padding: 1px 8px 1px 4px; border-radius: 7px; font-size: 16px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 2px 0 var(--drop); }
.rz-pill i, .rz-q em i { width: 14px; height: 14px; flex: none; background: center / 100% no-repeat; image-rendering: pixelated; }
.rz-bank small { font-size: 11px; color: var(--muted); }
.rz-put .rz-pill { font-size: 19px; }
.rz-arrow { display: grid; justify-items: center; padding-bottom: 26px; }
.rz-arrow span { font-size: 30px; line-height: .8; color: var(--muted); }
.rz-amt { font-size: 22px; }
.raise-panel.allin .rz-put .rz-pill { border-color: var(--gold); }
.rz-q { display: grid; justify-items: center; gap: 1px; height: auto; padding: 6px 2px; }
.rz-q span { font-size: 16px; }
.rz-q em { font-size: 11px; }
.rz-q.on em { color: #2b1a00 !important; }

.w-amt:not(:empty) { display: inline-flex; align-items: center; gap: .25em; padding: .08em .35em .08em .2em; border-radius: .3em; background: var(--panel); border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--drop); text-shadow: 0 3px 0 rgb(0 0 0 / .45); }
.w-amt:not(:empty)::before { content: ''; width: .8em; height: .8em; flex: none; background: var(--coin) center / 100% no-repeat; image-rendering: pixelated; }
.w-amt:not(:empty)::after { content: none; }
.rz-quick { display: none; }
.rz-ticks { position: relative; height: 14px; margin: -8px 48px 0; font-size: 11px; color: var(--muted); }
.rz-ticks span { position: absolute; translate: -50% 0; white-space: nowrap; }
.rz-ticks span:last-child { translate: -100% 0; }
