:root {
  --pgf-vh: 100vh;
  --pgf-vw: 100vw;
  --pgf-window-bg: #101418;
  --pgf-window-bg-accent: rgba(249, 115, 22, 0.18);
  --pgf-app-bg: #101418;
  --pgf-app-bg-accent: rgba(249, 115, 22, 0.18);
  --pgf-app-fg: #f3f7fb;
  --pgf-app-muted: rgba(243, 247, 251, 0.72);
  --pgf-app-font-family: Arial, sans-serif;
  --pgf-board-font-family: Arial, sans-serif;
  --pgf-accent: #f97316;
  --pgf-chrome-button-bg: transparent;
  --pgf-chrome-button-bg-hover: rgba(255, 255, 255, 0.06);
  --pgf-chrome-button-border: transparent;
  --pgf-chrome-icon-filter: none;
  --pgf-panel-bg: rgba(9, 13, 17, 0.72);
  --pgf-panel-border: rgba(255, 255, 255, 0.08);
  --pgf-card-bg: rgba(255, 255, 255, 0.03);
  --pgf-card-border: rgba(255, 255, 255, 0.08);
  --pgf-input-bg: rgba(255, 255, 255, 0.05);
  --pgf-input-border: rgba(255, 255, 255, 0.14);
  --pgf-trace-bg: rgba(249, 115, 22, 0.12);
  --pgf-tile-bg: #1f2937;
  --pgf-tile-fg: #f9fafb;
  --pgf-tile-border: #334155;
  --pgf-tile-active-bg: #f97316;
  --pgf-tile-active-border: #fff4e6;
  --pgf-tile-matched-bg: #39475b;
  --pgf-tile-corner-radius: 0.24;
  --pgf-tile-stroke-width: 2;
  --pgf-tile-font-scale: 0.34;
  --pgf-tile-occupancy: 0.88;
}

html {
  touch-action: manipulation;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: var(--pgf-vh);
  min-height: 100dvh;
  font-family: var(--pgf-app-font-family);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  background: var(--pgf-window-bg);
  color: var(--pgf-app-fg);
}

button,
.game-card,
.board-wrap,
.svg-board {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(960px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 20px 0 40px;
}

.app-shell.is-home {
  min-height: var(--pgf-vh);
  min-height: 100dvh;
  display: block;
  height: auto;
  padding: 4px 0 8px;
}

.app-shell.is-playing {
  width: min(var(--pgf-vw) - 12px, 960px);
  height: var(--pgf-vh);
  min-height: var(--pgf-vh);
  height: 100dvh;
  min-height: 100dvh;
  padding: 6px 0 3px;
}

.app-shell:not(.is-home) {
  width: min(var(--pgf-vw) - 12px, 960px);
  height: var(--pgf-vh);
  min-height: var(--pgf-vh);
  height: 100dvh;
  min-height: 100dvh;
  padding: 6px 0 3px;
}

.app-shell:not(.is-home) .app-header {
  display: none;
}

.app-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  margin-bottom: 0;
  text-align: center;
}

.app-shell.is-playing .app-header {
  display: none;
}

.app-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.app-description {
  margin: 0;
  margin-top: 0;
  margin-bottom: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--pgf-app-muted);
}

.app-shell.is-home .app-description {
  max-width: 60ch;
}

@media (min-width: 820px) {
  .app-shell.is-home .app-description {
    max-width: none;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .app-shell.is-home .app-header {
    gap: 8px;
    padding-top: 12px;
    margin-bottom: 8px;
  }

  .app-shell.is-home .app-header h1 {
    font-size: 29px;
  }

  .app-shell.is-home .app-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 0;
  }

  .app-shell.is-home .app-description {
    font-size: 13px;
  }
}

.theme-switcher {
  position: absolute;
  top: 6px;
  right: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  color: var(--pgf-app-fg);
  font-size: 0;
  line-height: 1;
}

.theme-switcher:hover,
.theme-switcher:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.theme-switcher .tool-icon {
  width: 25px;
  height: 25px;
}

.app-icon {
  width: 72px;
  height: 72px;
  display: block;
  margin-top: 0;
  margin-bottom: 2px;
}

#app-noscript {
  display: block;
  margin-top: 18px;
}

.noscript-copy {
  display: grid;
  gap: 14px;
}

.noscript-intro {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pgf-app-muted);
}

.noscript-games {
  display: grid;
  gap: 10px;
}

