/* No, I'm Not a Whore - main styles.
   Base rules first, then menus/overlays, the guide, and finally the
   responsive section (four breakpoints, see below). */

:root {
  --bg-dark: #020a0c;
  --teal-dark: #062329;
  --teal-main: #0c4d59;
  --teal-light: #248a9e;
  --text-main: #e0f2f5;
  --danger: #590c0c;
  --danger-hover: #8a1313;
}

#game-container.night-time {
  --bg-dark: #020a0c;
  --teal-dark: #062329;
  --teal-main: #0c4d59;
  --teal-light: #248a9e;
  --text-main: #e0f2f5;
}

#game-container.day-time {
  --bg-dark: #1a2820;
  --teal-dark: #2d5f45;
  --teal-main: #4a8f6f;
  --teal-light: #7ab88a;
  --text-main: #f0faf4;
}

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Courier New", Courier, monospace;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#game-container {
  width: 100%;
  max-width: 900px;
  height: min(90vh, calc(100dvh - 16px));
  min-height: 0;
  background-color: var(--teal-dark);
  border: 2px solid var(--teal-main);
  box-shadow: 0 0 20px rgba(12, 77, 89, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
}

.header-on-top {
  z-index: 2500 !important;
  position: relative !important;
}

header {
  background-color: #010608;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--teal-main);
  font-weight: bold;
  font-size: 1rem;
  gap: 16px;
  transition: background-color 0.3s ease;
}

#game-container.day-time header {
  background-color: #1a2820;
}

.time-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--teal-main);
  background-color: rgba(12, 77, 89, 0.2);
  border-radius: 4px;
  transition: all 0.3s ease;
}

#game-container.day-time .time-indicator {
  background-color: rgba(74, 143, 111, 0.2);
  border-color: var(--teal-main);
}

.time-indicator .action-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 4px currentColor);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-chip,
#room-display,
.energy-bar {
  border: 1px solid var(--teal-main);
  background-color: #031317;
  padding: 8px 12px;
  color: var(--text-main);
  white-space: nowrap;
}

#day-display,
#status-box {
  display: none !important;
}

.energy-bar span {
  color: var(--teal-light);
}

.energy-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#main-screen {
  display: flex;
  flex: 1;
  width: 100%;
}

.view-panel {
  flex: 2;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid var(--teal-main);
}

.image-container {
  flex: 1;
  background-color: #000;
  border: 2px solid var(--teal-main);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.tutorial-objective {
  position: absolute;
  right: 12px;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 10px 12px;
  border: 1px solid rgba(122, 184, 138, 0.55);
  border-left: 3px solid var(--teal-light);
  background: rgba(1, 8, 10, 0.9);
  color: var(--text-main);
  text-align: left;
  pointer-events: none;
}

.tutorial-objective p {
  font-size: 0.9rem;
  line-height: 1.35;
}

.controls-panel {
  flex: 1;
  padding: 20px;
  background-color: #031317;
  display: flex;
  flex-direction: column;
  gap: 25px;
  overflow-y: auto;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.control-group h3 {
  font-size: 0.9rem;
  color: var(--teal-light);
  text-transform: uppercase;
  border-bottom: 1px solid var(--teal-main);
  padding-bottom: 5px;
  text-align: center;
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.nav-room-btn {
  flex: 0 1 100px;
  min-width: 0;
}

.focused-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  padding: 20px 22px 24px;
  gap: 16px;
  background-color: #010608;
}

#peephole-screen,
#guest-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  grid-template-rows: auto auto 1fr;
  gap: 14px 24px;
  position: relative;
  overflow: hidden;
  padding: 0 3%;
}

#game-container.door-mode > header {
  display: none;
}

.focused-image-box {
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  background-color: #000;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.focused-image-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.peephole-lens,
.guest-scene {
  isolation: isolate;
  position: absolute;
  inset: 0;
}

.guest-scene::after,
.peephole-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.48),
      transparent 32%,
      transparent 78%,
      rgba(0, 0, 0, 0.42)
    ),
    linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.42),
      transparent 28%,
      transparent 75%,
      rgba(0, 0, 0, 0.25)
    );
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.58);
}

.guest-scene > #guest-background,
.peephole-lens > #peephole-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  object-fit: cover;
  filter: brightness(0.72) saturate(0.85);
}

.guest-scene > #guest-img,
.peephole-lens > #peephole-character {
  position: absolute;
  z-index: 1;
  width: 80%;
  height: 96%;
  left: 25%;
  top: auto;
  bottom: 0;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  filter: drop-shadow(14px 0 14px rgba(0, 0, 0, 0.3));
}

.guest-scene > #guest-img.seductive-door-image {
  width: 94%;
  height: 100%;
}

/* Her picture has more empty space around her, so it gets a little more room. */
.peephole-lens > #peephole-character.seductive-door-character {
  width: 100%;
  height: 112%;
}

.focused-dialogue-box {
  min-height: 0;
  border: 2px solid var(--teal-main);
  background: rgba(1, 6, 8, 0.84);
  padding: 22px 26px;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  flex-direction: column;
}

#peephole-dialogue,
#guest-screen > #guest-status {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  width: min(92%, 520px);
  justify-self: center;
  height: auto;
  margin: 14% 0 0;
  overflow: visible;
  border-color: var(--teal-light);
  box-shadow: inset 0 0 28px rgba(12, 77, 89, 0.14);
}

.tutorial-text {
  color: #ffd36a;
  text-shadow: 0 0 8px rgba(255, 211, 106, 0.35);
}

.focused-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

#peephole-controls,
#guest-screen > #guest-controls {
  position: relative;
  z-index: 3;
  grid-column: 2;
  grid-row: 2;
  width: min(92%, 520px);
  justify-self: center;
  margin: 0;
}

#game-container.decision-heartbeat::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2400;
  pointer-events: none;
  background: rgba(150, 0, 12, 0.12);
  animation: heartbeat-red 1.15s ease-in-out infinite;
}

@keyframes heartbeat-red {
  0%, 100% { opacity: 0.12; }
  14% { opacity: 0.38; }
  28% { opacity: 0.14; }
  42% { opacity: 0.3; }
  58% { opacity: 0.1; }
}

#peephole-controls button:nth-child(3) {
  grid-column: 1 / -1;
}

.focused-options-grid button {
  min-height: 72px;
  border: 2px solid var(--teal-main);
  border-radius: 0;
  background: rgba(1, 6, 8, 0.78);
  color: var(--teal-light);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 400;
}

.focused-options-grid button:hover:not(:disabled) {
  background-color: var(--teal-dark);
  color: var(--text-main);
  border-color: var(--teal-light);
}

button {
  background-color: var(--teal-main);
  color: var(--text-main);
  border: 2px solid var(--teal-light);
  padding: 15px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
}

button:hover:not(:disabled) {
  background-color: var(--teal-light);
  color: #000;
}

button:disabled {
  background-color: #1a1a1a;
  border-color: #333;
  color: #555;
  cursor: not-allowed;
  opacity: 0.6;
}

button.danger {
  background-color: var(--danger);
  border-color: #ff4d4d;
}

button.danger:hover:not(:disabled) {
  background-color: var(--danger-hover);
  color: #fff;
}

button.door-let-in {
  background-color: #1d5c22;
  border-color: #4caf50;
  color: #fff;
}

button.door-let-in:hover:not(:disabled) {
  background-color: #2e7d32;
  color: #fff;
}

button.pale-girl-danger-choice {
  color: #fff;
  animation: pale-girl-pulse 1.25s ease-in-out infinite;
}

