/* เศรษฐีมะลิ (2026-11-14, TYCOON_BRIEF.md): the page card and the full-screen
   3D layer. Colours come from the site's theme tokens, so menus and overlays
   follow Day / Night / Auto; the board itself is lit the same in both. */

/* ---------- the page ---------- */
.ty-hello { display: flex; align-items: center; gap: 14px; }
.ty-hello img { width: 56px; height: 56px; flex: none; }
.ty-hello p { margin: 0; font-weight: 700; line-height: 1.6; color: var(--text); }
.ty-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ty-go {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: #ff4b2b; color: #111111; font: 700 1.1rem/1.3 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif;
  box-shadow: 0 4px 0 var(--ink-sh, #111111); touch-action: manipulation;
}
.ty-go:active { transform: translateY(3px); box-shadow: none; }
.ty-go img { width: 28px; height: 28px; }
.ty-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
  background: var(--fill, rgba(17, 17, 17, .06)); color: var(--muted, #6b655c); }
.ty-tag img { width: 20px; height: 20px; }

/* ---------- the 3D layer ---------- */
html.ty-on, html.ty-on body { overflow: hidden; }
.ty-play {
  position: fixed; inset: 0; z-index: 2147482000; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 38%, #fbf7ef 0%, #ece4d4 70%, #e2d8c4 100%);
  color: #111111; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
html[data-theme="dark"] .ty-play { background: radial-gradient(120% 80% at 50% 38%, #2a2622 0%, #181614 72%, #111111 100%); color: #f3eee3; }
.ty-play[hidden] { display: none; }
.ty-stage { position: absolute; inset: 0; }
.ty-stage canvas { display: block; width: 100%; height: 100%; outline: none; }

.ty-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}
.ty-top > span { display: flex; gap: 8px; }
.ty-ib {
  width: 44px; height: 44px; border-radius: 14px; border: 0; cursor: pointer; pointer-events: auto; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: rgba(255, 253, 246, .86); color: #111111; box-shadow: 0 2px 0 rgba(17, 17, 17, .18);
  font: 800 .85rem/1 Inter, system-ui, sans-serif;
}
html[data-theme="dark"] .ty-ib { background: rgba(40, 36, 32, .9); color: #f3eee3; box-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.ty-ib svg { width: 24px; height: 24px; }
.ty-ib:focus-visible, .ty-chip:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }

.ty-chips {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 0 max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
.ty-chips[hidden] { display: none; }
.ty-chip {
  pointer-events: auto; cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 3px 12px 3px 3px; border-radius: 999px;
  border: 0; background: rgba(255, 253, 246, .9); color: #111111; box-shadow: 0 2px 0 rgba(17, 17, 17, .16);
  font: 700 .85rem/1 "Chakra Petch", Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .ty-chip { background: rgba(40, 36, 32, .92); color: #f3eee3; }
.ty-chip > img { width: 36px; height: 36px; border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat); }
.ty-chip.on { box-shadow: 0 0 0 3px var(--seat), 0 2px 0 rgba(17, 17, 17, .16); }
.ty-chip b { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.ty-coin { width: 14px; height: 14px; }

.ty-load { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; z-index: 3;
  padding: 10px 18px; border-radius: 999px; background: rgba(255, 253, 246, .92); color: #111111; font-weight: 700; pointer-events: none; }
.ty-load[hidden] { display: none; }

.ty-debug {
  position: absolute; left: max(8px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 52px); z-index: 4;
  max-width: min(92vw, 360px); padding: 6px 8px; border-radius: 8px; background: rgba(17, 17, 17, .78); color: #d6ffd6;
  font: 11px/1.35 ui-monospace, Menlo, monospace; pointer-events: auto;
}
.ty-debug pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
.ty-debug button { margin-top: 4px; min-height: 30px; padding: 2px 10px; border-radius: 6px; border: 0; background: #ffd23f; color: #111111; font: 700 12px/1 Inter, sans-serif; }

@media (prefers-reduced-motion: reduce) { .ty-go:active { transform: none; } }

/* ---------- Prompt 2: the speed / sound / replay buttons ---------- */
.ty-ib img { width: 30px; height: 30px; pointer-events: none; }
.ty-replay { position: absolute; z-index: 3; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 108px); width: 52px; height: 52px; border-radius: 50%; }
.ty-replay[hidden] { display: none; }
.ty-chip.out { opacity: .45; }
.ty-chip.out > img { filter: grayscale(1); }
.ty-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the 2D effects over the board (ty/fx) ---------- */
.ty-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.ty-fcoin, .ty-fstar, .ty-fnum, .ty-ban, .ty-ring2 { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.ty-fcoin img { display: block; width: 34px; height: 34px; filter: drop-shadow(0 3px 0 rgba(17, 17, 17, .25)); }
/* 2026-11-16: everything bigger and rounder (the user: "Expand the animation to be much bigger") */
.ty-fnum { display: inline-flex; align-items: center; gap: 6px; padding: 5px 16px 5px 6px; border-radius: 999px; white-space: nowrap;
  background: #fffdf6; color: #111111; box-shadow: 0 4px 0 rgba(17, 17, 17, .22), 0 0 0 3px #111111;
  font: 700 1.45rem/1.15 "Chakra Petch", Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.ty-fnum img { width: 26px; height: 26px; }
.ty-fnum.big { font-size: 2rem; padding: 6px 20px 6px 8px; }
.ty-fnum.big img { width: 34px; height: 34px; }
/* the big title: a sticker plate with an icon, thick ink, a hard shadow */
.ty-ban { display: inline-flex; align-items: center; gap: 10px; padding: 10px 22px 10px 12px; border-radius: 26px; white-space: nowrap; max-width: 92vw;
  background: #ffd23f; color: #111111; box-shadow: 0 6px 0 #111111, 0 0 0 4px #111111;
  font: 700 2.1rem/1.1 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif; }
.ty-ban img { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 2px 0 rgba(17, 17, 17, .3)); }
.ty-ban span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.ty-ban em { font-style: normal; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.ty-ban.orange { background: #ff4b2b; }
.ty-ban.green { background: #6fd38f; }
.ty-ban.red { background: #ff8a70; }
@media (max-width: 380px) { .ty-ban { font-size: 1.7rem; } .ty-ban img { width: 46px; height: 46px; } .ty-ban em { font-size: 1.35rem; } }
.ty-ring2 { width: var(--d, 120px); height: var(--d, 120px); border-radius: 50%; border: 6px solid var(--c, #ffd23f); box-shadow: 0 0 0 3px rgba(17, 17, 17, .5); }
.ty-flash { position: absolute; inset: 0; background: #fffdf6; pointer-events: none; }
.ty-fnum.pos b { color: #1d7a3e; }
.ty-fnum.neg b { color: #c22c0e; }
html[data-theme="dark"] .ty-fnum { background: rgba(40, 36, 32, .95); color: #f3eee3; }
html[data-theme="dark"] .ty-fnum.pos b { color: #6fd38f; }
html[data-theme="dark"] .ty-fnum.neg b { color: #ff8a70; }
.ty-fstar svg { display: block; }
.ty-confetti { position: absolute; inset: 0; width: 100%; height: 100%; }
.ty-card {
  position: absolute; left: 50%; top: 42%; pointer-events: auto; width: min(86vw, 340px); padding: 24px 20px 22px; border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  background: #fffdf6; color: #111111; box-shadow: 0 6px 0 rgba(17, 17, 17, .2), 0 0 0 3px #111111;
  font: 700 1.35rem/1.4 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif; backface-visibility: hidden;
  box-shadow: 0 8px 0 rgba(17, 17, 17, .25), 0 0 0 4px #111111;
}
.ty-card img { width: 84px; height: 84px; }
.ty-card p { margin: 0; }
html[data-theme="dark"] .ty-card { background: #2a2622; color: #f3eee3; box-shadow: 0 6px 0 rgba(0, 0, 0, .5), 0 0 0 3px #f3eee3; }
.ty-mali {
  position: absolute; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 108px);
  display: flex; align-items: center; gap: 12px; max-width: 440px; margin: 0 auto; padding: 10px 18px 10px 10px; border-radius: 26px;
  background: rgba(255, 253, 246, .97); color: #111111; box-shadow: 0 5px 0 rgba(17, 17, 17, .22), 0 0 0 3px #111111;
  font: 700 1.15rem/1.45 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif;
}
.ty-mali img { width: 76px; height: 76px; flex: none; }
.ty-mali p { margin: 0; }
html[data-theme="dark"] .ty-mali { background: rgba(40, 36, 32, .96); color: #f3eee3; }

/* ---------- ?debug=models ---------- */
.ty-gal { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 0 12px max(14px, env(safe-area-inset-bottom)); text-align: center; pointer-events: none; }
.ty-gal p { margin: 0 auto 6px; width: fit-content; max-width: 92vw; padding: 4px 12px; border-radius: 999px; background: rgba(255, 253, 246, .92); color: #111111; font: 700 .95rem/1.35 "Chakra Petch", Inter, "SukhumvitSet", sans-serif; }
.ty-gal p:empty { display: none; }
.ty-gal .ty-gal-n { font: 600 .8rem/1.3 ui-monospace, Menlo, monospace; }
.ty-gal .ty-gal-n.over { background: #c22c0e; color: #fff; }
.ty-gal-bar { display: flex; justify-content: center; gap: 10px; margin-top: 6px; }
.ty-gal-bar .ty-ib { font-size: 1.4rem; }
.ty-gal-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ty-gal-labels span { position: absolute; left: 0; top: 0; padding: 1px 6px; border-radius: 6px; background: rgba(255, 253, 246, .9); color: #111111; font: 700 10px/1.3 "Chakra Petch", "SukhumvitSet", sans-serif; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ty-fstar { display: none; } }

/* ======================= Prompt 4: the rooms (ty/room) ======================= */
.ty-home .panel-b, .ty-lobby .panel-b { display: flex; flex-direction: column; gap: 14px; }
.ty-name { display: flex; align-items: center; gap: 10px; }
.ty-name img { flex: none; }
.ty-name .bg-in { flex: 1; min-width: 0; }
.ty-chars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ty-char { min-height: 52px; border-radius: 16px; border: 0; padding: 4px; cursor: pointer; touch-action: manipulation;
  background: var(--fill, rgba(17, 17, 17, .05)); display: flex; align-items: center; justify-content: center; }
.ty-char img { width: 40px; height: 40px; pointer-events: none; }
.ty-char[aria-checked="true"] { background: #ff4b2b; box-shadow: 0 0 0 3px var(--text, #111111) inset; }
.ty-big {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 0; touch-action: manipulation; background: var(--fill, rgba(17, 17, 17, .06)); color: var(--text, #111111);
  font: 700 1.1rem/1.3 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif;
}
.ty-big.go { background: #ff4b2b; color: #111111; box-shadow: 0 4px 0 var(--ink-sh, #111111); }
.ty-big.go:active { transform: translateY(3px); box-shadow: none; }
.ty-big.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong, rgba(17, 17, 17, .16)); }
.ty-big:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.ty-big img { flex: none; pointer-events: none; }
.ty-joinbox { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 20px; background: var(--fill, rgba(17, 17, 17, .04)); }
.ty-jt { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--text, #111111); }
.ty-codes { display: flex; gap: 6px; }
.ty-cbox {
  flex: 1 1 0; min-width: 0; max-width: 54px; height: 56px; padding: 0; border-radius: 14px; text-align: center; text-transform: uppercase;
  border: 2px solid var(--line-strong, rgba(17, 17, 17, .2)); background: var(--surface, #fffdf6); color: var(--text, #111111);
  font: 700 1.5rem/1 "Chakra Petch", Inter, monospace;
}
.ty-cbox:focus { outline: 3px solid #ff4b2b; outline-offset: 1px; border-color: transparent; }
.ty-err:not(:empty) { display: flex; align-items: center; gap: 8px; }
.ty-go.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong, rgba(17, 17, 17, .16)); color: var(--text, #111111); }

/* the lobby */
.ty-room { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; border-radius: 20px; background: var(--fill, rgba(17, 17, 17, .04)); }
.ty-rc { font: 700 2.4rem/1 "Chakra Petch", Inter, monospace; letter-spacing: .16em; padding-left: .16em; color: var(--text, #111111); }
.ty-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ty-sb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface, #fffdf6); color: var(--text, #111111); box-shadow: inset 0 0 0 2px var(--line-strong, rgba(17, 17, 17, .14)); font: 700 .95rem/1 Inter, "SukhumvitSet", sans-serif; }
.ty-sb img { pointer-events: none; }
.ty-seats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ty-seats li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 18px;
  background: var(--fill, rgba(17, 17, 17, .04)); min-width: 0; }
.ty-seats li.me { box-shadow: inset 0 0 0 2px var(--seat); }
.ty-sav { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%;
  background: #fffdf6; box-shadow: 0 0 0 4px var(--seat, transparent); }
.ty-seats li.empty .ty-sav { background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong, rgba(17, 17, 17, .2)); opacity: .6; }
.ty-sav > b { font: 700 1.4rem/1 "Chakra Petch", "SukhumvitSet", sans-serif; color: #111111; }
.ty-crown { position: absolute; right: -8px; top: -10px; width: 26px; height: 26px; }
.ty-sn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .9rem; color: var(--text, #111111); }
.ty-sn small { font-weight: 600; color: var(--muted, #6b655c); }
.ty-x { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted, #6b655c); font: 700 1.4rem/1 Inter, sans-serif; cursor: pointer; }
.ty-opts { display: flex; gap: 8px; }
.ty-opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--fill, rgba(17, 17, 17, .05)); color: var(--text, #111111); font: 700 .95rem/1.2 Inter, "SukhumvitSet", sans-serif; touch-action: manipulation; }
.ty-opt img { flex: none; width: 24px; height: 24px; pointer-events: none; }
.ty-opt[aria-pressed="true"] { background: var(--pill, #111111); color: #f3eee3; }
html[data-theme="dark"] .ty-opt[aria-pressed="true"] { background: #f3eee3; color: #111111; }
.ty-opt:disabled { cursor: default; }
.ty-opt:disabled:not([aria-pressed="true"]) { opacity: .5; }
.ty-wait { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-weight: 700; color: var(--muted, #6b655c); }

/* ======================= Prompt 4: in a game (ty/hud) ======================= */
/* the chips: piece on a seat ring with the turn timer around it, cash with a coin, a dot per owned tile */
.ty-chips { gap: 6px; }
.ty-chip { gap: 6px; padding: 3px 10px 3px 3px; }
.ty-av { position: relative; display: block; width: 40px; height: 40px; flex: none; }
.ty-av > img { position: absolute; left: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat); }
.ty-ring { position: absolute; inset: -2px; width: 44px; height: 44px; transform: rotate(-90deg); pointer-events: none; display: none; }
.ty-ring circle { fill: none; stroke: #111111; stroke-width: 3.5; stroke-dasharray: 125.7; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
html[data-theme="dark"] .ty-ring circle { stroke: #f3eee3; }
.ty-chip.timed .ty-ring { display: block; }
.ty-cb { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.ty-dots { display: flex; flex-wrap: wrap; gap: 2px; max-width: 64px; min-height: 5px; }
.ty-dots i { display: block; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(17, 17, 17, .35); }
.ty-dots i.more { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.ty-chip.me b { text-decoration: underline 2px var(--seat); text-underline-offset: 3px; }
.ty-chip.out .ty-av > img { filter: grayscale(1); }
/* three players or more: each chip stands up (piece over cash), so six fit across a 360 px phone */
.ty-chips.many .ty-chip { flex-direction: column; gap: 2px; padding: 3px 4px 5px; border-radius: 16px; min-width: 52px; }
.ty-chips.many .ty-cb { align-items: center; }
.ty-chips.many .ty-chip b { font-size: .7rem; gap: 2px; }
.ty-chips.many .ty-coin { width: 11px; height: 11px; }
.ty-chips.many .ty-dots { justify-content: center; max-width: 52px; }

/* the bar for my turn, over the chips */
.ty-act { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); width: min(calc(100% - 20px), 440px);
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--ty-chips, 52px) + 10px); pointer-events: none; display: flex; justify-content: center; }
.ty-act[hidden] { display: none; }
.ty-act > * { pointer-events: auto; }
.ty-mine { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 12px 12px 12px; border-radius: 22px;
  background: rgba(255, 253, 246, .94); color: #111111; box-shadow: 0 3px 0 rgba(17, 17, 17, .18); }
html[data-theme="dark"] .ty-mine, html[data-theme="dark"] .ty-act .ty-wait { background: rgba(40, 36, 32, .95); color: #f3eee3; }
.ty-act .ty-wait { padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 253, 246, .92); color: #111111; box-shadow: 0 2px 0 rgba(17, 17, 17, .16); }
.ty-wav { width: 30px; height: 30px; border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat); }
.ty-sec { position: absolute; right: 12px; top: 10px; min-width: 28px; font: 700 .95rem/1 "Chakra Petch", Inter, monospace; font-variant-numeric: tabular-nums; text-align: right; opacity: .7; }
.ty-act .ty-wait .ty-sec { position: static; }
.ty-sec.low { color: #c22c0e; opacity: 1; }
html[data-theme="dark"] .ty-sec.low { color: #ff8a70; }
.ty-row, .ty-yn { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ty-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; min-width: 52px; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 0; touch-action: manipulation; background: rgba(17, 17, 17, .07); color: inherit;
  font: 700 1.05rem/1.2 "Chakra Petch", Inter, "SukhumvitSet", system-ui, sans-serif;
}
html[data-theme="dark"] .ty-btn { background: rgba(255, 238, 222, .1); }
.ty-btn.go { background: #ff4b2b; color: #111111; box-shadow: 0 4px 0 #111111; }
.ty-btn.go:active { transform: translateY(3px); box-shadow: none; }
.ty-btn.big { min-height: 64px; padding: 10px 32px; font-size: 1.25rem; }
.ty-btn.no { padding: 8px 14px; }
.ty-btn.bad { background: #c22c0e; color: #fff; }
.ty-btn.wide { width: 100%; }
.ty-btn.sm { min-height: 44px; padding: 4px 12px; font-size: .95rem; }
.ty-btn.sure { outline: 3px solid #ffd23f; }
.ty-btn:disabled { opacity: .5; cursor: default; transform: none; }
.ty-btn img { flex: none; pointer-events: none; }
.ty-ask { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: 700; padding-right: 28px; }
.ty-tc { display: inline-flex; align-items: center; gap: 6px; font: 700 1.05rem/1.3 "Chakra Petch", "SukhumvitSet", sans-serif; }
.ty-tc > i { display: block; width: 8px; height: 28px; border-radius: 4px; background: var(--band); }
.ty-m { display: inline-flex; align-items: center; gap: 4px; font: 700 1rem/1 "Chakra Petch", Inter, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ty-jl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding-right: 28px; }

/* sheets: the property sheet, the debt sheet, the rules, the menu, the hints */
.ty-sheetwrap { position: absolute; inset: 0; z-index: 5; background: rgba(17, 17, 17, .28); display: flex; align-items: flex-end; justify-content: center; touch-action: manipulation; }
.ty-sheetwrap[hidden] { display: none; }
.ty-sheet { position: relative; width: min(100%, 460px); max-height: 82%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--surface, #faf8f3); color: var(--text, #111111);
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -4px 0 rgba(17, 17, 17, .12); animation: tyUp .22s ease-out; }
html[data-theme="dark"] .ty-sheet { background: #1f1c1a; color: #f3eee3; }
.ty-sheet:focus { outline: none; }
@keyframes tyUp { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.ty-sx { position: absolute; right: 10px; top: 10px; box-shadow: none; background: transparent; }
.ty-sh { display: flex; align-items: center; gap: 10px; margin: 0; padding-right: 48px; font: 700 1.25rem/1.3 "Chakra Petch", "SukhumvitSet", sans-serif; }
.ty-sh .ty-m { margin-left: auto; }
.ty-band { display: block; width: 10px; height: 32px; border-radius: 5px; background: var(--band); flex: none; }
.ty-own { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 4px 12px 4px 4px; border-radius: 999px; font-weight: 700;
  background: var(--fill, rgba(17, 17, 17, .05)); }
.ty-own img { border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat, transparent); }
.ty-own.free img { box-shadow: none; background: transparent; }
.ty-ladder, .ty-sell, .ty-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ty-ladder li, .ty-rules li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px; border-radius: 12px; }
.ty-ladder li > b { margin-left: auto; font: 700 1rem/1 "Chakra Petch", Inter, sans-serif; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 4px; }
.ty-ladder li small { color: var(--muted, #6b655c); font-weight: 700; }
.ty-ladder li.on { background: rgba(255, 75, 43, .16); }
.ty-hs { display: inline-flex; align-items: center; gap: 2px; min-width: 80px; }
.ty-cost { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; flex-wrap: wrap; }
.ty-sell li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 4px 2px 0; }
.ty-sell li > i { width: 8px; height: 30px; border-radius: 4px; background: var(--band); flex: none; }
.ty-sell li > b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-bnote { margin: 0 0 10px; color: var(--muted, #6b655c); font-weight: 600; line-height: 1.5; }
.ty-rules li { font-weight: 700; line-height: 1.4; }
.ty-rules .ty-hs { min-width: 92px; }
.ty-kl { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-weight: 700; color: var(--muted, #6b655c); }
.ty-kicks { display: flex; flex-wrap: wrap; gap: 10px; }
.ty-kick { position: relative; width: 56px; height: 56px; border: 0; border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat); cursor: pointer; }
.ty-kick img { pointer-events: none; }
.ty-kick i { position: absolute; right: -4px; top: -4px; width: 22px; height: 22px; border-radius: 50%; background: #c22c0e; color: #fff; font: 700 15px/22px Inter, sans-serif; font-style: normal; }
.ty-kick.sure { outline: 3px solid #ffd23f; outline-offset: 3px; }
.ty-hint { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 10px 0 4px; text-align: center; }
.ty-hint > b { font: 700 1.3rem/1.4 "Chakra Petch", "SukhumvitSet", sans-serif; }
.ty-hs.anim img { animation: tyHop 1.2s ease-in-out infinite; }
.ty-hs.anim img:nth-child(2) { animation-delay: .2s; }
.ty-hs.anim img:nth-child(3) { animation-delay: .4s; }
@keyframes tyHop { 0%, 100% { transform: none; } 40% { transform: translateY(-10px); } }
.ty-dots3 { display: flex; gap: 6px; }
.ty-dots3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong, rgba(17, 17, 17, .2)); }
.ty-dots3 i.on { background: #ff4b2b; }

/* the toast: an icon and a few words */
.ty-toast { position: absolute; z-index: 6; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 58px); transform: translateX(-50%); margin: 0;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: #111111; color: #f3eee3; font: 700 .95rem/1.3 Inter, "SukhumvitSet", sans-serif; }
html[data-theme="dark"] .ty-toast { background: #f3eee3; color: #111111; }
.ty-toast[hidden] { display: none; }

/* the win screen */
.ty-win { position: absolute; inset: 0; z-index: 4; display: flex; align-items: flex-end; justify-content: center; pointer-events: none;
  padding: 0 10px max(12px, env(safe-area-inset-bottom)); }
.ty-win[hidden] { display: none; }
.ty-wcard { pointer-events: auto; width: min(100%, 440px); max-height: 70%; overflow: auto; padding: 16px; border-radius: 24px;
  background: rgba(255, 253, 246, .97); color: #111111; box-shadow: 0 4px 0 rgba(17, 17, 17, .2); display: flex; flex-direction: column; gap: 12px; }
html[data-theme="dark"] .ty-wcard { background: rgba(31, 28, 26, .97); color: #f3eee3; }
.ty-wcard h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 1.3rem/1.3 "Chakra Petch", "SukhumvitSet", sans-serif; }
.ty-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ty-rank li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px; border-radius: 14px; }
.ty-rank li:first-child { background: rgba(255, 210, 63, .3); }
.ty-rank li.me { box-shadow: inset 0 0 0 2px var(--seat); }
.ty-rank li > img { border-radius: 50%; background: #fffdf6; box-shadow: 0 0 0 3px var(--seat); }
.ty-rank li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ty-pl { width: 22px; font: 700 1.1rem/1 "Chakra Petch", sans-serif; text-align: center; }
.ty-wbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ty-wbtns .ty-wait { width: 100%; }
/* a short landscape screen: the ranking on the left, the buttons in a column on the right (always on screen) */
@media (orientation: landscape) and (max-height: 500px) {
  .ty-win { align-items: center; padding-top: calc(max(10px, env(safe-area-inset-top)) + 54px); }
  .ty-wcard { width: min(100%, 620px); max-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr);
    column-gap: 14px; row-gap: 8px; padding: 12px; overflow: hidden; }
  .ty-wcard h2 { grid-column: 1; grid-row: 1; font-size: 1.1rem; }
  .ty-wcard .ty-rank { grid-column: 1; grid-row: 2; overflow: auto; overscroll-behavior: contain; min-height: 0; }
  .ty-wbtns { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: stretch; }
  .ty-wbtns .ty-wait { width: auto; }
}
@media (prefers-reduced-motion: reduce) { .ty-sheet { animation: none; } .ty-hs.anim img { animation: none; } .ty-btn.go:active, .ty-big.go:active { transform: none; } .ty-ring circle { transition: none; } }