.noscript-game {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--pgf-card-border);
  border-radius: 18px;
  background: var(--pgf-card-bg);
  color: inherit;
  text-decoration: none;
}

.noscript-game strong {
  font-size: 16px;
  line-height: 1.2;
}

.noscript-game p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pgf-app-muted);
}

.noscript-game small {
  font-size: 12px;
  line-height: 1.35;
  color: var(--pgf-app-muted);
}

.noscript-game .noscript-play-link {
  color: var(--pgf-accent);
}

.noscript-how {
  display: grid;
  gap: 8px;
}

.noscript-how h2,
.noscript-games h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.noscript-how ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--pgf-app-muted);
}

.panel {
  padding: 18px;
  border: 1px solid var(--pgf-panel-border);
  border-radius: 24px;
  background: var(--pgf-panel-bg);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.app-shell.is-playing .panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

.app-shell:not(.is-home) .panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

body.is-playing {
  overflow: hidden;
}

.stack {
  display: grid;
  gap: 16px;
}

.screen-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  height: calc(var(--pgf-vh) - 8px);
  min-height: calc(var(--pgf-vh) - 8px);
  height: calc(100dvh - 8px);
  min-height: calc(100dvh - 8px);
  padding-bottom: 2px;
}

.screen-content {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  padding-inline: 4px;
}

.screen-content.results-screen {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.results-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 6px;
}

.landing-intro {
  width: min(100%, 38rem);
  justify-self: center;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.landing-description {
  width: 100%;
  max-width: none;
  white-space: pre-line;
}

.landing-game-icon {
  width: 86px;
  height: 86px;
  display: block;
  margin: 0 auto;
}

.landing-section {
  width: min(100%, 38rem);
  justify-self: center;
  padding: 4px 0 0;
  margin-bottom: 14px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.landing-section.card {
  border: 0;
  background: transparent;
}

.landing-section-title {
  width: 100%;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: color-mix(in srgb, var(--pgf-app-muted) 82%, var(--pgf-app-fg) 18%);
  text-align: center;
}

.landing-section-body {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  text-align: center;
}

.landing-section-body li {
  text-align: left;
}

.landing-section-body ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 8px;
  justify-content: center;
  justify-items: start;
}

.landing-section-body p {
  margin: 0;
  line-height: 1.45;
}

.landing-launches {
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 720px) {
  .landing-intro {
    gap: 8px;
  }

  .landing-description {
    max-width: none;
  }

  .landing-section {
    margin-bottom: 8px;
  }

  .landing-section-body {
    max-width: none;
  }

  .landing-section-body ul {
    gap: 6px;
  }

  .landing-launches {
    gap: 14px;
    margin-top: 10px;
  }

}

.play-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  gap: 8px;
  min-height: 0;
  height: 100%;
}

.screen-content.play-shell .board-wrap {
  align-self: center;
}

.screen-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 46px;
  align-items: center;
  gap: 8px;
}

.tool-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}

.tool-row.end {
  justify-content: flex-end;
}

.tool-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pgf-app-fg);
  cursor: pointer;
  touch-action: manipulation;
  padding: 0;
  font-size: 0;
  line-height: 1;
  transition:
    transform 140ms ease;
}

.tool-btn:hover,
.tool-btn:focus-visible {
  transform: translateY(-1px);
}

.tool-icon {
  width: 25px;
  height: 25px;
  display: block;
  opacity: 0.9;
  filter: var(--pgf-chrome-icon-filter);
}

.screen-title {
  min-height: 44px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  transform: translateY(1px);
}

.screen-title h2,
.screen-title p {
  margin: 0;
}

.screen-title h2 {
  font-size: 30px;
  line-height: 0.95;
  display: block;
  margin-top: 0;
}

.screen-title p {
  margin-top: 2px;
  min-height: 14px;
}

.indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}

.indicator {
  padding: 3px 7px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pgf-app-fg);
}

.indicator.is-accent {
  color: var(--pgf-tone-accent-fg);
}

.indicator.is-success {
  color: var(--pgf-tone-success-fg);
}

.indicator.is-score-positive {
  color: var(--pgf-tone-success-bg);
}

.indicator.is-warning {
  color: var(--pgf-tone-warning-border);
}

.indicator.is-error,
.indicator.is-danger {
  color: var(--pgf-tone-error-border);
}