@keyframes pale-girl-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(255, 77, 77, 0.15);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 77, 77, 0.85);
  }
}

button.small-btn {
  padding: 8px 15px;
  font-size: 0.85rem;
  background-color: #031317;
}

.icon-btn {
  padding: 2px;
  position: relative;
  background-color: var(--teal-dark);
  width: 100px;
  height: 70px;
  border: 2px solid transparent;
}

.icon-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: transparent;
}

.icon-btn:disabled img {
  filter: grayscale(100%) brightness(0.35);
}

.icon-btn.rounded {
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

.icon-btn.rounded img {
  border-radius: 50%;
}

.guest-identity-card {
  overflow: hidden;
  isolation: isolate;
}

.guest-identity-card .identity-background,
.guest-identity-card .identity-character {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.guest-identity-card .identity-background {
  z-index: 0;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.8);
}

.guest-identity-card .identity-character {
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.action-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 24px;
  filter: brightness(0) invert(1);
}

.energy-bar .action-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}

.icon-btn.current-room {
  cursor: default;
  border-color: #ff8c00;
  box-shadow: 0 0 12px rgba(255, 140, 0, 0.6);
}

.icon-btn.current-room > img:first-child {
  filter: grayscale(1) brightness(3);
}

.icon-btn.current-room:hover {
  background-color: var(--teal-dark);
}

.room-marker,
.presence-marker,
.door-marker {
  position: absolute;
  bottom: 3px;
  width: 25px;
  height: 25px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.room-marker {
  right: 3px;
}

.room-marker img,
.presence-marker img,
.door-marker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.presence-marker {
  right: 30px;
}

.presence-marker span {
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1;
}

.door-marker {
  right: 3px;
}

@keyframes tv-pulse {
  0% {
    box-shadow: 0 0 5px var(--teal-main);
    border-color: var(--teal-main);
  }
  50% {
    box-shadow: 0 0 20px var(--teal-light);
    border-color: var(--teal-light);
  }
  100% {
    box-shadow: 0 0 5px var(--teal-main);
    border-color: var(--teal-main);
  }
}

.tv-alert-btn {
  animation: tv-pulse 1.5s infinite;
  color: #fff !important;
  text-shadow: 0 0 5px #fff;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(2, 10, 12, 0.98);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  text-align: center;
  padding: 40px;
  overflow-y: auto;
}

.ending-panel {
  width: min(100%, 980px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.ending-stage {
  width: min(72vw, 560px);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(1, 8, 10, 0.82);
  border: 2px solid var(--teal-light);
  padding: 12px;
  box-shadow: 0 0 16px rgba(36, 138, 158, 0.08);
  cursor: pointer;
}

.ending-stage img {
  width: 100%;
  height: min(62vh, 440px);
  object-fit: contain;
  border: 2px solid var(--teal-main);
  background: rgba(4, 16, 18, 0.8);
}

.ending-current-text {
  min-height: 72px;
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-main);
  text-align: center;
}

.thanks-panel {
  position: relative;
  width: min(100%, 900px);
  min-height: min(80vh, 760px);
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 2vh, 22px);
  padding: clamp(18px, 4vw, 40px);
  box-sizing: border-box;
}

#end-screen .thanks-panel h1 {
  margin: 0;
}

.thanks-image {
  display: block;
  width: min(72vw, 560px);
  max-height: 42vh;
  object-fit: contain;
}

#end-screen .thanks-message {
  width: min(100%, 680px);
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.thanks-credits {
  width: 100%;
}

.thanks-credits > h2 {
  margin: 0 0 12px;
  color: var(--teal-light);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thanks-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.thanks-tier {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--teal-main);
  background: rgba(1, 8, 10, 0.82);
}

.thanks-tier h3 {
  margin: 0 0 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.thanks-credits-viewport {
  height: clamp(120px, 18vh, 170px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.thanks-credits-track {
  display: flex;
  flex-direction: column;
  animation: thanks-credits-scroll 42s linear infinite;
}

.thanks-tier-two .thanks-credits-track {
  animation-duration: 34s;
}

.thanks-tier:hover .thanks-credits-track {
  animation-play-state: paused;
}

.thanks-credits-list {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.25;
}

.thanks-tier-one .thanks-credits-list {
  color: #62df86;
}

.thanks-tier-two .thanks-credits-list {
  color: #ff6868;
}

.thanks-tier-three .thanks-credits-list {
  color: #ffdc62;
}

@keyframes thanks-credits-scroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

.thanks-patreon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 2px solid var(--teal-light);
  border-radius: 6px;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.thanks-patreon-btn:hover {
  background: var(--teal-main);
}

.thanks-logo-link {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vh, 28px);
  display: block;
  width: clamp(48px, 8vw, 76px);
  aspect-ratio: 1;
  z-index: 1;
}

.thanks-logo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#window-overlay {
  padding: 0;
  overflow: hidden;
  background-color: #000;
}

#window-overlay-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

#window-overlay-back {
  position: absolute;
  bottom: 24px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
}

.overlay h1 {
  font-size: 2.5rem;
  color: var(--teal-light);
  margin-bottom: 20px;
  text-shadow: 0 0 10px var(--teal-main);
}

.overlay p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  max-width: 600px;
  line-height: 1.5;
}

.overlay-image,
#test-gif-img {
  width: min(92vw, 820px);
  max-width: 500px;
  height: min(58vh, 520px);
  border: 4px solid var(--teal-light);
  margin-bottom: 20px;
  object-fit: contain;
  object-position: center;
  background:
    radial-gradient(
      circle at center,
      rgba(58, 167, 188, 0.12),
      transparent 55%
    ),
    rgba(1, 8, 10, 0.9);
  box-shadow: 0 0 18px rgba(36, 138, 158, 0.14);
}

#test-gif-img {
  max-width: none;
}

#sleep-transition {
  background:
    radial-gradient(
      circle at center,
      rgba(36, 138, 158, 0.16),
      transparent 45%
    ),
    rgba(1, 6, 8, 0.98);
  border: 2px solid var(--sleep-accent, #248a9e);
  color: var(--sleep-accent, #248a9e);
  /* Blocks clicks while the night/day passes (a second Sleep skipped a day). */
  pointer-events: auto;
}

#game-container.mushroom-trip::after,
#game-container.mushroom-ending-dark::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

#game-container.mushroom-trip::after {
  background:
    repeating-radial-gradient(circle at 18% 28%, rgba(102, 255, 91, 0.14) 0 4%, transparent 9% 18%),
    radial-gradient(ellipse at 24% 35%, rgba(0, 255, 119, 0.2), transparent 42%),
    radial-gradient(ellipse at 78% 68%, rgba(198, 50, 255, 0.22), transparent 46%),
    rgba(34, 104, 50, 0.1);
  mix-blend-mode: color-dodge;
  backdrop-filter: saturate(1.45) contrast(1.1) hue-rotate(18deg);
  animation: mushroom-trip-shift 3.2s ease-in-out infinite alternate;
}

#game-container.mushroom-ending-dark::after {
  background: rgba(0, 0, 0, 0.9);
  animation: mushroom-blackout 2s ease-in forwards;
}

