/* Visual overhaul — typography, depth, boards, cards, menu, puzzles, wheel, dominoes.
   Complements main.css. All art referenced here is drawn in CSS or js/art.js (original). */

html { background: var(--bg); }
body {
  background:
    radial-gradient(ellipse at 20% -10%, rgba(232, 212, 139, .09), transparent 50%),
    radial-gradient(ellipse at 90% 110%, rgba(14, 59, 46, .55), transparent 55%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(232,212,139,.06) 0, transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(122,30,40,.08) 0, transparent 36%);
  animation: bgdrift 22s ease-in-out infinite alternate;
}
@keyframes bgdrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .playing-card.deal-in, .speech-bubble.pop, .ludo-tok.playable { animation: none !important; }
}

.hero h1 { letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0,0,0,.25); font-weight: 600; }
.hero p { font-size: 1.05rem; }

.game-grid { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .9rem; }
.game-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 40%), var(--bg-elev);
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  padding: .7rem .75rem .85rem;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0,0,0,.32); }
.game-thumb { height: 5.2rem; border-radius: 8px; overflow: hidden; margin-bottom: .55rem; background: #0a2a21; }
.game-thumb svg { width: 100%; height: 100%; display: block; }
.game-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }

/* Cards — thickness, gradient, hover, deal, flip */
.playing-card {
  width: 4.5rem; height: 6.3rem;
  border-radius: .38rem;
  box-shadow:
    0 1px 0 rgba(255,255,255,.5),
    0 2px 0 #c9b896,
    0 3px 0 #a8946a,
    0 8px 16px rgba(0,0,0,.32);
  background: linear-gradient(180deg, #fffef9 0%, #f6eed8 100%);
  transition: transform .22s ease, box-shadow .22s ease;
  transform-origin: center bottom;
}
.playing-card.playable:hover, .playing-card.playable:focus-visible {
  transform: translateY(-8px) rotate(-1deg);
  box-shadow: 0 1px 0 #fff, 0 10px 22px rgba(0,0,0,.38);
  z-index: 3;
}
.playing-card.selected { transform: translateY(-12px); }
.playing-card.deal-in { animation: dealIn .4s ease backwards; }
@keyframes dealIn {
  from { transform: translateY(-36px) rotate(-12deg) scale(.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.playing-card .court-art { position: absolute; inset: 12% 10% 8%; overflow: hidden; }
.playing-card .court-art svg { width: 100%; height: 100%; }
.card-fly {
  position: fixed; z-index: 80; pointer-events: none;
  transition: left .45s cubic-bezier(.2,.7,.2,1), top .45s cubic-bezier(.2,.7,.2,1), transform .45s ease;
}

/* Durak table furniture */
.durak-table { display: flex; flex-direction: column; gap: .8rem; position: relative; }
.durak-mid {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.durak-stock {
  position: relative; width: 7.2rem; height: 5.6rem; flex: 0 0 auto;
}
.durak-stock .trump-peek {
  position: absolute; left: 0; top: 18%;
  transform: rotate(-90deg);
  transform-origin: center center;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.durak-stock .stock-backs { position: absolute; right: .2rem; top: .35rem; }
.durak-stock .stock-backs .playing-card { position: absolute; right: 0; }
.durak-stock .stock-count {
  position: absolute; right: -0.2rem; bottom: -0.2rem;
  background: #1b2a41; color: #e8d48b; border-radius: 999px;
  min-width: 1.8rem; height: 1.8rem; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; border: 1px solid #e8d48b;
  z-index: 4;
}
.durak-discard { position: relative; min-width: 4.5rem; min-height: 5.6rem; }
.durak-discard .playing-card { position: absolute; top: 0; }
.durak-pairs { display: flex; flex: 1; flex-wrap: wrap; justify-content: center; gap: .6rem; min-height: 6rem; }
.atk-pair { position: relative; width: 5.2rem; min-height: 6.2rem; }
.atk-pair .playing-card:nth-child(2) { position: absolute; left: 1.1rem; top: 1.2rem; transform: rotate(12deg); }

/* Felt depth */
.felt-table {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.08), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, var(--felt) 0%, var(--felt-dark) 100%);
  box-shadow: inset 0 0 0 3px rgba(232,212,139,.18), inset 0 0 60px rgba(0,0,0,.28), var(--shadow);
}

/* Chess / checkers — wood frame, bevel, grain */
.chess-board-wrap {
  display: flex; justify-content: center; padding: .6rem;
}
.chess-board, .checkers-board {
  width: min(92vw, 28rem);
  max-width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 14px solid #5a3a1e;
  border-radius: 4px;
  box-shadow:
    0 0 0 3px #c9a22755,
    0 0 0 10px #3a2414,
    inset 0 2px 0 rgba(255,255,255,.15),
    0 16px 30px rgba(0,0,0,.45);
  background: #3a2414;
}
.sq.light { background: linear-gradient(145deg, #f0e2bc, #d9c89a); }
.sq.dark { background: linear-gradient(145deg, #8a5a32, #5a3a1e); }
.sq.last { box-shadow: inset 0 0 0 3px rgba(232, 180, 60, .85); background-image: linear-gradient(145deg, rgba(232,180,60,.28), rgba(232,180,60,.08)); }
.sq.sel { outline: 3px solid #e8d48b; outline-offset: -3px; }
.piece { width: 86%; height: 86%; display: flex; align-items: center; justify-content: center; }
.piece .chess-svg, .piece svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,.4)); }
.fen-line { display: none; } /* hide raw FEN in the polished UI */

/* Dice — slight resting tilt so the cube reads as 3D */
.dice-3d {
  perspective: 320px;
  width: 3.6rem; height: 3.6rem;
  margin: .4rem;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,.35));
}
.d3-cube { transform-style: preserve-3d; }
.d3-face {
  background: linear-gradient(145deg, #fffdf6, #e8e0d0);
  box-shadow: inset 0 0 0 1px #fff, inset 0 0 8px rgba(0,0,0,.08);
}
.dice-3d:not(.rolling) .d3-cube { /* applied via JS too */ }

/* Nardy — triangular inlaid points */
.nardy-board {
  background:
    linear-gradient(90deg, #3a2414 0 8px, transparent 8px),
    linear-gradient(#4a2e1c, #2a1810);
  border: 12px solid #2a1810;
  box-shadow: 0 0 0 3px #c9a22766, 0 16px 32px rgba(0,0,0,.45), inset 0 0 20px rgba(0,0,0,.35);
}
.nardy-pt {
  background: none !important;
  overflow: visible;
}
.nardy-pt::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.nardy-row.top .nardy-pt.darkt::before {
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: linear-gradient(to bottom, #8b1e2d, #4a1018);
}
.nardy-row.top .nardy-pt.lightt::before {
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: linear-gradient(to bottom, #efe0b8, #c9b07a);
}
.nardy-row.bot .nardy-pt.darkt::before {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  background: linear-gradient(to top, #8b1e2d, #4a1018);
}
.nardy-row.bot .nardy-pt.lightt::before {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  background: linear-gradient(to top, #efe0b8, #c9b07a);
}
.nardy-pt, .nardy-bar { min-height: 8.6rem; height: 8.6rem; }
.nardy-stack { z-index: 1; height: 100%; overflow: visible; }
.nardy-man {
  width: 78%;
  max-width: 1.55rem;
  margin: -11px 0 0;
  box-shadow: 0 2px 0 rgba(0,0,0,.4), inset 0 4px 0 rgba(255,255,255,.28), inset 0 -3px 6px rgba(0,0,0,.25);
}
.nardy-row.top .nardy-man:first-child { margin-top: 1px; }
.nardy-row.bot .nardy-man { margin: 0 0 -11px; }
.nardy-row.bot .nardy-man:first-child { margin-bottom: 1px; }

/* Ludo polish */
.ludo-board {
  border: 8px solid #1b2a41;
  box-shadow: 0 0 0 3px #e8d48b44, 0 14px 28px rgba(0,0,0,.4);
  background: #0e1520;
}
.ludo-cell { border: 1px solid rgba(0,0,0,.15); }
.ludo-cell.path { background: #f6f1e4; }
.ludo-cell.ludo-center {
  background: conic-gradient(#c0392b 0 90deg, #2471a3 90deg 180deg, #d4ac0d 180deg 270deg, #1e8449 270deg 360deg);
}
.ludo-tok { box-shadow: 0 2px 2px rgba(0,0,0,.4), inset 0 3px 0 rgba(255,255,255,.4); }

/* Sudoku / crossword elegance */
.sudoku-board {
  margin: 0 auto;
  background: #f7f1e4;
  border: 8px solid #1b2a41;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  width: min(94vw, 28rem);
}
.su-cell { background: #fbf7ee; }
.su-n { font-family: var(--font-display); font-size: 1.35rem; color: #1b2a41; font-weight: 600; }
.su-cell.given .su-n { color: #111; font-weight: 700; }
.su-key {
  min-height: var(--tap);
  background: linear-gradient(180deg, #fffdf6, #e8e0d0);
  color: #1b2a41 !important;
  border: 1px solid #c9b896;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 2px 0 #c9b896;
}
.su-key.wide { font-size: .9rem; }
.su-key.active { border-color: var(--gold-dim); box-shadow: inset 0 0 0 2px var(--gold); }
.sudoku-pad { margin: .8rem auto 0; max-width: 28rem; }
.cw-cell { font-family: var(--font-display); background: #fbf7ee; color: #1b2a41; border: 1px solid #1b2a41; }

/* Bots */
.bot-avatar {
  box-shadow: 0 3px 0 rgba(0,0,0,.25);
  border-radius: 50%;
}
.speech-bubble {
  animation: pop .35s ease;
  border: 1px solid #e8d48b55;
}

/* Puzzle shells */
.puzzle-shell { display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.puzzle-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; align-items: center; }

/* 15-puzzle */
.fifteen-board {
  display: grid; gap: .35rem; width: min(92vw, 22rem); aspect-ratio: 1;
  background: #1b2a41; padding: .45rem; border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.3);
}
.fifteen-tile {
  background: linear-gradient(180deg, #e8d48b, #c9a227);
  color: #1b2a41; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.2rem, 6vw, 2rem);
  border: 0; border-radius: 8px; cursor: pointer;
  box-shadow: inset 0 2px 0 #fff8, 0 3px 0 #8a6a18;
  min-height: var(--tap);
}
.fifteen-tile.empty { background: transparent; box-shadow: none; cursor: default; }

/* Minesweeper */
.mine-board { display: grid; gap: 1px; background: #2a4a3c; border: 6px solid #1b2a41; margin: 0 auto; }
.mine-cell {
  width: 1.85rem; height: 1.85rem; min-width: 1.85rem; min-height: 1.85rem;
  background: linear-gradient(#8aa07a, #6b805c); border: 0; color: #111; font-weight: 700; padding: 0;
  font-size: .85rem;
}
.mine-cell.open { background: #dce6cc; }
.mine-cell.boom { background: #c0392b; }
.mine-cell.flag { color: #8b1e2d; }

/* 2048 */
.g2048-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem;
  width: min(92vw, 22rem); background: #bbada0; padding: .55rem; border-radius: 10px;
}
.g2048-cell {
  aspect-ratio: 1; border-radius: 6px; background: #cdc1b4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: #776e65;
}
.g2048-cell.t2{background:#eee4da} .g2048-cell.t4{background:#ede0c8}
.g2048-cell.t8{background:#f2b179;color:#fff} .g2048-cell.t16{background:#f59563;color:#fff}
.g2048-cell.t32{background:#f67c5f;color:#fff} .g2048-cell.t64{background:#f65e3b;color:#fff}
.g2048-cell.t128{background:#edcf72;color:#fff;font-size:1.3rem}
.g2048-cell.t256{background:#edcc61;color:#fff;font-size:1.3rem}
.g2048-cell.t512{background:#edc850;color:#fff;font-size:1.2rem}
.g2048-cell.t1024,.g2048-cell.t2048{background:#edc22e;color:#fff;font-size:1.05rem}

/* Match-3 */
.match3-board { display: grid; gap: 3px; background: #1b1220; padding: 6px; border-radius: 10px; width: min(92vw, 24rem); }
.match3-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; background: #24182c; }
.match3-cell.sel { outline: 2px solid #e8d48b; }
.match3-cell svg { width: 78%; height: 78%; }

/* Nonogram */
.nono-grid { border-collapse: collapse; margin: 0 auto; }
.nono-grid td, .nono-grid th { border: 1px solid #4a4038; width: 1.5rem; height: 1.5rem; text-align: center; font-size: .65rem; padding: 0; }
.nono-grid th { background: transparent; color: var(--ivory); font-weight: 600; }
.nono-cell { background: #f7f1e4; cursor: pointer; }
.nono-cell.fill { background: #1b2a41; }
.nono-cell.mark { background: #f7f1e4; color: #8b1e2d; }

/* Word search */
.ws-grid { display: grid; margin: 0 auto; gap: 2px; background: #1b2a41; padding: 4px; border-radius: 8px; }
.ws-cell {
  width: 1.7rem; height: 1.7rem; display: flex; align-items: center; justify-content: center;
  background: #f7f1e4; color: #1b2a41; font-weight: 700; cursor: pointer; user-select: none;
  font-size: .85rem;
}
.ws-cell.on { background: #e8d48b; }
.ws-cell.found { background: #5dbe8a; color: #0a2a21; }
.ws-list { display: flex; flex-wrap: wrap; gap: .4rem .8rem; justify-content: center; }
.ws-list .got { text-decoration: line-through; opacity: .55; }

/* Hanoi */
.hanoi-row { display: flex; justify-content: space-around; align-items: flex-end; width: min(96vw, 36rem); min-height: 16rem; }
.hanoi-peg {
  flex: 1; display: flex; flex-direction: column-reverse; align-items: center;
  min-height: 16rem; cursor: pointer; position: relative; padding-bottom: 1rem;
}
.hanoi-peg::before {
  content: ""; position: absolute; bottom: 1.4rem; width: 8px; height: 12rem;
  background: #c9a227; border-radius: 4px; z-index: 0;
}
.hanoi-peg::after {
  content: ""; position: absolute; bottom: .4rem; width: 80%; height: 14px;
  background: #5a3a18; border-radius: 4px;
}
.hanoi-disc {
  position: relative; z-index: 1; height: 1.35rem; border-radius: 8px;
  margin: 2px 0; box-shadow: inset 0 2px 0 #fff6, 0 2px 0 rgba(0,0,0,.3);
}
.hanoi-peg.sel { filter: brightness(1.15); }

/* Lights out */
.lo-board { display: grid; gap: .35rem; width: min(80vw, 18rem); }
.lo-cell {
  aspect-ratio: 1; border: 0; border-radius: 8px; cursor: pointer; min-height: 48px;
  background: #1a2a30; box-shadow: inset 0 0 0 2px #2a4a50;
}
.lo-cell.on { background: #e8d48b; box-shadow: 0 0 12px #e8d48b88; }

/* Lucky Wheel */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.wheel-stage { position: relative; width: min(86vw, 22rem); aspect-ratio: 1; }
.wheel-rotor {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 0 8px #1b2a41, 0 0 0 12px #e8d48b, 0 16px 28px rgba(0,0,0,.4);
  transition: transform 0s;
  will-change: transform;
  position: relative; overflow: hidden;
}
.wheel-pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 22px solid #e8d48b; z-index: 2; filter: drop-shadow(0 2px 2px #0008);
}
.wheel-phrase {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .5rem;
  max-width: 40rem; font-family: var(--font-display); font-size: 1.6rem;
}
.wheel-letter {
  min-width: 1.7rem; min-height: 2.15rem; text-align: center;
  border: 1px solid #e8d48b66; border-bottom: 3px solid #e8d48b;
  background: #0e1a1488; border-radius: 4px;
  padding: 0 .15rem; color: #e8d48b;
  display: inline-flex; align-items: center; justify-content: center;
}
.wheel-letter.space { border: 0; min-width: .8rem; }
.wheel-letters { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; max-width: 36rem; }
.wheel-letters button { min-width: 2.4rem; min-height: var(--tap); }

/* Dominoes */
.domino-table { min-height: 14rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; padding: 1rem; }
.domino-tile {
  width: 3.4rem; height: 6.4rem; border-radius: 6px;
  background: linear-gradient(180deg, #fffdf6, #e8e0d0);
  border: 1px solid #c9a227;
  box-shadow: 0 2px 0 #c9b896, 0 6px 10px rgba(0,0,0,.3), inset 0 1px 0 #fff;
  display: flex; flex-direction: column; cursor: pointer;
  flex: 0 0 auto;
}
.domino-tile.hz { width: 6.4rem; height: 3.4rem; flex-direction: row; }
.domino-tile .half { flex: 1; position: relative; }
.domino-tile .bar { height: 2px; background: #1b2a41; }
.domino-tile.hz .bar { width: 2px; height: auto; }
.domino-pip {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #1b2a41; transform: translate(-50%,-50%);
  box-shadow: inset 0 1px 0 #fff4, 0 1px 0 #0004;
}
.domino-hand { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.domino-tile.playable:hover { transform: translateY(-6px); }

/* Daily XP spin (profile) */
.daily-spin { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); }

/* Mobile 390-ish */
@media (max-width: 430px) {
  #app { padding: .6rem .6rem 5rem; }
  .app-header { flex-wrap: wrap; gap: .4rem; }
  .hero { padding: .6rem .2rem .8rem; }
  .hero h1 { font-size: 1.55rem; }
  .playing-card { width: 3.5rem; height: 4.9rem; }
  .playing-card.small { width: 2.6rem; height: 3.7rem; }
  .chess-board, .checkers-board { border-width: 8px; }
  .nardy-pt { min-height: 6.4rem; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
  .header-actions .btn { padding: 0 .55rem; font-size: .85rem; }
  .mine-cell { width: 1.55rem; height: 1.55rem; min-width: 1.55rem; min-height: 1.55rem; }
  .wheel-phrase { font-size: 1.15rem; }
  .wheel-stage { width: min(76vw, 16.2rem); }
  .wheel-letter { min-width: 1.35rem; min-height: 1.7rem; }
}
.online-side:empty { display: none; }
@media (min-width: 900px) {
  .play-wrap:has(.online-side:not(:empty)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: 1rem;
    align-items: start;
  }
  .play-wrap:has(.online-side:not(:empty)) .play-actions { grid-column: 1 / -1; }
  .play-wrap:has(.online-side:not(:empty)) .felt-table,
  .play-wrap:has(.online-side:not(:empty)) .game-mount { grid-column: 1; }
  .play-wrap:has(.online-side:not(:empty)) .online-side { grid-column: 2; grid-row: 2 / span 3; }
}

@media (max-height: 860px) {
  .sudoku-board { width: min(92vw, 22rem); }
  .su-key { min-height: 2.4rem; }
  .nardy-pt, .nardy-bar { min-height: 8.2rem; height: 8.2rem; }
}

/* Wheel hub + mobile nardy fit */
.wheel-rotor::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18%; height: 18%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7efd4, #c9a227 55%, #6a5428);
  box-shadow: 0 0 0 3px #1b2a41, 0 2px 6px #0008;
  z-index: 2;
}
@media (max-width: 430px) {
  .nardy-board { border-width: 8px; width: 100%; max-width: 100%; }
  .nardy-pt { min-width: 0; min-height: 6.2rem; height: 6.2rem; }
  .nardy-bar { min-width: 12px; width: 12px; flex: 0 0 12px; min-height: 6.2rem; height: 6.2rem; }
  .nardy-man { max-width: 1.25rem; }
  .ludo-board { width: min(92vw, 20rem); }
}
@media (max-height: 860px) {
  .ludo-board { width: min(92vw, 24rem); }
}
.opp-hand { min-height: 4.2rem; }

/* Compact header on game screens (especially mobile) */
body.in-game .header-compact { flex-wrap: nowrap; align-items: center; gap: .3rem; padding: .3rem .55rem; }
body.in-game .header-compact .brand-title { font-size: .85rem; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.in-game .header-compact img { width: 28px; height: 28px; }
@media (max-width: 430px) {
  body.in-game .header-compact .brand-title { display: none; }
  body.in-game .header-compact .header-actions { flex-wrap: nowrap; gap: .2rem; }
  body.in-game .header-compact .header-actions .btn { padding: 0 .4rem; font-size: .72rem; min-height: 2rem; }
}
.piece.moving { z-index: 6; will-change: transform; pointer-events: none; }

/* Mahjong solitaire — original tile faces */
.mj-shell { overflow-x: auto; }
.mj-board { position: relative; margin: .4rem auto 1rem; min-height: 12rem; }
.mj-tile {
  position: absolute;
  width: 42px; height: 56px;
  padding: 0; border: 0;
  border-radius: 5px;
  background: linear-gradient(180deg, #f6f0dc 0%, #e6d8b0 100%);
  box-shadow: 2px 3px 0 #3a2a14, inset 0 0 0 1px #cbb98a;
  color: #1b1208;
  display: flex; align-items: center; justify-content: center;
  opacity: .92;
}
.mj-tile.free { opacity: 1; cursor: pointer; filter: brightness(1.06); }
.mj-tile.free:hover { transform: translateY(-2px); }
.mj-tile.sel, .mj-tile.hint { outline: 3px solid #e8c15a; z-index: 80 !important; }
.mj-tile:disabled { cursor: default; }
.mj-face { width: 100%; height: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; padding: 4px; pointer-events: none; }
.mj-dots { display: grid; grid-template-columns: repeat(3, 1fr); place-items: center; }
.mj-dot { width: 7px; height: 7px; border-radius: 50%; background: #b33; box-shadow: inset 0 0 0 1px #7a1d1d; }
.mj-bams { flex-direction: column; gap: 1px; }
.mj-bam { width: 6px; height: 8px; border-radius: 3px; background: #1f7a3a; }
.mj-char { font-family: "Noto Serif", serif; font-size: 1.15rem; color: #8b1a1a; font-weight: 700; }
.mj-wind { font-weight: 800; font-size: 1rem; color: #16325c; }
.mj-drag { width: 18px; height: 18px; border-radius: 50%; }
.mj-drag-R { background: #c0392b; }
.mj-drag-G { background: #1e8449; }
.mj-drag-Wh { background: #f4f0e4; box-shadow: inset 0 0 0 2px #2a2a2a; }
.mj-flower { color: #a4286a; font-size: .85rem; font-weight: 700; }
.mj-season { color: #1a5f8a; font-size: .85rem; font-weight: 700; }
@media (max-width: 430px) {
  .mj-tile { width: 34px; height: 46px; }
  .mj-char { font-size: .95rem; }
}


/* Keep bot jokes from covering the turn status */
.game-side { align-items: flex-start; }
.speech-bubble {
  position: relative;
  inset: auto;
  top: auto;
  inset-inline-start: auto;
  max-width: 16rem;
  flex: 0 1 auto;
  z-index: 2;
}
.game-status { position: relative; z-index: 3; }