.indicator.is-info {
  color: var(--pgf-tone-info-fg);
}

.indicator.is-muted {
  color: var(--pgf-tone-muted-fg);
}

.indicator.is-neutral {
  color: var(--pgf-app-fg);
}

.indicator-label {
  display: block;
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.8;
}

.indicator-value {
  display: block;
  margin-top: 1px;
  font-size: 20px;
  font-weight: 700;
  color: inherit;
}

.message-area {
  height: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 1px 8px;
  text-align: center;
  overflow: hidden;
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--pgf-app-muted);
}

.message-area.is-prominent {
  font-weight: 700;
  line-height: 1.08;
  color: var(--pgf-app-fg);
}

.message-area.is-success {
  font-weight: 700;
  line-height: 1.08;
  color: var(--pgf-tone-success-fg);
}

.message-area.is-warning {
  font-weight: 700;
  line-height: 1.08;
  color: var(--pgf-tone-warning-border);
}

.message-area.is-error {
  font-weight: 700;
  line-height: 1.08;
  color: var(--pgf-tone-error-border);
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.36);
  z-index: 20;
}

.overlay-sheet {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  border-radius: 18px;
  padding: 18px;
}

.overlay-sheet.card {
  background: color-mix(in srgb, var(--pgf-app-bg) 94%, white 6%);
  border: 1px solid var(--pgf-panel-border);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.definition-sheet {
  width: min(560px, calc(100vw - 40px));
}

.definition-body {
  display: grid;
  gap: 14px;
  max-height: min(60vh, 34rem);
  overflow: auto;
}

.definition-status {
  padding: 12px 0 2px;
  text-align: center;
  color: var(--pgf-app-muted);
}

.definition-status.is-error {
  color: var(--pgf-tone-error-border);
  font-weight: 600;
}

.definition-body-content {
  display: grid;
  gap: 12px;
}

.definition-entry {
  display: grid;
  gap: 8px;
}

.definition-part-of-speech {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pgf-accent);
}

.definition-list {
  margin: 0;
  padding-left: 1.8em;
  padding-inline-start: 1.8em;
  list-style-position: outside;
  display: grid;
  gap: 8px;
  color: var(--pgf-app-fg);
  line-height: 1.45;
}

.definition-attribution {
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--pgf-card-border) 66%, transparent 34%);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--pgf-app-muted);
}

.definition-attribution a {
  color: var(--pgf-accent);
  text-decoration: none;
}

.definition-attribution a:hover,
.definition-attribution a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  min-width: 140px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pgf-app-bg) 72%, var(--pgf-accent) 28%);
  background: color-mix(in srgb, var(--pgf-app-bg) 88%, var(--pgf-accent) 12%);
  color: var(--pgf-app-fg);
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.overlay-actions {
  justify-content: center;
}

.help-sheet > strong {
  display: block;
  text-align: center;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.card-actions {
  justify-content: flex-start;
}

.game-card {
  cursor: pointer;
  justify-items: center;
  text-align: center;
  align-content: start;
  width: min(100%, 26rem);
  justify-self: center;
  touch-action: manipulation;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
  gap: 10px;
}

.game-card strong {
  font-size: 1.55rem;
  line-height: 1.05;
}

.screen-content.home-games .game-card,
.screen-content:not(.home-games) .game-card {
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.game-card-icon {
  width: 65px;
  height: 65px;
  display: block;
}

.game-card:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--pgf-accent) 32%, var(--pgf-card-border) 68%);
  background: color-mix(in srgb, var(--pgf-card-bg) 82%, var(--pgf-accent) 18%);
  outline: none;
}

.screen-content.home-games {
  gap: 14px;
  align-content: start;
  overflow: visible;
  padding-inline: 6px;
}

.screen-content.home-games .game-card {
  width: min(calc(100% - 20px), 36rem);
  max-width: none;
  justify-self: center;
}

.screen-content.home-games .game-card.is-featured-game {
  width: min(calc(100% - 20px), 36rem);
}