.identity-truth-label {
  position: absolute;
  top: 24px;
  right: 4%;
  z-index: 20;
  padding: 8px 14px;
  border: 1px solid var(--identity-color);
  border-radius: 4px;
  background: color-mix(in srgb, var(--identity-color) 18%, #050c0e);
  color: var(--identity-color);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px color-mix(in srgb, var(--identity-color) 75%, transparent);
}

.identity-truth-label.identity-human,
.focused-dialogue-box.identity-human {
  --identity-color: #55e68a;
}

.identity-truth-label.identity-visitor,
.focused-dialogue-box.identity-visitor {
  --identity-color: #ff4545;
}

.focused-dialogue-box.identity-enabled {
  border-color: var(--identity-color) !important;
  box-shadow: inset 0 0 28px color-mix(in srgb, var(--identity-color) 18%, transparent) !important;
}

#exclusive-cheats-open {
  position: sticky;
  bottom: 0;
  z-index: 4;
  box-shadow: 0 -8px 14px rgba(3, 19, 23, 0.9);
}

#controls.seductive-bedroom .actions-group > .action-buttons button {
  min-height: 0;
  height: 36px;
  padding: 4px 8px;
  font-size: 0.9rem;
  line-height: 1;
}

#controls.seductive-bedroom .actions-group > .action-buttons {
  gap: 4px;
}

#controls.seductive-bedroom .actions-group {
  gap: 6px;
}

#controls.seductive-bedroom #exclusive-cheats-open {
  position: static;
  box-shadow: none;
}

@keyframes mushroom-trip-shift {
  from { filter: hue-rotate(-25deg) saturate(1.45) blur(0); opacity: 0.52; transform: scale(1); }
  to { filter: hue-rotate(42deg) saturate(2.2) blur(0.8px); opacity: 0.78; transform: scale(1.02); }
}

@keyframes mushroom-blackout {
  from { background-color: rgba(0, 0, 0, 0.25); }
  to { background-color: rgba(0, 0, 0, 0.96); }
}

#sleep-transition:not(.hidden) {
  animation: sleep-fade 6s ease-in-out both;
}

#sleep-transition.sleep-to-day:not(.hidden) {
  animation-name: sleep-fade-to-day, sleep-color-to-day;
  animation-duration: 7s, 3.8s;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-fill-mode: both, both;
}

#sleep-transition.sleep-to-night:not(.hidden) {
  animation-name: sleep-fade-to-night, sleep-color-to-night;
  animation-duration: 7s, 3.8s;
  animation-timing-function: ease-in-out, ease-in-out;
  animation-fill-mode: both, both;
}

#sleep-transition.sleep-to-day:not(.hidden) .sleep-transition-text,
#sleep-transition.sleep-to-night:not(.hidden) .sleep-transition-text {
  animation-duration: 7s;
}

.sleep-transition-text {
  color: inherit;
  font-size: 1.4rem;
  letter-spacing: 0;
  text-shadow: 0 0 12px var(--teal-main);
  animation: sleep-text-pulse 6s ease-in-out both;
}

.sleep-transition-dream {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(72vw, 620px);
  max-height: 62vh;
  object-fit: contain;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  box-shadow: 0 0 28px rgba(80, 255, 140, 0.35);
}

#sleep-transition.mushroom-dream .sleep-transition-text {
  position: absolute;
  z-index: 1;
  top: auto;
  bottom: 8%;
  left: 8%;
  right: 8%;
  text-align: center;
  color: #d9ffb8;
  text-shadow: 0 0 14px #47d36d;
}

.sleep-transition-deaths {
  position: absolute;
  bottom: 12%;
  left: 8%;
  right: 8%;
  color: #ff4545;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 40, 40, 0.75);
}

/* Energy limit change after a night, under the deaths line. */
.sleep-transition-energy {
  position: absolute;
  bottom: 6%;
  left: 8%;
  right: 8%;
  color: #47d3a0;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.sleep-transition-energy.energy-lost {
  color: #ff8a3d;
}

@keyframes sleep-fade {
  0% {
    opacity: 0;
    filter: blur(0);
  }
  30% {
    opacity: 1;
    filter: blur(1px);
  }
  70% {
    opacity: 1;
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    filter: blur(0);
  }
}

@keyframes sleep-fade-to-day {
  0% {
    opacity: 0;
    filter: blur(0);
  }
  12% {
    opacity: 0.92;
    filter: blur(1px);
  }
  45% {
    opacity: 1;
    filter: blur(1px);
  }
  80% {
    opacity: 1;
    filter: blur(0);
  }
  90% {
    opacity: 1;
    filter: blur(0);
  }
  94% {
    opacity: 0.88;
    filter: blur(0);
  }
  98% {
    opacity: 0.42;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    filter: blur(0);
  }
}

@keyframes sleep-fade-to-night {
  0% {
    opacity: 0;
    filter: blur(0);
  }
  12% {
    opacity: 0.92;
    filter: blur(1px);
  }
  45% {
    opacity: 1;
    filter: blur(1px);
  }
  80% {
    opacity: 1;
    filter: blur(0);
  }
  90% {
    opacity: 1;
    filter: blur(0);
  }
  94% {
    opacity: 0.88;
    filter: blur(0);
  }
  98% {
    opacity: 0.42;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    filter: blur(0);
  }
}

@keyframes sleep-color-to-day {
  0%, 12% {
    color: #248a9e;
    border-color: #248a9e;
  }
  45% {
    color: #4a9b79;
    border-color: #4a9b79;
  }
  80%, 100% {
    color: #7ab88a;
    border-color: #7ab88a;
  }
}

@keyframes sleep-color-to-night {
  0%, 12% {
    color: #7ab88a;
    border-color: #7ab88a;
  }
  45% {
    color: #4a9b79;
    border-color: #4a9b79;
  }
  80%, 100% {
    color: #248a9e;
    border-color: #248a9e;
  }
}

@keyframes sleep-text-pulse {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  35%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.hidden {
  display: none !important;
}

.save-container {
  width: 100%;
  max-width: 700px;
  background-color: var(--bg-dark);
  border: 4px solid var(--teal-main);
  padding: 30px;
  display: flex;
  flex-direction: column;
}

#save-menu {
  padding: 16px;
}

#save-menu .save-container {
  width: min(100%, 700px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.save-slots-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 40px;
}

.save-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 4px solid var(--teal-light);
  padding: 15px 20px;
  background-color: #010608;
  font-size: 1.1rem;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.25s ease;
}

.save-slot-row.is-latest {
  border-color: #8df5d0;
  box-shadow:
    0 0 12px rgba(75, 235, 188, 0.32),
    inset 0 0 18px rgba(75, 235, 188, 0.08);
}

.save-slot-row.is-saving {
  animation: save-slot-confirm 850ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.save-slot-row .slot-name {
  flex: 0 0 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  color: var(--text-main);
}

.save-slot-row .slot-date {
  flex: 1;
  text-align: center;
  color: inherit;
}

.latest-save-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #8df5d0;
  color: #baffdf;
  background: rgba(27, 111, 87, 0.3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.save-load-confirm-container {
  gap: 18px;
  text-align: center;
}

.save-load-confirm-container h2,
.save-load-confirm-container p {
  margin: 0;
}

.save-load-confirm-container h2 {
  color: var(--teal-light);
}

.save-load-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.save-load-confirm-actions button {
  min-width: 150px;
  padding: 12px 18px;
}

.save-slot-actions {
  display: flex;
  gap: 10px;
}

.save-slot-actions button {
  border: 3px solid var(--teal-light);
  padding: 8px 15px;
  font-size: 0.95rem;
  background-color: var(--bg-dark);
}

.save-bottom-actions {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 20px;
}

.save-bottom-actions button,
.save-bottom-actions label {
  flex: 1;
  border: 4px solid var(--teal-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  padding: 20px;
  font-size: 1.1rem;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.save-bottom-actions button:hover,
.save-bottom-actions label:hover {
  background-color: var(--teal-light);
  color: #000;
}

.close-menu-btn {
  align-self: center;
  padding: 10px 40px;
}

.btn-wide {
  width: 200px;
}

#save-status-msg {
  color: var(--teal-light);
  text-align: center;
  margin-top: 15px;
  min-height: 20px;
}

#save-status-msg.save-status-success {
  color: #baffdf;
  text-shadow: 0 0 12px rgba(75, 235, 188, 0.7);
  animation: save-status-confirm 450ms ease-out both;
}

@keyframes save-slot-confirm {
  0% {
    transform: scale(0.97);
    background-color: rgba(75, 235, 188, 0.24);
    box-shadow: 0 0 28px rgba(75, 235, 188, 0.65);
  }
  65% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes save-status-confirm {
  0% {
    opacity: 0.4;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#end-message {
  margin-bottom: 20px;
}

@keyframes consumeItemFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1.5);
  }
}

@keyframes consumeLabelFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1.2);
  }
}

