/* Local table play and CEO emotes borrow the supplied board's wood and paper. */
.table-toys { position: absolute; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.table-tap { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; transform: scale(var(--table-size,1)); pointer-events: none; }
.table-tap::before { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(83,48,19,.5); border-radius: 50%; animation: table-ring .5s ease-out both; }
.table-tap i { position: absolute; left: 17px; top: 17px; width: 3px; height: 2px; border-radius: 50%; background: #71502e; animation: table-chip .45s ease-out both; --chip-x: -13px; --chip-y: -6px; }
.table-tap i:nth-child(2) { --chip-x: 12px; --chip-y: -10px; animation-delay: .025s; }
.table-tap i:nth-child(3) { --chip-x: -9px; --chip-y: 10px; animation-delay: .04s; }
.table-tap i:nth-child(4) { --chip-x: 14px; --chip-y: 7px; animation-delay: .01s; }
.table-stone i { background: #b7b09c; width: 2px; height: 2px; }
.table-stone::before { border-color: rgba(110,109,99,.65); }
.table-water::before { border-color: #a6e6ed; border-width: 2px; }
.table-water i { width: 3px; height: 3px; background: #c2f2f4; }
.table-coin::before { border-color: #edc158; border-width: 2px; }
.table-coin i { background: #ffe8a7; }
@keyframes table-ring { from { opacity: .65; transform: scale(.24); } to { opacity: 0; transform: scale(1.25); } }
@keyframes table-chip { from { opacity: .6; transform: translate(0,0); } to { opacity: 0; transform: translate(var(--chip-x),var(--chip-y)); } }

#hud > .speech {
  box-sizing: border-box; z-index: 55; max-width: none; min-height: 72px; padding: 18px 23px;
  background: #f4e9cb; color: #352411; border: 2px solid #6a4828; border-radius: 30px 34px 29px 32px;
  box-shadow: 0 6px 15px rgba(31,16,5,.5), inset 0 0 16px rgba(165,119,56,.16);
  font: 400 21px/1.28 'HS Belwe',Georgia,serif; text-align: center; text-wrap: pretty; overflow-wrap: anywhere;
  transform: scale(calc(var(--speech-scale,1) * .9)); transform-origin: 0 50%;
  transition: transform .18s cubic-bezier(.16,1,.3,1), opacity .16s ease-out; pointer-events: none;
}
#hud > .speech.show { transform: scale(var(--speech-scale,1)); }
#hud > .speech::before {
  width: 17px; height: 17px; left: -10px; top: 27px; border: 0; border-left: 2px solid #6a4828; border-bottom: 2px solid #6a4828;
  background: #f4e9cb; transform: skew(-16deg) rotate(32deg); border-bottom-left-radius: 4px;
}
#hud > .speech-me::before { top: auto; bottom: 13px; transform: skew(16deg) rotate(58deg); }
#hud > .speech.speech-native { min-height: 64px; padding: 14px 18px; font-size: 18px; line-height: 1.26; }

#hud > .emote-wheel {
  box-sizing: border-box; display: none; padding: 17px 18px 14px; gap: 0;
  transform: scale(var(--emote-scale,1)); transform-origin: top left;
  border: 2px solid #9a743e; border-radius: 22px;
  background: #382414 url('./hs/table.webp') center / 680px auto;
  box-shadow: 0 12px 30px rgba(17,9,2,.62), inset 0 0 0 4px #513519, inset 0 0 0 5px #a4793b;
  color: #f7e5bd; pointer-events: auto;
}
#hud > .emote-wheel.open { display: block; }
#hud > .emote-wheel h3 { margin: 0 0 12px; font: 400 23px/1.15 'HS Belwe',Georgia,serif; text-align: center; color: #ffe3a1; text-shadow: 0 2px 3px #221004; }
#hud > .emote-wheel .emote-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
#hud > .emote-wheel button {
  position: relative; display: block; width: 100%; min-width: 44px; min-height: 48px; margin: 0; padding: 8px 10px;
  border: 1px solid #79532c; border-radius: 48% / 44%; background: #f4e7c4; color: #352411;
  font: 400 18px/1.15 'HS Belwe',Georgia,serif; box-shadow: 0 3px 5px rgba(24,12,2,.35), inset 0 0 9px rgba(155,112,48,.17);
  cursor: pointer; touch-action: manipulation; transition: background-color .12s, transform .12s;
}
#hud > .emote-wheel button::after { content: ''; position: absolute; width: 8px; height: 8px; bottom: -3px; background: #f4e7c4; border-right: 1px solid #79532c; border-bottom: 1px solid #79532c; transform: rotate(45deg); }
#hud > .emote-wheel button:nth-child(odd)::after { right: 20px; }
#hud > .emote-wheel button:nth-child(even)::after { left: 20px; }
#hud > .emote-wheel button:hover, #hud > .emote-wheel button:focus-visible { background: #fff2d1; color: #291907; outline: 3px solid #e8c676; outline-offset: 2px; }
#hud > .emote-wheel button:hover::after, #hud > .emote-wheel button:focus-visible::after { background: #fff2d1; }
#hud > .emote-wheel button:active { transform: translateY(1px); }
#hud > .emote-wheel .emote-preview { margin: 13px 0 0; min-height: 38px; color: #f9e8c6; font: 15px/1.3 Georgia,serif; text-align: center; text-wrap: pretty; }
#hud > .emote-wheel.emote-compact-short .emote-preview { display: none; }
#hud > .emote-wheel.emote-compact-short h3 { font-size: 18px; }

.settings .audio-slider { gap: 18px; }
.settings input[type="range"] { width: 150px; min-height: 44px; margin: 0; accent-color: #d3a757; cursor: pointer; touch-action: pan-x; }
.settings input[type="range"]:focus-visible { outline: 2px solid #ffe3a1; outline-offset: 3px; }
/* Native phone controls sit above the scaled board. While choosing an emote,
   they must neither cover a preset nor turn that tap into a game action. */
body:has(#hud > .emote-wheel.open) #mobile-controls { visibility: hidden; pointer-events: none; }
@media (max-width: 900px), (max-height: 520px) {
  #hud > .emote-wheel { padding: 12px 14px 11px; }
  #hud > .emote-wheel h3 { font-size: 20px; margin-bottom: 9px; }
  #hud > .emote-wheel .emote-choices { gap: 7px 12px; }
  #hud > .emote-wheel button { min-height: 44px; font-size: 17px; }
  #hud > .emote-wheel .emote-preview { min-height: 36px; margin-top: 10px; font-size: 13px; }
  #overlay.pause-wrap { padding: 10px; }
  #overlay .pause { width: min(680px,100%); padding: 12px 18px; }
  #overlay .pause h2 { margin: 0; }
  #overlay .settings { gap: 7px; margin: 10px 0 12px; }
  #overlay .settings label { min-height: 44px; gap: 8px; }
  #overlay .settings button { min-width: 96px; padding: 7px 12px; }
  #overlay .settings input[type="range"] { width: 112px; }
  #overlay .pause > .buttons { margin-top: 0; gap: 8px; }
  #overlay.pause-wrap.show { display: flex; align-items: center; }
  #overlay .pause { display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; max-height: 100%; }
  #overlay .pause .settings { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #a8834a #281a0e; }
}
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) and (orientation: landscape) {
  #overlay .settings { display: grid; grid-template-columns: 1fr 1fr; column-gap: 26px; }
  #overlay .settings .phone-install-tip { grid-column: 1 / -1; max-width: none; margin: 0; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .table-tap::before, .table-tap i { animation: none; }
  .table-tap { opacity: .35; }
  .table-tap i { display: none; }
  #hud > .speech, #hud > .emote-wheel button { transition: none; }
  #hud > .speech { transform: scale(var(--speech-scale,1)); }
}
