/* Mahjong Solitaire */
.mj-board { position: relative; width: 100%; max-width: 720px; margin: 8px auto 0; --u: 56px; }
.mj-tile {
  --d: calc(var(--u) * .09);
  position: absolute; left: calc(var(--x) * var(--u) + var(--z) * var(--d) * -1 + var(--u) * .3); top: calc(var(--y) * var(--u) * 1.3 + var(--z) * var(--d) * -1 + var(--u) * .4);
  width: var(--u); height: calc(var(--u) * 1.3); padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fbf7ee; color: var(--fc); border: 1px solid #c9bfa8; border-radius: calc(var(--u) * .12);
  box-shadow: var(--d) var(--d) 0 #b8ab8d, calc(var(--d) + 1px) calc(var(--d) + 1px) 0 #8d8166;
  transition: transform .12s ease, opacity .2s ease, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.mj-tile[hidden] { display: none; }
.mj-tile b { font-family: var(--font-display); font-weight: 700; font-size: calc(var(--u) * .38); line-height: 1; color: #2b2d3a; }
.mj-tile i { font-style: normal; font-size: calc(var(--u) * .34); line-height: 1; }
.mj-tile:not(.free) { filter: brightness(.86) saturate(.7); cursor: default; }
.mj-tile.free:hover { transform: translateY(-2px); }
.mj-tile.sel { background: #fff3b0; outline: 3px solid var(--a3); outline-offset: -2px; transform: translateY(-3px); }
.mj-tile.hint { animation: mj-hint .9s ease 2; }
.mj-tile.gone { opacity: 0; transform: scale(.8) translateY(-10px); }
.mj-tile.shake { animation: mj-shake .25s; }
@keyframes mj-hint { 50% { background: color-mix(in srgb, var(--a2) 35%, #fff); transform: translateY(-4px); } }
@keyframes mj-shake { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

[data-theme="modern"] .mj-tile { background: var(--panel); border-color: var(--line); box-shadow: var(--d) var(--d) 0 color-mix(in srgb, var(--fg) 14%, var(--bg)), 0 6px 14px rgba(0,0,0,.08); }
[data-theme="modern"] .mj-tile b { color: var(--fg); }
@media (prefers-color-scheme: dark) { [data-theme="modern"] .mj-tile.sel { background: color-mix(in srgb, var(--a3) 30%, var(--panel)); } }

[data-theme="retro"] .mj-tile { background: #120f26; border: 2px solid var(--fc); border-radius: 0; box-shadow: var(--d) var(--d) 0 #000; }
[data-theme="retro"] .mj-tile b { font-weight: 400; font-size: calc(var(--u) * .26); color: #eaf6ff; }
[data-theme="retro"] .mj-tile i { text-shadow: 0 0 6px currentColor; }
[data-theme="retro"] .mj-tile:not(.free) { filter: brightness(.55); }
[data-theme="retro"] .mj-tile.sel { background: #2e2858; outline-color: var(--a3); }

[data-theme="doodle"] .mj-tile { background: var(--panel); border: 2px solid var(--line); border-radius: 8px 12px 7px 11px / 11px 7px 12px 8px; box-shadow: var(--d) var(--d) 0 var(--line); }
[data-theme="doodle"] .mj-tile:nth-child(odd) { border-radius: 12px 7px 11px 8px / 8px 11px 7px 12px; }
[data-theme="doodle"] .mj-tile b { font-weight: 400; color: var(--fg); }
[data-theme="doodle"] .mj-tile:not(.free) { filter: none; background: repeating-linear-gradient(-45deg, rgba(30,42,74,.1) 0 1.5px, transparent 1.5px 5px), var(--panel); }
[data-theme="doodle"] .mj-tile.sel { background: linear-gradient(100deg, transparent 4%, var(--a3) 8% 92%, transparent 96%), var(--panel); outline: none; }