#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background-color: #000;
  border-radius: inherit;
  overflow: hidden;
}

.start-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.3);
  z-index: 1;
  animation:
    camera-pan 25s infinite alternate ease-in-out,
    glitch-flicker 6s infinite;
}

.carousel-left,
.carousel-right {
  position: absolute;
  top: 0;
  width: 12vw;
  max-width: 150px;
  height: 100%;
  overflow: hidden;
  z-index: 2;
  display: flex;
  justify-content: center;
}

.carousel-left {
  left: 3vw;
}

.carousel-right {
  right: 3vw;
}

.carousel-track {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.carousel-track img {
  width: 100%;
  aspect-ratio: 1.8 / 1;
  object-fit: cover;
  margin-bottom: 15vh;
  border: 2px solid #c2d6d9;
  filter: grayscale(100%) sepia(0.2) hue-rotate(120deg) saturate(0.2)
    brightness(0.7) contrast(1.8);
  image-rendering: pixelated;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
  display: block;
}

.track-down {
  animation: step-scroll-down 24s infinite;
}

.track-up {
  animation: step-scroll-up 24s infinite;
}

.start-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    transparent 35%,
    rgba(0, 0, 0, 0.4) 75%,
    #000 98%
  );
  z-index: 3;
  pointer-events: none;
}

.start-vignette::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
}

.start-content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.main-title-img {
  width: 55vw;
  max-width: 400px;
  max-height: 32vh;
  object-fit: contain;
  margin-bottom: clamp(16px, 4vh, 40px);
  filter: drop-shadow(0px 0px 15px rgba(0, 0, 0, 0.9));
  animation: float-title 4s infinite ease-in-out;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 15px);
  width: 240px;
}

.menu-buttons button {
  background: transparent;
  border: 2px solid #ffffff;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 1.25rem;
  padding: 14px 18px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  box-shadow: none;
  transition:
    transform 0.2s ease-in-out,
    background 0.2s ease-in-out,
    color 0.2s;
}

.menu-buttons button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #a3c9b6;
  color: #a3c9b6;
  transform: scale(1.05);
}

.side-logo-link {
  position: absolute;
  right: clamp(10px, 3vw, 30px);
  bottom: clamp(10px, 3vh, 30px);
  width: 80px;
  height: 80px;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
  overflow: hidden;
}

.side-logo-link:hover {
  transform: scale(1.1);
  border-color: #a3c9b6;
}

.side-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  color: #fff;
  font-size: 0.8rem;
  font-family: "Courier New", Courier, monospace;
}

@keyframes camera-pan {
  0% {
    transform: scale(1.02) translate(0, 0);
  }
  100% {
    transform: scale(1.12) translate(-1%, 1%);
  }
}

@keyframes glitch-flicker {
  0%,
  91%,
  95%,
  100% {
    opacity: 1;
    filter: brightness(1.3);
  }
  92% {
    opacity: 0.8;
    filter: brightness(1.7) contrast(1.2);
  }
  94% {
    opacity: 0.6;
    filter: brightness(0.5);
  }
  96% {
    opacity: 0.9;
    filter: brightness(1.3);
  }
}

@keyframes float-title {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes step-scroll-up {
  0%,
  12% {
    transform: translateY(0);
  }
  16.66%,
  28.66% {
    transform: translateY(-8.333%);
  }
  33.33%,
  45.33% {
    transform: translateY(-16.666%);
  }
  50%,
  62% {
    transform: translateY(-25%);
  }
  66.66%,
  78.66% {
    transform: translateY(-33.333%);
  }
  83.33%,
  95.33% {
    transform: translateY(-41.666%);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes step-scroll-down {
  0%,
  12% {
    transform: translateY(-50%);
  }
  16.66%,
  28.66% {
    transform: translateY(-41.666%);
  }
  33.33%,
  45.33% {
    transform: translateY(-33.333%);
  }
  50%,
  62% {
    transform: translateY(-25%);
  }
  66.66%,
  78.66% {
    transform: translateY(-16.666%);
  }
  83.33%,
  95.33% {
    transform: translateY(-8.333%);
  }
  100% {
    transform: translateY(0);
  }
}

.achievements-container {
  width: 95%;
  max-width: 800px;
  height: 85vh;
  background-color: #0b1c18;
  border: 2px solid #204539;
  padding: 30px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
}

.achievements-header {
  font-family: "Courier New", Courier, monospace;
  font-size: 2rem;
  color: #fff;
  text-align: left;
  border-bottom: 2px solid #204539;
  padding-bottom: 15px;
  margin-bottom: 10px;
}

.achievements-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding-right: 15px;
}

.achievements-list::-webkit-scrollbar {
  width: 8px;
}

.achievements-list::-webkit-scrollbar-track {
  background: #06110f;
}

.achievements-list::-webkit-scrollbar-thumb {
  background: #204539;
  border-radius: 4px;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 25px 10px;
  border-bottom: 1px solid #1a332a;
}

.achievement-item:last-child {
  border-bottom: none;
}

.achievement-item.exclusive-achievement {
  border: 2px solid #f2c94c;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.achievement-item.exclusive-achievement:hover,
.achievement-item.exclusive-achievement:focus-visible {
  background-color: rgba(242, 201, 76, 0.08);
  box-shadow: 0 0 12px rgba(242, 201, 76, 0.3);
  outline: none;
}

.achievement-exclusive-label {
  color: #f2c94c;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.prophet-dig-button {
  background: linear-gradient(
    to right,
    #2b775e 0,
    #2b775e var(--dig-progress),
    #10231c var(--dig-progress),
    #10231c 100%
  );
  border: 1px solid #78c6a7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.prophet-dig-button span {
  font-weight: 700;
}

.achievement-icon {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  background-color: #06110f;
  border: 2px solid #4a8270;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.achievement-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achievement-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.achievement-title {
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: #ffffff;
  text-transform: uppercase;
}

.achievement-desc {
  font-family: Arial, sans-serif;
  font-size: 1rem;
  color: #c7d6d1;
  line-height: 1.4;
}

.achievement-toast {
  position: fixed;
  top: 20px;
  right: -400px;
  width: 320px;
  max-width: calc(100vw - 24px);
  background-color: #0b1c18;
  border: 2px solid #204539;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
  z-index: 999999;
  transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.achievement-toast.show {
  right: 20px;
}

.toast-icon {
  width: 55px;
  height: 55px;
  background-color: #06110f;
  border: 1px solid #4a8270;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.toast-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-label {
  font-family: Arial, sans-serif;
  font-size: 0.7rem;
  color: #4a8270;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toast-title {
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
}

/* A locked achievement is dimmed, but its Details button stays usable. */
.achievement-item.locked > .achievement-icon,
.achievement-item.locked .achievement-title,
.achievement-item.locked .achievement-desc,
.achievement-item.locked .achievement-exclusive-label {
  opacity: 0.35;
  filter: grayscale(100%);
}
.achievement-item.exclusive-achievement:not(.links-to-patreon) {
  cursor: default;
}
.achievement-details-button {
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 0.85rem;
}
.achievement-details-button.open {
  border-color: var(--guide-warning, #ffd36a);
  color: var(--guide-warning, #ffd36a);
}
.achievement-details {
  margin: 4px 0 0;
  padding-left: 20px;
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #e0ece8;
}
.achievement-details li,
.achievement-details li * {
  font-family: Arial, sans-serif !important;
}
.achievement-details li + li {
  margin-top: 4px;
}
.achievement-details .tutorial-text {
  color: #ffd36a;
  font-weight: bold;
}
.achievement-details[hidden] {
  display: none;
}

.achievement-icon.locked-icon {
  background-color: #030807;
  border-color: #1a332a;
}

.locked-question-mark {
  font-family: "Courier New", Courier, monospace;
  font-size: 2.5rem;
  color: #204539;
  font-weight: bold;
}

#disclaimer-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #05080a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  padding: clamp(10px, 3vh, 24px) clamp(10px, 3vw, 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: "Courier New", Courier, monospace;
}

#language-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #05080a;
  font-family: "Courier New", Courier, monospace;
}

.language-box {
  width: min(100%, 480px);
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid #4a8f6f;
  background: #010608;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
  text-align: center;
}

.language-box h2 {
  margin-bottom: 16px;
  color: #d4af37;
  font-family: Georgia, serif;
}

.language-box p {
  margin-bottom: 22px;
  color: #ccc;
  line-height: 1.5;
}

.language-box label {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  text-align: left;
}

.language-box select {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #4a8f6f;
  background: #071114;
  color: #fff;
  font: inherit;
}

.language-box button {
  width: 100%;
}

#language-error {
  min-height: 1.5em;
  margin: 0 0 16px;
  color: #ff8e8e;
}

.language-picker {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
  text-align: left;
}

.language-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--teal-main);
  background: #071114;
  color: var(--text-main);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}

.language-picker-trigger::after {
  content: "\25be";
  margin-left: auto;
  color: var(--teal-light);
}

.language-picker-options {
  position: absolute;
  z-index: 100000;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--teal-main) #071114;
  border: 1px solid var(--teal-main);
  background: #071114;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
}

