.games-controls { position: relative; display: inline-flex; flex: 0 0 auto; }
.games-trigger { min-height: 46px; padding: 0 14px; border-radius: 999px; border: 1px solid #3c4b36; background: #182217; color: #d8f3cc; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.games-trigger:hover, .games-trigger[aria-expanded="true"] { background: #283b22; border-color: #8ded54; }
.games-trigger.has-game::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9afa58; margin-left: 7px; vertical-align: middle; }
.games-panel { position: absolute; z-index: 75; right: -12px; bottom: calc(100% + 12px); width: 340px; max-height: min(58vh, 520px); overflow-y: auto; padding: 16px; color: #f5f9f2; border: 1px solid #404a3c; border-radius: 18px; background: #101510; box-shadow: 0 18px 48px #000b; }
.games-panel[hidden] { display: none; }
.games-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.games-header h2 { margin: 4px 0 0; font-size: 20px; line-height: 1.2; }
.games-eyebrow { font-size: 10px; color: #98e777; font-weight: 800; letter-spacing: .08em; }
.games-close { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #3c4b36; border-radius: 50%; background: #1a2418; color: white; font-size: 24px; cursor: pointer; }
.games-copy, .games-status, .games-empty, .games-players { margin: 0 0 12px; font-size: 13px; line-height: 1.45; color: #b8c8b2; overflow-wrap: anywhere; }
.games-status { color: #f5fff0; font-weight: 700; }
.games-players { font-size: 12px; }
.games-hint { margin: -6px 0 10px; font-size: 11px; line-height: 1.35; color: #aabca3; }
.games-field { display: grid; gap: 6px; margin-bottom: 12px; color: #dbead5; font-size: 13px; font-weight: 700; }
.games-field select { width: 100%; min-height: 44px; border: 1px solid #40503b; border-radius: 10px; padding: 0 10px; background: #1a2418; color: #fff; }
.games-actions { display: flex; gap: 8px; }
.games-primary, .games-secondary { min-height: 44px; padding: 0 14px; border: 1px solid #45583d; border-radius: 10px; font-weight: 700; cursor: pointer; }
.games-primary { background: #99ef58; color: #10190d; border-color: #99ef58; }
.games-secondary { background: #1a2418; color: #ecf8e7; }
.games-end { margin-top: 14px; width: 100%; }
.games-board { display: grid; gap: 5px; }
.games-ttt { grid-template-columns: repeat(3,minmax(0,1fr)); }
.games-cell { display: grid; place-items: center; aspect-ratio: 1; min-height: 56px; border: 1px solid #41533c; border-radius: 10px; background: #1c2919; color: #c7ffa7; font-size: clamp(24px,7vw,34px); font-weight: 800; cursor: pointer; }
.games-cell.is-o { color: #ffb15c; }
.games-cell:disabled { opacity: 1; }
.games-cell:disabled, .games-column:disabled { cursor: default; }
.games-cell:not(:disabled):hover, .games-column:not(:disabled):hover { border-color: #a6f77a; background: #314a29; }
.games-columns { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; margin-bottom: 6px; }
.games-column { min-width: 0; min-height: 44px; border: 1px solid #42543b; border-radius: 8px; background: #202e1c; color: #c6ffa7; font-size: 20px; cursor: pointer; }
.games-column:disabled { opacity: .4; }
.games-connect4 { padding: 7px; border-radius: 12px; background: #2c4226; }
.games-board-row { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.games-disc { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border-radius: 50%; background: #0e170d; border: 1px solid #42583a; color: #172010; font-size: 11px; font-weight: 800; }
.games-disc.is-x { background: #a5f46c; }
.games-disc.is-o { background: #ffad56; }
.games-slide-scores, .games-slide-next { margin: 0 0 8px; color: #dcebd5; font-size: 12px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.games-slide-next { color: #b8f595; }
.games-slide-last { margin: 0 0 8px; color: #fff0a7; font-size: 12px; font-weight: 700; }
.games-slide-help { margin: 0 0 8px; color: #bdcdb7; font-size: 12px; line-height: 1.4; }
.games-slide-help summary { min-height: 28px; cursor: pointer; color: #dcebd5; }
.games-slide-help p { margin: 0 0 8px; }
.games-slide { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; align-items: stretch; }
.games-slide-arrow { min-width: 0; min-height: 44px; padding: 0; border: 1px solid #42543b; border-radius: 8px; background: #202e1c; color: #c6ffa7; font-size: 19px; cursor: pointer; }
.games-slide-arrow:disabled { opacity: .4; cursor: default; }
.games-slide-arrow:not(:disabled):hover { border-color: #a6f77a; background: #314a29; }
.games-slide-tile { min-width: 0; min-height: 44px; display: grid; place-items: center; border: 1px solid #3a5133; border-radius: 8px; background: #20301c; font-size: clamp(16px, 5vw, 22px); }
.games-slide-tile.is-empty { background: #121c10; border-color: #263725; }
.games-slide-hint { margin-top: 12px; }
.games-tactical { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; padding: 7px; border-radius: 12px; background: #263c21; }
.games-tactical-cell { display: grid; place-items: center; min-width: 0; min-height: 40px; aspect-ratio: 1; padding: 0; border: 1px solid #405839; border-radius: 7px; background: #172513; color: #eef9e7; font-size: clamp(14px,4vw,21px); font-weight: 800; cursor: pointer; }
.games-tactical-cell.is-player0 { background: #3d692c; border-color: #89d45b; }
.games-tactical-cell.is-player1 { background: #704522; border-color: #e5a253; }
.games-tactical-cell.is-cover { background: #26371e; }
.games-tactical-cell.is-selected { outline: 3px solid white; outline-offset: -3px; }
.games-tactical-cell:disabled { opacity: 1; cursor: default; }
.games-tactical-cell:not(:disabled):hover { filter: brightness(1.25); }
.games-tactical + .games-hint { margin: 10px 0 0; }
.games-team-picker { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px; border: 1px solid #40503b; border-radius: 10px; }
.games-team-picker legend { color: #bdcdb7; font-size: 12px; }
.games-team-choice { display: flex; align-items: center; gap: 8px; min-height: 32px; color: #eff9e9; font-size: 13px; }
.games-team-choice input { width: 18px; height: 18px; accent-color: #99ef58; }
.games-picker-description { margin: -4px 0 12px; color: #a6bc9c; font-size: 12px; }
.games-party-prompt { margin: 7px 0 12px; color: #f5fff0; font-size: 20px; line-height: 1.2; }
.games-party-choices { display: grid; gap: 8px; }
.games-party-choice { min-height: 49px; padding: 10px 12px; border: 1px solid #59754e; border-radius: 12px; background: #21351b; color: #f5fff0; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.games-party-choice.is-chosen { border-color: #a9f777; background: #36582a; }
.games-party-choice:disabled { opacity: .8; cursor: default; }
.games-party-scores { margin-top: 14px; border-top: 1px solid #34442f; }
.games-party-score { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 0; border-bottom: 1px solid #293925; color: #c8d7c2; font-size: 12px; overflow-wrap: anywhere; }
.games-party-score strong { color: #b9f893; }
.games-party-hint { margin: 12px 0 0; }
.games-flick-table { position: relative; container-type: inline-size; width: 100%; aspect-ratio: 5 / 3; overflow: hidden; margin: 12px 0; border: 7px solid #72513a; border-radius: 16px; background: #34713c; box-shadow: inset 0 0 0 3px #204a2a; }
.games-flick-pocket { position: absolute; width: 12%; aspect-ratio: 1; border-radius: 50%; background: #101b12; box-shadow: 0 0 0 3px #24321f; }
.games-flick-pocket.is-tl { left: -3%; top: -5%; }.games-flick-pocket.is-tr { right: -3%; top: -5%; }
.games-flick-pocket.is-bl { left: -3%; bottom: -5%; }.games-flick-pocket.is-br { right: -3%; bottom: -5%; }
.games-flick-piece { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%,-50%); padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.games-flick-piece[hidden] { display: none; }
/* A 36-unit simulated diameter on a 600-unit table is exactly 6%. The larger
   transparent button around it keeps the touch target at least 44px. */
.games-flick-face { display: grid; place-items: center; width: 6cqw; height: 6cqw; border: 1px solid #b8f594; border-radius: 50%; box-sizing: border-box; background: #6cae42; font-size: clamp(8px,3cqw,14px); line-height: 1; }
.games-flick-piece.is-player1 .games-flick-face { border-color: #ffd18b; background: #d58c3c; }
.games-flick-piece.is-selected .games-flick-face { outline: 2px solid white; outline-offset: 2px; }
.games-flick-piece:disabled { opacity: 1; cursor: default; pointer-events: none; }
.games-flick-aim { position: absolute; z-index: 2; width: 28%; height: 3px; background: repeating-linear-gradient(90deg,#f4ffdb 0 7px,transparent 7px 11px); transform-origin: 0 50%; pointer-events: none; filter: drop-shadow(0 1px 2px #102d16); }
.games-flick-aim::after { content: ''; position: absolute; right: -2px; top: -5px; border-left: 10px solid #f4ffdb; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.games-flick-powers { justify-content: center; margin: 10px 0; }
.games-flick-powers button.is-selected { background: #9bef60; color: #14210f; }
.games-flick-aim-control { display: grid; gap: 4px; color: #dcebd5; font-size: 12px; font-weight: 700; }
.games-flick-aim-control input { width: 100%; min-height: 44px; margin: 0; accent-color: #9bef60; cursor: pointer; }
.games-flick-aim-control input:disabled { opacity: .4; cursor: default; }
.games-flick-shoot { width: 100%; margin-top: 3px; }
.games-flick-shoot:disabled { opacity: .4; cursor: default; }
.games-flick-hint { margin: 9px 0 0; color: #aabca3; font-size: 11px; line-height: 1.4; }
.games-play-only { margin: 0 0 10px; color: #9fea75; font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.games-hand-label { margin: 12px 0 5px; color: #dcebd5; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.games-card-row { display: flex; flex-wrap: wrap; gap: 5px; min-height: 52px; }
.games-card { min-width: 33px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: #f8fbf6; color: #141c13; font-size: 15px; font-weight: 800; box-shadow: 0 2px 6px #0005; }
.games-card.is-red { color: #ba3635; }
.games-card.is-hidden { background: repeating-linear-gradient(45deg,#36512f,#36512f 4px,#263c22 4px,#263c22 8px); color: #a5ef87; border: 1px solid #719d63; }
.games-card-actions { flex-wrap: wrap; margin-top: 12px; }
.games-card-actions button { flex: 1 1 70px; }
.games-raise { margin-top: 12px; }
.games-raise input { width: 100%; min-height: 44px; border: 1px solid #40503b; border-radius: 10px; padding: 0 10px; background: #1a2418; color: #fff; }
.games-results { margin-top: 12px; }
.games-card-hint { margin-top: 12px; }
.games-panel :focus-visible, .games-trigger:focus-visible { outline: 2px solid white; outline-offset: 2px; }
@media (max-width: 720px) {
  .games-trigger { min-height: 44px; padding: 0 10px; font-size: 12px; }
  .games-panel { position: fixed; left: 12px; right: 12px; bottom: calc(90px + env(safe-area-inset-bottom)); width: auto; max-width: 340px; margin: 0 auto; max-height: min(72vh, 600px); padding: 14px; }
}
@media (max-width: 360px) {
  .control-buttons { max-width: 100%; flex-wrap: wrap; justify-content: center; gap: 5px; }
  #call-view { padding-bottom: 170px; }
  #call-view.is-match .hud-right { bottom: calc(200px + env(safe-area-inset-bottom)); }
  #call-view.is-match .room-chat { bottom: calc(145px + env(safe-area-inset-bottom)); }
  #call-view.is-match .watch-panel { bottom: calc(345px + env(safe-area-inset-bottom)); }
  #call-view.is-match .watch-panel:not(.is-open):not(.is-watching) { left: 14px; right: auto; }
}
#call-view.is-searching .games-controls { display: none; }
