/* Mahjong. Tavolo e comandi circoscritti alla nuova pagina. */
.sr-mahjong { background: #191c1a; color: #f8f3e7; }
.mj-container { width: min(1100px, calc(100% - 48px)); margin: 0 auto; }
.mj-header { padding-top: 24px; padding-bottom: 24px; }
.mj-header .games-breadcrumb { margin-bottom: 22px; }
.mj-eyebrow { color: #c8dabe; font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.mj-header h1 { margin: 6px 0 10px; font: 500 clamp(32px, 5vw, 48px)/1.1 Georgia, serif; letter-spacing: -.025em; }
.mj-header .mj-lead { max-width: 650px; color: #c4cdc6; font-size: 15px; line-height: 1.7; }
.mj-play { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; }
.mj-surface { min-width: 0; overflow: hidden; border: 1px solid #52745d; border-radius: 20px; background: radial-gradient(ellipse at 50% 25%, #285f44, #143c2b 90%); box-shadow: 0 16px 50px #0002; }
.mj-table-head { padding: 20px 24px 16px; border-bottom: 1px solid #d9e8d023; }
.mj-table-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 17px; }
.mj-table-label h2 { font: 500 23px/1.25 Georgia, serif; }
.mj-badge { border: 1px solid #a6bda45c; border-radius: 99px; padding: 5px 10px; color: #dfebd6; font-size: 11px; white-space: nowrap; }
.mj-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.mj-stat dt { margin-bottom: 2px; color: #c9d9c9; font-size: 11px; }
.mj-stat dd { font-size: 21px; line-height: 1.3; font-variant-numeric: tabular-nums; font-weight: 650; }
.mj-stat dd small { color: #b6ceb7; font-size: 13px; font-weight: 400; }
.mj-progress { display: block; width: 100%; height: 3px; margin-top: 16px; border: 0; border-radius: 4px; background: #ffffff19; accent-color: #e6cf95; }
.mj-progress::-webkit-progress-bar { background: #ffffff19; border-radius: 4px; }
.mj-progress::-webkit-progress-value { background: #e6cf95; border-radius: 4px; }
.mj-progress::-moz-progress-bar { background: #e6cf95; }
.mj-table { position: relative; padding: 25px 14px 10px; }
.mj-board { position: relative; margin: 0 auto; isolation: isolate; }
.sr-mahjong .mj-tile {
  position: absolute; display: block; padding: 0; margin: 0;
  width: calc(var(--cw) - 3px); height: calc(var(--ch) - 3px);
  border: 1px solid #d2c7ac; border-radius: 6px;
  background: linear-gradient(135deg, #fffdf4, #eae1c9);
  color: #254634; box-shadow: 1px 3px 0 #aeaa83, 2px 5px 0 #51734c, 2px 7px 5px #00180e66;
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: opacity .16s, box-shadow .16s, filter .16s; -webkit-tap-highlight-color: transparent;
}
.sr-mahjong .mj-tile[aria-disabled="true"] { cursor: not-allowed; filter: brightness(.78) saturate(.75); }
.sr-mahjong .mj-tile[aria-disabled="false"]:hover { filter: brightness(1.06); }
.sr-mahjong .mj-tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; z-index: 900 !important; }
.sr-mahjong .mj-tile.is-selected { background: #ffedbb; outline: 3px solid #f1cc6d; outline-offset: 1px; box-shadow: 0 0 0 5px #132d20; z-index: 900 !important; }
.sr-mahjong .mj-tile.is-hint { outline: 3px solid #ffde88; outline-offset: 1px; animation: mj-hint 1.2s ease-in-out infinite; z-index: 890 !important; }
.sr-mahjong .mj-tile.is-blocker { outline: 3px solid #ff9d7a; outline-offset: 0; filter: none; z-index: 880 !important; }
.sr-mahjong .mj-tile.is-removed { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
.mj-board.is-stuck { filter: saturate(.55); transition: filter .4s; }
.mj-fx { position: absolute; inset: 0; z-index: 600; overflow: hidden; pointer-events: none; }
.sr-mahjong .mj-fly { box-sizing: border-box; cursor: default; transition: none; }
.mj-spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px #ffe3a4cc; }
.mj-confetti { position: absolute; width: 8px; height: 13px; border-radius: 2px; }
.mj-chain { position: absolute; color: #ffe3a4; font: 500 30px/1 Georgia, serif; text-shadow: 0 2px 8px #0b1f15; white-space: nowrap; }
.mj-table-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; max-width: 100%; }
.mj-table-tools .mj-badge { min-width: 0; white-space: normal; }
.sr-mahjong .mj-toggle { display: inline-flex; flex: 0 0 44px; justify-content: center; align-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #a6bda45c; border-radius: 10px; background: transparent; color: #ead29a; cursor: pointer; }
.sr-mahjong .mj-toggle:hover { background: #ffffff14; }
.sr-mahjong .mj-toggle:focus-visible { outline: 3px solid #fff0b9; outline-offset: 2px; }
.sr-mahjong .mj-toggle[aria-pressed="false"] { color: #b6ceb7; opacity: .6; background: linear-gradient(to top right, transparent 47%, currentColor 47%, currentColor 53%, transparent 53%); }
.mj-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mj-finish-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mj-face { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mj-face text { font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Serif CJK SC', serif; }
.mj-tile .mj-corner { font: 750 15px Inter, sans-serif; }
.mj-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }
.sr-mahjong .mj-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
  border: 1px solid #94ad8e; border-radius: 10px; padding: 10px 14px;
  background: #214d36; color: #fff8e7; font: 650 13px/1.45 Inter, system-ui, sans-serif; cursor: pointer;
}
.sr-mahjong .mj-button:hover { background: #306143; }
.sr-mahjong .mj-button:disabled { opacity: .45; cursor: default; }
.sr-mahjong .mj-button--gold { background: #ead29a; border-color: #ead29a; color: #183e2b; }
.sr-mahjong .mj-button--gold:hover { background: #ffe3a4; }
.sr-mahjong .mj-button:focus-visible, .sr-mahjong select:focus-visible { outline: 3px solid #fff0b9; outline-offset: 3px; }
.mj-button svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mj-message { min-height: 55px; margin: 0; padding: 0 22px 18px; color: #e4ebdc; text-align: center; font-size: 12px; line-height: 1.6; }
.mj-side { display: grid; gap: 16px; }
.mj-panel { padding: 20px; border: 1px solid #4b5b4d; border-radius: 15px; background: #242b26; }
.mj-panel h2 { font-size: 15px; margin-bottom: 14px; }
.mj-panel label { display: block; color: #d2dbd2; margin-bottom: 7px; font-size: 12px; }
.mj-panel select { display: block; width: 100%; min-height: 44px; border: 1px solid #71806e; background: #19271f; color: #fff8e7; font: 14px Inter, sans-serif; }
.mj-panel > .mj-button { width: 100%; margin-top: 12px; }
.mj-panel p { color: #c0ccc1; font-size: 12px; line-height: 1.8; margin-top: 12px; }
.mj-how { padding-left: 18px; color: #d0d9ce; font-size: 13px; line-height: 1.7; }
.mj-how li + li { margin-top: 9px; }
.mj-record { font-variant-numeric: tabular-nums; }
.mj-finish { position: absolute; z-index: 500; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1px solid #a2ba8c; border-radius: 15px; background: #173e2bf5; text-align: center; }
.mj-finish svg { width: 58px; height: 58px; margin-bottom: 12px; color: #eed596; }
.mj-finish h2 { margin: 0 0 12px; font: 500 32px/1.2 Georgia, serif; }
.mj-finish p { color: #d9e3cf; font-size: 14px; line-height: 1.8; max-width: 360px; margin-bottom: 18px; }
.sr-mahjong [hidden] { display: none !important; }
.mj-details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-block: 36px; }
.mj-details section { min-width: 0; }
.mj-details h2 { font-size: 17px; margin-bottom: 12px; }
.mj-details p { color: #bbc9bc; font-size: 14px; line-height: 1.8; margin-top: 10px; }
.mj-details a { color: #ecd49d; text-decoration: underline; text-underline-offset: 3px; }
.sr-mahjong .mj-dialog { position: fixed; inset: 0; width: min(420px, calc(100% - 32px)); margin: auto; padding: 26px; border: 1px solid #8ca183; border-radius: 16px; background: #202e24; color: #fff7e4; }
.mj-dialog::backdrop { background: #0009; }
.mj-dialog h2 { font-size: 20px; margin-bottom: 12px; }
.mj-dialog p { color: #d0d9ca; line-height: 1.7; font-size: 14px; }
.mj-dialog-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
@keyframes mj-hint { 50% { box-shadow: 0 0 0 5px #f6d77955, 2px 5px 0 #51734c; } }
@media (max-width: 900px) {
  .mj-play { grid-template-columns: 1fr; }
  .mj-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .mj-container { width: calc(100% - 24px); }
  .mj-header { padding-top: 16px; padding-bottom: 20px; }
  .mj-header .games-breadcrumb { margin-bottom: 16px; }
  .mj-header h1 { font-size: 34px; }
  .mj-header .mj-lead { font-size: 14px; }
  .mj-table-head { padding: 17px 16px 14px; }
  .mj-table-label { margin-bottom: 14px; }
  .mj-table-label h2 { font-size: 22px; }
  .mj-stats { gap: 8px; }
  .mj-stat dd { font-size: 20px; }
  .mj-stat dt { font-size: 10px; }
  .mj-table { padding: 20px 6px 4px; }
  .sr-mahjong .mj-tile { border-radius: 4px; }
  .mj-actions { padding: 15px 10px; gap: 7px; }
  .sr-mahjong .mj-actions .mj-button { padding: 10px 12px; font-size: 12px; }
  .mj-message { padding-inline: 12px; font-size: 12px; }
  .mj-side { gap: 12px; }
  .mj-panel { padding: 16px; }
  .mj-panel h2 { font-size: 14px; }
  .mj-how { font-size: 12px; }
  .mj-details { grid-template-columns: 1fr; gap: 28px; padding: 30px 4px; }
}
@media (max-width: 380px) {
  .mj-side { grid-template-columns: 1fr; }
  .mj-badge { font-size: 10px; padding-inline: 8px; }
}
@media (max-width: 600px) {
  .mj-finish { inset: 4px; padding: 12px; }
  .mj-finish svg { width: 36px; height: 36px; margin-bottom: 6px; }
  .mj-finish h2 { font-size: 24px; margin-bottom: 6px; }
  .mj-finish p { font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sr-mahjong .mj-tile, .sr-mahjong .mj-tile.is-hint { transition: none; animation: none; } }
@media print { .mj-play, .mj-dialog, .mj-fx { display: none; } .sr-mahjong { background: #fff; color: #000; } .mj-details p { color: #000; } }