.language-picker-options[hidden] {
  display: none;
}

.language-picker-options::-webkit-scrollbar {
  width: 10px;
}

.language-picker-options::-webkit-scrollbar-track {
  background: #071114;
}

.language-picker-options::-webkit-scrollbar-thumb {
  background: var(--teal-main);
}

.language-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--text-main, #fff);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.language-picker-option:hover,
.language-picker-option:focus-visible,
.language-picker-option[aria-selected="true"] {
  background: rgba(70, 150, 112, 0.35);
  outline: none;
}

.language-recommended-badge {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--teal-light);
  color: var(--teal-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.language-picker-flag {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}

.settings-language-picker {
  margin-bottom: 0;
}

.settings-panel {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

.settings-section {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--teal-main);
  background: #010608;
}

.settings-section-title {
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
}

.settings-volume-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--teal-light);
  cursor: pointer;
}

.settings-audio-categories {
  display: grid;
  gap: 10px;
}

.settings-audio-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-align: left;
}

.settings-audio-row output {
  color: var(--teal-light);
  font-size: 0.9rem;
  text-align: right;
}

.settings-mute-button {
  min-width: 100px;
}

.settings-language-label {
  align-self: stretch;
  color: var(--text-main);
  font-weight: bold;
  text-align: left;
}

.settings-language-error {
  min-height: 1.2em;
  margin: -8px 0 0;
  color: #ff8e8e;
}

.disclaimer-box {
  border: 1px solid #4a8f6f;
  background-color: #010608;
  max-width: 800px;
  max-height: calc(100vh - 2 * clamp(10px, 3vh, 24px));
  max-height: calc(100dvh - 2 * clamp(10px, 3vh, 24px));
  width: 100%;
  padding: clamp(16px, 4vw, 40px);
  margin-block: auto;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
  text-align: left;
}

.disclaimer-title {
  flex: 0 0 auto;
  color: #d4af37;
  text-align: center;
  margin-bottom: clamp(14px, 3vh, 30px);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-family: Georgia, serif;
  letter-spacing: 1px;
}

.disclaimer-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: clamp(14px, 3vh, 30px);
}

.disclaimer-heading {
  color: #fff;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 5px;
}

.disclaimer-text {
  margin-top: 0;
  margin-bottom: 15px;
}

.disclaimer-last-text {
  margin-bottom: 0;
}

#disclaimer-error {
  color: #888;
  text-align: center;
  margin-bottom: 20px;
  min-height: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.9rem;
}

.disclaimer-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-confirm-age,
.btn-reject-age {
  flex: 1;
  min-width: 250px;
  padding: 12px;
  background: transparent;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-confirm-age {
  color: #fff;
  border: 1px solid #4a8f6f;
}

.btn-confirm-age:hover {
  background-color: #4a8f6f;
  color: #000;
}

.btn-reject-age {
  color: #555;
  border: 1px solid #333;
}

.btn-reject-age:hover {
  border-color: #777;
  color: #aaa;
}

#end-screen:has(.thanks-panel:not(.hidden)) {
  overflow: hidden;
  padding: clamp(4px, 1.5vh, 16px);
}

#end-screen .thanks-panel {
  width: min(100%, 1000px);
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  justify-content: space-between;
  gap: clamp(3px, 1.1vh, 12px);
  padding: clamp(5px, 1.5vh, 16px) clamp(8px, 2vw, 20px);
}

#end-screen .thanks-panel h1 {
  flex: 0 0 auto;
  font-size: clamp(1.1rem, 4vh, 2.5rem);
  line-height: 1.05;
}

#end-screen .thanks-image {
  flex: 0 1 auto;
  width: min(55vw, 460px);
  height: min(22vh, 190px);
  max-height: min(22vh, 190px);
}

#end-screen .thanks-message {
  flex: 0 0 auto;
  font-size: clamp(0.72rem, 1.8vh, 1.05rem);
  line-height: 1.25;
}

#end-screen .thanks-credits {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#end-screen .thanks-credits > h2 {
  flex: 0 0 auto;
  margin: 0 0 clamp(2px, 0.6vh, 8px);
  font-size: clamp(0.8rem, 2.2vh, 1.25rem);
}

#end-screen .thanks-tiers {
  flex: 1 1 0;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(3px, 1vw, 10px);
}

#end-screen .thanks-tier {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(3px, 0.8vh, 9px);
  font-size: clamp(0.6rem, 1.4vh, 0.85rem);
}

#end-screen .thanks-tier h3 {
  margin-bottom: 3px;
  font-size: clamp(0.65rem, 1.6vh, 0.9rem);
}

#end-screen .thanks-credits-viewport {
  width: 100%;
  min-width: 0;
  height: 0;
  min-height: 0;
  flex: 1 1 0;
  overflow: hidden;
}

#end-screen .thanks-credits-track,
#end-screen .thanks-credits-list {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#end-screen .thanks-credits-list {
  gap: clamp(2px, 0.4vh, 5px);
  line-height: 1.1;
}

