/* WHITEOUT: Tally, the lodge card duel. Same chip language as ui.css. */

/* ---------- a card ---------- */
.tc { position: relative; width: var(--w, 90px); height: calc(var(--w, 90px) * 1.4); flex: none; border-radius: 11% / 8%; transition: transform 0.18s cubic-bezier(.3,1.5,.5,1), filter 0.2s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; user-select: none; }
.tc-cv { width: 100%; height: 100%; display: block; }
.tc.rare::after { content: ""; position: absolute; inset: 3px; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.6) 45%, rgba(255,255,255,0) 55%) no-repeat; background-size: 250% 100%; animation: tc-shine 2.8s ease-in-out infinite; mix-blend-mode: soft-light; }
.tc.rare.back::after { display: none; }
@keyframes tc-shine { 0% { background-position: 130% 0; } 60%, 100% { background-position: -60% 0; } }
.tc.deal { animation: tc-deal 0.42s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes tc-deal { from { transform: translateY(60px) rotate(8deg) scale(0.7); opacity: 0; } to { transform: none; opacity: 1; } }
.tc.drop { animation: tc-drop 0.32s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes tc-drop { from { transform: translateY(-26px) scale(1.12); } to { transform: none; } }
.tc.flip-out { transform: scaleX(0.02) !important; transition: transform 0.13s ease-in; }
.tc.flip-in { animation: tc-flipin 0.32s cubic-bezier(.2,1.5,.4,1); }
@keyframes tc-flipin { from { transform: scaleX(0.02) scale(1.1); } 60% { transform: scaleX(1.06) scale(1.08); } to { transform: none; } }
.tc.act { animation: tc-act 0.5s cubic-bezier(.2,1.6,.4,1); z-index: 2; }
@keyframes tc-act { 0% { transform: none; } 35% { transform: scale(1.16) rotate(-3deg); filter: drop-shadow(0 0 10px #F2C94C); } 100% { transform: none; } }
.tc.hit { animation: tc-hit 0.45s; }
@keyframes tc-hit { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-3deg); } 45% { transform: translateX(5px) rotate(2deg); } 70% { transform: translateX(-3px); } }
.tc.win { box-shadow: 0 0 0 4px #F2C94C, 0 0 22px 4px rgba(242,201,76,0.9); animation: tc-win 0.55s cubic-bezier(.2,1.6,.4,1); z-index: 2; }
@keyframes tc-win { 0% { transform: none; } 40% { transform: scale(1.13) translateY(-4px); } 100% { transform: none; } }
.tc.lose { filter: grayscale(0.75) brightness(0.8); transform: scale(0.93); }
.tc-live { position: absolute; left: calc(var(--w, 90px) * 0.2 - 17px); top: calc(var(--w, 90px) * 0.2 - 17px); min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; background: #000; color: #fff; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font: 700 18px "Cooper Hewitt", sans-serif; box-shadow: 0 2px 0 rgba(0,0,0,0.4); z-index: 3; pointer-events: none; }
.tc-live.up { background: #3BA272; animation: tc-pop 0.4s cubic-bezier(.2,1.8,.4,1); }
.tc-live.down { background: #D9475B; animation: tc-pop 0.4s cubic-bezier(.2,1.8,.4,1); }
@keyframes tc-pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
.td-float { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); font: 700 28px "Cooper Hewitt", sans-serif; color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; pointer-events: none; z-index: 4; animation: td-float 0.95s ease-out forwards; }
.td-float.up { color: #7BE0A8; }
.td-float.down { color: #FF8C9C; }
@keyframes td-float { 0% { transform: translate(-50%, 10px) scale(0.6); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.25); opacity: 1; } 100% { transform: translate(-50%, -38px) scale(1); opacity: 0; } }

/* ---------- the duel ---------- */
#tally-duel { padding: 12px; background: rgba(0, 20, 60, 0.72); --cw: min(26vw, 12.5vh, 132px); --hw: min(17.4vw, 11vh, 110px); }
body.in-tally #menu, body.in-tally #pad, body.in-tally #hint, body.in-tally #quest, body.in-tally .tally-ask { visibility: hidden; }
.td { position: relative; width: min(760px, 100%); height: min(100%, 900px); display: flex; flex-direction: column; gap: 7px; background: #fff; border: 3px solid #000; border-radius: 20px; box-shadow: 8px 8px 0 rgba(0,0,0,0.35); padding: 10px; overflow: hidden; }
.td-top { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.td-face { width: 52px; height: 52px; flex: none; border: 3px solid #000; border-radius: 50%; background: #DFF1FC; display: block; }
.td-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.td-who b { font: 700 17px "Cooper Hewitt", sans-serif; letter-spacing: -0.02em; line-height: 1.1; }
.td-said { position: relative; font-size: 13px; line-height: 1.25; color: #003FBA; background: #E3F2FC; border: 2px solid #000; border-radius: 12px; padding: 3px 8px; margin-top: 3px; align-self: flex-start; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.td-said:empty { display: none; }
.td-said.pop { animation: td-said 0.35s cubic-bezier(.2,1.6,.4,1); }
@keyframes td-said { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
.td-score { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; flex: none; }
.td-pips { display: flex; align-items: center; gap: 4px; font: 700 10px "Cooper Hewitt", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; }
.td-pips span { margin-right: 2px; }
.td-pips i { width: 15px; height: 15px; border: 2.5px solid #000; border-radius: 50%; background: #fff; display: block; transition: background 0.2s, transform 0.2s; }
.td-pips.o i.on { background: #D9475B; transform: scale(1.15); }
.td-pips.p i.on { background: #F2C94C; transform: scale(1.15); }
.td-small { height: 40px; min-width: 40px; padding: 0 10px; font-size: 14px; border-radius: 12px; flex: none; touch-action: manipulation; }
.td-board { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: #003FBA; border: 3px solid #000; border-radius: 16px; padding: 6px; background-image: radial-gradient(rgba(255,255,255,0.08) 1.5px, transparent 1.6px); background-size: 14px 14px; }
.td-lane { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 2px; border-radius: 12px; padding: 4px 0; background: rgba(255,255,255,0.07); transition: background 0.25s, box-shadow 0.25s; }
.td-lane.pick { background: rgba(255,255,255,0.14); }
.td-lane.home { background: rgba(242,201,76,0.28); box-shadow: inset 0 0 0 3px #F2C94C; }
.td-lane.pw { background: rgba(242,201,76,0.32); }
.td-lane.ow { background: rgba(217,71,91,0.32); }
.td-post { display: flex; align-items: center; gap: 4px; background: #fff; border: 2.5px solid #000; border-radius: 999px; padding: 1px 9px 1px 4px; font: 700 12px "Cooper Hewitt", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; }
.td-post i, .td-kind::before { width: 11px; height: 11px; border: 2px solid #000; border-radius: 50%; display: inline-block; }
.k-kin i, i.k-kin, .td-kind.k-kin::before { background: #D9475B; }
.k-kit i, i.k-kit, .td-kind.k-kit::before { background: #F2C94C; }
.k-drift i, i.k-drift, .td-kind.k-drift::before { background: #34A1E5; }
.td-slot { position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); border: 3px dashed rgba(255,255,255,0.45); border-radius: 12px; display: flex; align-items: center; justify-content: center; --w: var(--cw); }
.td-slot .tc { position: absolute; left: -3px; top: -3px; }
.td-slot.me { cursor: pointer; touch-action: manipulation; }
.td-lane.pick .td-slot.me { border-color: #fff; animation: td-breathe 1.1s ease-in-out infinite; }
.td-lane.home .td-slot.me { border-color: #F2C94C; }
@keyframes td-breathe { 50% { background: rgba(255,255,255,0.16); } }
.td-slot-tip { font: 700 11px "Cooper Hewitt", sans-serif; color: rgba(255,255,255,0.55); text-align: center; padding: 4px; }
.td-vs { height: 28px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.td-num { min-width: 26px; height: 24px; padding: 0 5px; border-radius: 8px; background: rgba(255,255,255,0.18); color: #fff; font: 700 15px "Cooper Hewitt", sans-serif; display: flex; align-items: center; justify-content: center; }
.td-num:empty { visibility: hidden; }
.td-num.home { background: #F2C94C; color: #000; }
.td-mark { font: 700 11px "Cooper Hewitt", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; border: 2.5px solid #000; border-radius: 999px; padding: 2px 7px; background: #fff; }
.td-mark:empty { display: none; }
.td-mark.p { background: #F2C94C; }
.td-mark.o { background: #D9475B; color: #fff; }
.td-mark.e { background: #E1E7EF; }
.td-mark.slam { animation: td-slam 0.38s cubic-bezier(.2,1.8,.4,1); }
@keyframes td-slam { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.td-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border: 3px solid #000; border-radius: 18px; padding: 10px 20px; box-shadow: 6px 6px 0 rgba(0,0,0,0.35); animation: td-banner 0.5s cubic-bezier(.2,1.6,.4,1) both, td-bannerout 0.5s ease-in 2.2s forwards; pointer-events: none; white-space: nowrap; }
@keyframes td-bannerout { to { transform: translate(-50%, -160%) scale(0.6) rotate(-2deg); opacity: 0; } }
.td-banner b { font: 700 clamp(22px, 7vw, 34px) "Cooper Hewitt", sans-serif; letter-spacing: -0.04em; }
.td-banner span { font-size: 12px; color: #003FBA; }
.td-banner.p { background: #F2C94C; }
.td-banner.o { background: #D9475B; color: #fff; }
.td-banner.o span { color: #fff; }
@keyframes td-banner { from { transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-2deg); opacity: 1; } }
.td-msg { min-height: 38px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; font-size: 13px; line-height: 1.3; background: #E3F2FC; border: 2.5px solid #000; border-radius: 12px; padding: 4px 10px; }
.td-msg b { font: 700 14px "Cooper Hewitt", sans-serif; }
.td-msg.theirs { background: #FCE4E8; }
.td-msg.yours { background: #FFF4D6; }
.td-kind { display: inline-flex; align-items: center; gap: 3px; font: 700 11px "Cooper Hewitt", sans-serif; background: #fff; border: 2px solid #000; border-radius: 999px; padding: 0 6px 0 3px; }
.td-hand { display: flex; justify-content: center; align-items: flex-end; gap: 5px; min-height: calc(var(--hw) * 1.4 + 14px); padding-top: 12px; --w: var(--hw); transition: opacity 0.3s; }
.td-hand.dim { opacity: 0.45; pointer-events: none; }
.td-hand .tc { cursor: pointer; touch-action: manipulation; }
.td-hand .tc:hover { transform: translateY(-4px); }
.td-hand .tc.sel { transform: translateY(-12px) rotate(-2deg); filter: drop-shadow(0 6px 0 rgba(0,0,0,0.35)); }
.td-bar { display: flex; align-items: center; gap: 8px; }
.td-count { font: 700 12px "Cooper Hewitt", sans-serif; color: #003FBA; white-space: nowrap; }
.td-go { flex: 1; height: 50px; font-size: 20px; border-radius: 16px; background: #fff; touch-action: manipulation; transition: transform 0.08s, box-shadow 0.08s, background 0.2s; }
.td-go.ready { background: #F2C94C; box-shadow: 0 5px 0 #000; transform: translateY(-3px); animation: td-ready 1.4s ease-in-out infinite; }
.td-go.ready:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.td-go:disabled { color: #777; background: #eee; box-shadow: none; transform: none; animation: none; }
@keyframes td-ready { 50% { box-shadow: 0 5px 0 #000, 0 0 0 5px rgba(242,201,76,0.45); } }
.td-end { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; gap: 8px; padding: 18px; text-align: center; background: rgba(255,255,255,0.97); animation: td-said 0.4s cubic-bezier(.2,1.4,.4,1); overflow: hidden; }
.td-end > :first-child { margin-top: auto; }
.td-end > :last-child { margin-bottom: auto; }
.td-end h3 { margin: 0; font: 700 clamp(30px, 9vw, 46px)/1 "Cooper Hewitt", sans-serif; letter-spacing: -0.05em; color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; text-shadow: 0 4px 0 #003FBA, 0 7px 0 #000; animation: logo-bob 3.2s ease-in-out infinite; }
.td-end.lost h3 { color: #BFE6FF; }
.td-end-score { margin: 4px 0 0; font: 700 15px "Cooper Hewitt", sans-serif; color: #003FBA; }
.td-loot { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.td-loot li { background: #FFF4D6; border: 2.5px solid #000; border-radius: 999px; padding: 5px 14px; font: 700 14px "Cooper Hewitt", sans-serif; animation: td-said 0.4s cubic-bezier(.2,1.6,.4,1) both; }
.td-end-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.td-end-row button { height: 46px; padding: 0 16px; font-size: 16px; touch-action: manipulation; }
.td-end-row button:first-child { background: #F2C94C; }
.td-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.td-confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border: 2px solid #000; border-radius: 3px; animation: td-conf 2s ease-in forwards; }
@keyframes td-conf { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) rotate(720deg); } }

/* how-to sheet */
.t-how { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(0,20,60,0.5); }
.t-how-card { background: #fff; border: 3px solid #000; border-radius: 18px; padding: 14px 16px; max-width: 420px; width: 100%; box-shadow: 6px 6px 0 rgba(0,0,0,0.35); text-align: left; max-height: 100%; overflow-y: auto; animation: td-said 0.35s cubic-bezier(.2,1.5,.4,1); }
.t-how-card h3 { margin: 0 0 6px; font: 700 22px "Cooper Hewitt", sans-serif; letter-spacing: -0.03em; }
.t-how-card ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.35; }
.t-how-card ol b { font-family: "Cooper Hewitt", sans-serif; }
.t-how-kinds { margin: 10px 0; font-size: 12px; line-height: 2; }
.t-how-ok { width: 100%; height: 46px; background: #F2C94C; touch-action: manipulation; }

/* ---------- the table: hub ---------- */
.tl-card { max-width: 820px !important; }
.tl-card { position: relative; }
.tl-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding: 2px 2px 6px; }
.tl-rank { display: flex; align-items: center; gap: 10px; background: #E3F2FC; border: 3px solid #000; border-radius: 16px; padding: 8px 12px; }
.tl-pin { width: 48px; height: 48px; flex: none; display: block; }
.tl-rank-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-rank-tx b { font: 700 18px "Cooper Hewitt", sans-serif; }
.tl-rank-tx span { font-size: 12px; color: #003FBA; }
.tl-bar { display: block; height: 10px; border: 2px solid #000; border-radius: 999px; background: #fff; overflow: hidden; }
.tl-bar b { display: block; height: 100%; background: #F2C94C; }
.tl-rec { font: 700 13px "Cooper Hewitt", sans-serif; }
.tl-list { display: flex; flex-direction: column; gap: 8px; }
.tl-row { display: flex; align-items: center; gap: 10px; border: 3px solid #000; border-radius: 16px; padding: 7px 10px; background: #fff; }
.tl-row.beat { background: #FFF4D6; }
.tl-row.locked { background: #F4F7FB; border-style: dashed; }
.tl-row.locked .tl-tx b { color: #9AA6B8; }
.tl-row.cur { outline: 4px solid #F2C94C; outline-offset: -1px; }
.tl-face { width: 54px; height: 54px; flex: none; border: 3px solid #000; border-radius: 50%; display: block; background: #DFF1FC; }
.tl-face.pin { border: none; background: transparent; border-radius: 0; }
.tl-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-tx b { font: 700 16px "Cooper Hewitt", sans-serif; }
.tl-tx span { font-size: 12px; color: #003FBA; line-height: 1.25; }
.tl-chip { font: 700 11px "Cooper Hewitt", sans-serif; border: 2px solid #000; border-radius: 999px; padding: 2px 8px; background: #fff; white-space: nowrap; }
.tl-chip.new { background: #34A1E5; }
.tl-duel { height: 44px; min-width: 72px; padding: 0 12px; font-size: 15px; background: #F2C94C; border-radius: 14px; touch-action: manipulation; flex: none; }
.tl-duel:disabled { background: #eee; color: #888; }
.tl-how, .tl-auto { height: 40px; padding: 0 14px; font-size: 13px; align-self: flex-start; touch-action: manipulation; }
.tl-warn { background: #FCE4E8; border: 2.5px solid #000; border-radius: 12px; padding: 8px 10px; margin: 0 !important; font-size: 13px !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-warn button { height: 40px; padding: 0 12px; font-size: 13px; }
.tl-deckhead, .tl-collhead { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.tl-deckhead b, .tl-collhead b { font: 700 17px "Cooper Hewitt", sans-serif; }
.tl-deckhead span, .tl-collhead span { font-size: 12px; color: #003FBA; flex: 1; min-width: 160px; }
.tl-deck { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; background: #003FBA; border: 3px solid #000; border-radius: 14px; padding: 8px; --w: 100%; }
.tl-deck .tc { width: 100%; height: auto; aspect-ratio: 100 / 140; cursor: pointer; touch-action: manipulation; }
.tl-deck .tc:hover { transform: translateY(-3px) rotate(-2deg); }
.tl-empty { aspect-ratio: 100 / 140; border: 2.5px dashed rgba(255,255,255,0.5); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.6); font: 700 20px "Cooper Hewitt", sans-serif; }
.tl-msg { margin: 0 !important; min-height: 18px; font-size: 13px !important; color: #A3182B; font-weight: 700; }
.tl-coll { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tl-tile { position: relative; display: flex; gap: 8px; align-items: center; border: 3px solid #000; border-radius: 14px; padding: 6px; background: #fff; cursor: pointer; touch-action: manipulation; --w: 64px; min-height: 100px; }
.tl-tile.indeck { background: #FFF4D6; }
.tl-tile.unfound { cursor: default; background: #F4F7FB; border-style: dashed; }
.tl-tile.unfound .tc { opacity: 0.5; }
.tl-tile.nope { animation: tc-hit 0.4s; }
.tl-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-right: 26px; }
.tl-meta b { font: 700 14px "Cooper Hewitt", sans-serif; }
.tl-tag { font: 700 10px "Cooper Hewitt", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; color: #003FBA; }
.tl-tag::before { content: ""; width: 8px; height: 8px; border: 1.5px solid #000; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.tl-tag.k-kin::before { background: #D9475B; } .tl-tag.k-kit::before { background: #F2C94C; } .tl-tag.k-drift::before { background: #34A1E5; }
.tl-ab { font-size: 12px; line-height: 1.3; }
.tl-count { position: absolute; right: 6px; top: 6px; font: 700 12px "Cooper Hewitt", sans-serif; background: #000; color: #fff; border-radius: 999px; padding: 2px 7px; }
.tl-starter { align-items: center; text-align: center; padding: 10px 4px 14px; }
.tl-fan { display: flex; justify-content: center; padding: 18px 0 6px; --w: 104px; }
.tl-fan .tc { margin: 0 -18px; rotate: var(--r); translate: 0 calc(var(--r) * 0.5); transform-origin: 50% 100%; animation: tc-deal 0.5s cubic-bezier(.2,1.4,.4,1) both; }
.tl-fan .tc:nth-child(2) { z-index: 1; translate: 0 -12px; animation-delay: 0.12s; }
.tl-fan .tc:nth-child(3) { animation-delay: 0.24s; }
.tl-note { font: 700 18px "Cooper Hewitt", sans-serif !important; margin: 4px 0 !important; }
.tl-small { font-size: 13px !important; color: #003FBA; margin: 0 !important; }
.tl-big { height: 54px; min-width: 200px; padding: 0 20px; font-size: 20px; background: #F2C94C; border-radius: 18px; box-shadow: 0 5px 0 #000; transform: translateY(-3px); touch-action: manipulation; }
.tl-big:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.tl-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tl-pack { border: 3px solid #000; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: #E3F2FC; }
.tl-pack b { font: 700 17px "Cooper Hewitt", sans-serif; }
.tl-pack span { font-size: 12px; color: #003FBA; }
.tl-packcv { width: 96px; height: 134px; display: block; animation: tl-float 3s ease-in-out infinite; }
@keyframes tl-float { 50% { transform: translateY(-5px) rotate(2deg); } }
.tl-buy, .tl-open { height: 44px; min-width: 130px; padding: 0 14px; font-size: 16px; touch-action: manipulation; }
.tl-open { background: #F2C94C; }
.tl-buy:disabled { background: #eee; color: #777; font-size: 13px; }

/* pack opening */
.tp-stage { align-items: center; justify-content: center; min-height: 360px; text-align: center; }
.tp-pack { cursor: pointer; touch-action: manipulation; animation: tp-wobble 1.2s ease-in-out infinite; }
.tp-packcv { width: 170px; height: 238px; display: block; }
@keyframes tp-wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-4px); } }
.tp-pack.tear { animation: tp-tear 0.52s ease-in forwards; }
@keyframes tp-tear { 0% { transform: none; } 30% { transform: scale(1.1) rotate(-6deg); } 50% { transform: scale(1.12) rotate(6deg); } 100% { transform: scale(1.6) translateY(-40px); opacity: 0; filter: brightness(3); } }
.tp-tip { font: 700 16px "Cooper Hewitt", sans-serif !important; color: #003FBA; cursor: pointer; animation: td-ready 1.4s ease-in-out infinite; }
.tp-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; --w: min(28vw, 138px); padding: 6px 0; }
.tp-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tp-slot.rare-glow .tc { box-shadow: 0 0 0 4px #F2C94C, 0 0 30px 8px rgba(242,201,76,0.85); }
.tp-new { position: absolute; top: -8px; right: -6px; z-index: 3; background: #34A1E5; border: 2.5px solid #000; border-radius: 999px; padding: 1px 8px; font: 700 12px "Cooper Hewitt", sans-serif; animation: td-slam 0.38s cubic-bezier(.2,1.8,.4,1); }
.tp-name { font: 700 12px "Cooper Hewitt", sans-serif; }
.tp-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; animation: td-said 0.4s both; }
.tp-btns button { height: 48px; padding: 0 16px; font-size: 16px; touch-action: manipulation; }

/* the end-of-chat ask */
.tally-ask { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9; width: min(440px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border: 3px solid #000; border-radius: 18px; padding: 8px 10px; box-shadow: 6px 6px 0 rgba(0,0,0,0.3); animation: ta-in 0.4s cubic-bezier(.2,1.5,.4,1); }
@keyframes ta-in { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.ta-face { width: 46px; height: 46px; flex: none; border: 3px solid #000; border-radius: 50%; display: block; }
.ta-text { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.ta-text b { font: 700 14px "Cooper Hewitt", sans-serif; color: #003FBA; text-transform: uppercase; letter-spacing: 0.06em; }
.ta-text span { font-size: 14px; line-height: 1.3; }
.ta-row { display: flex; gap: 6px; margin-left: auto; }
.ta-row button { height: 44px; min-width: 64px; padding: 0 12px; font-size: 15px; touch-action: manipulation; }
.ta-yes { background: #F2C94C; }

@media (max-width: 520px) {
  #tally-duel { padding: 0; }
  .td { border-radius: 0; border: none; box-shadow: none; height: 100%; padding: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .td-who b { font-size: 15px; }
  .td-said { font-size: 12px; }
  .td-board { padding: 4px; gap: 4px; }
  .td-post { font-size: 11px; padding: 1px 7px 1px 3px; }
  .tl-deck { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 6px; }
  .tl-coll { grid-template-columns: 1fr; }
  .tl-packs { grid-template-columns: 1fr 1fr; }
  .tl-pack { padding: 8px 6px; }
  .tl-buy, .tl-open { min-width: 0; width: 100%; }
  .tally-ask { bottom: calc(200px + env(safe-area-inset-bottom)); }
  .td-lane.pw .td-num, .td-lane.ow .td-num, .td-lane.even .td-num { display: none; }
  .td-mark { font-size: 10px; padding: 1px 6px; }
  .tl-tile.unfound { --w: 36px; min-height: 0; padding: 4px 6px; }
  .tl-tile.unfound .tl-meta b { font-size: 12px; }
}
@media (max-height: 560px) {
  #tally-duel { --cw: min(24vw, 11.5vh, 132px); --hw: min(16vw, 10vh, 110px); }
}

.td-endface { width: 84px; height: 84px; border: 3px solid #000; border-radius: 50%; display: block; background: #DFF1FC; animation: td-said 0.4s cubic-bezier(.2,1.6,.4,1); }
.td-endsay { margin: 0 !important; max-width: 420px; font-size: 14px; color: #003FBA; background: #E3F2FC; border: 2px solid #000; border-radius: 12px; padding: 5px 10px; }
.td-endsay:empty { display: none; }