.home-timestamp {
  grid-column: 1 / -1;
  justify-self: center;
  padding-top: 4px;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
  color: color-mix(in srgb, var(--pgf-app-muted) 55%, transparent);
  opacity: 0.72;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.home-contact {
  grid-column: 1 / -1;
  justify-self: center;
  padding-top: 2px;
  padding-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
  color: color-mix(in srgb, var(--pgf-app-muted) 72%, transparent);
  text-align: center;
}

.home-contact a {
  color: inherit;
  text-decoration: none;
}

.home-contact a:hover,
.home-contact a:focus-visible {
  color: var(--pgf-app-fg);
  text-decoration: underline;
  outline: none;
}

.screen-content.home-games .game-card {
  border: 1px solid var(--pgf-card-border);
  background: color-mix(in srgb, var(--pgf-card-bg) 72%, var(--pgf-app-bg) 28%);
}

.screen-content.home-games .game-card-home {
  padding: 18px 18px 18px 16px;
  justify-items: stretch;
  text-align: left;
  gap: 0;
}

.game-card-home-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.game-card-home-body.has-no-icon {
  grid-template-columns: minmax(0, 1fr) auto;
}

.game-card-home-copy {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  text-align: left;
  max-width: none;
}

.game-card-home-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.game-card-home-meta-icon {
  flex: 0 0 1em;
  width: 1em;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1;
  color: currentColor;
}

.screen-content.home-games .game-card-home strong {
  font-size: 1.35rem;
  line-height: 1.08;
}

.screen-content.home-games .game-card-home .meta {
  font-size: 0.9rem;
  line-height: 1.3;
}

.screen-content.home-games .game-card-home .meta.is-success,
.screen-content.home-games .game-card.is-featured-game .meta.is-success {
  color: color-mix(in srgb, var(--pgf-tone-success-fg) 88%, var(--pgf-app-fg) 12%);
}

.screen-content.home-games .game-card-home .meta.is-warning,
.screen-content.home-games .game-card.is-featured-game .meta.is-warning {
  color: color-mix(in srgb, var(--pgf-tone-warning-fg) 88%, var(--pgf-app-fg) 12%);
}

.screen-content.home-games .game-card-home .meta.is-error,
.screen-content.home-games .game-card.is-featured-game .meta.is-error {
  color: color-mix(in srgb, var(--pgf-tone-error-fg) 88%, var(--pgf-app-fg) 12%);
}

.screen-content.home-games .game-card-home .meta.is-muted,
.screen-content.home-games .game-card.is-featured-game .meta.is-muted {
  color: color-mix(in srgb, var(--pgf-tone-muted-fg) 88%, var(--pgf-app-fg) 12%);
}

.game-card-home-cta {
  justify-self: end;
  align-self: center;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pgf-accent) 34%, var(--pgf-card-border) 66%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pgf-accent) 24%, transparent 76%) 0%, transparent 100%),
    color-mix(in srgb, var(--pgf-card-bg) 76%, var(--pgf-app-bg) 24%);
  color: color-mix(in srgb, var(--pgf-app-fg) 88%, var(--pgf-accent) 12%);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 16px rgba(0, 0, 0, 0.12);
}

.screen-content.home-games .game-card-home .game-card-icon {
  width: 44px;
  height: 44px;
  margin-top: 0;
}

.screen-content.home-games .game-card.is-featured-game {
  gap: 12px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--pgf-card-border) 28%, var(--pgf-app-fg) 72%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pgf-app-fg) 4%, transparent 96%) 0%, transparent 34%),
    color-mix(in srgb, var(--pgf-card-bg) 82%, var(--pgf-app-bg) 18%);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  margin-bottom: 12px;
}

.screen-content.home-games .game-card.is-featured-game + .game-card {
  margin-top: 6px;
}

