/* 2048: the approved board-game atelier, scoped to this game. */
#mg-2048.mg-shell {
  background-color:#6cae9c;
  background-image:url("../game-2048-atelier/background.bb0323d24bb7.webp");
  color:#24483f;
}
#mg-2048 .mg-wrap--2048 {width:min(100%,1120px);max-width:1120px}
#mg-2048 .mg-board-panel--2048 {
  grid-template-columns:minmax(0,1fr) minmax(300px,360px);
  gap:24px;
}
html[data-classroom-playing] #mg-2048 #mg-2048-board,
#mg-2048 #mg-2048-board {width:min(100%,660px,calc(100dvh - var(--classroom-play-height,72px) - 68px))}
#mg-2048 #mg-2048-board {
  background:#f7e6ca;
  border:5px solid #fff4dc;
  box-shadow:0 6px 0 #cbb18c,0 14px 30px #20473c4d;
  border-radius:22px;
}
#mg-2048 .mg-2048-cell {
  background:#d5bda4;
  border:1px solid #d4bda4;
  box-shadow:inset 0 4px 8px #765b4145;
}
#mg-2048 .mg-2048-tile {
  border:0;
  background:#f9e9d3 url("../game-2048-atelier/tile-cream.4675a424ae52.webp") center / 100% 100% no-repeat;
  box-shadow:none;
  color:#573a27;
}
#mg-2048 :is(.mg-2048-tile--v4,.mg-2048-tile--v32) {
  background-color:#9ed6bd;
  background-image:url("../game-2048-atelier/tile-mint.fde61192abdb.webp");
  color:#174a3c;
}
#mg-2048 :is(.mg-2048-tile--v8,.mg-2048-tile--v16,.mg-2048-tile--v128,.mg-2048-tile--v256,.mg-2048-tile--v512) {
  background-color:#f39e83;
  background-image:url("../game-2048-atelier/tile-coral.35e3b5a7695f.webp");
  color:#4f261d;
}
#mg-2048 :is(.mg-2048-tile--v64,.mg-2048-tile--v1024,.mg-2048-tile--v2048,.mg-2048-tile--super) {
  background-color:#fbe7c2;
  background-image:url("../game-2048-atelier/tile-cream.4675a424ae52.webp");
  color:#573a27;
}
#mg-2048 .mg-2048-side {
  background:transparent;
  border:0;
  box-shadow:none;
  padding:12px;
}
#mg-2048 .mg-board-intro {
  padding:8px 12px;
  border-radius:14px;
  background:#fff8e9ee;
}
#mg-2048 .mg-score-boxes span {
  background:#ffe1a1;
  border:2px solid #f4c45e;
  color:#5a3e23;
  box-shadow:0 3px 0 #b68f53;
}
#mg-2048 .mg-score-boxes small {color:#654a2d}
html[data-classroom-playing] #mg-2048 .mg-2048-controls,
#mg-2048 .mg-2048-controls {grid-template-rows:repeat(3,90px);gap:4px}
#mg-2048 .mg-2048-controls button {
  width:min(100%,90px);
  height:90px;
  min-height:90px;
  justify-self:center;
  border:0;
  border-radius:15px;
  padding:6px;
  color:#123e33;
  background:#6ab79c url("../game-2048-atelier/button.73e707d22897.webp") center / 100% 100% no-repeat;
  box-shadow:none;
  transition:filter .14s ease,transform .14s ease;
}
#mg-2048 .mg-2048-controls button span {font-size:34px;font-weight:900;line-height:1}
#mg-2048 .mg-2048-controls button:hover:not(:disabled) {filter:brightness(1.06)}
#mg-2048 .mg-2048-controls button:active:not(:disabled) {transform:translateY(3px) scale(.97);filter:brightness(.94)}
#mg-2048 .mg-2048-controls button:disabled {background-color:#cbd8cc;filter:grayscale(.8);opacity:.7;color:#243b35}
#mg-2048 .mg-2048-controls button:focus-visible {outline:4px solid #124c62;outline-offset:2px}
#mg-2048 #mg-2048-start {
  min-height:56px;
  border:0;
  color:#123e33;
  background:#6ab79c url("../game-2048-atelier/button-wide.a93ebd53fd31.webp") center / 100% 100% no-repeat;
  box-shadow:none;
}
#mg-2048 #mg-2048-start:focus-visible {outline:4px solid #124c62;outline-offset:2px}
#mg-2048 #mg-2048-start:active:not(:disabled) {transform:translateY(2px);filter:brightness(.94)}
#mg-2048 #mg-2048-start:disabled {filter:grayscale(.8);opacity:.7}
#mg-2048 .mg-status-row :is(.mg-status,.mg-thought) {background:#fff8e9ef;color:#355346}
@media (max-width:850px), (orientation:portrait) {
  #mg-2048 .mg-board-panel--2048,html[data-classroom-playing] #mg-2048 .mg-board-panel--2048 {grid-template-columns:minmax(0,1fr)}
  html[data-classroom-playing] #mg-2048 #mg-2048-board,#mg-2048 #mg-2048-board {width:min(100%,520px)}
  html[data-classroom-playing] #mg-2048 .mg-2048-controls,
  #mg-2048 .mg-2048-controls {grid-template-rows:68px;gap:6px}
  #mg-2048 .mg-2048-controls button {width:min(100%,68px);height:68px;min-height:68px}
  #mg-2048 .mg-2048-controls button span {font-size:28px}
}
@media (max-width:480px) {
  #mg-2048 .mg-board-intro {padding:5px 8px}
  #mg-2048 #mg-2048-board {border-width:4px}
  html[data-classroom-playing] #mg-2048 .mg-2048-controls,
  #mg-2048 .mg-2048-controls {grid-template-rows:56px}
  #mg-2048 .mg-2048-controls button {width:min(100%,56px);height:56px;min-height:56px}
}
@media(prefers-reduced-motion:reduce) {
  #mg-2048 .mg-2048-controls button {transition:none}
}

