/* Mini Sudoku — Game Anything · tokens: --msu-* */

#msuPlayShell.game-worlds-play-shell {
  min-height: 0;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    linear-gradient(165deg, #05070c 0%, #0c1118 42%, #080b10 100%);
}

#msuPlayShell.game-worlds-play-shell:not([data-msu-sized]) {
  height: 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.msu-outer-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

:root {
  --msu-panel: rgba(15, 23, 42, 0.78);
  --msu-border: rgba(56, 189, 248, 0.22);
  --msu-text: #f1f5f9;
  --msu-muted: #94a3b8;
  --msu-accent: #818cf8;
  --msu-player: #38bdf8;
  --msu-clue: #e2e8f0;
  --msu-danger: #fb7185;
  --msu-radius: 18px;
  --msu-font: "Outfit", "DM Sans", system-ui, sans-serif;
  --msu-cell-gap: 2px;
  --msu-cols: 6;
  --msu-rows: 6;
  --msu-cell-w: 48px;
  --msu-cell-h: 48px;
}

.ga-casual-scope.msu-app {
  --msu-panel: var(--ga-surface);
  --msu-border: var(--ga-border);
  --msu-text: var(--ga-text);
  --msu-muted: var(--ga-muted);
  --ga-accent-game: #818cf8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.msu-standalone {
  margin: 0;
  min-height: 100%;
  font-family: var(--msu-font);
  color: var(--msu-text);
  background: #000;
  -webkit-tap-highlight-color: transparent;
}

.msu-app {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(14px, env(safe-area-inset-top)) clamp(18px, 5vw, 30px)
    max(30px, env(safe-area-inset-bottom));
  font-family: var(--msu-font);
  color: var(--msu-text);
}

#msuPlayShell .msu-app.msu-gw {
  align-items: stretch;
  padding: clamp(0.45rem, 1.8vw, 0.75rem) clamp(0.55rem, 2vw, 0.9rem);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.msu-screen {
  width: min(960px, 100%);
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  justify-content: center;
  align-items: center;
}

.msu-screen.msu-screen-active {
  display: flex;
  flex-direction: column;
}

.msu-screen-play.msu-screen-active {
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
}

#msuPlayShell .msu-screen-play.msu-screen-active {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
}

#msuPlayShell .msu-screen-play.msu-screen-active .msu-play {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

/* Infinite Maze–style: frosted menu over a live board preview */
#msu-app.msu-mode-overlay {
  position: relative;
}

#msu-app.msu-mode-overlay #msu-screen-play.msu-screen-active {
  display: flex;
}

#msu-app.msu-mode-overlay #msu-screen-play .msu-play-head,
#msu-app.msu-mode-overlay #msu-screen-play .msu-status {
  visibility: hidden;
  pointer-events: none;
}

#msu-app.msu-mode-overlay #msu-screen-play .msu-board-wrap {
  pointer-events: none;
}

#msu-app.msu-mode-overlay #msu-screen-play .msu-pad,
#msu-app.msu-mode-overlay #msu-screen-play .msu-controls {
  visibility: hidden;
  pointer-events: none;
}

.msu-screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  margin: 0;
  padding: clamp(12px, 3vw, 24px);
  box-sizing: border-box;
  background: rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(11px) saturate(1.06);
  -webkit-backdrop-filter: blur(11px) saturate(1.06);
}

.msu-screen-overlay.msu-screen-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#msu-screen-menu.msu-screen,
#msu-screen-difficulty.msu-screen,
#msu-screen-how.msu-screen {
  width: 100%;
  max-width: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#msu-screen-menu .msu-panel,
#msu-screen-difficulty .msu-panel,
#msu-screen-how .msu-panel {
  width: min(var(--ga-puzzle-menu-max), 100%);
  max-width: min(var(--ga-puzzle-menu-max), 100%);
  margin-inline: auto;
}

.msu-screen.msu-screen-active .msu-panel {
  animation: msu-panel-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes msu-panel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .msu-screen.msu-screen-active .msu-panel {
    animation: none;
  }
}

.msu-panel {
  width: min(520px, 100%);
  padding: clamp(22px, 4.5vw, 34px) clamp(20px, 4vw, 30px);
  border-radius: var(--msu-radius);
  background: var(--msu-panel);
  border: 1px solid var(--msu-border);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.msu-panel h1,
.msu-panel h2 {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.msu-panel h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  background: linear-gradient(102deg, #f8fafc 0%, #a5b4fc 45%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.msu-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #a5b4fc;
}

.msu-lead {
  margin: 0 0 20px;
  line-height: 1.55;
  color: var(--msu-muted);
  font-size: 0.98rem;
}

.msu-muted {
  color: var(--msu-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.msu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.msu-btn {
  border: 1px solid var(--msu-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--msu-text);
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.msu-btn:hover {
  background: rgba(255, 255, 255, 0.09);
}

.msu-btn:active {
  transform: scale(0.98);
}

.msu-btn-primary {
  border-color: rgba(99, 102, 241, 0.45);
  background: linear-gradient(135deg, #4338ca, #6366f1 48%, #38bdf8);
  color: #fff;
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.35);
}

.msu-btn-ghost {
  background: transparent;
  margin-top: 8px;
}

.msu-diff-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0 8px;
}

.msu-diff-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--msu-border);
  background: rgba(15, 23, 42, 0.65);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.msu-diff-card:hover {
  border-color: rgba(129, 140, 248, 0.5);
}

.msu-diff-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.msu-diff-meta {
  color: var(--msu-muted);
  font-size: 0.88rem;
}

.msu-list {
  margin: 0 0 18px;
  padding-left: 1.15rem;
  color: var(--msu-muted);
  line-height: 1.55;
}

.msu-list li {
  margin-bottom: 8px;
}

.msu-list strong {
  color: var(--msu-text);
}

.msu-play {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  width: 100%;
}

.msu-play-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

.msu-hud-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.msu-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--msu-muted);
}

.msu-pill-accent {
  border-color: rgba(129, 140, 248, 0.4);
  color: #c7d2fe;
}


.msu-diff-wrap {
  display: inline-flex;
  align-items: center;
}

.msu-diff-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 30px;
  padding: 4px 28px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background:
    rgba(15, 23, 42, 0.78)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%94a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--msu-muted, #94a3b8);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.msu-diff-select:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--msu-text, #e2e8f0);
}