.game-card-kicker {
  color: color-mix(in srgb, var(--pgf-app-muted) 88%, var(--pgf-app-fg) 12%);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-card-featured-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.game-card-featured-icon-shell {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.09), transparent 58%),
    color-mix(in srgb, var(--pgf-card-bg) 64%, var(--pgf-app-bg) 36%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.game-card-featured-copy {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
  text-align: left;
}

.game-card-featured-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.game-card-featured-meta-icon {
  flex: 0 0 1em;
  width: 1em;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1;
  color: currentColor;
}

.screen-content.home-games .game-card.is-featured-game .game-card-icon {
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
}

.screen-content.home-games .game-card.is-featured-game strong {
  font-size: clamp(1.9rem, 4vw, 2.85rem);
  line-height: 0.98;
}

.screen-content.home-games .game-card.is-featured-game .meta {
  font-size: 1rem;
  line-height: 1.25;
}

.game-card-cta {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  padding: 16px 28px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pgf-accent) 30%, transparent 70%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--pgf-accent) 90%, white 10%) 0%, color-mix(in srgb, var(--pgf-accent) 74%, black 26%) 100%);
  color: color-mix(in srgb, var(--pgf-app-bg) 90%, black 10%);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.screen-content .game-card.is-daily-card {
  border-color: color-mix(in srgb, var(--pgf-accent) 36%, var(--pgf-card-border) 64%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pgf-accent) 10%, transparent 90%) 0%, transparent 44%),
    color-mix(in srgb, var(--pgf-card-bg) 78%, var(--pgf-accent) 22%);
  box-shadow:
    0 12px 28px rgba(249, 115, 22, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.screen-content .game-card.is-practice-card {
  width: min(70%, 18rem);
  padding: 14px 16px;
  gap: 7px;
  border-color: color-mix(in srgb, var(--pgf-card-border) 78%, var(--pgf-app-fg) 22%);
  background: color-mix(in srgb, var(--pgf-card-bg) 84%, var(--pgf-app-bg) 16%);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.screen-content .game-card.is-practice-card strong {
  font-size: 1.18rem;
  line-height: 1.08;
}

.screen-content .game-card.is-practice-card .meta {
  font-size: 0.86rem;
  line-height: 1.2;
}

.screen-content.home-games .game-card:focus-visible {
  background: color-mix(in srgb, var(--pgf-card-bg) 68%, var(--pgf-accent) 32%);
}

@media (hover: hover) and (pointer: fine) {
  .game-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--pgf-accent) 32%, var(--pgf-card-border) 68%);
    background: color-mix(in srgb, var(--pgf-card-bg) 82%, var(--pgf-accent) 18%);
    outline: none;
  }

  .screen-content.home-games .game-card:hover {
    background: color-mix(in srgb, var(--pgf-card-bg) 68%, var(--pgf-accent) 32%);
  }

  .screen-content .game-card.is-daily-card:hover {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--pgf-accent) 14%, transparent 86%) 0%, transparent 44%),
      color-mix(in srgb, var(--pgf-card-bg) 72%, var(--pgf-accent) 28%);
  }

  .screen-content .game-card.is-practice-card:hover {
    background: color-mix(in srgb, var(--pgf-card-bg) 80%, var(--pgf-app-bg) 20%);
  }
}

