.game-toolbar-button {
  position: relative;
}

.game-toolbar-icon {
  font-size: 18px;
  line-height: 1;
}

.game-toolbar-live {
  position: absolute;
  top: -7px;
  right: -8px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #e83e4d;
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .04em;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .25);
}

.game-rullo-stack {
  display: grid;
  gap: 12px;
  margin: 8px 0 14px;
  padding: 0 2px;
}

.game-rullo-stack[hidden] {
  display: none !important;
}

.game-rullo-card {
  --game-accent: #5b7cfa;
  border: 1px solid color-mix(in srgb, var(--game-accent) 45%, var(--border, #d8dee9));
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 10%, transparent), transparent 46%),
    color-mix(in srgb, var(--panel, #fff) 96%, #fff);
  box-shadow: 0 9px 26px rgba(20, 31, 55, .13);
  color: var(--text, #172033);
  padding: 14px;
}

[data-chat-theme="dark"] .game-rullo-card,
html[data-theme="dark"] .game-rullo-card,
body.dark .game-rullo-card {
  background:
    linear-gradient(135deg, rgba(91, 124, 250, .16), transparent 50%),
    rgba(18, 27, 43, .97);
  color: #eef4ff;
  border-color: rgba(122, 153, 255, .35);
}

.game-rullo-card.is-compact {
  padding: 11px;
  box-shadow: none;
}

.game-tournament-card {
  --game-accent: #d69b19;
}

.game-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.game-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.game-card-title > div {
  min-width: 0;
}

.game-card-title strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.game-card-title span:not(.game-card-icon) {
  display: block;
  margin-top: 2px;
  color: var(--text-dim, #68748a);
  font-size: 11px;
}

.game-card-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: color-mix(in srgb, var(--game-accent) 15%, transparent);
  font-size: 22px;
}

.game-card-fee {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: color-mix(in srgb, #f5b800 18%, transparent);
  color: #9a6800;
  font-size: 11px;
  font-weight: 850;
}

[data-chat-theme="dark"] .game-card-fee,
html[data-theme="dark"] .game-card-fee,
body.dark .game-card-fee {
  color: #ffd86b;
}

.game-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 8px;
}

.game-card-meta span {
  border: 1px solid color-mix(in srgb, var(--border, #d8dee9) 75%, transparent);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--text-dim, #68748a);
  background: color-mix(in srgb, var(--panel, #fff) 88%, transparent);
  font-size: 10px;
  font-weight: 750;
}

.game-player-strip,
.game-last-action,
.game-waiting-copy,
.game-turn-label,
.game-round-label,
.game-quiz-progress {
  font-size: 12px;
  line-height: 1.45;
}

.game-player-strip {
  color: var(--text-dim, #68748a);
}

.game-last-action {
  margin-top: 8px;
  border-left: 3px solid var(--game-accent);
  border-radius: 0 7px 7px 0;
  padding: 6px 9px;
  background: color-mix(in srgb, var(--game-accent) 8%, transparent);
}

.game-card-board {
  margin-top: 12px;
}

.game-card-actions,
.game-rps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.game-card-actions button,
.game-rps-actions button,
.game-connect-controls button,
.game-quiz-options button {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--game-accent) 35%, var(--border, #d8dee9));
  border-radius: 9px;
  padding: 7px 12px;
  background: color-mix(in srgb, var(--game-accent) 9%, var(--panel, #fff));
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.game-card-actions button:hover:not(:disabled),
.game-rps-actions button:hover:not(:disabled),
.game-connect-controls button:hover:not(:disabled),
.game-quiz-options button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.game-card-actions button:disabled,
.game-rps-actions button:disabled,
.game-connect-controls button:disabled,
.game-quiz-options button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.game-card-actions .is-primary,
.game-primary-button {
  background: linear-gradient(135deg, #4f6ef7, #7657e9) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.game-card-actions .is-danger {
  border-color: rgba(220, 53, 69, .4);
  background: rgba(220, 53, 69, .1);
  color: #c92d3f;
}

.game-card-actions .is-secondary {
  background: transparent;
}

.game-tris-board {
  width: min(260px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin: 10px auto 0;
}

.game-tris-board button {
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--game-accent) 35%, var(--border, #d8dee9));
  border-radius: 10px;
  background: color-mix(in srgb, var(--game-accent) 7%, var(--panel, #fff));
  color: inherit;
  font-size: clamp(25px, 5vw, 42px);
  font-weight: 900;
  cursor: pointer;
}

.game-connect-controls,
.game-connect-board {
  width: min(350px, 100%);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-inline: auto;
}

.game-connect-controls {
  margin-top: 9px;
  margin-bottom: 5px;
}

.game-connect-controls button {
  min-height: 27px;
  padding: 2px;
}

.game-connect-board {
  border-radius: 12px;
  padding: 8px;
  background: #2f5ed9;
}

.game-connect-cell {
  aspect-ratio: 1;
  display: block;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.2);
}

.game-connect-cell.is-red {
  background: #e7424f;
}

.game-connect-cell.is-yellow {
  background: #ffd243;
}

.game-result-list,
.game-score-list {
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.game-result-list li,
.game-score-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 6px 9px;
  background: color-mix(in srgb, var(--game-accent) 7%, transparent);
  font-size: 12px;
}

.game-rps-locked,
.game-battle-public {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.game-rps-locked span,
.game-battle-public span {
  border-radius: 999px;
  padding: 5px 8px;
  background: color-mix(in srgb, var(--game-accent) 8%, transparent);
  font-size: 11px;
}

.game-quiz-question {
  margin: 8px 0 10px;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.4;
}

.game-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.game-quiz-options button {
  text-align: left;
}

.game-quiz-options button.is-correct {
  border-color: #24a565;
  background: rgba(36, 165, 101, .16);
}

.game-battle-boards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-battle-grid-wrap > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.game-battle-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  border-radius: 10px;
  padding: 5px;
  background: #1f6eaa;
}

.game-battle-grid button {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 3px;
  background: #9ed7f5;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: crosshair;
}

.game-battle-grid button.has-ship {
  background: #687888;
}

.game-battle-grid button.is-hit {
  background: #e43d50;
}

.game-battle-grid button.is-miss {
  background: #eaf6ff;
  color: #1f6eaa;
}

.game-battle-grid button:disabled {
  cursor: default;
}

.game-finished-result {
  border-radius: 10px;
  padding: 10px;
  background: rgba(243, 181, 26, .14);
  color: #956200;
  text-align: center;
  font-size: 13px;
}

.game-room-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 9, 19, .72);
  backdrop-filter: blur(7px);
}

.game-room-modal[hidden] {
  display: none !important;
}

.game-room-modal-open {
  overflow: hidden !important;
}

.game-room-dialog {
  width: min(1000px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  background: var(--panel, #fff);
  color: var(--text, #172033);
  box-shadow: 0 30px 80px rgba(0,0,0,.36);
  padding: 18px;
}

[data-chat-theme="dark"] .game-room-dialog,
html[data-theme="dark"] .game-room-dialog,
body.dark .game-room-dialog {
  background: #111a2a;
  color: #edf3ff;
}

.game-room-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.game-room-dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.game-room-dialog-head p {
  margin: 4px 0 0;
  color: var(--text-dim, #68748a);
  font-size: 12px;
}

.game-room-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 25px;
  cursor: pointer;
}

.game-room-balance {
  margin: 14px 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(243, 181, 26, .13);
  color: #926300;
  font-size: 13px;
}

.game-room-create-panel,
.game-room-modal-section {
  margin-top: 14px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 15px;
  padding: 14px;
}

.game-room-create-panel h3,
.game-room-modal-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.game-room-create-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.game-room-create-grid label {
  display: grid;
  gap: 5px;
  color: var(--text-dim, #68748a);
  font-size: 11px;
  font-weight: 800;
}

.game-room-create-grid select,
.game-room-create-grid input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 9px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 7px 9px;
  font: inherit;
}

.game-primary-button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 850;
  cursor: pointer;
}

.game-room-create-note {
  margin: 9px 0 0;
  color: var(--text-dim, #68748a);
  font-size: 11px;
}

.game-modal-list {
  display: grid;
  gap: 10px;
}

.game-empty-state {
  margin: 0;
  color: var(--text-dim, #68748a);
  font-size: 12px;
}

.game-room-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 2147483000;
  max-width: min(500px, 90vw);
  transform: translate(-50%, 25px);
  border-radius: 11px;
  padding: 10px 14px;
  background: #1d8f58;
  color: #fff;
  box-shadow: 0 13px 30px rgba(0,0,0,.3);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.game-room-toast.is-error {
  background: #c73548;
}

.game-room-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .game-room-create-grid {
    grid-template-columns: 1fr 1fr;
  }

  .game-primary-button {
    grid-column: 1 / -1;
  }

  .game-battle-boards {
    grid-template-columns: 1fr;
  }

  .game-quiz-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .game-room-modal {
    padding: 0;
  }

  .game-room-dialog {
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .game-room-create-grid {
    grid-template-columns: 1fr;
  }
}

/* V3.0 classifica generale */
.game-leaderboard {
  display: grid;
  gap: 7px;
}

.game-leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 10px;
  background: rgba(15, 23, 42, .48);
  font-size: 12px;
}

.game-leaderboard-position {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(250, 204, 21, .16);
  color: #facc15;
  font-weight: 900;
}

.game-leaderboard-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-leaderboard-row > span:not(.game-leaderboard-position) {
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

@media (max-width: 680px) {
  .game-leaderboard-row {
    grid-template-columns: 32px 1fr auto;
  }

  .game-leaderboard-row > span:nth-last-child(2),
  .game-leaderboard-row > span:nth-last-child(3) {
    display: none;
  }
}

/* V3.1 – Giochi di carte */
.game-card-phase,
.game-card-table-zone,
.game-card-private-zone,
.game-private-note,
.game-card-meta-inline,
.game-hand-counts,
.game-showdown-list {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.45;
}

.game-card-phase {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: color-mix(in srgb, var(--game-accent) 11%, transparent);
  font-weight: 850;
  letter-spacing: .03em;
}

.game-card-table-zone,
.game-card-private-zone {
  border: 1px solid color-mix(in srgb, var(--game-accent) 28%, var(--border, #d8dee9));
  border-radius: 12px;
  padding: 9px;
  background: color-mix(in srgb, var(--game-accent) 5%, transparent);
}

.game-card-table-zone > strong,
.game-card-private-zone > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.game-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.game-playing-card {
  width: 42px;
  min-width: 42px;
  height: 58px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  justify-items: start;
  border: 1px solid rgba(24, 35, 56, .22);
  border-radius: 7px;
  padding: 4px;
  background: #fff;
  color: #111827;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: default;
}

button.game-playing-card {
  cursor: pointer;
}

button.game-playing-card:hover:not(:disabled) {
  transform: translateY(-3px);
}

.game-playing-card strong {
  align-self: center;
  justify-self: center;
  font-size: 20px;
  line-height: 1;
}

.game-playing-card.is-red {
  color: #d62f43;
}

.game-playing-card.is-selected {
  outline: 3px solid var(--game-accent);
  transform: translateY(-5px);
}

.game-playing-card:disabled {
  cursor: default;
  opacity: .78;
}

.game-playing-card.is-back {
  place-items: center;
  background:
    repeating-linear-gradient(45deg, #315cba 0 5px, #4d77d5 5px 10px);
  color: #fff;
}

.game-card-placeholder,
.game-private-note {
  color: var(--text-dim, #68748a);
  font-style: italic;
}

.game-poker-players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.game-poker-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--border, #d8dee9) 75%, transparent);
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 10px;
}

.game-poker-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-poker-player em {
  grid-column: 1 / -1;
  color: var(--game-accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.game-poker-player.is-turn {
  border-color: var(--game-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--game-accent) 16%, transparent);
}

.game-poker-actions {
  align-items: end;
}

.game-poker-raise-label {
  display: grid;
  gap: 3px;
  color: var(--text-dim, #68748a);
  font-size: 10px;
  font-weight: 800;
}

.game-poker-raise-input {
  width: 82px;
  min-height: 34px;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 8px;
  background: var(--panel, #fff);
  color: inherit;
  padding: 5px 7px;
}

.game-poker-reveal,
.game-burraco-team,
.game-burraco-meld {
  margin-top: 8px;
  border-radius: 10px;
  padding: 8px;
  background: color-mix(in srgb, var(--game-accent) 6%, transparent);
}

.game-poker-reveal > strong,
.game-burraco-team > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.game-burraco-meld {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
}

.game-burraco-meld > span {
  font-size: 10px;
  font-weight: 800;
}

.game-burraco-meld > button {
  border: 1px solid color-mix(in srgb, var(--game-accent) 35%, var(--border, #d8dee9));
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.game-card-meta-inline,
.game-hand-counts,
.game-showdown-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-card-meta-inline span,
.game-hand-counts span,
.game-showdown-list span {
  border-radius: 999px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--game-accent) 8%, transparent);
  font-size: 10px;
}

.game-trick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.game-trick-row > div {
  display: grid;
  gap: 3px;
  justify-items: center;
  font-size: 9px;
}

@media (max-width: 620px) {
  .game-playing-card {
    width: 36px;
    min-width: 36px;
    height: 50px;
  }

  .game-playing-card strong {
    font-size: 16px;
  }

  .game-burraco-meld {
    grid-template-columns: 1fr;
  }
}


/* ======================================================================
   FIX V3.1.17 — GIOCHI E TORNEI FISSI SOPRA IL RULLO PUBBLICO
   - larghezza ridotta e centrata;
   - pannello e carte semi-trasparenti per mostrare lo sfondo del rullo;
   - area sticky: i messaggi continuano a scorrere sotto;
   - scroll interno quando un tavolo diventa molto alto.
   ====================================================================== */
.game-rullo-stack {
  position: sticky;
  top: 6px;
  z-index: 24;
  width: min(54%, 780px);
  min-width: 420px;
  max-width: calc(100% - 16px);
  max-height: min(48vh, 540px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 4px auto 14px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 19px;
  background: rgba(245, 249, 255, .27);
  -webkit-backdrop-filter: blur(9px) saturate(125%);
  backdrop-filter: blur(9px) saturate(125%);
  box-shadow: 0 12px 32px rgba(18, 35, 58, .20);
  isolation: isolate;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 124, 250, .58) transparent;
}

.game-rullo-stack::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.04));
}

.game-rullo-stack .game-rullo-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 12%, transparent), transparent 48%),
    rgba(252, 254, 255, .78);
  -webkit-backdrop-filter: blur(7px) saturate(115%);
  backdrop-filter: blur(7px) saturate(115%);
  box-shadow: 0 7px 20px rgba(20, 31, 55, .13);
}

[data-chat-theme="dark"] .game-rullo-stack,
html[data-theme="dark"] .game-rullo-stack,
body.dark .game-rullo-stack {
  border-color: rgba(145, 167, 220, .24);
  background: rgba(12, 20, 34, .31);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .34);
}

[data-chat-theme="dark"] .game-rullo-stack .game-rullo-card,
html[data-theme="dark"] .game-rullo-stack .game-rullo-card,
body.dark .game-rullo-stack .game-rullo-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 18%, transparent), transparent 50%),
    rgba(18, 27, 43, .76);
}

@media (max-width: 1100px) {
  .game-rullo-stack {
    width: min(68%, 720px);
    min-width: 380px;
  }
}

@media (max-width: 700px) {
  .game-rullo-stack {
    top: 3px;
    width: calc(100% - 6px);
    min-width: 0;
    max-width: none;
    max-height: min(44vh, 430px);
    margin: 2px auto 10px;
    padding: 5px;
    border-radius: 15px;
  }

  .game-rullo-stack .game-rullo-card {
    padding: 10px;
    border-radius: 13px;
  }

  .game-rullo-stack .game-card-title strong {
    font-size: 13px;
  }
}

/* ======================================================================
   FIX V3.1.18 — FINESTRE POPUP TRASCINABILI E RIDIMENSIONABILI
   FIX V3.1.19 — DIMENSIONI INIZIALI COMPATTE
   - ogni gioco e torneo appare automaticamente a tutti nella room;
   - posizione e dimensione sono personali e salvate nel browser;
   - la chat continua a scorrere liberamente sotto le finestre;
   - trascinamento e ridimensionamento funzionano con mouse e touch.
   ====================================================================== */
.game-rullo-stack {
  position: fixed !important;
  inset: 0 !important;
  z-index: 160 !important;
  display: block !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  pointer-events: none;
  isolation: isolate;
}

.game-rullo-stack::before {
  display: none !important;
}

.game-rullo-stack[hidden] {
  display: none !important;
}

.game-floating-window {
  --game-window-bar-height: 40px;
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* DEFAULT_COMPACT_GAME_WINDOWS_V3_1_19 */
  width: min(30vw, 500px);
  height: min(34vh, 420px);
  min-width: 300px;
  min-height: 200px;
  max-width: calc(100vw - 8px);
  max-height: calc(100dvh - 8px);
  overflow: hidden;
  border: 1px solid rgba(151, 174, 221, .58);
  border-radius: 18px;
  background: rgba(244, 248, 255, .72);
  -webkit-backdrop-filter: blur(12px) saturate(132%);
  backdrop-filter: blur(12px) saturate(132%);
  box-shadow: 0 18px 48px rgba(10, 24, 48, .30), 0 2px 8px rgba(10, 24, 48, .16);
  pointer-events: auto;
  transform: translateZ(0);
  transition: box-shadow .16s ease, border-color .16s ease;
}

.game-floating-window:hover,
.game-floating-window:focus-within {
  border-color: color-mix(in srgb, var(--game-accent, #5b7cfa) 58%, rgba(151, 174, 221, .58));
  box-shadow: 0 22px 56px rgba(10, 24, 48, .36), 0 3px 10px rgba(10, 24, 48, .18);
}

.game-floating-window.is-moving,
.game-floating-window.is-resizing {
  transition: none;
  box-shadow: 0 26px 66px rgba(10, 24, 48, .42);
}

.game-floating-window-bar {
  min-height: var(--game-window-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 7px 5px 11px;
  border-bottom: 1px solid rgba(151, 174, 221, .40);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--game-accent, #5b7cfa) 15%, transparent), transparent 58%),
    rgba(250, 252, 255, .70);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-floating-window.is-moving .game-floating-window-bar {
  cursor: grabbing;
}

.game-floating-window-caption {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.game-floating-window-caption strong,
.game-floating-window-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-floating-window-caption strong {
  color: var(--text, #172033);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}

.game-floating-window-caption span {
  color: var(--text-dim, #68748a);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .015em;
}

.game-floating-window-reset {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(112, 139, 197, .34);
  border-radius: 9px;
  background: rgba(255, 255, 255, .62);
  color: var(--text, #172033);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
}

.game-floating-window-reset:hover {
  background: rgba(255, 255, 255, .90);
}

.game-floating-window-body {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 124, 250, .62) transparent;
}

.game-floating-window-body > .game-rullo-card {
  width: 100%;
  min-height: 100%;
  margin: 0;
  border-radius: 13px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 11%, transparent), transparent 48%),
    rgba(252, 254, 255, .76);
  -webkit-backdrop-filter: blur(7px) saturate(116%);
  backdrop-filter: blur(7px) saturate(116%);
  box-shadow: none;
}

.game-floating-window-resize {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 30px;
  height: 30px;
  z-index: 4;
  border: 0;
  border-radius: 0 0 16px 0;
  background:
    linear-gradient(135deg,
      transparent 0 44%,
      rgba(66, 91, 145, .28) 45% 51%,
      transparent 52% 61%,
      rgba(66, 91, 145, .48) 62% 68%,
      transparent 69% 78%,
      rgba(66, 91, 145, .68) 79% 85%,
      transparent 86%);
  cursor: nwse-resize;
  touch-action: none;
}

.game-floating-window.is-finished {
  opacity: .94;
}

[data-chat-theme="dark"] .game-floating-window,
html[data-theme="dark"] .game-floating-window,
body.dark .game-floating-window {
  border-color: rgba(122, 153, 215, .35);
  background: rgba(13, 22, 37, .73);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .52);
}

[data-chat-theme="dark"] .game-floating-window-bar,
html[data-theme="dark"] .game-floating-window-bar,
body.dark .game-floating-window-bar {
  border-bottom-color: rgba(122, 153, 215, .26);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--game-accent, #5b7cfa) 22%, transparent), transparent 62%),
    rgba(17, 28, 46, .77);
}

[data-chat-theme="dark"] .game-floating-window-caption strong,
html[data-theme="dark"] .game-floating-window-caption strong,
body.dark .game-floating-window-caption strong,
[data-chat-theme="dark"] .game-floating-window-reset,
html[data-theme="dark"] .game-floating-window-reset,
body.dark .game-floating-window-reset {
  color: #eef4ff;
}

[data-chat-theme="dark"] .game-floating-window-reset,
html[data-theme="dark"] .game-floating-window-reset,
body.dark .game-floating-window-reset {
  border-color: rgba(135, 158, 208, .30);
  background: rgba(35, 49, 73, .72);
}

[data-chat-theme="dark"] .game-floating-window-body > .game-rullo-card,
html[data-theme="dark"] .game-floating-window-body > .game-rullo-card,
body.dark .game-floating-window-body > .game-rullo-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--game-accent) 18%, transparent), transparent 52%),
    rgba(18, 27, 43, .78);
}

@media (max-width: 700px) {
  .game-floating-window {
    /* COMPACT_MOBILE_GAME_WINDOWS_V3_1_19 */
    width: min(82vw, 360px);
    height: min(34dvh, 360px);
    min-width: 240px;
    min-height: 180px;
    max-width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 15px;
  }

  .game-floating-window-bar {
    min-height: 39px;
    padding: 5px 6px 5px 9px;
  }

  .game-floating-window-caption strong {
    font-size: 12px;
  }

  .game-floating-window-body {
    padding: 5px;
  }

  .game-floating-window-body > .game-rullo-card {
    padding: 10px;
    border-radius: 11px;
  }

  .game-floating-window-resize {
    width: 38px;
    height: 38px;
  }
}
