/* TapuCraft board: 9 by 9 grid, squares on the edge, the middle is the control panel. Built on the journal play stage. */
/* The intro paragraph is dark by default; the TapuCraft card is dark, so make it white. */
.tapu-shell .journal-intro p { color: #fff; }
.tapu-card { padding: clamp(14px, 3vw, 28px); }
/* The shared 20rem/100vw reserve is sized for the journal games; the card padding already bounds the width, so only the height needs fitting. */
.tapu-card .journal-play-board { width: min(100%, 800px, calc(100dvh - 7rem)); }
.tapu-board { position: relative; display: grid; grid-template: repeat(9, minmax(0, 1fr)) / repeat(9, minmax(0, 1fr)); width: 100%; aspect-ratio: 1; border: 4px solid #1d1d1d; background: repeating-conic-gradient(#5d9b3c 0 25%, #67a845 0 50%) 0 0 / 12.5% 12.5%; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18); font-size: clamp(.5rem, 1.35vw, .74rem); overflow: hidden; }
.tapu-sq { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-width: 0; padding: 3px 2px 0; border: 1px solid #1d1d1d; background: #c6c6c6; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .55), inset -2px -2px 0 rgba(0, 0, 0, .25); color: #1d1d1d; text-align: center; line-height: 1.1; overflow: hidden; }
.tapu-sq.is-owned { box-shadow: inset 0 0 0 3px var(--tapu-owner), inset 2px 2px 0 rgba(255, 255, 255, .55); }
.tapu-sq::before { content: ""; position: absolute; inset: 0 0 auto; height: 18%; background: var(--tapu-g, transparent); }
.tapu-sq-name { position: relative; margin-top: 18%; font-weight: 800; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tapu-sq > i { position: relative; margin-top: 8%; font-size: 1.6em; }
.tapu-sq--spawn, .tapu-sq--camp, .tapu-sq--treasure, .tapu-sq--portal { background: #8b8b8b; color: #fff; }
.tapu-sq--spawn > .tapu-sq-name, .tapu-sq--camp > .tapu-sq-name, .tapu-sq--treasure > .tapu-sq-name, .tapu-sq--portal > .tapu-sq-name { margin-top: 2px; }
.tapu-sq--portal { background: #3b1f5c; }
.tapu-sq--treasure { background: #2b8a8a; }
.tapu-sq--chest > i { color: #8a5a2b; }
.tapu-sq--tax > i { color: #2d8a2d; }
.tapu-sq-price { color: #4a4a4a; font-weight: 700; }
.tapu-sq-level { position: absolute; right: 2px; bottom: 1px; padding: 0 3px; background: var(--tapu-owner); color: #fff; font-weight: 800; border: 1px solid #1d1d1d; }
.tapu-sq-tokens { position: absolute; inset: auto 0 14% 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; }
.tapu-token { width: clamp(12px, 2.6vw, 22px); height: clamp(12px, 2.6vw, 22px); border: 2px solid var(--tapu-owner); image-rendering: pixelated; background: #1d1d1d; transition: transform .15s; cursor: pointer; }
.tapu-token:hover { transform: scale(1.22); z-index: 3; }
.tapu-token.is-me { transform: scale(1.18); z-index: 1; }
.tapu-token.is-me:hover { transform: scale(1.26); }
.tapu-g0 { --tapu-g: #7fc455; } .tapu-g1 { --tapu-g: #2f6b2a; } .tapu-g2 { --tapu-g: #e3cf8a; } .tapu-g3 { --tapu-g: #3a7fd0; }
.tapu-g4 { --tapu-g: #6e6e6e; } .tapu-g5 { --tapu-g: #e9f3f7; } .tapu-g6 { --tapu-g: #a2332a; } .tapu-g7 { --tapu-g: #d8d39a; }
.tapu-center { position: relative; grid-row: 2 / 9; grid-column: 2 / 9; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px; padding: clamp(6px, 2vw, 18px); border: 3px solid #1d1d1d; background: rgba(29, 29, 29, .78); color: #fff; font-size: clamp(.72rem, 1.7vw, 1rem); overflow: hidden; }
.tapu-countdown { margin: 0; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .02em; color: rgba(255, 210, 63, .7); font-size: .8em; }
.tapu-dice { display: flex; gap: 10px; }
.tapu-dice span { display: grid; place-items: center; width: clamp(30px, 6vw, 52px); aspect-ratio: 1; border: 3px solid #1d1d1d; border-radius: 18%; background-color: #f4f4f4; color: #1d1d1d; font-size: 1.5em; font-weight: 900; box-shadow: inset -3px -3px 0 #bdbdbd; }
.tapu-dice span[data-n] { font-size: 0; color: transparent; background-size: 26% 26%; }
.tapu-dice span[data-n="1"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 50% 50%; }
.tapu-dice span[data-n="2"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 16% 16%, 84% 84%; }
.tapu-dice span[data-n="3"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 16% 16%, 50% 50%, 84% 84%; }
.tapu-dice span[data-n="4"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 16% 16%, 84% 16%, 16% 84%, 84% 84%; }
.tapu-dice span[data-n="5"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 16% 16%, 84% 16%, 50% 50%, 16% 84%, 84% 84%; }
.tapu-dice span[data-n="6"] { background-image: radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%), radial-gradient(circle, #1d1d1d 62%, transparent 66%); background-position: 16% 16%, 84% 16%, 16% 50%, 84% 50%, 16% 84%, 84% 84%; }
.tapu-dice span[data-n] { background-repeat: no-repeat; }
.tapu-board.is-rolling .tapu-dice span { animation: tapu-roll .55s ease-in-out infinite; background-color: #fff6d6; box-shadow: inset -3px -3px 0 #bdbdbd, 0 0 calc(6px + 22px * var(--heat, 0)) calc(1px + 5px * var(--heat, 0)) rgba(255, 190, 40, calc(.35 + .6 * var(--heat, 0))); }
.tapu-board.is-rolling .tapu-dice span:nth-child(2) { animation-direction: reverse; animation-duration: .68s; }
.tapu-board.is-landed .tapu-dice span { animation: tapu-land .85s cubic-bezier(.3, 1.6, .5, 1); box-shadow: inset -3px -3px 0 #bdbdbd, 0 0 0 10px rgba(255, 210, 63, 0), 0 0 26px 8px rgba(255, 210, 63, .9); }
.tapu-board.is-double .tapu-dice span { background-color: #ffd23f; box-shadow: inset -3px -3px 0 #c9a21b, 0 0 14px 4px #ffd23f; animation: tapu-land .85s cubic-bezier(.3, 1.6, .5, 1), tapu-flash .45s ease-in-out .85s 3; }
@keyframes tapu-roll { 0% { transform: translate(0, 0) rotate(-40deg) scale(.85); } 20% { transform: translate(-6px, -16px) rotate(110deg) scale(1.2); } 40% { transform: translate(5px, 0) rotate(220deg) scale(.9); } 60% { transform: translate(6px, -12px) rotate(310deg) scale(1.15); } 80% { transform: translate(-4px, 2px) rotate(400deg) scale(.9); } 100% { transform: translate(0, 0) rotate(680deg) scale(.85); } }
@keyframes tapu-flash { 50% { transform: scale(1.3) rotate(8deg); } }
@keyframes tapu-land { 0% { transform: translateY(-34px) rotate(-25deg) scale(1.7); } 55% { transform: translateY(3px) rotate(6deg) scale(.88); } 100% { transform: none; } }
.tapu-status { margin: 0; min-height: 1.3em; color: #fff; text-align: center; font-weight: 700; }
.tapu-hint { flex: none; margin: -4px 0 0; max-width: 32em; color: rgba(255, 255, 255, .75); text-align: center; font-size: .82em; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.tapu-hint[hidden] { display: none; }
.tapu-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tapu-feedback { flex: none; margin: 0; max-width: 100%; color: #fff; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.tapu-feedback.is-error { padding: 6px 10px; border: 1px solid #ffb4a8; background: #64251e; color: #fff; }
.tapu-btn { width: auto; margin: 0; border-radius: 0; min-height: 40px; padding: 8px 16px; border: 3px solid #1d1d1d; background: #8b8b8b; color: #fff; font: inherit; font-weight: 800; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .4), inset -2px -2px 0 rgba(0, 0, 0, .35); cursor: pointer; }
.tapu-btn.is-primary { background: #3c8527; }
.tapu-btn:disabled { opacity: .55; cursor: wait; }
.tapu-btn:focus-visible { outline: 3px solid #e9b416; outline-offset: 2px; }
.tapu-join-cta { width: 100%; max-width: 320px; min-height: 52px; font-size: 1.25em; flex: none; animation: tapu-pulse 1.6s ease-in-out infinite; }
@keyframes tapu-pulse { 50% { transform: scale(1.04); } }
.tapu-join { position: absolute; inset: 0; z-index: 2; padding: clamp(10px, 2.5vw, 20px); background: #1d1d1d; overflow: auto; font-size: .9em; }
.tapu-join p { margin: 8px 0; }
.tapu-join-balance { color: #ffd23f; font-size: 1.05em; }
.tapu-join-msg { font-weight: 700; color: #e9b416; }
.tapu-join form { display: flex; flex-wrap: wrap; gap: 8px; }
.tapu-join select { width: auto; min-height: 40px; margin: 0; }
.tapu-join-close { position: absolute; top: 6px; right: 6px; min-height: 0; padding: 2px 10px; }
.tapu-log { flex: 1; width: 100%; margin: 0; padding: 0; list-style: none; overflow: auto; font-size: .85em; color: #ddd; }
.tapu-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; width: 100%; margin: 0; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: .85em; }
.tapu-stats[hidden] { display: none; }
.tapu-stats div { text-align: center; }
.tapu-stats dt { opacity: .6; font-size: .85em; }
.tapu-stats dd { margin: 0; font-weight: 700; }
.tapu-log li { padding: 3px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.tapu-log-t { margin-right: 6px; opacity: .6; font-variant-numeric: tabular-nums; }
.tapu-log li:first-child { color: #fff; border-top: 0; }
.tapu-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 12px; }
.tapu-side p { margin: 8px 0; }
.tapu-players { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.tapu-players li { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: center; padding: 6px 8px; border-left: 4px solid var(--tapu-owner, #8b8b8b); background: rgba(0, 0, 0, .04); }
.tapu-players li.is-me { background: rgba(212, 120, 72, .14); }
.tapu-players img { grid-row: span 2; width: 28px; height: 28px; image-rendering: pixelated; }
.tapu-players span { font-size: .85rem; opacity: .8; }
.tapu-players .tapu-kick { grid-column: 3; grid-row: 1 / span 2; min-width: 32px; padding: 2px 8px; }
.tapu-tables { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.tapu-tables li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; background: rgba(0, 0, 0, .04); }
.tapu-tables span { flex: 1; font-size: .85rem; opacity: .8; }
.tapu-rules { margin: 8px 0; padding-left: 18px; font-size: .9rem; }
.tapu-rules li { margin: 4px 0; }
.tapu-flow { margin-top: 20px; }
.tapu-flow-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 8px 0; }
.tapu-flow-box { flex: 1 1 130px; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 3px solid #1d1d1d; background: #c6c6c6; color: #1d1d1d; font-size: .85rem; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .55), inset -2px -2px 0 rgba(0, 0, 0, .25); }
.tapu-flow-box.is-end { background: #3c8527; color: #fff; }
.tapu-flow-box.is-up { background: #bfe3a8; }
.tapu-flow-box.is-down { background: #f0b4aa; }
.tapu-flow-arrow { align-self: center; font-weight: 900; font-size: 1.4rem; }
/* Outcome cards: one pops over the board per event, tinted by tone. */
.tapu-tip { position: absolute; z-index: 6; display: grid; gap: 2px; max-width: min(260px, 90%); padding: 8px 10px; border: 3px solid #1d1d1d; background: #2b2b2b; color: #fff; font-size: .8rem; line-height: 1.3; pointer-events: none; box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .18), inset -2px -2px 0 rgba(0, 0, 0, .4); }
.tapu-tip[hidden] { display: none; }
.tapu-sq { cursor: help; }
.tapu-fx { position: absolute; inset: 0; z-index: 5; display: none; place-items: center; pointer-events: none; --fx: #e9b416; }
.tapu-fx.is-on { display: grid; }
.tapu-fx.is-good { --fx: #4cd964; } .tapu-fx.is-bad { --fx: #ff4d3a; } .tapu-fx.is-portal { --fx: #b36bff; }
.tapu-fx.is-on::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, color-mix(in srgb, var(--fx) 55%, transparent) 0, transparent 65%); animation: tapu-wash var(--beat, 1.3s) ease-out both; }
.tapu-fx-card { position: relative; display: grid; justify-items: center; gap: 4px; max-width: 70%; padding: 14px 26px; border: 4px solid #1d1d1d; background: #2b2b2b; color: #fff; text-align: center; font-weight: 800; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .18), inset -3px -3px 0 rgba(0, 0, 0, .4), 0 0 0 4px var(--fx); animation: tapu-card var(--beat, 1.3s) cubic-bezier(.2, .9, .3, 1.2) both; }
.tapu-fx-card > i { font-size: 2.6em; color: var(--fx); animation: tapu-wiggle .8s ease-in-out 2; }
.tapu-fx-card > b { font-size: 1.15em; }
.tapu-fx-card > span { font-size: .85em; opacity: .85; }
.tapu-fx-card > strong { font-size: 1.7em; color: var(--fx); animation: tapu-rise .9s ease-out both; }
.tapu-p { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; background: var(--pc, var(--fx)); animation: tapu-burst 1.4s ease-out both; }
.tapu-token.is-hop { animation: tapu-hop .34s ease-out; }
.tapu-sq.is-hit { z-index: 2; animation: tapu-hit 1s ease-in-out 2; }
.tapu-sq.is-built { z-index: 3; animation: tapu-built 1.6s ease-out; }
.tapu-board.fx-shake { animation: tapu-shake .9s linear; }
.tapu-board.fx-warp { animation: tapu-warp 1.2s ease-in-out; }
.tapu-log li:first-child { animation: tapu-slide .4s ease-out; }
.tapu-btn { animation: tapu-pop .25s ease-out; }
.tapu-btn.is-primary:not(:disabled) { animation: tapu-pop .25s ease-out, tapu-pulse 1.6s ease-in-out .3s infinite; }
@keyframes tapu-card { 0% { transform: scale(.3) rotate(-6deg); opacity: 0; } 15% { transform: scale(1.12); opacity: 1; } 25% { transform: none; } 85% { transform: none; opacity: 1; } 100% { transform: scale(.9); opacity: 0; } }
@keyframes tapu-wash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tapu-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg) scale(1.15); } 75% { transform: rotate(14deg) scale(1.15); } }
@keyframes tapu-rise { from { transform: translateY(14px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tapu-burst { from { transform: translate(-50%, -50%) scale(1); opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(180deg) scale(0); opacity: 0; } }
@keyframes tapu-hop { 50% { transform: translateY(-14px) scale(1.25); } }
@keyframes tapu-hit { 50% { box-shadow: inset 0 0 0 4px #e9b416, 0 0 14px 4px #e9b416; transform: scale(1.12); } }
@keyframes tapu-built { 0% { transform: scale(1); filter: brightness(1); } 25% { transform: scale(1.3); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
@keyframes tapu-shake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -3px); } 80% { transform: translate(4px, 4px); } }
@keyframes tapu-warp { 50% { filter: hue-rotate(70deg) saturate(1.6); transform: scale(.985); } }
@keyframes tapu-slide { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.tapu-btn.is-rest { background: #5a5a5a; animation: none; opacity: 1; cursor: default; }
.tapu-btn.is-rest::before { content: ""; }
@keyframes tapu-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tapu-pulse { 50% { box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .4), inset -2px -2px 0 rgba(0, 0, 0, .35), 0 0 0 4px rgba(233, 180, 22, .8); } }
@media (max-width: 560px) { .tapu-flow-arrow { transform: rotate(90deg); flex-basis: 100%; text-align: center; } }
@media (max-width: 560px) {
  .tapu-sq-price { display: none; }
  .tapu-sq-name { -webkit-line-clamp: 3; font-size: .9em; }
}

.tapu-help-open { position: absolute; top: 4px; right: 4px; z-index: 1; min-height: 0; width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 1.1em; animation: none; }
.tapu-help { position: fixed; inset: 0; margin: auto; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: clamp(14px, 3vw, 24px); border: 4px solid #1d1d1d; background: #2b2b2b; color: #fff; overflow: auto; }
.tapu-player { position: fixed; inset: 0; margin: auto; width: min(320px, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 24px); padding: clamp(12px, 3vw, 18px); border: 4px solid #1d1d1d; background: #2b2b2b; color: #fff; overflow: auto; }
.tapu-player::backdrop { background: rgba(0, 0, 0, .55); }
.tapu-player h2 { margin: 0 28px 10px 0; font-size: 1.1rem; line-height: 1.25; color: #fff; }
.tapu-player-stats { display: grid; gap: 4px; margin: 0 0 12px; font-size: .86rem; line-height: 1.35; }
.tapu-player-stats b { font-size: 1rem; }
.tapu-player-cake { width: 100%; margin: 0; animation: none; }
.tapu-player-cake:not(:disabled) { animation: tapu-pop .25s ease-out; }
.tapu-player-cake[hidden] { display: none; }
.tapu-help::backdrop { background: rgba(0, 0, 0, .7); }
.tapu-help h2 { margin: 0 32px 10px 0; font-size: 1.25rem; }
.tapu-help-steps { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.tapu-help-steps li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 8px; background: rgba(255, 255, 255, .06); }
.tapu-help-steps p { margin: 2px 0 0; font-size: .85rem; opacity: .9; }
.tapu-help-vis { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 1.5rem; }
.tapu-help-vis .tapu-dice span { width: 40px; }
.tapu-help-vis .tapu-sq { width: 84px; aspect-ratio: 1; font-size: .7rem; }
.tapu-help-build i:nth-child(1) { color: #e9b416; } .tapu-help-build i:nth-child(2) { color: #d47848; } .tapu-help-build i:nth-child(3) { color: #b8b8b8; }
.tapu-help-rent span { width: 22px; height: 22px; border: 2px solid #1d1d1d; background: var(--tapu-g); }
.tapu-help-rent b { color: #4cd964; }
.tapu-help-special .fa-house-flag { color: #4cd964; } .tapu-help-special .fa-gem { color: #5ce1e6; } .tapu-help-special .fa-bomb { color: #ff4d3a; } .tapu-help-special .fa-dungeon { color: #b36bff; }
.tapu-help-end { color: #e9b416; font-size: 2.2rem; }
@media (max-width: 460px) { .tapu-help-steps li { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* Spinner on the action that is waiting for the server. */
.tapu-btn.is-loading { position: relative; color: transparent; cursor: wait; }
.tapu-btn.is-loading::after { content: ""; box-sizing: border-box; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: tapu-spin .7s linear infinite; }
@keyframes tapu-spin { to { transform: rotate(360deg); } }

/* Extra juice: flying coins, cash chips, the turn spotlight, the last seconds and the final celebration. */
.tapu-coin { position: absolute; z-index: 6; width: 12px; height: 12px; border: 2px solid #6b4a00; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #e9b416 45%, #a8780a); box-shadow: 0 0 8px rgba(255, 210, 63, .8); pointer-events: none; }
.tapu-players li { position: relative; }
.tapu-players li.is-up { animation: tapu-up 1.4s ease-out; }
.tapu-players li.is-down { animation: tapu-down 1.4s ease-out; }
.tapu-delta { position: absolute; right: 8px; top: 2px; font-style: normal; font-weight: 800; color: #2e9e4a; pointer-events: none; animation: tapu-float 1.8s ease-out both; }
.tapu-players li.is-down .tapu-delta { color: #d8341f; }
.tapu-token.is-turn:not(.is-hop) { z-index: 2; animation: tapu-turn 1.1s ease-in-out infinite; }
.tapu-status.is-urgent { color: #ff6b5a; animation: tapu-urgent .5s ease-in-out infinite alternate; }
.tapu-rain { position: absolute; top: -4%; width: 7px; height: 11px; background: var(--pc); animation: tapu-fall 2.8s linear both; }
@keyframes tapu-up { 0%, 40% { background: rgba(76, 217, 100, .35); } }
@keyframes tapu-down { 0%, 40% { background: rgba(255, 77, 58, .3); } }
@keyframes tapu-float { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 20% { transform: none; opacity: 1; } 100% { transform: translateY(-22px); opacity: 0; } }
@keyframes tapu-turn { 50% { box-shadow: 0 0 0 3px #ffd23f, 0 0 14px 4px rgba(255, 210, 63, .9); transform: translateY(-3px) scale(1.25); } }
@keyframes tapu-urgent { to { transform: scale(1.08); text-shadow: 0 0 10px rgba(255, 77, 58, .9); } }
@keyframes tapu-fall { to { top: 104%; transform: translateX(24px) rotate(720deg); } }
.tapu-help-open.tapu-share { right: auto; left: 4px; font-size: .95em; }
.tapu-help-open.tapu-view { right: auto; left: 38px; font-size: .75em; }
.tapu-help-open.tapu-sound { right: auto; left: 72px; font-size: .8em; }
.tapu-sound[aria-pressed="false"] { background: #5a5a5a; opacity: .78; }
.tapu-view[aria-pressed="true"] { background: #7b3dff; }

/* Persistent progress: every move leaves the player with a clear next target. */
.tapu-momentum { flex: none; display: grid; grid-template-columns: auto minmax(110px, 1fr) auto auto; align-items: center; gap: 7px; width: 100%; padding: 7px 8px; border: 1px solid rgba(255, 210, 63, .48); background: linear-gradient(115deg, rgba(255, 210, 63, .13), rgba(123, 61, 255, .16)); box-shadow: inset 0 0 20px rgba(255, 210, 63, .07); }
.tapu-momentum[hidden] { display: none; }
.tapu-rank { display: flex; align-items: center; gap: 5px; text-align: left; white-space: nowrap; }
.tapu-rank-medal { font-size: 1.45em; filter: drop-shadow(0 0 6px rgba(255, 210, 63, .6)); }
.tapu-rank span:last-child { display: grid; line-height: 1; }
.tapu-rank small { color: #ffd23f; font-size: .56em; font-weight: 900; letter-spacing: .08em; }
.tapu-rank strong { font-size: 1.05em; }
.tapu-chase { display: grid; gap: 3px; min-width: 0; font-size: .68em; text-align: left; }
.tapu-chase > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tapu-progress { height: 5px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .35); overflow: hidden; }
.tapu-progress i { display: block; height: 100%; background: linear-gradient(90deg, #7b3dff, #21d6e0, #ffd23f); box-shadow: 0 0 8px #21d6e0; transition: width .65s cubic-bezier(.2, .9, .3, 1); }
.tapu-momentum-chip { position: relative; display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 3px; min-width: 43px; padding: 3px 5px; background: rgba(0, 0, 0, .28); text-align: center; line-height: 1; overflow: hidden; }
.tapu-momentum-chip > i { grid-row: span 2; color: #ffd23f; }
.tapu-momentum-chip > b { font-size: .9em; }
.tapu-momentum-chip > span { font-size: .56em; opacity: .72; }
.tapu-momentum-chip > em { position: absolute; left: 0; bottom: 0; width: var(--p); height: 2px; background: #4cd964; transition: width .65s ease; }
.tapu-momentum-chip.is-hot { color: #fff4bb; box-shadow: inset 0 0 12px rgba(255, 108, 32, .45); animation: tapu-heat 1.2s ease-in-out infinite; }
.tapu-momentum-chip.is-hot > i { color: #ff7a22; filter: drop-shadow(0 0 5px #ff4d3a); }
.tapu-momentum.is-rank-up { animation: tapu-rank-up 1.8s ease-out; }
@keyframes tapu-rank-up { 0%, 100% { transform: none; } 18% { transform: scale(1.06); background-color: rgba(255, 210, 63, .42); box-shadow: 0 0 28px #ffd23f; } 34% { transform: scale(.98); } 50% { transform: scale(1.02); } }
@keyframes tapu-heat { 50% { transform: translateY(-1px) scale(1.04); } }

@media (max-width: 560px) {
  .tapu-momentum { grid-template-columns: auto 1fr auto; gap: 5px; padding: 5px 6px; }
  .tapu-momentum-chip:first-of-type { display: none; }
  .tapu-rank small { display: none; }
}

/* 3D view: the same DOM board in a dark scene. Lifts use the individual translate/rotate properties, so the 2D keyframes on transform keep working on top. */
.tapu-side-face, .tapu-bld, .tapu-well { display: none; }
.tapu-shell:has(.tapu-3d):not(.nexus *) { --tapu-w: min(100vw - 2rem, 1760px); width: var(--tapu-w); margin-left: calc((100% - var(--tapu-w)) / 2); }
.tapu-card:has(.tapu-3d):hover { transform: none; }
.tapu-card:has(.tapu-3d) { padding: clamp(6px, 1vw, 14px); }
.tapu-3d { position: relative; }
.tapu-3d .journal-play-board { --cam-x: 50deg; --cam-z: -18deg; --aim-x: 0%; --aim-y: 0%; --zoom: 1; --u: 1; container-type: size; box-sizing: border-box; display: grid; place-items: center; width: 100%; height: max(480px, calc(100dvh - 6.5rem)); margin: 0; border: 1px solid rgba(140, 120, 255, .45); border-radius: 18px; overflow: hidden; perspective: min(1500px, 240vw); perspective-origin: 50% 35%; background: radial-gradient(ellipse at 50% 58%, rgba(123, 61, 255, .5), transparent 58%), radial-gradient(circle at 12% 12%, rgba(33, 214, 224, .3), transparent 42%), radial-gradient(circle at 90% 88%, rgba(255, 60, 172, .28), transparent 42%), #070815; box-shadow: 0 0 40px rgba(123, 61, 255, .3); cursor: grab; touch-action: pan-y; user-select: none; }
.tapu-3d .journal-play-board.is-orbit { cursor: grabbing; }
.tapu-3d .tapu-board { width: min(70cqw, 75cqh); font-size: clamp(.5rem, 1.35cqw, .95rem); border: 0; background: #11132a; box-shadow: none; overflow: visible; transform-style: preserve-3d; transform: translate(var(--pan-x, 0), var(--pan-y, 0)) scale(var(--zoom)) rotateX(var(--cam-x)) rotateZ(var(--cam-z)) translate(var(--aim-x), var(--aim-y)); transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.tapu-3d .is-orbit .tapu-board { transition: none; }
.tapu-3d .tapu-board::before { content: ""; position: absolute; inset: -6.5%; border: 2px solid #8c78ff; border-radius: 10px; background: #0b0c1d; box-shadow: 0 0 0 6px rgba(140, 120, 255, .4), 0 0 0 16px rgba(140, 120, 255, .18), 0 0 0 32px rgba(33, 214, 224, .1); transform: translateZ(-14px); }
.tapu-3d .tapu-sq { justify-content: flex-end; padding-bottom: 3px; --tapu-h: 12px; --tapu-side: var(--tapu-g, #6b6f86); overflow: visible; border-color: rgba(0, 0, 0, .55); transform-style: preserve-3d; translate: 0 0 2px; transition: translate .2s ease-out; }
.tapu-3d .tapu-sq:hover, .tapu-3d .tapu-sq.is-hit { translate: 0 0 16px; --rim-z: -30px; }
.tapu-3d .tapu-sq.is-owned { box-shadow: inset 0 0 0 3px var(--tapu-owner), 0 0 14px var(--tapu-owner); --tapu-side: var(--tapu-owner); }
.tapu-3d .tapu-sq.is-built { animation: tapu-boing-3d .7s ease-out; }
.tapu-3d .tapu-side-face { display: block; position: absolute; pointer-events: none; background: color-mix(in srgb, var(--tapu-side) 62%, #000); }
.tapu-3d .tapu-sq-name { margin-top: 0; overflow-wrap: normal; -webkit-line-clamp: 3; }
.tapu-3d .tapu-side-face:nth-last-child(-n+2) { top: 0; left: 0; width: 100%; height: calc(var(--tapu-h) * var(--u)); transform-origin: 0 0; transform: rotateX(-90deg); }
.tapu-3d .tapu-side-face:nth-last-child(1) { top: 100%; }
.tapu-3d .tapu-side-face:nth-last-child(n+3):nth-last-child(-n+4) { top: 0; left: 0; width: calc(var(--tapu-h) * var(--u)); height: 100%; transform-origin: 0 0; transform: rotateY(90deg); filter: brightness(.72); }
.tapu-3d .tapu-side-face:nth-last-child(3) { left: 100%; }
.tapu-3d .tapu-sq-level { top: 1px; bottom: auto; left: 1px; right: auto; font-size: .7em; line-height: 1.1; }
.tapu-3d .tapu-rim { position: absolute; width: 46%; aspect-ratio: 1; transform-style: preserve-3d; pointer-events: none; }
.tapu-3d .tapu-out-n .tapu-rim { bottom: 100%; left: 27%; }
.tapu-3d .tapu-out-s .tapu-rim { top: 100%; left: 27%; }
.tapu-3d .tapu-out-w .tapu-rim { right: 100%; top: 27%; }
.tapu-3d .tapu-out-e .tapu-rim { left: 100%; top: 27%; }
/* Stands on the rim slab, below the tile's face; a lifted tile leaves it on the ground (--rim-z). */
.tapu-3d .tapu-bld { display: block; translate: 0 0 var(--rim-z, -16px); transition: translate .2s ease-out; border-radius: 3px; background: color-mix(in srgb, var(--tapu-owner) 40%, transparent); }
.tapu-3d .is-built-1 .tapu-bld { animation: tapu-spring .7s .35s ease-out both; }
.tapu-3d .is-built-2 .tapu-bld { animation: tapu-hammered 1.2s linear both; }
.tapu-3d .is-built-3 .tapu-box { animation: tapu-tier .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.tapu-3d .is-built-3 .tapu-box:nth-child(2) { animation-delay: .35s; }
.tapu-3d .is-built-3 .tapu-box:nth-child(3) { animation-delay: .7s; }
.tapu-3d .is-built-3 .tapu-bld { animation: tapu-spring .5s 1.05s ease-out; }
.tapu-prop { pointer-events: none; }
.tapu-3d .tapu-stamp { position: absolute; inset: 10%; display: grid; place-items: center; border: 3px solid var(--tapu-owner); border-radius: 4px; background: rgba(255, 255, 255, .9); color: #17172b; font-weight: 900; font-size: .9em; animation: tapu-stamp 2.2s ease-in both; }
.tapu-3d .tapu-hammer, .tapu-3d .tapu-flag { display: grid; place-items: center; font-size: 3em; color: #fff; filter: drop-shadow(0 2px 2px #000); transform: translateZ(calc(26px * var(--u))) rotateZ(calc(-1 * var(--cam-z))) rotateX(calc(-1 * var(--cam-x))); }
.tapu-3d .tapu-hammer i { transform-origin: 90% 90%; animation: tapu-hammer .4s ease-in 3; }
.tapu-3d .tapu-flag { font-size: 2em; color: var(--tapu-owner); transform: translateZ(calc(60px * var(--u))) rotateZ(calc(-1 * var(--cam-z))) rotateX(calc(-1 * var(--cam-x))); }
.tapu-3d .tapu-flag i { animation: tapu-flag .6s 1.05s cubic-bezier(.3, 1.8, .5, 1) both; }
.tapu-3d .tapu-dust { border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); opacity: 0; translate: 0 0 -14px; animation: tapu-dust .6s ease-out; }
.tapu-3d .is-built-1 .tapu-dust { animation-delay: .35s; }
.tapu-3d .is-built-2 .tapu-dust { animation-delay: .9s; }
.tapu-3d .is-built-3 .tapu-dust { animation-delay: 1.05s; }
.tapu-3d .tapu-vortex { position: absolute; inset: -18%; border-radius: 50%; background: conic-gradient(#7b3dff, #ff3cac, #120326, #7b3dff, #21d6e0, #120326, #7b3dff); box-shadow: 0 0 22px #b36bff; translate: 0 0 1px; animation: tapu-vortex 1.6s ease-in-out both; }
.tapu-3d .tapu-dizzy { position: absolute; left: 50%; top: 0; translate: 0 0 44px; color: #ffd23f; font-size: .8em; }
.tapu-3d .tapu-dizzy i { display: block; text-shadow: 1.6em 0 #ffd23f, -1.6em 0 #ffd23f; animation: tapu-spin .7s linear 1s infinite; opacity: 0; animation-fill-mode: forwards; }
.tapu-3d .tapu-token.is-sucked { animation: tapu-sucked .8s ease-in both; }
.tapu-3d .tapu-token.is-spat { animation: tapu-spat 1.2s ease-out both; }
.tapu-3d .tapu-fx.is-stage { place-items: start center; padding-top: 12px; font-size: .85em; }
.tapu-3d .tapu-fx.is-stage::before { display: none; }
.tapu-3d .tapu-box { --tapu-side: var(--tapu-owner); position: absolute; inset: 0; margin: auto; display: block; background: color-mix(in srgb, var(--tapu-owner) 80%, #fff); transform-style: preserve-3d; transform: translateZ(calc(var(--tapu-z) * var(--u))); box-shadow: 0 0 8px var(--tapu-owner); }
/* Off screen the 3D board's animations pause, so scrolling past it costs nothing. */
.tapu-3d.is-away, .tapu-3d.is-away *, .tapu-3d.is-away *::before, .tapu-3d.is-away *::after { animation-play-state: paused !important; }
/* Cats past the board's corners. */
.tapu-city { display: none; }
.tapu-3d .tapu-city { display: block; position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.tapu-3d .tapu-district { position: absolute; transform-style: preserve-3d; }
.tapu-3d .tapu-district[hidden] { display: none; }
.tapu-3d .tapu-vox { position: absolute; display: block; transform-style: preserve-3d; transform: translateZ(calc(var(--tapu-z) * var(--u))); background: var(--tapu-top, #888); }
/* The cat strolls only while .is-walking is set (see strollCat): a looping animation inside the 3D scene re-composites every layer on every frame. */
.tapu-3d .tapu-cat { position: absolute; left: 28%; top: 10.5%; width: 20%; height: 7%; transform-style: preserve-3d; }
.tapu-3d .tapu-cat.is-walking { animation: tapu-cat-walk 6s linear both; }
.tapu-3d .tapu-cat.is-walking .is-leg { animation: tapu-cat-leg .4s linear 15; }
.tapu-3d .tapu-cat.is-walking .is-alt { animation-delay: -.2s; }
/* The camera looks down on the cats and foreshortens the head's front face to a sliver, so the eyes and nose go on its top, at the front end. */
.tapu-3d .tapu-cat .is-head { background: linear-gradient(#1d1d21, #1d1d21) 74% 14% / 20% 24% no-repeat, linear-gradient(#1d1d21, #1d1d21) 74% 86% / 20% 24% no-repeat, linear-gradient(#f4a0b5, #f4a0b5) 100% 50% / 14% 20% no-repeat, var(--tapu-top); }
/* Eyes and nose on the face that looks along the walk. That face is turned a quarter, so its horizontal runs down the head. */
.tapu-3d .tapu-cat .is-head .tapu-side-face:nth-last-child(3) { background: linear-gradient(#1d1d21, #1d1d21) 22% 16% / 30% 20% no-repeat, linear-gradient(#1d1d21, #1d1d21) 22% 84% / 30% 20% no-repeat, linear-gradient(#f4a0b5, #f4a0b5) 70% 50% / 22% 18% no-repeat, color-mix(in srgb, var(--tapu-side) 62%, #000); }
.tapu-3d .tapu-cat .is-ear { background: linear-gradient(#f4a0b5, #f4a0b5) 18% 18% / 64% 64% no-repeat, color-mix(in srgb, var(--tapu-top) 72%, #000); }
.tapu-3d .tapu-cat .is-tabby, .tapu-3d .tapu-cat .is-tabby .tapu-side-face { background: linear-gradient(#c26412, #c26412) 22% 0 / 16% 100% no-repeat, linear-gradient(#c26412, #c26412) 52% 0 / 16% 100% no-repeat, linear-gradient(#c26412, #c26412) 78% 0 / 14% 100% no-repeat, var(--tapu-top); }
/* Out along the path, turn about, back, turn to the start pose; the turns ease, the walks stay level. */
@keyframes tapu-cat-walk {
  0% { transform: translateX(0) rotateZ(0deg); }
  40% { transform: translateX(120%) rotateZ(0deg); animation-timing-function: ease-in-out; }
  50% { transform: translateX(120%) rotateZ(180deg); }
  90% { transform: translateX(0) rotateZ(180deg); animation-timing-function: ease-in-out; }
  100% { transform: translateX(0) rotateZ(360deg); }
}
/* A paw swings back on the ground, lifts and comes forward; diagonal pairs run half a stride apart. */
@keyframes tapu-cat-leg {
  0%, 100% { translate: 0 0 0; }
  25% { translate: -2.5px 0 0; }
  50% { translate: 0 0 2px; }
  75% { translate: 2.5px 0 0; }
}
.tapu-3d .tapu-sq-tokens { inset: 0 0 82% 0; align-items: flex-end; align-content: flex-end; transform-style: preserve-3d; rotate: z calc(-1 * var(--cam-z)); translate: 0 0 3px; pointer-events: none; }
.tapu-3d .tapu-token { width: clamp(14px, 3.4cqw, 42px); height: clamp(14px, 3.4cqw, 42px); transform-origin: 50% 100%; rotate: x calc(-1 * var(--cam-x)); pointer-events: auto; cursor: pointer; transition: transform .15s; }
.tapu-3d .tapu-token:hover { transform: scale(1.12); }
.tapu-3d .tapu-board.fx-shake, .tapu-3d .tapu-board.fx-warp, .tapu-3d .tapu-board.fx-cake-hit { animation: none; }
.tapu-3d .journal-play-board:has(.fx-shake) { animation: tapu-shake .9s linear; }
.tapu-3d .journal-play-board:has(.fx-warp) { animation: tapu-warp 1.2s ease-in-out; }
.tapu-3d .tapu-well { display: grid; grid-row: 2 / 9; grid-column: 2 / 9; place-items: center; position: relative; transform-style: preserve-3d; pointer-events: none; }
.tapu-3d .tapu-well::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: conic-gradient(#21d6e0, #7b3dff, #ff3cac, #21d6e0); opacity: .75; mask: radial-gradient(closest-side, transparent 92%, #000 94%), conic-gradient(from var(--sweep), rgba(0, 0, 0, calc(1 - .92 * var(--wait))), #000); mask-composite: intersect; animation: tapu-spin 9s linear infinite, tapu-sweep 1.1s linear infinite paused; transition: --wait .6s ease, opacity .6s ease; }
/* Waiting for the server: a comet tail (fading alpha) sweeps round the ring. --wait fades it in and out, and the sweep only pauses, so neither end jumps. */
@property --wait { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.tapu-3d .tapu-well.is-waiting::before { --wait: 1; opacity: 1; animation-play-state: running, running; }
@keyframes tapu-sweep { to { --sweep: 360deg; } }
.tapu-dice.tapu-cubes { --d: clamp(30px, 9vw, 64px); gap: calc(var(--d) * .7); transform-style: preserve-3d; translate: 0 0 calc(var(--d) / 2 + 2px); }
.is-rolling .tapu-cubes { animation: tapu-toss .55s ease-in-out infinite alternate; }
/* Roll from the board: the dice and their label wake up when a roll is allowed. */
.tapu-zoom { display: none; }
.tapu-3d .tapu-well.is-ready .tapu-cubes { pointer-events: auto; cursor: pointer; }
.tapu-3d .tapu-well.is-ready .tapu-cube span { box-shadow: inset 0 0 calc(var(--d) * .18) rgba(0, 0, 0, .28), 0 0 calc(var(--d) * .35) #ffd23f; }
/* Lifted off the board's plane: coplanar with it, clicks can land on the board instead. */
.tapu-well-play { position: absolute; bottom: 21%; left: 0; right: 0; display: grid; justify-items: center; gap: 4px; translate: 0 0 6px; }
.tapu-well-note { margin: 0; padding: 0 14%; color: #fff; font-weight: 800; text-align: center; text-shadow: 0 1px 3px #000; }
.tapu-well-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tapu-well-btns .tapu-btn { min-height: 28px; padding: .3em .9em; font-size: max(.75rem, 1em); white-space: nowrap; pointer-events: auto; cursor: pointer; }
.tapu-well-btns .tapu-btn:not(.is-primary) { border: 1px solid #fff; background: rgba(13, 14, 36, .9); color: #fff; opacity: 1; }
.tapu-well-btns .tapu-btn.is-primary { animation: tapu-pulse-roll 1.6s ease-in-out infinite; }
@keyframes tapu-pulse-roll { 50% { box-shadow: 0 0 18px #ffd23f; } }
.tapu-3d .tapu-zoom { display: flex; gap: 6px; position: absolute; left: 12px; bottom: 12px; z-index: 5; }
.tapu-zoom button { width: 36px; height: 36px; padding: 0; border: 1px solid #8c78ff; border-radius: 10px; background: rgba(13, 14, 36, .85); color: #fff; font-size: 1.25rem; font-weight: 800; line-height: 1; cursor: pointer; }
.tapu-zoom button:hover { background: #8c78ff; }
.tapu-zoom button:focus-visible { outline: 2px solid #ffd23f; outline-offset: 2px; }
.tapu-notice { position: absolute; top: 14px; left: 50%; translate: -50% 0; z-index: 6; box-sizing: border-box; width: max-content; max-width: min(90%, 460px); margin: 0; padding: 10px 16px; border: 2px solid #ffb4a8; border-radius: 10px; background: #64251e; color: #fff; font-weight: 800; text-align: center; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); pointer-events: none; animation: tapu-notice 4s ease-out both; }
.tapu-notice[hidden] { display: none; }
@keyframes tapu-notice { from { opacity: 0; translate: -50% -8px; } 6%, 92% { opacity: 1; translate: -50% 0; } to { opacity: 0; translate: -50% 0; } }
.tapu-3d .tapu-well::after { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: var(--flash, transparent); mask: radial-gradient(closest-side, transparent 80%, #000 82%); opacity: 0; pointer-events: none; }
.tapu-3d .tapu-well.is-flash-good { --flash: #ff9f1c; }
.tapu-3d .tapu-well.is-flash-bad { --flash: #ff2a2a; }
.tapu-3d .tapu-well.is-flash-good::after, .tapu-3d .tapu-well.is-flash-bad::after { animation: tapu-flash .32s ease-out 5; filter: drop-shadow(0 0 22px var(--flash)) drop-shadow(0 0 48px var(--flash)); }
/* The gradient underneath goes wild while it flashes: faster, brighter, more saturated; a win also pumps the whole ring. */
.tapu-3d .tapu-well.is-flash-good::before, .tapu-3d .tapu-well.is-flash-bad::before { animation-duration: 1.1s; opacity: 1; background: conic-gradient(var(--flash), color-mix(in srgb, var(--flash) 45%, #fff), var(--flash), color-mix(in srgb, var(--flash) 45%, #000), var(--flash)); filter: saturate(1.6) brightness(1.3); }
.tapu-3d .tapu-well.is-flash-good { animation: tapu-pump .32s ease-out 5; }
.tapu-3d .tapu-well.is-flash-bad { animation: tapu-wobble .16s linear 8; }
@keyframes tapu-flash { 0% { opacity: 1; scale: .94; } 100% { opacity: .55; scale: 1.14; } }
@keyframes tapu-pump { 0% { scale: 1.1; } 100% { scale: 1; } }
@keyframes tapu-wobble { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.is-landed .tapu-well::before { opacity: 1; filter: drop-shadow(0 0 16px #ffd23f); }
.tapu-cube { position: relative; width: var(--d); height: var(--d); transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .8, .3, 1); }
.tapu-cube:not(.is-set) { animation: tapu-idle 9s linear infinite; }
.tapu-dice.tapu-cubes span { position: absolute; inset: 0; width: auto; border-width: 1px; border-radius: 10%; animation: none !important; box-shadow: inset 0 0 calc(var(--d) * .18) rgba(0, 0, 0, .28); backface-visibility: hidden; }
.tapu-dice.tapu-cubes span[data-n="1"] { transform: translateZ(calc(var(--d) / 2)); }
.tapu-dice.tapu-cubes span[data-n="6"] { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.tapu-dice.tapu-cubes span[data-n="2"] { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); }
.tapu-dice.tapu-cubes span[data-n="5"] { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.tapu-dice.tapu-cubes span[data-n="3"] { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); }
.tapu-dice.tapu-cubes span[data-n="4"] { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.tapu-3d > .tapu-center { box-sizing: border-box; width: 100%; min-height: 230px; margin: 12px 0 0; border: 1px solid rgba(140, 120, 255, .55); border-radius: 14px; background: linear-gradient(160deg, #15163a, #0b0c1d); box-shadow: 0 0 24px rgba(123, 61, 255, .25); }
.tapu-3d > .tapu-center > .tapu-dice { display: none; }
.tapu-3d .tapu-status, .tapu-3d .tapu-feedback { color: #fff; }
.tapu-3d .tapu-stats dt, .tapu-3d .tapu-stats dd { color: #fff; }
.tapu-3d .tapu-log { max-height: 7.5em; }
.tapu-3d .tapu-btn:not(.tapu-help-open) { border: 0; border-radius: 10px; }
.tapu-3d .tapu-btn.is-primary { background: linear-gradient(120deg, #7b3dff, #21a6e0); }
.tapu-3d .tapu-fx-card, .tapu-3d .tapu-tip, .tapu-3d .tapu-player { border-color: #8c78ff; border-radius: 12px; background: rgba(13, 14, 36, .92); }
.tapu-3d .tapu-fx { font-size: clamp(.85rem, 1.6cqw, 1.15rem); }
/* Wide screens play like a game: the board fills the scene and the controls float beside it. Phones keep them below. */
@media (min-width: 900px) {
  .tapu-3d .journal-play-board { padding-right: 336px; }
  .tapu-3d > .tapu-center { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 304px; margin: 0; background: linear-gradient(160deg, rgba(21, 22, 58, .92), rgba(11, 12, 29, .92)); }
  .tapu-3d .tapu-log { max-height: none; }
  .tapu-3d .tapu-fx { right: 336px; }
  .tapu-3d .tapu-notice { left: calc((100% - 336px) / 2); }
}
/* Full screen: the stage (scene plus controls) fills the viewport; on phones the panel below scrolls inside it. */
.tapu-3d.is-full { position: fixed; inset: 0; z-index: 1000; box-sizing: border-box; margin: 0; padding: 0; overflow: auto; background: #070815; }
.tapu-3d.is-full .journal-play-board { height: 100dvh; border: 0; border-radius: 0; }
.tapu-3d.is-full > .tapu-center { margin-top: 0; }
@media (min-width: 900px) { .tapu-3d.is-full .tapu-board { width: min(78cqw, 82cqh); font-size: clamp(.5rem, 1.35cqw, 1.7rem); } } /* a bigger board, and its text with it */
.tapu-has-full { overflow: hidden; }
@media (min-width: 900px) { .tapu-3d.is-full { overflow: hidden; } }
@media (max-width: 899px) {
  .tapu-3d .tapu-zoom { top: 8px; bottom: auto; left: 8px; } /* the board reaches the bottom corners here */
  .tapu-3d .tapu-sq-level { display: none; } /* no room beside the name on 31px tiles: the glow marks the owner, a tap shows the rent */
  .tapu-3d .journal-play-board { --cam-z: 0deg; --u: .5; height: auto; aspect-ratio: .95; perspective: 400vw; }
  .tapu-3d .tapu-board { width: 88cqw; }
}
@keyframes tapu-boing-3d { 30% { scale: 1.12 .9; } 60% { scale: .95 1.06; } }
@keyframes tapu-spring { 0% { transform: scale3d(1, 1, 0); } 35% { transform: scale3d(.7, .7, 1.7); } 65% { transform: scale3d(1.25, 1.25, .65); } 85% { transform: scale3d(.95, .95, 1.15); } }
@keyframes tapu-hammered { 0%, 12% { transform: scale3d(1, 1, .1); } 18%, 42% { transform: scale3d(1.15, 1.15, .4); } 50%, 75% { transform: scale3d(1.15, 1.15, .7); } 82% { transform: scale3d(.8, .8, 1.5); } 92% { transform: scale3d(1.1, 1.1, .85); } }
/* visibility, not opacity: animating opacity would flatten the box and lose its sides. */
@keyframes tapu-tier { from { translate: 0 0 120px; visibility: hidden; } }
@keyframes tapu-stamp { 0% { transform: translateZ(190px) rotate(16deg) scale(2.2); opacity: 0; } 16% { transform: translateZ(4px) rotate(-12deg) scale(1); opacity: 1; } 22% { transform: translateZ(4px) rotate(-12deg) scale(1.14); } 28%, 80% { transform: translateZ(4px) rotate(-12deg) scale(1); opacity: 1; } 100% { transform: translateZ(4px) rotate(-12deg) scale(1); opacity: 0; } }
@keyframes tapu-hammer { 0% { transform: rotate(35deg); } 70% { transform: rotate(-55deg); } 100% { transform: rotate(35deg); } }
@keyframes tapu-flag { from { transform: scale(0) rotate(-40deg); } }
@keyframes tapu-dust { from { opacity: .9; scale: .4; } to { opacity: 0; scale: 3; } }
@keyframes tapu-vortex { 0% { transform: scale(0) rotate(0); } 25%, 75% { transform: scale(1) rotate(1.5turn); } 100% { transform: scale(0) rotate(3turn); } }
@keyframes tapu-sucked { 15% { transform: translateX(-5px) rotate(-16deg); } 30% { transform: translateX(5px) rotate(16deg); } 45% { transform: translateX(-3px) scale(1.25, .7); } 100% { transform: scale(.1, 2.8) rotate(900deg); opacity: 0; } }
@keyframes tapu-spat { 0% { transform: scale(0); } 25% { transform: translateY(-130px) rotate(360deg) scale(.6, 1.6); } 50% { transform: translateY(-160px) rotate(720deg); } 78% { transform: translateY(0) rotate(1080deg) scale(1.55, .5); } 90% { transform: translateY(-18px) rotate(1080deg) scale(.9, 1.2); } 100% { transform: rotate(1080deg); } }
@keyframes tapu-toss { to { translate: 0 0 calc(var(--d) * 1.6); } }
@keyframes tapu-idle { from { transform: rotateX(-30deg) rotateY(0); } to { transform: rotateX(-30deg) rotateY(360deg); } }
.tapu-cake { position: absolute; z-index: 8; width: clamp(44px, 6vw, 64px); height: clamp(44px, 6vw, 64px); pointer-events: none; image-rendering: pixelated; background: linear-gradient(#e23d3d, #e23d3d) 18% 20% / 22% 22% no-repeat, linear-gradient(#e23d3d, #e23d3d) 50% 8% / 18% 18% no-repeat, linear-gradient(#e23d3d, #e23d3d) 76% 24% / 16% 16% no-repeat, linear-gradient(#fff, #fff) 0 0 / 100% 44% no-repeat, linear-gradient(#e0b06a, #c4843a); box-shadow: inset 0 0 0 3px #6b3e1f, 0 5px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(255, 200, 100, .65); transform: translate(-50%, -50%); }
.tapu-cake.is-hold { z-index: 9; animation: tapu-cake-hold .45s ease-in-out infinite alternate; }
@keyframes tapu-cake-hold { from { transform: translate(-50%, -50%) rotate(-18deg) scale(1); } to { transform: translate(-50%, -58%) rotate(-10deg) scale(1.06); } }
.tapu-splat-pixel { position: absolute; z-index: 7; pointer-events: none; image-rendering: pixelated; background: var(--pc, #fff); box-shadow: 1px 1px 0 rgba(0, 0, 0, .22); }
.tapu-board.fx-cake-hit { animation: tapu-cake-shake 1.15s linear; }
.tapu-3d .journal-play-board:has(.fx-cake-hit) { animation: tapu-cake-shake 1.15s linear; }
@keyframes tapu-cake-shake { 0%, 100% { transform: none; } 15% { transform: translate(-9px, 4px) rotate(-0.6deg); } 30% { transform: translate(8px, -6px) rotate(0.5deg); } 45% { transform: translate(-7px, -5px); } 60% { transform: translate(7px, 5px); } 75% { transform: translate(-4px, 2px); } }
.tapu-splat-ring { position: absolute; z-index: 7; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none; border: 4px solid rgba(255, 255, 255, .95); border-radius: 50%; box-shadow: 0 0 20px rgba(226, 61, 61, .75), inset 0 0 12px rgba(255, 210, 63, .5); animation: tapu-splat-ring .95s ease-out both; }
.tapu-splat-frost { position: absolute; z-index: 7; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .55) 35%, rgba(226, 61, 61, .35) 55%, transparent 72%); animation: tapu-splat-frost 1.1s ease-out both; }
.tapu-board .tapu-token.is-splat { animation: tapu-squash .72s ease-out, tapu-splat-wobble .8s ease-out .08s, tapu-frost 3.6s ease-out; z-index: 4; }
@keyframes tapu-squash { 15% { scale: 2 .42; } 35% { scale: 1.65 .58; } 55% { scale: 1.35 .78; } 75% { scale: 1.12 .92; } }
@keyframes tapu-splat-wobble { 0%, 100% { rotate: 0deg; } 18% { rotate: -16deg; } 42% { rotate: 14deg; } 68% { rotate: -8deg; } 88% { rotate: 4deg; } }
@keyframes tapu-splat-ring { from { transform: scale(.15); opacity: 1; } 40% { opacity: .85; } to { transform: scale(3.8); opacity: 0; } }
@keyframes tapu-splat-frost { from { transform: scale(.25); opacity: .95; } 35% { opacity: .7; } to { transform: scale(2.8); opacity: 0; } }
@keyframes tapu-frost { 0% { box-shadow: inset 0 -18px 0 #fff, inset 0 -32px 0 rgba(255, 255, 255, .5), 0 0 0 9px rgba(226, 61, 61, .95), 0 0 36px 14px rgba(255, 210, 63, .9); filter: brightness(1.55) saturate(1.25); } 10% { transform: scale(1.28); } 100% { box-shadow: inset 0 0 0 0 transparent, 0 0 0 0 transparent; filter: none; } }