@media (min-width: 820px) {
  .screen-content.home-games .game-card.is-featured-game {
    margin-bottom: 16px;
  }

  .screen-content.home-games .game-card.is-featured-game + .game-card {
    margin-top: 10px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-featured-body {
    gap: 20px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-featured-icon-shell {
    width: 120px;
    height: 120px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-icon {
    width: 88px;
    height: 88px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-cta {
    padding: 16px 30px;
    font-size: 17px;
  }

  .screen-content .game-card.is-practice-card {
    width: min(70%, 19rem);
    padding: 15px 17px;
  }

  .screen-content .game-card.is-practice-card strong {
    font-size: 1.22rem;
  }

  .screen-content.home-games .game-card-home {
    padding: 20px 20px 20px 18px;
  }

  .game-card-home-body {
    gap: 16px;
  }

  .game-card-home-icon-shell {
    width: 64px;
    height: 64px;
  }

  .screen-content.home-games .game-card-home strong {
    font-size: 1.58rem;
    line-height: 1.06;
  }

  .screen-content.home-games .game-card-home .meta {
    font-size: 0.95rem;
    line-height: 1.28;
  }

  .game-card-home-cta {
    padding: 11px 20px;
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .screen-content.home-games .game-card.is-featured-game {
    padding: 18px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-featured-body {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-featured-icon-shell {
    width: 76px;
    height: 76px;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-icon {
    width: 52px;
    height: 52px;
  }

  .screen-content.home-games .game-card.is-featured-game strong {
    font-size: clamp(1.55rem, 6vw, 2rem);
  }

  .screen-content.home-games .game-card.is-featured-game .meta {
    font-size: 0.95rem;
  }

  .screen-content.home-games .game-card.is-featured-game .game-card-cta {
    grid-column: 1 / -1;
    justify-self: center;
    align-self: start;
    padding: 14px 18px;
    font-size: 14px;
  }

  .screen-content .game-card.is-practice-card {
    width: min(82%, 18rem);
    padding: 13px 15px;
  }

  .screen-content .game-card.is-practice-card strong {
    font-size: 1.1rem;
  }

  .screen-content .game-card.is-practice-card .meta {
    font-size: 0.82rem;
  }
}

.card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--pgf-card-border);
  background: var(--pgf-card-bg);
}

.button {
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  color: color-mix(in srgb, var(--pgf-app-bg) 88%, black 12%);
  background: var(--pgf-accent);
  cursor: pointer;
}

.button.secondary {
  color: var(--pgf-app-fg);
  background: var(--pgf-card-bg);
}

.screen-topbar .more-games-btn {
  margin-left: 18px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pgf-app-fg);
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none;
  text-decoration: none;
  transform: none;
  appearance: none;
  transition:
    color 0.2s ease,
    opacity 0.2s ease,
    text-decoration-color 0.2s ease;
}

.screen-topbar .more-games-btn:hover,
.screen-topbar .more-games-btn:focus-visible {
  background: transparent;
  color: var(--pgf-app-fg);
  opacity: 0.92;
  text-decoration: underline;
  transform: none;
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: saturate(0.72);
}

.bottom-actions {
  min-height: 72px;
}

.bottom-actions.is-empty {
  visibility: hidden;
}

.meta {
  color: var(--pgf-app-muted);
  font-size: 14px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
}

.board-wrap {
  width: 100%;
  max-width: 100%;
  justify-self: center;
  margin: 0 auto;
  touch-action: manipulation;
}

.svg-board {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--pgf-board-font-family);
  touch-action: manipulation;
}

.svg-board-bg {
  fill: var(--pgf-board-bg);
  stroke: var(--pgf-board-border);
}

.svg-tile-shape {
  transition: transform 180ms ease;
}

.svg-tile-label {
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.svg-tile.is-active .svg-tile-shape {
  stroke-width: 3;
}

.svg-tile.is-disabled {
  opacity: 1;
}

.svg-tile.is-disabled .svg-tile-shape {
  filter: none;
}

.svg-tile.is-disabled .svg-tile-label {
  opacity: 1;
}

.tile {
  min-height: 88px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--pgf-tile-border);
  background: var(--pgf-tile-bg);
  color: var(--pgf-tile-fg);
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background-color 180ms ease;
}

.field {
  width: min(220px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--pgf-input-border);
  border-radius: 14px;
  color: var(--pgf-app-fg);
  background: var(--pgf-input-bg);
}

.trace-word {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--pgf-card-border);
  background: var(--pgf-trace-bg);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.bottom-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 64px;
  align-items: center;
  padding-bottom: calc(2px + env(safe-area-inset-bottom) * 0.2);
}

.bottom-actions.is-empty {
  visibility: hidden;
}

.bottom-actions .button {
  min-width: 104px;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 14px;
}

@media (max-width: 720px), (pointer: coarse) {
  .screen-topbar .more-games-btn {
    margin-left: 14px;
  }

  .screen-topbar {
    grid-template-columns: 1fr auto 1fr;
    min-height: 52px;
    gap: 6px;
  }

  .tool-row {
    min-height: 42px;
    gap: 8px;
  }

  .tool-btn {
    width: 48px;
    height: 48px;
  }

  .home-link.button {
    font-size: 13px;
  }

  .tool-icon {
    width: 28px;
    height: 28px;
  }

  .action-row {
    gap: 10px;
  }

  .bottom-actions {
    min-height: 68px;
    gap: 10px;
    padding-bottom: calc(3px + env(safe-area-inset-bottom) * 0.2);
  }

  .bottom-actions .button {
    min-width: 118px;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 15px;
  }

  .result-share-cluster-top .button,
  .bottom-actions.results-actions > .result-button-row > .button.result-match-width {
    min-width: 176px;
  }
}

@media (min-width: 760px) and (pointer: coarse) {
  .screen-topbar .more-games-btn {
    margin-left: 20px;
  }

  .app-shell.is-playing,
  .app-shell:not(.is-home) {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .screen-shell {
    gap: 12px;
  }

  .screen-topbar {
    grid-template-columns: 1fr auto 1fr;
    min-height: 58px;
    gap: 10px;
  }

  .tool-row {
    min-height: 50px;
    gap: 10px;
  }

  .tool-btn {
    width: 54px;
    height: 54px;
  }

  .home-link.button {
    font-size: 14px;
  }

  .tool-icon {
    width: 31px;
    height: 31px;
  }

  .screen-title {
    min-height: 50px;
    transform: translateY(0);
  }

  .screen-title h2 {
    font-size: 34px;
  }

  .screen-title p {
    margin-top: 3px;
    font-size: 16px;
  }

  .indicators {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 10px;
  }

  .indicator-label {
    font-size: 10px;
  }

  .indicator-value {
    font-size: 22px;
  }

  .message-area {
    height: 54px;
    min-height: 54px;
    font-size: 22px;
  }

  .bottom-actions {
    min-height: 88px;
    gap: 12px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .bottom-actions .button {
    min-width: 132px;
    padding: 12px 20px;
    border-radius: 18px;
    font-size: 17px;
  }
}

/* Debug-only shell overlays for inspecting layout allocation. */
body.debug-shell-layout .screen-shell {
  background: rgba(255, 64, 64, 0.06);
}

body.debug-shell-layout .screen-topbar {
  background: rgba(255, 170, 0, 0.14);
  outline: 1px solid rgba(255, 170, 0, 0.3);
}

body.debug-shell-layout .screen-content {
  background: rgba(74, 222, 128, 0.08);
  outline: 1px solid rgba(74, 222, 128, 0.24);
}

body.debug-shell-layout .message-area {
  background: rgba(59, 130, 246, 0.12);
  outline: 1px solid rgba(59, 130, 246, 0.26);
}

body.debug-shell-layout .board-wrap {
  background: rgba(168, 85, 247, 0.12);
  outline: 1px solid rgba(168, 85, 247, 0.3);
}

body.debug-shell-layout .bottom-actions {
  background: rgba(244, 114, 182, 0.14);
  outline: 1px solid rgba(244, 114, 182, 0.3);
}

body.debug-shell-layout .bottom-actions .button {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

body.debug-shell-layout .app-header {
  background: rgba(59, 130, 246, 0.12);
  outline: 1px solid rgba(59, 130, 246, 0.26);
}

body.debug-shell-layout .panel {
  background: rgba(16, 185, 129, 0.08);
  outline: 1px solid rgba(16, 185, 129, 0.24);
}

body.debug-shell-layout .home-games {
  background: rgba(251, 191, 36, 0.08);
  outline: 1px solid rgba(251, 191, 36, 0.26);
}

body.debug-shell-layout .home-games .game-card {
  background: rgba(244, 114, 182, 0.12);
  outline: 1px solid rgba(244, 114, 182, 0.28);
}

@media (min-width: 760px) {
  .panel {
    padding: 24px;
  }
}

.result-hero {
  text-align: center;
  display: grid;
  gap: 6px;
  padding: 8px 0;
}

.results-body .result-hero {
  padding-top: 0;
}

.result-outcome {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.outcome-won,
.outcome-completed {
  color: var(--pgf-accent);
}

.outcome-lost,
.outcome-aborted {
  color: var(--pgf-app-fg);
}

.outcome-expired {
  color: #f59e0b;
}

.outcome-ended {
  color: var(--pgf-app-muted);
}

.result-score-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.result-pill {
  display: grid;
  gap: 4px;
  padding: 12px 20px;
  border-radius: 16px;
  background: var(--pgf-card-bg);
  border: 1px solid var(--pgf-card-border);
  text-align: center;
  min-width: 140px;
}

.result-pill.is-new-best {
  background: color-mix(in srgb, var(--pgf-card-bg) 80%, var(--pgf-accent) 20%);
  border-color: color-mix(in srgb, var(--pgf-card-border) 50%, var(--pgf-accent) 50%);
}

.result-pill-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pgf-app-muted);
}

.result-pill.is-new-best .result-pill-label {
  color: var(--pgf-accent);
  font-weight: 600;
}

.result-pill-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.result-streak {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--pgf-accent);
  font-weight: 600;
}

.result-stats-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(100%, 18rem);
  max-width: 100%;
  margin-inline: auto;
  margin-top: 2px;
  margin-bottom: 2px;
}

.result-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 6px;
  width: 100%;
  padding: 2px 0;
}

.result-stat-row.is-success {
  color: var(--pgf-tone-success-fg);
}

.result-stat-row.is-warning {
  color: var(--pgf-tone-warning-fg);
}

.result-stat-row.is-muted {
  opacity: 0.88;
}

.result-stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pgf-app-muted);
  white-space: nowrap;
  text-align: left;
}