#end-screen .thanks-credits-list li {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

#end-screen .thanks-patreon-btn,
#end-screen #thanks-continue-btn {
  flex: 0 0 auto;
  min-height: clamp(30px, 5vh, 42px);
  padding: 5px 16px;
  font-size: clamp(0.72rem, 1.7vh, 0.95rem);
}

#end-screen .thanks-logo-link {
  position: absolute;
  width: clamp(30px, 5vh, 54px);
  right: clamp(6px, 1.5vw, 16px);
  top: clamp(6px, 1.5vh, 16px);
  bottom: auto;
}

.achievement-item.locked.exclusive-achievement {
  opacity: 1;
  filter: none;
  pointer-events: auto;
  border-color: #f2c94c;
}

.achievement-item.locked.exclusive-achievement .achievement-icon {
  border-color: #f2c94c;
}

#room-display {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#test-overlay #test-gif-img {
  flex: 0 1 min(58vh, 520px);
  height: auto;
  min-height: 90px;
  max-height: min(58vh, 520px);
}

#test-overlay > h1,
#test-overlay > p,
#test-overlay > button {
  flex-shrink: 0;
}

/* =========================================================
   Menus and overlays (classes that replace inline styles)
   ========================================================= */
.header-logo {
  display: flex;
  align-items: center;
  margin-right: 15px;
}
.header-logo img {
  height: 35px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.menu-panel {
  text-align: center;
}
.menu-panel h2 {
  margin-bottom: 20px;
  color: var(--teal-light);
}
.menu-button-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.contact-panel {
  max-width: 600px;
}
.contact-email {
  color: var(--teal-light);
  font-weight: bold;
}
.settings-container {
  max-width: 450px;
}
.settings-container .close-menu-btn,
.achievements-container .close-menu-btn {
  margin-top: 20px;
}
.tv-close-button {
  position: relative;
  z-index: 1000;
  margin-top: 20px;
}
.tv-caption.tv-caption-visitor {
  color: #ff4444;
}
.fridge-panel h2 {
  margin-bottom: 15px;
}
.action-buttons {
  display: grid;
  gap: 10px;
}

/* Overlay stacking order, lowest first. */
#telephone-overlay,
#fridge-overlay {
  z-index: 2000;
  background-color: rgba(0, 0, 0, 0.95);
}
.guide-overlay {
  z-index: 2500;
}
#window-overlay {
  z-index: 2600;
}
#main-menu-overlay {
  z-index: 3000;
}
#settings-menu,
#achievements-menu {
  z-index: 20000;
  background-color: rgba(0, 0, 0, 0.95);
}
#save-menu {
  z-index: 99999;
}
#contact-menu {
  z-index: 100000;
}
.save-load-confirm-overlay {
  z-index: 100001;
}

/* People taken away from the house, drawn behind the visitor at the door. */
#peephole-victims-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
/* More specific than ".focused-image-box img", which would stretch them to full size. */
.peephole-lens .peephole-victim {
  position: absolute;
  top: auto;
  bottom: 0;
  height: 62%;
  width: 34%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  opacity: 0.5;
  filter: grayscale(50%) blur(1px);
}

/* =========================================================
   Guide
   ========================================================= */
.guide-overlay {
  justify-content: flex-start;
  overflow-y: auto;
  padding: 16px;
}
.guide-frame {
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-frame > .btn-wide {
  flex: 0 0 auto;
  align-self: center;
  width: 100%;
}
.guide {
  --guide-panel: #0d1d21;
  --guide-panel-light: #132a30;
  --guide-line: #248a9e;
  --guide-muted: #a9c4c9;
  --guide-warning: #ffd36a;
  --guide-danger: #ff7777;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  width: 100%;
  padding: 28px 20px 44px;
  background: radial-gradient(circle at top, #12343b, #071013 55%);
  color: var(--text-main);
  line-height: 1.55;
  text-align: left;
}
#guide-overlay .guide header {
  display: block;
  margin-bottom: 22px;
  padding: 24px;
  border: 2px solid var(--guide-line);
  background: rgba(7, 16, 19, 0.88);
  box-shadow: 0 0 24px rgba(36, 138, 158, 0.18);
}
.guide h1,
.guide h2,
.guide h3 {
  color: var(--guide-warning);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.guide h1 {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}
.guide h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--guide-line);
  font-size: 1.05rem;
}
.guide h3 {
  margin: 16px 0 4px;
  color: var(--text-main);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
/* "Rules" / "Endings" tabs at the top of the guide: both use the game's
   button look; the open tab is outlined in yellow. */
.guide-tabs {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.guide-tab-button {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 10px 22px;
}
.guide-tab-button.active,
.guide-tab-button.active:hover:not(:disabled) {
  background-color: var(--teal-main);
  border-color: var(--guide-warning);
  color: var(--guide-warning);
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.25);
}
#guide-overlay .guide header {
  position: relative;
}
.guide-close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.1rem;
}
/* Sections built by renderGuide() sit directly in the grid. */
.guide-dynamic {
  display: contents;
}
.guide li .tutorial-text {
  color: var(--guide-warning);
  font-weight: bold;
}
.guide li.tip .tutorial-text,
.guide li.warning .tutorial-text {
  color: #fff;
}
/* Star shown beside a members-only title when the exclusive files are installed. */
.guide-exclusive-tag {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--guide-warning);
  opacity: 0.85;
}
/* Members-only ending: blurred, opens the Patreon page on click. */
.guide section.guide-locked {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.guide section.guide-locked > ol {
  filter: blur(6px);
  user-select: none;
}
.guide-locked-badge {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border: 1px solid var(--guide-warning);
  background: rgba(7, 16, 19, 0.92);
  color: var(--guide-warning);
  font-weight: bold;
  white-space: nowrap;
}
.guide section.guide-locked:hover .guide-locked-badge {
  background: var(--guide-warning);
  color: #000;
}
.guide-grid[hidden] {
  display: none;
}
.guide ol {
  margin-top: 8px;
  padding-left: 22px;
}
.guide section {
  padding: 18px;
  border: 1px solid var(--guide-line);
  background: linear-gradient(145deg, var(--guide-panel-light), var(--guide-panel));
}
.guide section.wide {
  grid-column: 1 / -1;
}
.guide p,
.guide ul {
  margin-top: 8px;
}
.guide ul {
  padding-left: 20px;
}
.guide li + li {
  margin-top: 7px;
}
.guide .warning {
  color: var(--guide-danger);
  font-weight: bold;
}
.guide .tip {
  color: var(--guide-warning);
}
.guide .patreon {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 20px;
  align-items: center;
}
.guide .patreon-logo {
  width: 100%;
  max-width: 180px;
  justify-self: center;
}
.guide .patreon a {
  color: var(--guide-warning);
  font-weight: bold;
}

/* =========================================================
   Responsive layout
   Four breakpoints only:
     height <= 800px  short screens (laptops): tighter spacing
     width  <= 760px  phones / narrow windows: one column
     width  <= 420px  very small phones
     height <= 500px  phones in landscape: side by side again
   Later blocks win, so phones in landscape get the last block.
   ========================================================= */
@media (max-height: 800px) {
  #game-container {
    height: calc(100dvh - 16px);
  }
  header {
    padding: 6px 12px;
    gap: 8px;
  }
  .header-logo {
    margin-right: 6px;
  }
  .header-logo img {
    height: 28px;
  }
  .header-stats {
    gap: 6px;
  }
  .header-chip,
  #room-display,
  .energy-bar {
    padding: 5px 8px;
  }
  .time-indicator {
    width: 40px;
    height: 40px;
  }
  .time-indicator .action-icon {
    width: 26px;
    height: 26px;
  }
  .view-panel {
    padding: 10px;
  }
  .controls-panel {
    padding: 10px;
    gap: 10px;
  }
  .control-group {
    gap: 6px;
  }
  .icon-grid {
    gap: 8px;
  }
  .nav-room-btn {
    flex-basis: 84px;
    width: 84px;
    height: 58px;
  }
  .controls-panel .action-buttons {
    gap: 6px;
  }
  .controls-panel .icon-btn.rounded {
    width: 58px;
    height: 58px;
  }
  .controls-panel button:not(.icon-btn) {
    padding: 8px 10px;
  }

  .overlay {
    padding: 16px;
  }
  .overlay h1 {
    font-size: clamp(1.3rem, 5vh, 2.5rem);
    margin-bottom: 10px;
  }
  .overlay p {
    margin-bottom: 14px;
  }
  #test-overlay #test-gif-img {
    margin-bottom: 10px;
    border-width: 2px;
  }
  #test-overlay > p {
    font-size: 1rem;
  }

  #save-menu .save-container {
    padding: 14px;
  }
  .save-slots-wrapper {
    gap: 8px;
    margin-bottom: 12px;
  }
  .save-slot-row {
    padding: 8px 12px;
    border-width: 3px;
    font-size: 1rem;
  }
  .save-slot-actions button {
    padding: 6px 12px;
  }
  .save-bottom-actions {
    gap: 12px;
    margin-bottom: 12px;
  }
  .save-bottom-actions button,
  .save-bottom-actions label {
    padding: 10px 8px;
    font-size: 0.95rem;
    border-width: 3px;
  }
  .close-menu-btn {
    padding: 8px 30px;
  }
  #save-status-msg {
    margin-top: 8px;
  }

  #achievements-menu {
    padding: 10px;
  }
  .achievements-container {
    height: 100%;
    padding: 14px 18px;
  }
  .achievements-header {
    font-size: 1.3rem;
    padding-bottom: 8px;
  }
  .achievement-item {
    gap: 14px;
    padding: 10px 6px;
  }
  .achievement-icon {
    width: 60px;
    height: 60px;
  }
  .achievements-container .close-menu-btn {
    margin-top: 10px;
  }

  #end-screen {
    padding: 8px 14px;
  }
  #end-screen .ending-panel {
    gap: 8px;
  }
  #end-screen .ending-panel h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3.2vw, 2rem);
  }
  #end-screen .ending-stage {
    width: min(52vw, 430px);
    min-height: 0;
    height: min(43vh, 300px);
    padding: 6px;
  }
  #end-screen .ending-stage img {
    height: 100%;
  }
  #end-screen .ending-current-text {
    min-height: 42px;
    font-size: 0.88rem;
    line-height: 1.25;
  }
  #end-screen .ending-panel button {
    min-height: 34px;
    padding: 6px 16px;
  }

  #disclaimer-screen {
    padding-block: 8px;
  }
  .disclaimer-box {
    padding-block: 14px;
  }
  .disclaimer-title,
  .disclaimer-content {
    margin-bottom: 12px;
  }
  .disclaimer-text {
    margin-bottom: 8px;
  }
  #disclaimer-error {
    margin-bottom: 10px;
  }
}

