.play-page {
  --play-page-background:
    linear-gradient(90deg, rgba(149, 213, 178, 0.22), transparent 24%, transparent 76%, rgba(116, 198, 157, 0.2)),
    #f5faf4;
  --play-page-base: #f5faf4;
  --play-cream: #fffdf7;
  --play-paper: #f8f2e5;
  --play-charcoal: #242421;
  --play-gold: #d7aa32;
  --play-red: #a8322a;
  --play-logo-red: #e61f25;
  min-width: 320px;
  color: var(--play-charcoal);
  background: var(--play-page-background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (min-width: 901px) {
  .play-page:not([data-embedded="true"]):not([data-tester="true"]) {
    zoom: .85;
  }
}

.play-header {
  display: grid;
  width: min(1460px, calc(100% - 32px));
  min-height: 76px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(36, 36, 33, 0.18);
}

.play-page[data-embedded="true"] .play-header {
  display: none;
}

.play-page[data-embedded="true"] .play-shell {
  margin-top: 18px;
}

.play-page[data-embedded="true"] .play-main {
  --play-board-size: min(100%, 630px, max(280px, calc(100vh - 190px)));
}

.play-brand,
.play-header-actions,
.play-section-heading,
.play-controls,
.play-tool-group {
  display: flex;
  align-items: center;
}

.play-brand {
  min-width: 0;
  gap: 14px;
}

.play-header-title {
  min-width: 0;
  text-align: center;
}

.play-header-title h1 {
  max-width: min(38vw, 520px);
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 1.25rem;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-logo-crop {
  position: relative;
  width: 184px;
  height: 44px;
  flex: 0 0 auto;
  overflow: hidden;
}

.play-logo {
  position: absolute;
  top: -44px;
  left: -8px;
  width: 205px;
  max-width: none;
  height: auto;
}

.back-link {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(36, 36, 33, 0.26);
  border-radius: 6px;
  color: inherit;
  font-size: 1.35rem;
  text-decoration: none;
}

.back-link:hover {
  background: var(--frosted-mint);
}

.play-kicker,
.play-section-label {
  margin: 0;
  color: #397459;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.play-header-actions {
  justify-self: end;
  gap: 10px;
}

.difficulty-switcher {
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(36, 36, 33, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.difficulty-switcher a {
  padding: 9px 11px;
  color: #4d554f;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 850;
}

.difficulty-switcher a + a {
  border-left: 1px solid rgba(36, 36, 33, 0.13);
}

.difficulty-switcher a.is-active {
  color: #fff;
  background: #1f5845;
}

.difficulty-switcher small {
  margin-left: 2px;
  opacity: 0.68;
}

.developer-load {
  display: none;
}

.play-page[data-tester="true"] .developer-load {
  display: inline-flex;
}

.play-page[data-tester="true"][data-admin="true"] .developer-load {
  display: none;
}

.play-page:not([data-tester="true"]) .developer-load {
  display: none !important;
}

.play-page[data-tester="true"] .difficulty-switcher {
  display: none;
}

.play-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: center;
}

.play-timer-card {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(31, 88, 69, 0.26);
  border-radius: 12px;
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(216, 243, 220, 0.96), rgba(255, 252, 244, 0.98));
  box-shadow: 3px 3px 0 rgba(31, 88, 69, 0.12);
  color: var(--play-charcoal);
}

.play-timer-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 2px solid var(--play-logo-red);
  border-radius: 999px;
  background: var(--play-cream);
  color: var(--play-logo-red);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.play-timer-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.play-timer-copy small {
  color: #4f7568;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.play-timer-card .play-timer {
  color: #1f5845;
  font-size: 1.13rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: left;
}

.play-load-button {
  position: relative;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid rgba(36, 36, 33, 0.26);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--play-cream);
  cursor: pointer;
  font-weight: 750;
}

.play-load-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.play-shell {
  display: grid;
  width: min(1460px, calc(100% - 32px));
  grid-template-areas:
    "clue clue"
    "sidebar main";
  grid-template-columns: minmax(330px, 420px) minmax(540px, 1fr);
  column-gap: 32px;
  row-gap: 18px;
  align-items: start;
  justify-content: center;
  margin: 24px auto 48px;
}

.play-sidebar {
  grid-area: sidebar;
  min-width: 0;
}

.play-sidebar > .painting-review-button {
  width: 100%;
  margin: 0 0 14px;
}

.play-main {
  --play-board-size: min(100%, 700px, max(420px, calc(100vh - 280px)));
  grid-area: main;
  min-width: 0;
}

.play-clue-card {
  position: relative;
  display: grid;
  grid-area: clue;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0;
  border: 2px solid var(--play-charcoal);
  border-left: 8px solid var(--play-gold);
  border-radius: 8px;
  padding: 16px 18px;
  background: var(--play-cream);
  box-shadow: 4px 4px 0 rgba(36, 36, 33, 0.14);
}

.play-clue-card p:last-child {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.42;
}

.play-section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.play-section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.play-section-heading span {
  color: #50705e;
  font-size: 0.8rem;
  font-weight: 750;
}

.play-suspects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 981px) {
  .play-shell {
    grid-template-areas: "sidebar main";
    row-gap: 0;
  }

  .play-sidebar {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .play-sidebar > .play-clue-card {
    grid-area: auto;
    flex: 0 0 auto;
    margin: 0 0 14px;
  }

  .play-page[data-embedded="true"] {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .play-page[data-embedded="true"] .play-shell {
    height: calc(100vh - 36px);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    margin-top: 18px;
    margin-bottom: 18px;
  }

  .play-page[data-embedded="true"] .play-sidebar {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 8px 4px 4px;
    scrollbar-color: #6b7f75 #dce9df;
    scrollbar-width: thin;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar-track {
    background: #dce9df;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #6b7f75;
  }

  .play-page[data-embedded="true"] .play-main {
    height: 100%;
    overflow: hidden;
  }
}

.play-suspect-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 112px;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: 1fr;
  gap: 10px;
  align-items: stretch;
  justify-content: stretch;
  border: 2px solid rgba(36, 36, 33, 0.24);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--play-charcoal);
  text-align: left;
}

.play-suspect-card:hover {
  border-color: rgba(36, 36, 33, 0.62);
}

.play-suspect-card.is-selected {
  border-color: var(--play-logo-red);
  box-shadow: 0 0 0 4px var(--play-logo-red);
}

.play-suspect-card.is-notes-selected {
  border-color: #1674c8;
  box-shadow: 0 0 0 4px #1674c8;
}

.play-suspect-card.is-placed:not(.is-selected) {
  opacity: 0.62;
}

.play-suspect-card.is-incorrect {
  border-color: var(--play-red);
  opacity: 1;
}

.play-suspect-card img {
  width: 64px;
  height: 94px;
  min-height: 0;
  align-self: start;
  border-radius: 5px;
  background: #e8dfce;
  object-fit: cover;
  object-position: center top;
}

.play-suspect-card[data-role="artwork"] {
  grid-column: 1 / -1;
  min-height: 392px;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 14px;
  padding: 10px;
}

.play-suspect-card[data-role="artwork"] img {
  width: 256px;
  height: 376px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 4px 4px 0 rgba(31, 88, 69, 0.14);
}

.play-suspect-card.no-portrait::before {
  content: attr(data-initial);
  display: grid;
  width: 64px;
  height: 94px;
  place-items: center;
  border-radius: 5px;
  color: #172019;
  background: hsl(var(--token-hue) 48% 79%);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.play-suspect-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 4px 2px 16px 0;
}

.play-suspect-copy strong {
  margin-bottom: 4px;
  font-size: 0.94rem;
}

.play-suspect-clue {
  display: block;
  overflow: visible;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  line-height: 1.2;
}

.suspect-abbreviation {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border: 2px solid #101010;
  border-radius: 4px;
  background: hsl(var(--token-hue) 62% 74%);
  color: #101010;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.suspect-state {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: #397459;
  font-size: 0.67rem;
  font-weight: 850;
  text-transform: uppercase;
}

.play-board {
  width: var(--play-board-size);
  margin: 0;
  container-type: inline-size;
}

.play-board-workspace {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.play-board-workspace .play-controls {
  width: 116px;
  max-width: 116px;
  flex: 0 0 116px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
}

.play-board-workspace .play-tool-group {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
}

.play-board-workspace .play-tool,
.play-board-workspace .check-solution {
  width: 100%;
  min-height: 42px;
  padding-right: 8px;
  padding-left: 8px;
}

.play-board-workspace .play-tool {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.play-board-workspace .check-solution {
  white-space: normal;
}

.play-board-buttons {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.play-board-buttons .painting-review-button {
  margin: 0;
}

.play-board-buttons .play-controls {
  width: auto;
  max-width: 100%;
  margin: 0;
}

.play-board-buttons .play-tool,
.play-board-buttons .check-solution {
  min-height: 38px;
  padding-right: 9px;
  padding-left: 9px;
}

.play-board .board-matrix {
  width: 100%;
}

.play-board .board-grid {
  box-shadow: 0 14px 36px rgba(36, 36, 33, 0.18);
}

.play-board .board-line-thin {
  stroke: rgba(38, 38, 38, 0.62);
}

.play-board .window-l {
  left: 0;
  transform: translateX(-50%);
}

.play-board .window-r {
  right: 0;
  transform: translateX(50%);
}

.play-board .window-t {
  top: 0;
  transform: translateY(-50%);
}

.play-board .window-b {
  bottom: 0;
  transform: translateY(50%);
}

.play-board .item-image-chair {
  width: 110%;
  height: 110%;
}

.play-board .multi-cell-the-kiss.multi-cell-tall .multi-cell-object-image {
  transform: translateY(-4%);
}

.painting-review-button {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 0;
  border: 1px solid rgba(36, 36, 33, 0.34);
  border-radius: 6px;
  padding: 0 13px;
  background: var(--play-cream);
  color: var(--play-charcoal);
  font-size: 0.82rem;
  font-weight: 800;
}

.painting-review-button:hover:not(:disabled) {
  border-color: var(--play-charcoal);
  background: var(--frosted-mint);
}

.painting-review-button:disabled {
  color: #77746d;
  cursor: not-allowed;
  opacity: 0.58;
}

.painting-review-penalty {
  border-left: 1px solid rgba(36, 36, 33, 0.22);
  padding-left: 8px;
  color: var(--play-red);
  font-size: 0.72rem;
}

.play-placement-layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--size), minmax(0, 1fr));
}

.play-placement-visual-layer {
  z-index: 12;
  pointer-events: none;
}

.play-placement-notes-layer {
  z-index: 18;
  pointer-events: none;
}

.play-placement-hit-layer {
  z-index: 20;
}

.play-board .board-room-labels {
  z-index: 14;
}

.play-board .room-label {
  background: #f6fff8;
  box-shadow: 0 0 0 2px rgba(246, 255, 248, 0.96);
}

.play-board .board-void-mask {
  background: var(--play-page-base);
}

.play-cell-target {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.play-cell-visual,
.play-cell-notes {
  pointer-events: none;
}

.play-cell-hit {
  cursor: pointer;
}

.play-cell-target:hover,
.play-cell-target:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(22, 116, 200, 0.76);
}

.play-cell-hit:hover,
.play-cell-hit:focus-visible {
  box-shadow: none;
}

.play-cell-target.is-selected-placement {
  box-shadow: inset 0 0 0 3px var(--play-logo-red);
}

.play-cell-hit.is-selected-placement {
  box-shadow: none;
}

.play-cell-target.is-long-press-ready {
  box-shadow: inset 0 0 0 4px var(--play-logo-red);
}

.play-cell-target.is-object-blocked {
  cursor: not-allowed;
}

.play-cell-target.is-void-cell {
  visibility: hidden;
  pointer-events: none;
}

.play-cell-target.is-object-blocked:hover,
.play-cell-target.is-object-blocked:focus-visible {
  box-shadow: none;
}

.cell-suspect-token {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 60%;
  min-width: 0;
  height: 60%;
  place-items: center;
  border: max(2px, 0.32cqi) solid #101010;
  border-radius: 16%;
  background: hsl(var(--token-hue) 68% 68% / 0.96);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  color: #101010;
  font-size: clamp(10px, 3.8cqi, 28px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  transform: translate(-50%, -50%);
}

.cell-suspect-token.is-incorrect {
  border-color: #fff;
  background: var(--play-red);
  color: #fff;
  box-shadow: 0 0 0 3px var(--play-red);
}

.cell-cross {
  position: absolute;
  inset: 7%;
  display: grid;
  place-items: center;
  color: var(--line);
  font-size: clamp(18px, 8cqi, 58px);
  font-weight: 950;
  line-height: 1;
}

.cell-candidate-notes {
  position: absolute;
  top: 4%;
  right: 4%;
  left: 4%;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1% 7%;
  pointer-events: none;
}

.cell-candidate-notes.avoids-room-label-left {
  left: 34%;
}

.cell-candidate-notes.avoids-room-label-right {
  right: 34%;
}

.cell-candidate-notes.avoids-room-label-top {
  top: 30%;
}

.cell-candidate-notes.avoids-room-label-bottom {
  top: auto;
  bottom: 30%;
}

.cell-candidate-note {
  padding: 0 0.08em;
  border-radius: 0.18em;
  background: rgb(246 255 248 / 0.78);
  color: hsl(var(--token-hue) 56% 42%);
  font-size: clamp(8px, 2.7cqi, 20px);
  font-weight: 950;
  line-height: 1;
  paint-order: stroke fill;
  -webkit-text-stroke: max(1px, 0.12cqi) #111;
}

.play-controls {
  width: min(100%, 780px);
  justify-content: space-between;
  gap: 14px;
  margin: 20px auto 0;
}

.play-tool-group {
  flex-wrap: wrap;
  gap: 7px;
}

.play-tool,
.check-solution {
  min-height: 44px;
  border: 2px solid var(--play-charcoal);
  border-radius: 6px;
  padding: 0 13px;
  background: var(--play-cream);
  color: var(--play-charcoal);
  font-size: 0.84rem;
  font-weight: 820;
}

.play-tool {
  gap: 7px;
}

.play-tool.is-active {
  border-color: #1674c8;
  background: #ddecf8;
  box-shadow: 0 0 0 2px rgba(22, 116, 200, 0.2);
}

.share-challenge {
  border-color: var(--play-logo-red);
  color: var(--play-logo-red);
}

.play-tool.needs-confirmation {
  border-color: var(--play-red);
  color: var(--play-red);
}

.tool-icon {
  min-width: 17px;
  font-size: 1.05rem;
  line-height: 1;
}

.tool-x {
  font-weight: 950;
}

.check-solution {
  flex: 0 0 auto;
  border-color: #8f6d0c;
  background: var(--play-gold);
  box-shadow: 3px 3px 0 rgba(36, 36, 33, 0.3);
}

.play-tool:disabled,
.check-solution:disabled {
  border-color: rgba(36, 36, 33, 0.18);
  background: #e8e6df;
  box-shadow: none;
  color: #77746d;
  cursor: not-allowed;
}

.play-status {
  width: var(--play-board-size);
  min-height: 22px;
  margin: 34px auto 0;
  color: #50705e;
  font-size: 0.82rem;
  font-weight: 700;
}

.play-suspects .play-status {
  display: flex;
  width: auto;
  min-height: 112px;
  margin: 0;
  align-items: center;
  color: #315f4b;
}

.play-status[data-type="error"] {
  color: var(--play-red);
}

.play-status[data-type="success"] {
  color: #17683e;
}

.result-dialog {
  width: min(470px, calc(100% - 32px));
  border: 2px solid var(--play-charcoal);
  border-radius: 16px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(216, 243, 220, 0.98), rgba(255, 252, 244, 0.98));
  box-shadow: 8px 8px 0 rgba(36, 36, 33, 0.3);
  color: var(--play-charcoal);
  text-align: center;
}

.result-dialog::backdrop {
  background: rgba(25, 28, 25, 0.64);
}

.result-celebration-gif {
  display: block;
  width: auto;
  max-width: min(100%, 280px);
  height: auto;
  max-height: 280px;
  margin: 0 auto 16px;
  border: 2px solid rgba(31, 88, 69, 0.28);
  border-radius: 14px;
  background: var(--play-cream);
  box-shadow: 5px 5px 0 rgba(31, 88, 69, 0.14);
}

.result-dialog h2 {
  margin: 5px 0 10px;
  color: #1f5845;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1;
}

.result-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  border: 1px solid rgba(239, 35, 42, 0.28);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(255, 252, 244, 0.92);
  color: var(--play-logo-red);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.result-dialog #resultText {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.45;
}

.result-share-challenge {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  margin: 0 0 10px;
  border-color: var(--play-logo-red);
  background: var(--play-cream);
  color: var(--play-logo-red);
  box-shadow: 4px 4px 0 rgba(239, 35, 42, 0.14);
}

.painting-dialog {
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 2px solid var(--play-charcoal);
  border-radius: 8px;
  padding: 24px;
  background: var(--play-cream);
  box-shadow: 8px 8px 0 rgba(36, 36, 33, 0.3);
  color: var(--play-charcoal);
}

.painting-dialog::backdrop {
  background: rgba(25, 28, 25, 0.76);
}

.painting-dialog-header {
  max-width: 720px;
  margin-bottom: 20px;
}

.painting-dialog h2 {
  margin: 5px 0 7px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.painting-dialog-text {
  margin: 0;
  color: #4d574f;
  line-height: 1.45;
}

.painting-memory-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
}

.painting-memory-card {
  min-width: 0;
  border: 1px solid rgba(36, 36, 33, 0.2);
  border-radius: 6px;
  padding: 8px;
  background: #f8f2e5;
}

.painting-memory-artwork {
  display: grid;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(36, 36, 33, 0.13);
  background: #ebe2d1;
}

.painting-memory-artwork img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.painting-memory-card.is-portrait {
  grid-row: span 2;
}

.painting-memory-card.is-portrait .painting-memory-artwork {
  aspect-ratio: 3 / 4;
}

.painting-memory-card h3 {
  margin: 8px 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  line-height: 1.15;
}

.painting-memory-card p {
  margin: 0;
  color: #567061;
  font-size: 0.72rem;
  line-height: 1.25;
}

.painting-dialog-actions {
  position: sticky;
  bottom: -24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 22px -24px -24px;
  border-top: 1px solid rgba(36, 36, 33, 0.16);
  padding: 14px 24px;
  background: rgba(255, 253, 247, 0.98);
}

.painting-dialog [hidden] {
  display: none;
}

.painting-dialog-load {
  margin-right: auto;
}

.result-dialog h2 {
  margin: 10px 0;
  font-size: 1.8rem;
}

.result-dialog p:not(.play-section-label) {
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  min-height: 36px;
  border: 1px solid rgba(36, 36, 33, 0.26);
  padding: 0;
  background: transparent;
}

@media (max-width: 980px) {
  .difficulty-switcher small {
    display: none;
  }

  .difficulty-switcher a {
    padding: 8px;
  }

  .play-shell {
    grid-template-areas:
      "clue"
      "main"
      "sidebar";
    grid-template-columns: minmax(0, 760px);
  }

  .play-sidebar {
    display: block;
  }

  .play-main {
    --play-board-size: min(calc(100% - 128px), 700px, max(420px, calc(100vh - 280px)));
  }
}

@media (max-width: 680px) {
  .play-header {
    width: min(100% - 20px, 1460px);
    min-height: 68px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .play-brand {
    min-width: 0;
    gap: 8px;
  }

  .play-logo-crop {
    width: 82px;
    height: 25px;
  }

  .play-logo {
    top: -20px;
    left: -3px;
    width: 92px;
  }

  .play-header-title h1 {
    max-width: 100%;
    font-size: 0.88rem;
  }

  .play-kicker {
    display: none;
  }

  .play-load-button {
    width: 42px;
    overflow: hidden;
    padding: 0;
    color: transparent;
  }

  .play-header-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .difficulty-switcher {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(20, 24, 21, 0.24);
  }

  .play-timer {
    font-size: 0.88rem;
  }

  .play-load-button::before {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--play-charcoal);
    font-size: 1.35rem;
  }

  .play-shell {
    width: min(100% - 20px, 760px);
    gap: 18px;
    margin-top: 16px;
  }

  .play-sidebar {
    display: block;
  }

  .play-clue-card {
    display: block;
  }

  .play-clue-card p:last-child {
    margin-top: 8px;
  }

  .play-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .play-main {
    --play-board-size: min(100%, 700px, max(320px, calc(100vh - 280px)));
  }

  .play-board-workspace {
    flex-direction: column;
  }

  .play-board-workspace .play-controls {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .play-board-workspace .play-tool-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .play-tool {
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    font-size: 0.7rem;
  }

  .check-solution {
    width: 100%;
  }

  .painting-dialog[open] {
    width: calc(100% - 20px);
    height: calc(100vh - 20px);
    height: calc(100svh - 20px);
    max-height: calc(100svh - 20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 16px 0;
  }

  .painting-dialog:not([open]) {
    display: none;
  }

  .painting-dialog-header {
    order: 1;
    flex: 0 0 auto;
    margin-bottom: 12px;
  }

  .painting-memory-gallery {
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .result-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
    padding: 18px;
  }

  .result-celebration-gif {
    max-width: min(100%, 220px);
    max-height: 220px;
    margin-bottom: 12px;
  }

  .painting-memory-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .painting-dialog-actions {
    position: static;
    order: 2;
    flex: 0 0 auto;
    flex-direction: column;
    margin: 0 0 12px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .painting-dialog-actions .play-tool,
  .painting-dialog-actions .check-solution {
    width: 100%;
    min-height: 52px;
    font-size: 0.9rem;
  }

  .painting-dialog .painting-dialog-load {
    display: none;
  }

  .painting-dialog .painting-dialog-load::before {
    content: none;
  }
}

@media (max-width: 430px) {
  .play-suspects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .play-suspect-card {
    min-height: 104px;
  }

  .play-suspect-card[data-role="artwork"] {
    min-height: auto;
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .play-suspect-card[data-role="artwork"] img {
    width: 128px;
    height: 188px;
  }
}

@media (max-width: 680px) {
  html,
  .play-page[data-embedded="true"] {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .play-page[data-embedded="true"] .play-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-areas:
      "main"
      "sidebar";
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(180px, 1fr);
    gap: 0;
    margin: 0;
  }

  .play-page[data-embedded="true"] .play-clue-card {
    margin: 6px 8px;
    border-width: 1px 1px 1px 4px;
    padding: 7px 9px;
    box-shadow: 2px 2px 0 rgba(36, 36, 33, 0.1);
  }

  .play-page[data-embedded="true"] .play-clue-card .play-section-label {
    font-size: 0.64rem;
  }

  .play-page[data-embedded="true"] .play-clue-card p:last-child {
    margin-top: 4px;
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .play-page[data-embedded="true"] .play-main {
    --play-board-size: min(calc(100vw - 4px), 49svh, 450px);
    min-height: 0;
    padding: 0 2px 6px;
    background: #dff1e5;
  }

  .play-page[data-embedded="true"] .play-board .board-void-mask {
    background: #dff1e5;
  }

  .play-page[data-embedded="true"] .play-board .room-label {
    padding: 0.012in 0.018in 0.014in;
    border-width: 0.009in;
    font-size: 0.112in;
  }

  .play-page[data-embedded="true"] .play-board .room-label-left,
  .play-page[data-embedded="true"] .play-board .room-label-right {
    font-size: min(var(--vertical-label-size, 0.112in), 0.112in);
  }

  .play-page[data-embedded="true"] .play-board .room-label-board-edge {
    left: calc(var(--label-edge-x) * 100% / var(--size));
    top: calc(var(--label-edge-y) * 100% / var(--size));
  }

  .play-page[data-embedded="true"] .play-board .room-label-board-edge.room-label-bottom {
    transform: translate(-50%, -50%);
  }

  .play-page[data-embedded="true"] .play-board .room-label-board-edge.room-label-left,
  .play-page[data-embedded="true"] .play-board .room-label-board-edge.room-label-right {
    transform: translate(-50%, -50%) rotate(-90deg);
  }

  .play-page[data-embedded="true"] .play-board .cell-candidate-notes,
  .play-page[data-embedded="true"] .play-board .cell-candidate-notes.avoids-room-label-left,
  .play-page[data-embedded="true"] .play-board .cell-candidate-notes.avoids-room-label-right,
  .play-page[data-embedded="true"] .play-board .cell-candidate-notes.avoids-room-label-top,
  .play-page[data-embedded="true"] .play-board .cell-candidate-notes.avoids-room-label-bottom {
    top: 3%;
    right: 3%;
    bottom: auto;
    left: 3%;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 2% 4%;
  }

  .play-page[data-embedded="true"] .play-board .cell-candidate-note {
    min-width: 1.35em;
    border: max(1px, 0.09cqi) solid hsl(var(--token-hue) 44% 34%);
    padding: 0.06em 0.16em 0.09em;
    background: hsl(var(--token-hue) 68% 79% / 0.96);
    color: #17251f;
    box-shadow: 0 1px 2px rgb(20 31 26 / 0.34);
    font-size: clamp(9px, 3.05cqi, 21px);
    line-height: 1;
    text-align: center;
    -webkit-text-stroke: 0;
  }

  .play-page[data-embedded="true"] .play-board-workspace {
    display: block;
  }

  .play-page[data-embedded="true"] .play-board {
    margin: 0 auto;
  }

  .play-page[data-embedded="true"] .play-sidebar {
    display: flex;
    min-height: 180px;
    height: calc(51svh - 6px);
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: #6b7f75 #dce9df;
    border-top: 1px solid rgba(36, 36, 33, 0.18);
    padding: 7px 8px calc(60px + env(safe-area-inset-bottom, 0px));
    background: #edf6ef;
  }

  .play-page[data-embedded="true"] .play-sidebar > .painting-review-button {
    min-height: 30px;
    margin-bottom: 6px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .play-page[data-embedded="true"] .play-suspect-section {
    display: block;
    min-height: 0;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar {
    width: 7px;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar-track {
    background: #dce9df;
  }

  .play-page[data-embedded="true"] .play-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #6b7f75;
  }

  .play-page[data-embedded="true"] .play-clue-card,
  .play-page[data-embedded="true"] .painting-review-button,
  .play-page[data-embedded="true"] .play-suspect-section,
  .play-page[data-embedded="true"] .play-suspects,
  .play-page[data-embedded="true"] .play-suspect-card {
    touch-action: pan-y;
  }

  .play-page[data-embedded="true"] .play-section-heading {
    flex: 0 0 auto;
    margin-bottom: 6px;
  }

  .play-page[data-embedded="true"] .play-section-heading h2 {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .play-page[data-embedded="true"] .play-section-heading span {
    font-size: 0.64rem;
  }

  .play-page[data-embedded="true"] .play-suspects {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    overflow: visible;
    padding: 2px 4px 8px 2px;
  }

  .play-page[data-embedded="true"] .play-suspect-card {
    min-height: 84px;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 6px;
    border-width: 1.5px;
    border-radius: 7px;
    padding: 4px;
  }

  .play-page[data-embedded="true"] .play-suspect-card img,
  .play-page[data-embedded="true"] .play-suspect-card.no-portrait::before {
    width: 46px;
    height: 68px;
  }

  .play-page[data-embedded="true"] .play-suspect-card.no-portrait::before {
    font-size: 1rem;
  }

  .play-page[data-embedded="true"] .play-suspect-copy {
    padding: 2px 0 11px;
  }

  .play-page[data-embedded="true"] .play-suspect-copy strong {
    margin-bottom: 2px;
    font-size: 0.8rem;
  }

  .play-page[data-embedded="true"] .play-suspect-clue {
    font-size: 0.78rem;
    line-height: 1.18;
  }

  .play-page[data-embedded="true"] .suspect-abbreviation {
    top: 3px;
    left: 3px;
    min-width: 18px;
    height: 18px;
    border-width: 1px;
    font-size: 0.56rem;
  }

  .play-page[data-embedded="true"] .suspect-state {
    right: 4px;
    bottom: 3px;
    font-size: 0.52rem;
  }

  .play-page[data-embedded="true"] .play-suspect-card[data-role="artwork"] {
    min-height: 150px;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    padding: 5px;
  }

  .play-page[data-embedded="true"] .play-suspect-card[data-role="artwork"] img {
    width: 96px;
    height: 140px;
  }

  .play-page[data-embedded="true"] .play-board-workspace .play-controls {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    width: 100%;
    max-width: none;
    min-height: 54px;
    grid-template-columns: minmax(0, 2.4fr) minmax(58px, 0.8fr) 44px 58px;
    gap: 4px;
    border-top: 1px solid rgba(36, 36, 33, 0.2);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    background: rgba(251, 248, 240, 0.98);
    box-shadow: 0 -5px 16px rgba(36, 36, 33, 0.12);
  }

  .play-page[data-embedded="true"] .play-board-workspace .play-tool-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .play-page[data-embedded="true"] .play-board-workspace .play-tool,
  .play-page[data-embedded="true"] .play-board-workspace .check-solution {
    width: 100%;
    min-height: 42px;
    border-width: 1.5px;
    padding: 3px;
    border-radius: 7px;
    box-shadow: none;
  }

  .play-page[data-embedded="true"] .play-board-workspace .play-tool-group .play-tool,
  .play-page[data-embedded="true"] .play-board-workspace .share-challenge {
    justify-content: center;
    font-size: 0;
  }

  .play-page[data-embedded="true"] .play-board-workspace .tool-icon {
    min-width: 0;
    font-size: 1rem;
  }

  .play-page[data-embedded="true"] .play-board-workspace .check-solution {
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .play-page[data-embedded="true"] .play-timer-card {
    min-height: 42px;
    gap: 2px;
    border-width: 1px;
    padding: 3px;
    box-shadow: none;
  }

  .play-page[data-embedded="true"] .play-timer-icon,
  .play-page[data-embedded="true"] .play-timer-copy small {
    display: none;
  }

  .play-page[data-embedded="true"] .play-timer-card .play-timer {
    font-size: 0.68rem;
  }

  .play-page[data-embedded="true"] .play-status {
    position: fixed;
    right: 8px;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    z-index: 55;
    width: auto;
    min-height: 0;
    margin: 0;
    border-radius: 6px;
    padding: 0;
    background: rgba(247, 251, 246, 0.94);
    text-align: center;
  }
}