.result-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  white-space: nowrap;
  text-align: right;
}

.result-summary-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.08;
  font-weight: 800;
}

.result-summary-line.outcome-won,
.result-summary-line.outcome-completed {
  color: var(--pgf-tone-success-fg);
}

.result-summary-line.outcome-lost,
.result-summary-line.outcome-expired,
.result-summary-line.outcome-aborted {
  color: var(--pgf-tone-error-fg);
}

.result-summary-line.outcome-ended {
  color: var(--pgf-app-muted);
}

.result-summary-icon {
  font-size: 28px;
  line-height: 1;
}

.result-summary-text {
  display: block;
}

.result-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--pgf-card-border) 56%, transparent 44%);
}

.results-body .result-section:last-child {
  margin-bottom: 2px;
}

.result-spacer {
  flex: 1;
  min-height: 0;
}

.result-comeback-nudge {
  padding-top: 4px;
  padding-bottom: 4px;
  text-align: center;
  font-size: 14px;
  color: var(--pgf-app-muted);
}

.result-nav-row {
  justify-content: center;
  padding-top: 4px;
  padding-bottom: 12px;
}

.result-nav-row .button.result-match-width {
  min-width: 160px;
}

.bottom-actions.results-footer-empty {
  display: none;
  min-height: 0;
}