@media (max-width: 760px) {
  header {
    padding: 8px 10px;
  }
  .header-stats {
    flex: 1 1 auto;
  }
  .header-chip,
  #room-display,
  .energy-bar {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
  header button.small-btn {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  /* Main screen: picture on top, controls below. */
  #main-screen {
    min-height: 0;
    flex-direction: column;
  }
  #main-screen .view-panel {
    flex: 1 1 42%;
    min-height: 0;
    padding: 8px;
    border-right: 0;
    border-bottom: 2px solid var(--teal-main);
  }
  #main-screen .controls-panel {
    flex: 1 1 58%;
    min-width: 0;
    min-height: 0;
    padding: 10px;
    gap: 14px;
  }
  #controls .control-group {
    min-width: 0;
    gap: 8px;
  }
  #controls .icon-grid {
    gap: 6px;
  }
  #controls .control-group:first-child .icon-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }
  #controls .nav-room-btn {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 10 / 7;
    padding: 2px;
  }
  #controls .nav-room-btn .room-marker,
  #controls .nav-room-btn .presence-marker,
  #controls .nav-room-btn .door-marker {
    width: clamp(15px, 5vw, 22px);
    height: clamp(15px, 5vw, 22px);
    bottom: 1px;
  }
  #controls .nav-room-btn .presence-marker {
    right: clamp(18px, 6vw, 26px);
  }
  #controls .nav-room-btn .presence-marker span {
    font-size: clamp(0.55rem, 2.5vw, 0.7rem);
  }
  #controls .action-buttons button {
    min-width: 0;
    padding: 10px;
    font-size: 0.9rem;
  }
  #controls .icon-btn.rounded {
    width: 48px;
    height: 48px;
  }

  /* Door and guest screens: one column. */
  .focused-screen {
    padding: 12px;
    gap: 12px;
  }
  #peephole-screen,
  #guest-screen {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(280px, 1fr) auto auto;
    gap: 12px;
    padding: 0;
  }
  .guest-scene,
  .peephole-lens {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-height: 0;
  }
  .peephole-lens > #peephole-character,
  .guest-scene > #guest-img {
    width: 100%;
    height: 100%;
    left: 50%;
  }
  #peephole-dialogue,
  #peephole-controls,
  #guest-screen > #guest-status,
  #guest-screen > #guest-controls {
    grid-column: 1;
    width: calc(100% - 24px);
    margin: 0 12px;
    justify-self: stretch;
  }
  #peephole-dialogue,
  #guest-screen > #guest-status {
    grid-row: 2;
    align-self: end;
  }
  #peephole-controls,
  #guest-screen > #guest-controls {
    grid-row: 3;
  }
  .focused-options-grid button {
    min-height: 58px;
    padding: 10px;
  }

  /* Overlays and menus. */
  .overlay h1 {
    font-size: clamp(1.4rem, 7vw, 2.5rem);
  }
  .overlay p {
    font-size: 1rem;
  }
  .save-container {
    padding: 18px;
  }
  .save-slot-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 10px;
  }
  .save-slot-row .slot-name {
    grid-column: 1;
    grid-row: 1;
    flex: 0 0 auto;
    gap: 2px;
  }
  .save-slot-row .slot-date {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-size: 0.85rem;
  }
  .save-slot-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .save-slot-actions button {
    flex: 1;
    padding: 8px;
  }
  .latest-save-badge {
    padding: 2px 5px;
    font-size: 0.6rem;
  }
  .save-bottom-actions {
    gap: 10px;
  }
  .save-load-confirm-actions {
    flex-direction: column-reverse;
  }

  .achievement-toast {
    top: 12px;
  }
  .achievement-toast.show {
    right: 12px;
  }
  .achievements-container {
    width: 100%;
    height: min(85vh, calc(100dvh - 32px));
    padding: 16px;
  }
  .achievements-header {
    font-size: 1.4rem;
  }
  .achievements-list {
    padding-right: 6px;
  }
  .achievement-item {
    gap: 14px;
    padding: 14px 6px;
  }
  .achievement-icon {
    width: 64px;
    height: 64px;
  }
  .achievement-title {
    font-size: 1rem;
  }
  .achievement-desc {
    font-size: 0.9rem;
  }

  .language-picker-trigger {
    position: relative;
    flex-wrap: wrap;
    padding-right: 36px;
  }
  .language-picker-trigger::after {
    position: absolute;
    top: 50%;
    right: 12px;
    margin-left: 0;
    transform: translateY(-50%);
  }
  .language-picker-option {
    flex-wrap: wrap;
  }
  .language-recommended-badge {
    margin-left: 34px;
  }
  .settings-panel {
    gap: 12px;
  }
  .settings-section {
    padding: 12px;
  }
  .settings-mute-button {
    width: 100%;
  }

  .disclaimer-box {
    padding: 18px 16px;
  }
  .disclaimer-title {
    font-size: clamp(1.05rem, 5vw, 1.35rem);
    line-height: 1.25;
    letter-spacing: 0.5px;
  }
  .disclaimer-content {
    font-size: 0.82rem;
    line-height: 1.45;
  }
  .disclaimer-heading {
    font-size: 0.92rem;
  }
  .disclaimer-text {
    margin-bottom: 10px;
  }
  .disclaimer-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .btn-confirm-age,
  .btn-reject-age {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    padding: 12px 8px;
    font-size: 0.8rem;
  }

  /* Title screen: no side carousels, logo centered at the bottom. */
  .carousel-left,
  .carousel-right {
    display: none;
  }
  .start-content {
    padding-bottom: 90px;
  }
  .side-logo-link {
    left: 0;
    right: 0;
    bottom: 20px;
    width: 64px;
    height: 64px;
    margin-inline: auto;
  }

  /* Endings: the image shrinks so NEXT always fits. */
  #end-screen {
    padding: 12px;
  }
  #end-screen .ending-panel {
    gap: 10px;
  }
  #end-screen .ending-panel h1 {
    font-size: clamp(1.3rem, 6vw, 2rem);
  }
  #end-screen .ending-stage {
    width: min(88vw, 560px);
    height: auto;
  }
  #end-screen .ending-stage img {
    height: max(140px, min(62vh, 440px, calc(100dvh - 330px)));
  }
  #end-screen .ending-current-text {
    min-height: 0;
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .guide-grid,
  .guide .patreon {
    grid-template-columns: 1fr;
  }
  .guide section.wide {
    grid-column: auto;
  }
  .guide .patreon {
    text-align: center;
  }
}