.msu-diff-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.msu-diff-select:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.msu-diff-select option {
  background: #0f172a;
  color: #e2e8f0;
}

.msu-hud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msu-tool {
  border: 1px solid var(--msu-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--msu-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.msu-tool--active {
  border-color: rgba(129, 140, 248, 0.65);
  background: rgba(99, 102, 241, 0.25);
  color: #e0e7ff;
}

.msu-tool-ghost {
  background: transparent;
}

.msu-icon-btn {
  border: 1px solid var(--msu-border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  min-width: 32px;
  min-height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
}

.msu-board-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.msu-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--msu-cols), var(--msu-cell-w));
  grid-template-rows: repeat(var(--msu-rows), var(--msu-cell-h));
  gap: var(--msu-cell-gap);
  padding: 8px;
  border-radius: 14px;
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  user-select: none;
}

.msu-cell {
  position: relative;
  z-index: 1;
  width: var(--msu-cell-w);
  height: var(--msu-cell-h);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.75);
  color: var(--msu-text);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.msu-cell--box-l {
  border-left-width: 2px;
  border-left-color: rgba(226, 232, 240, 0.35);
}
.msu-cell--box-r {
  border-right-width: 2px;
  border-right-color: rgba(226, 232, 240, 0.35);
}
.msu-cell--box-t {
  border-top-width: 2px;
  border-top-color: rgba(226, 232, 240, 0.35);
}
.msu-cell--box-b {
  border-bottom-width: 2px;
  border-bottom-color: rgba(226, 232, 240, 0.35);
}

.msu-cell--related {
  background: rgba(99, 102, 241, 0.16);
}

.msu-cell--same {
  background: rgba(56, 189, 248, 0.18);
}

.msu-cell--selected {
  background: rgba(99, 102, 241, 0.32);
  box-shadow: inset 0 0 0 2px rgba(165, 180, 252, 0.85);
  z-index: 2;
}

.msu-cell--clue .msu-val {
  color: var(--msu-clue);
  font-weight: 800;
}

.msu-cell--player .msu-val {
  color: var(--msu-player);
  font-weight: 700;
}

.msu-cell--conflict .msu-val {
  color: var(--msu-danger);
}

.msu-cell--conflict {
  box-shadow: inset 0 0 0 2px rgba(251, 113, 133, 0.85);
}

.msu-val {
  font-size: clamp(1rem, 3.4vw, 1.45rem);
  line-height: 1;
  pointer-events: none;
}

.msu-notes {
  position: absolute;
  inset: 3px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0;
  pointer-events: none;
}

.msu-note {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.45rem, 1.5vw, 0.62rem);
  font-weight: 700;
  color: transparent;
}

.msu-note--on {
  color: rgba(148, 163, 184, 0.95);
}

.msu-controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  position: relative;
  z-index: 5;
}

.msu-numpad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.msu-num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #e0e7ff;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}

.msu-num:hover {
  background: rgba(99, 102, 241, 0.3);
}

.msu-num:active {
  transform: scale(0.96);
}

.msu-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.msu-status {
  margin: 0;
  min-height: 1.15em;
  text-align: center;
  font-size: 0.8rem;
  color: var(--msu-muted);
  flex: 0 0 auto;
  position: relative;
  z-index: 5;
}

.msu-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}

#msuPlayShell .msu-overlay.ga-game-overlay,
.msu-app .msu-overlay.ga-game-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  border-radius: inherit;
}

.msu-overlay[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .msu-play-head {
    flex-direction: column;
    align-items: stretch;
  }

  .msu-num {
    width: 40px;
    height: 40px;
  }
}

/* Game Worlds: center menu cards in the full play shell */
.game-worlds-body #msuPlayShell #msu-screen-menu.msu-screen-active,
.game-worlds-body #msuPlayShell #msu-screen-difficulty.msu-screen-active,
.game-worlds-body #msuPlayShell #msu-screen-how.msu-screen-active,
.game-worlds-body .game-worlds-play-shell #msu-screen-menu.msu-screen-active,
.game-worlds-body .game-worlds-play-shell #msu-screen-difficulty.msu-screen-active,
.game-worlds-body .game-worlds-play-shell #msu-screen-how.msu-screen-active {
  width: 100%;
  align-items: center;
  justify-content: center;
}