.result-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pgf-app-muted);
}

.result-section.has-items .result-section-title {
  text-align: center;
}

.result-section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.result-section-list li {
  font-size: 15px;
}

.result-section-list .result-pill {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--pgf-card-border) 82%, transparent 18%);
  color: var(--pgf-app-fg);
  opacity: 0.88;
}

.result-section-list .result-pill.is-definition-word {
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.result-section-list .result-pill.is-definition-word:hover,
.result-section-list .result-pill.is-definition-word:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--pgf-accent) 36%, var(--pgf-card-border) 64%);
  background: color-mix(in srgb, var(--pgf-card-bg) 86%, var(--pgf-accent) 14%);
  outline: none;
}

.result-section-list .result-pill.is-success {
  background: color-mix(in srgb, var(--pgf-tone-success-bg) 22%, transparent);
  border-color: color-mix(in srgb, var(--pgf-tone-success-border) 78%, var(--pgf-card-border) 22%);
  color: var(--pgf-tone-success-fg);
  opacity: 1;
}

.result-section-list .result-pill.is-warning {
  border-color: color-mix(in srgb, var(--pgf-tone-warning-border) 56%, var(--pgf-card-border) 44%);
  color: color-mix(in srgb, var(--pgf-tone-warning-fg) 88%, var(--pgf-app-fg) 12%);
  opacity: 1;
}

.result-section-list .result-pill.is-error {
  border-color: color-mix(in srgb, var(--pgf-tone-error-border) 56%, var(--pgf-card-border) 44%);
  color: color-mix(in srgb, var(--pgf-tone-error-fg) 88%, var(--pgf-app-fg) 12%);
  opacity: 1;
}

.result-section-list .result-pill.is-muted {
  border-color: color-mix(in srgb, var(--pgf-tone-muted-border) 56%, var(--pgf-card-border) 44%);
  color: color-mix(in srgb, var(--pgf-tone-muted-fg) 88%, var(--pgf-app-fg) 12%);
  opacity: 0.84;
}

.result-share-nudge {
  margin: 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pgf-app-fg);
}

.result-share-cluster {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: end;
  align-self: stretch;
  width: 100%;
}

.result-share-cluster-top {
  padding-block: 8px;
  gap: 10px;
}

.result-share-cluster-top .button,
.bottom-actions.results-actions > .result-button-row > .button.result-match-width {
  min-width: 160px;
}

.bottom-actions.results-actions {
  justify-content: center;
  align-items: stretch;
  min-height: 64px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom) * 0.2);
}

.bottom-actions.results-actions > .result-button-row {
  width: 100%;
}

.bottom-actions.results-actions > .result-button-row {
  justify-content: center;
}

.bottom-actions.results-actions > .result-button-row > .button {
  align-self: center;
}

.stats-sheet {
  min-width: 280px;
}

.stats-variant {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--pgf-card-border);
}

.stats-variant:first-child {
  border-top: none;
  padding-top: 0;
}

.stats-variant-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pgf-app-muted);
  font-weight: 600;
}

.stats-list {
  display: grid;
  gap: 8px;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.stats-label {
  color: var(--pgf-app-muted);
}

.stats-value {
  font-weight: 600;
  color: var(--pgf-app-fg);
}