@media (max-width: 420px) {
  .header-logo {
    display: none;
  }
  .time-indicator {
    width: 36px;
    height: 36px;
  }
  .time-indicator .action-icon {
    width: 22px;
    height: 22px;
  }
  #end-screen .thanks-logo-link {
    display: none;
  }
  #end-screen .thanks-patreon-btn,
  #end-screen #thanks-continue-btn {
    min-height: 30px;
    padding: 4px 12px;
  }
}

@media (max-height: 500px) {
  header {
    padding-block: 4px;
  }
  .time-indicator {
    width: 32px;
    height: 32px;
  }
  .time-indicator .action-icon {
    width: 20px;
    height: 20px;
  }

  /* Main screen: picture and controls side by side. */
  #main-screen {
    flex-direction: row;
  }
  #main-screen .view-panel {
    flex: 1.3 1 0;
    min-width: 0;
    padding: 6px;
    border-right: 2px solid var(--teal-main);
    border-bottom: 0;
  }
  #main-screen .controls-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 8px;
    gap: 8px;
  }
  #controls .control-group {
    gap: 5px;
  }
  #controls .control-group h3 {
    font-size: 0.75rem;
    padding-bottom: 2px;
  }
  #controls .control-group:first-child .icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 5px;
  }
  #controls .nav-room-btn {
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 10 / 7;
    padding: 2px;
  }
  #controls .action-buttons {
    gap: 5px;
  }
  #controls .action-buttons button {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  #controls .icon-btn.rounded {
    width: 42px;
    height: 42px;
  }

  /* Door and guest screens: picture left, dialogue right. */
  #peephole-screen,
  #guest-screen {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr);
    grid-template-rows: auto auto 1fr;
    gap: 8px 16px;
    padding: 0 3%;
  }
  .guest-scene,
  .peephole-lens {
    position: absolute;
    inset: 0;
  }
  .peephole-lens > #peephole-character,
  .guest-scene > #guest-img {
    width: 80%;
    height: 96%;
    left: 25%;
  }
  #peephole-dialogue,
  #guest-screen > #guest-status,
  #peephole-controls,
  #guest-screen > #guest-controls {
    grid-column: 2;
    width: min(92%, 520px);
    margin: 0;
    justify-self: center;
  }
  #peephole-dialogue,
  #guest-screen > #guest-status {
    grid-row: 1;
    align-self: start;
    margin-top: 4%;
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  #peephole-controls,
  #guest-screen > #guest-controls {
    grid-row: 2;
  }
  .focused-options-grid {
    gap: 8px;
  }
  .focused-options-grid button {
    min-height: 40px;
    padding: 6px;
  }

  /* Menus: two columns so everything fits without scrolling. */
  .menu-button-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .menu-button-list button {
    padding: 10px;
  }
  .menu-panel h2 {
    margin-bottom: 10px;
    font-size: 1.2rem;
  }
  #main-menu-overlay .save-container,
  #settings-menu .save-container,
  #contact-menu .save-container {
    padding: 12px 16px;
  }
  #settings-menu .save-container {
    max-width: 760px;
  }
  #settings-menu .settings-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
  }
  #settings-menu .settings-section {
    padding: 10px;
    gap: 8px;
  }
  #settings-menu .settings-audio-categories {
    gap: 4px;
  }
  #settings-menu .close-menu-btn {
    margin-top: 12px;
  }
  #settings-menu .language-picker-options {
    max-height: 150px;
  }

  /* Save menu: one line per save. */
  #save-menu {
    padding: 8px;
  }
  #save-menu .save-container {
    padding: 10px 14px;
    max-height: 100%;
  }
  .save-slot-row {
    display: flex;
    padding: 5px 10px;
  }
  .save-slot-row .slot-date {
    text-align: center;
  }
  .save-slots-wrapper {
    gap: 5px;
    margin-bottom: 8px;
  }
  .save-slot-actions button {
    padding: 4px 10px;
  }
  .save-bottom-actions {
    gap: 10px;
    margin-bottom: 8px;
  }
  .save-bottom-actions button,
  .save-bottom-actions label {
    padding: 6px 8px;
  }
  #save-status-msg:empty {
    display: none;
  }
}

/* Touch screens keep :hover after a tap; the zoom effects only make sense with a mouse. */
@media (hover: none) {
  .menu-buttons button:hover,
  .side-logo-link:hover {
    transform: none;
  }
}

/* Reduced motion: only the decorative looping animations are softened. */
@media (prefers-reduced-motion: reduce) {
  .start-bg-img,
  .main-title-img,
  .carousel-track,
  .thanks-credits-track,
  .tv-alert-btn,
  button.pale-girl-danger-choice,
  .save-slot-row,
  #save-status-msg.save-status-success {
    animation: none;
  }
  .carousel-track.track-down {
    transform: translateY(-25%);
  }
  .thanks-credits-viewport,
  #end-screen .thanks-credits-viewport {
    overflow-y: auto;
  }
  .thanks-credits-list[aria-hidden="true"] {
    display: none;
  }
  #game-container.decision-heartbeat::after {
    animation-duration: 3s;
  }
  #game-container.mushroom-trip::after {
    animation: none;
    opacity: 0.6;
  }
}
