:root {
  --bg: #0b0b0d;
  --panel: rgba(18, 18, 21, 0.88);
  --text: #e6e0d6;
  --muted: #8f887e;
  --line: rgba(230, 224, 214, 0.12);
  --accent: #b89a61;
  --error: #9f8060;
  --success: #d2b97f;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, #1b1b1f 0%, #0b0b0d 58%, #060607 100%);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

body {
  min-height: 100vh;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.puzzle-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px var(--shadow);
}

.image-wrap {
  position: relative;
  align-self: start;
  margin: 0;
}

.puzzle-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  filter: saturate(0.92) contrast(1.04);
}

.tile-hotspots {
  position: absolute;
  inset: 0;
}

.tile-hotspot {
  position: absolute;
  display: block;
  background: transparent;
  outline: none;
}

/* Tile bounds follow the collage's artwork, leaving its white gutters uncovered. */
.column-1 { left: 1.35%; width: 31.5%; }
.column-2 { left: 34.3%; width: 31.4%; }
.column-3 { left: 67.2%; width: 31.5%; }

.row-1 { top: 1.3%; height: 31.2%; }
.row-2 { top: 33.8%; height: 31.5%; }
.row-3 { top: 66.7%; height: 32%; }

.tile-number {
  position: absolute;
  right: 8%;
  bottom: 8%;
  min-width: 1.7rem;
  padding: 3px 6px;
  border: 1px solid rgba(210, 185, 127, 0.35);
  background: rgba(11, 11, 13, 0.78);
  color: var(--success);
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.tile-hotspot:hover .tile-number,
.tile-hotspot:focus-visible .tile-number {
  opacity: 1;
}

.disc-track-number {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.disc-indicator {
  font-size: 0.6em;
  opacity: 0.7;
}

.content-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.phase-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
}

.meta-marker {
  margin-left: 8px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.riddle {
  margin: 0 0 26px;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.15;
  font-weight: 400;
}

.track-03-riddle {
  font-size: clamp(1.55rem, 2.35vw, 2.2rem);
  line-height: 1.16;
}

.track-03-riddle span {
  display: block;
  white-space: nowrap;
}

.track-03-riddle span + span {
  margin-top: 0.12em;
}

.answer-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.answer-input {
  flex: 1 1 250px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
}

.answer-input::placeholder {
  color: #716b63;
}

.answer-input:focus {
  border-color: rgba(184, 154, 97, 0.6);
  box-shadow: 0 0 0 1px rgba(184, 154, 97, 0.18);
}

.submit-button {
  padding: 14px 20px;
  border: 1px solid rgba(184, 154, 97, 0.38);
  background: rgba(184, 154, 97, 0.08);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.submit-button:hover {
  background: rgba(184, 154, 97, 0.14);
  border-color: rgba(184, 154, 97, 0.6);
}

.submit-button:active {
  transform: translateY(1px);
}

.response-message {
  min-height: 1.5em;
  margin: 0 0 18px;
  color: var(--error);
  font-size: 0.96rem;
}

.success-panel {
  padding: 16px 18px;
  border-left: 2px solid rgba(210, 185, 127, 0.5);
  background: rgba(210, 185, 127, 0.05);
  color: var(--success);
}

.success-panel p {
  margin: 0 0 10px;
}

.success-panel p:last-child {
  margin-bottom: 0;
}

.proceed-control {
  display: block;
  width: fit-content;
  margin: 16px 0 0 auto;
  padding: 7px 0;
  color: var(--success);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.proceed-control:hover,
.proceed-control:focus-visible {
  border-bottom-color: transparent;
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .puzzle-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .track-03-riddle {
    font-size: clamp(1rem, 5vw, 1.55rem);
  }
}

.proceed-control:focus:not(:focus-visible) { outline: none; }
