/* Duo Puzzle — Game Anything
 * Ember ● / Frost ▲ · tokens: --duo-* */

#duoPlayShell.game-worlds-play-shell {
  min-height: 0;
  box-sizing: border-box;
  background:
    radial-gradient(ellipse 110% 80% at 20% 20%, rgba(251, 146, 60, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 110% 80% at 80% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, #05070c 0%, #0c1118 42%, #080b10 100%);
}

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

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

:root {
  --duo-panel: rgba(15, 23, 42, 0.78);
  --duo-border: rgba(56, 189, 248, 0.22);
  --duo-text: #f1f5f9;
  --duo-muted: #94a3b8;
  --duo-ember: #fb923c;
  --duo-frost: #38bdf8;
  --duo-radius: 18px;
  --duo-font: "Outfit", "DM Sans", system-ui, sans-serif;
  --duo-cell-gap: 4px;
  --duo-cols: 6;
  --duo-rows: 6;
  --duo-cell-w: 48px;
  --duo-cell-h: 48px;
}

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

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

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

.duo-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(--duo-font);
  color: var(--duo-text);
}

#duoPlayShell .duo-app.duo-gw {
  align-items: stretch;
  padding: clamp(0.55rem, 2vw, 0.85rem) clamp(0.65rem, 2.5vw, 1rem);
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

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

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

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

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

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

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

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

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

.duo-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);
}

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

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

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

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

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

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

.duo-panel {
  width: min(520px, 100%);
  padding: clamp(22px, 4.5vw, 34px) clamp(20px, 4vw, 30px);
  border-radius: var(--duo-radius);
  background: var(--duo-panel);
  border: 1px solid var(--duo-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);
}

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

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

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

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

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

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

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

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

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

.duo-btn-primary {
  border-color: rgba(251, 146, 60, 0.45);
  background: linear-gradient(135deg, #c2410c, #fb923c 48%, #38bdf8);
  color: #0f172a;
  box-shadow: 0 10px 32px rgba(251, 146, 60, 0.3);
}

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

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

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

.duo-diff-card:hover {
  border-color: rgba(251, 146, 60, 0.45);
}

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

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

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

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

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

.duo-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--duo-muted);
}

.duo-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.duo-legend-ember {
  color: var(--duo-ember);
  font-size: 1.1rem;
}

.duo-legend-frost {
  color: var(--duo-frost);
  font-size: 1.1rem;
}

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

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

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

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

.duo-pill-accent {
  border-color: rgba(251, 146, 60, 0.35);
  color: #fdba74;
}


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

.duo-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(--duo-muted, #94a3b8);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

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

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

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

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

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

.duo-tool {
  border: 1px solid var(--duo-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--duo-text);
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

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

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

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

.duo-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--duo-cols), var(--duo-cell-w));
  grid-template-rows: repeat(var(--duo-rows), var(--duo-cell-h));
  gap: var(--duo-cell-gap);
  padding: 12px;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  user-select: none;
}

.duo-cell {
  position: relative;
  z-index: 1;
  width: var(--duo-cell-w);
  height: var(--duo-cell-h);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  color: var(--duo-text);
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.duo-cell:hover:not(.duo-cell--locked) {
  border-color: rgba(148, 163, 184, 0.4);
}

.duo-cell:active:not(.duo-cell--locked) {
  transform: scale(0.96);
}

.duo-cell--locked {
  cursor: default;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.duo-cell--a {
  background: linear-gradient(160deg, rgba(154, 52, 18, 0.55), rgba(67, 20, 7, 0.9));
  border-color: rgba(251, 146, 60, 0.45);
}

.duo-cell--b {
  background: linear-gradient(160deg, rgba(7, 89, 133, 0.55), rgba(12, 40, 70, 0.9));
  border-color: rgba(56, 189, 248, 0.45);
}

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

.duo-cell--a .duo-glyph {
  color: #fdba74;
  text-shadow: 0 0 10px rgba(251, 146, 60, 0.45);
}

.duo-cell--b .duo-glyph {
  color: #7dd3fc;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.duo-cell--conflict {
  box-shadow:
    inset 0 0 0 2px rgba(251, 113, 133, 0.9),
    0 0 14px rgba(251, 113, 133, 0.35);
}

.duo-cell--conflict .duo-glyph {
  color: #fecdd3;
}

.duo-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.duo-edge {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 18px;
  min-height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(2, 6, 23, 0.5);
}

.duo-edge--eq {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.45);
}

.duo-edge--neq {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.45);
}

.duo-edge--bad {
  color: #fecdd3;
  border-color: rgba(251, 113, 133, 0.85);
  background: rgba(76, 20, 30, 0.95);
}

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

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

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

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

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

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