.play-page {
  min-height: 100svh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.play-page::before {
  background:
    radial-gradient(circle at top left, rgba(242, 180, 0, 0.1), transparent 22rem),
    radial-gradient(circle at bottom right, rgba(17, 17, 17, 0.04), transparent 24rem);
}

.play-page::after {
  background: linear-gradient(180deg, rgba(248, 243, 235, 0.2), rgba(248, 243, 235, 0.72));
}

.play-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  height: 100%;
  padding: 1rem clamp(1rem, 2.6vw, 2rem) 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.play-page .ghost-button,
.play-page .button {
  padding: 0.82rem 1.15rem;
}

.play-page .text-input {
  padding: 0.82rem 0.95rem;
}

.play-layout {
  width: 100%;
  margin: 0;
  min-height: 0;
  height: 100%;
  padding: 0 0 clamp(0.85rem, 2vw, 1.25rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.play-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(1rem, 1.6vw, 1.45rem);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.7rem;
}

.image-stage {
  min-height: 0;
  display: flex;
  margin-bottom: 0;
}

.image-frame {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 8px);
  background: rgba(255, 255, 255, 0.62);
}

.image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.play-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(255, 252, 246, 0.88);
  transition: opacity 180ms ease;
}

.play-loading[hidden] {
  opacity: 0;
}

.play-loading-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 3px solid rgba(17, 17, 17, 0.12);
  border-top-color: rgba(242, 180, 0, 0.95);
  animation: play-loading-spin 900ms linear infinite;
}

.play-loading-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
}

#game-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(4.6);
  transform-origin: center center;
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.guess-form {
  display: grid;
  gap: 0.45rem;
}

.guess-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.guess-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
}

.autocomplete-shell {
  position: relative;
}

.autocomplete-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0.82rem 0.95rem;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  font: inherit;
}

.autocomplete-typed {
  color: transparent;
}

.autocomplete-suffix {
  color: rgba(17, 17, 17, 0.32);
}

.autocomplete-input {
  position: relative;
  z-index: 1;
  background: transparent;
}

.field-label {
  font-size: 0.86rem;
  flex-shrink: 0;
}

.status-message {
  min-height: 1.25rem;
  font-size: 0.95rem;
  text-align: right;
}

@keyframes play-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .play-page {
    height: auto;
    overflow: auto;
  }

  .play-shell {
    height: auto;
  }

  .play-layout,
  .play-panel {
    height: auto;
  }
}

@media (max-width: 640px) {
  .guess-meta,
  .guess-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-message {
    text-align: left;
  }

  .play-layout {
    padding-top: 0;
    padding-bottom: 1rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .image-frame {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-height: 860px) and (min-width: 641px) {
  .play-panel {
    padding: 0.9rem 1rem;
    gap: 0.6rem;
  }

  .image-frame {
    min-height: clamp(280px, 50vh, 500px);
  }

  .status-message {
    min-height: 1.15rem;
    font-size: 0.9rem;
  }

  .guess-form .field-label {
    font-size: 0.82rem;
  }

  .play-page .text-input,
  .play-page .button {
    padding-top: 0.74rem;
    padding-bottom: 0.74rem;
  }

  .autocomplete-ghost {
    padding-top: 0.74rem;
    padding-bottom: 0.74rem;
  }
}

@media (max-height: 760px) and (min-width: 641px) {
  .image-frame {
    min-height: clamp(240px, 44vh, 380px);
  }
}