/* Match the selected tabletop composition; controls remain live HTML. */
#mg-2048.mg-shell {background-image:url("../game-2048-atelier/desk.0da50246f5a1.webp");background-size:100% 100%;background-attachment:scroll}
#mg-2048 .mg-wrap--2048 {width:min(100%,1240px);max-width:1240px}
#mg-2048 .mg-board-panel--2048 {grid-template-columns:minmax(0,1fr) minmax(300px,420px);gap:12px}
html[data-classroom-playing] #mg-2048 #mg-2048-board,
#mg-2048 #mg-2048-board {
  border:0;
  border-radius:0;
  padding:clamp(22px,5.5vw,53px);
  gap:clamp(6px,1vw,14px);
  background:transparent url("../game-2048-atelier/board.f2f4296bf68f.webp") center / 100% 100% no-repeat;
  box-shadow:none;
}
#mg-2048 .mg-2048-cell {border:0;background:#c2a99225;box-shadow:none}
#mg-2048 .mg-2048-board:focus:not(:focus-visible) {outline:none}
#mg-2048 .mg-2048-cell .mg-2048-tile {background-color:transparent}
#mg-2048 .mg-2048-side {gap:6px;padding:0}
#mg-2048 .mg-2048-atelier-logo {display:block;width:100%;height:auto;object-fit:contain}
#mg-2048 .mg-board-intro {background:transparent;padding:0 8px;text-align:center}
#mg-2048 .mg-board-intro strong {font-size:16px;color:#21493d}
#mg-2048 .mg-board-intro span {display:none}
#mg-2048 .mg-score-boxes span {
  min-height:78px;padding:7px 10px;border:3px solid #ffefb6;border-radius:20px;
  background:linear-gradient(#ffe59b,#f9c85a);box-shadow:0 5px 0 #c4974f,0 7px 10px #38512a55;
}
#mg-2048 .mg-score-boxes small {font-size:17px;font-weight:800;color:#6a421f}
#mg-2048 .mg-score-boxes b {width:100%;border-radius:12px;background:#fff7e8;color:#613d26;font-size:28px}
html[data-classroom-playing] #mg-2048 .mg-2048-controls,
#mg-2048 .mg-2048-controls {grid-template-rows:repeat(3,1fr);gap:0;max-width:420px;aspect-ratio:1}
#mg-2048 .mg-2048-controls button {
  width:100%;height:100%;min-height:0;aspect-ratio:1;border-radius:25%;padding:4px;
  background-color:transparent;
  background-image:url("../game-2048-atelier/button.73e707d22897.webp"),linear-gradient(#6ab79c,#6ab79c);
  background-position:center;background-size:118% 118%,75% 75%;background-repeat:no-repeat;
}
#mg-2048 .mg-2048-controls [data-direction=down] {
  background-color:transparent;
  background-image:url("../game-2048-atelier/button-coral.a2e53cdc3c3d.webp"),linear-gradient(#ee8f72,#ee8f72);
}
#mg-2048 .mg-2048-controls button span {
  color:#fff4db;font-size:clamp(42px,5vw,76px);line-height:1;
  text-shadow:0 3px 0 #b3a080,0 5px 5px #335c4c70;
}
#mg-2048 .mg-status-row :is(.mg-status,.mg-thought) {background:#fff7e4df}
@media (max-width:850px), (orientation:portrait) {
  #mg-2048.mg-shell {background-size:cover}
  #mg-2048 .mg-board-panel--2048,html[data-classroom-playing] #mg-2048 .mg-board-panel--2048 {grid-template-columns:minmax(0,1fr)}
  #mg-2048 .mg-2048-atelier-logo {display:none}
  #mg-2048 .mg-board-intro {background:#fff8e9ee;padding:5px 8px}
  #mg-2048 .mg-score-boxes span {min-height:52px;border-width:2px;border-radius:14px}
  #mg-2048 .mg-score-boxes b {width:auto;min-width:56px;font-size:22px}
  html[data-classroom-playing] #mg-2048 #mg-2048-board,#mg-2048 #mg-2048-board {width:min(100%,520px)}
  html[data-classroom-playing] #mg-2048 .mg-2048-controls,
  #mg-2048 .mg-2048-controls {grid-template-rows:68px;gap:6px;aspect-ratio:auto}
  #mg-2048 .mg-2048-controls button {width:min(100%,68px);height:68px;min-height:68px}
  #mg-2048 .mg-2048-controls button span {font-size:35px}
}
@media (max-width:480px) {
  #mg-2048 .mg-score-boxes span {min-height:44px;padding:4px 7px}
  #mg-2048 .mg-score-boxes small {font-size:13px;white-space:nowrap}
  #mg-2048 .mg-score-boxes b {min-width:42px;font-size:19px}
  #mg-2048 #mg-2048-board {border:0;border-radius:0}
  html[data-classroom-playing] #mg-2048 .mg-2048-controls,
  #mg-2048 .mg-2048-controls {grid-template-rows:56px}
  #mg-2048 .mg-2048-controls button {width:min(100%,56px);height:56px;min-height:56px}
  #mg-2048 .mg-2048-controls button span {font-size:30px}
}
