.wall-mobile-brand { display: none; }

body[data-page="results"] {
  min-height: 100svh;
  background: #001339;
}
body[data-page="results"] main {
  display: grid;
  place-items: center;
  max-width: none;
  min-height: 100svh;
}
body[data-page="results"] > footer,
body[data-page="results"] .header > .brand { display: none; }
body[data-page="results"] .header {
  position: absolute;
  width: 0;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.results-stage {
  position: relative;
  width: min(100vw, calc(100svh * 1.77683316));
  aspect-ratio: 1672 / 941;
  isolation: isolate;
  container-type: inline-size;
}
.wall-artwork { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: -1; }
.wall-home { position: absolute; top: 1.2%; right: 1.5%; height: 9%; display: flex; align-items: center; gap: .5cqw; border-radius: 6px; font-size: 2.5cqw; font-weight: 800; letter-spacing: -.05em; white-space: nowrap; }
.wall-home img { width: 3.3cqw; height: 100%; object-fit: contain; }
.wall-home b, .wall-mobile-brand b { color: var(--orange); font-weight: 400; }
.wall-frames { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wall-frames polygon { filter: drop-shadow(0 0 4px var(--frame-color)); }
.wall-mosaic { position: absolute; inset: 0; }
.wall-slot {
  position: absolute;
  left: var(--tile-left);
  top: var(--tile-top);
  width: var(--tile-width);
  height: var(--tile-height);
  clip-path: var(--tile-shape);
}
.wall-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  color: #edf5ff;
  text-align: center;
  animation: tile-arrival .65s ease-out;
}
.wall-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.wall-tile.has-image img { opacity: 1; }
.wall-tile:focus-visible { outline: none; box-shadow: inset 0 0 0 5px #baf7ff; }
.wall-tile:focus-visible::after { content: ''; position: absolute; inset: 6%; z-index: 2; border: 3px solid #baf7ff; border-radius: 4px; }
.wall-tile:hover { filter: brightness(1.13); }
.wall-tile-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35cqw;
  width: 100%;
  height: 100%;
  padding: 12%;
  background: radial-gradient(ellipse at top, #00bed540, #001339ee 75%);
  transition: opacity .3s;
}
.wall-tile.has-image .wall-tile-copy { opacity: 0; }
.wall-tile-spark { font-size: 1.3cqw; line-height: 1; color: var(--orange); }
.wall-tile-status { font-size: .52cqw; line-height: 1.35; color: #7fe5f1; }
.wall-tile:not(.has-image):not([data-image-load-failed]) .wall-tile-spark { animation: spark-pulse 1.7s ease-in-out infinite alternate; }
@keyframes spark-pulse { from { opacity: .35; } to { opacity: 1; text-shadow: 0 0 15px var(--cyan); } }
@keyframes tile-arrival { from { opacity: 0; filter: brightness(1.6); } to { opacity: 1; filter: brightness(1); } }

body[data-page="results"] .screen-menu-toggle {
  display: block;
  position: fixed;
  z-index: 10;
  right: 16px;
  bottom: 12px;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid #00bed550;
  border-radius: 8px;
  color: #7fe5f1;
  background: #001339df;
  font-size: 13px;
  letter-spacing: 2px;
}
body[data-page="results"] .screen-tools {
  display: none;
  position: fixed;
  z-index: 10;
  right: 16px;
  bottom: 54px;
  width: 290px;
  max-height: calc(100svh - 80px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #00bed566;
  border-radius: 14px;
  background: #001339fa;
  box-shadow: 0 12px 45px #0009;
}
body[data-page="results"].menu-open .screen-tools { display: block; }
body[data-page="results"] .header nav { display: grid; height: auto; width: auto; margin: 0 0 18px; gap: 8px; }
body[data-page="results"] .header nav a { padding: 10px 2px; gap: 12px; }
body[data-page="results"] .header-end { justify-content: space-between; }
.wall-tools { margin-top: 20px; padding-top: 18px; border-top: 1px solid #00bed550; }
.wall-tools > p { font-size: 12px; color: #b8cdec; line-height: 1.5; }
.wall-tools b { color: var(--accent); }
.wall-paging { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
#wall-page { font-size: 12px; color: #edf5ff; font-variant-numeric: tabular-nums; }
.wall-tools #pause { width: 100%; }
.wall-tools #rotation-status { display: block; margin-top: 12px; font-size: 10px; text-align: center; color: #a5b9db; }
.wall-connection { position: fixed; left: 16px; bottom: 12px; z-index: 5; margin: 0; padding: 9px 13px; background: #001339ed; border: 1px solid #ff612b80; border-radius: 7px; color: #ff926b; font-size: 12px; }

.wall-detail { width: min(720px, calc(100vw - 32px)); max-height: calc(100svh - 48px); overflow: auto; padding: 0; border: 1px solid #00bed5; border-radius: 18px; color: #edf5ff; background: #001339; box-shadow: 0 18px 90px #000a; }
.wall-detail::backdrop { background: #000b; backdrop-filter: blur(8px); }
.wall-detail-content { position: relative; padding: 25px; }
#detail-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border: 1px solid #00bed580; border-radius: 50%; background: #001339ea; color: #baf7ff; font-size: 26px; line-height: 1; }
#detail-image { display: block; max-width: 100%; max-height: 54svh; margin: 0 auto 23px; border-radius: 9px; object-fit: contain; }
#detail-theme { color: var(--accent); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; margin: 8px 42px 12px 0; }
#detail-idea { margin: 0 0 19px; font-size: clamp(20px, 2vw, 28px); font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
#detail-name { margin: 0; font-size: 12px; color: #b8cdec; }
#detail-status { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: #7fe5f1; }
#detail-status:empty { display: none; }
.generation-settings .settings-fields > p { max-width: none; margin-bottom: 15px; }
.generation-failure { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.generation-failure p { flex: 1; margin: 0; overflow-wrap: anywhere; }
.generation-error { display: block; margin-top: 6px; color: #ff926b; }
.generation-failure button { flex-shrink: 0; }

/* On phones the same live slots form a readable, touch-friendly gallery. */
@media (max-width: 700px) and (orientation: portrait) {
  body[data-page="results"] main { display: block; }
  .results-stage { width: 100%; min-height: 100svh; aspect-ratio: auto; padding: 105px 18px 55px; }
  .wall-artwork { position: fixed; height: 100svh; object-fit: cover; object-position: 80% center; opacity: .3; }
  .wall-home { display: none; }
  .wall-frames { display: none; }
  .wall-mobile-brand { display: flex; position: absolute; top: 0; right: 0; width: 100%; height: 94px; padding: 18px 22px; gap: 9px; align-items: center; justify-content: flex-end; background: linear-gradient(#001339, #001339ee 80%, #00133900); font-size: 27px; font-weight: 800; letter-spacing: -.05em; }
  .wall-mobile-brand img { width: 34px; height: auto; }
  .wall-mobile-brand b { font-weight: 400; }
  .wall-mosaic { position: relative; display: grid; grid-template-columns: repeat(var(--wall-mobile-columns, 3), minmax(0, 1fr)); gap: 9px; }
  .wall-slot { position: relative; top: auto; left: auto; width: 100%; height: auto; aspect-ratio: 1; clip-path: none; border: 1px solid #00bed5bb; border-radius: 6px; background: #001339cc; box-shadow: 0 0 9px #00bed525, inset 0 0 16px #00bed512; overflow: hidden; }
  .wall-slot:nth-child(even) { border-color: #ff612bbb; box-shadow: 0 0 9px #ff612b25, inset 0 0 16px #ff612b12; }
  .wall-tile-copy { padding: 10%; gap: 6px; }
  .wall-tile-spark { font-size: 20px; }
  .wall-tile-status { font-size: 9px; }
  .wall-detail-content { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .wall-tile:not(.has-image):not([data-image-load-failed]) .wall-tile-spark { animation: none; }
  .wall-tile { animation: none; }
  .wall-tile img, .wall-tile-copy { transition: none; }
}

/* Fullscreen keeps the operator menu available when it is needed. */
@media (display-mode: fullscreen) {
  body[data-page="results"] .header { display: flex; }
}
