html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #1c1125; /* deep plum */
  color: #fefefe;
  font-family: 'Fira Mono', 'Consolas', 'Menlo', monospace;
  letter-spacing: 0.03em;
  overflow: hidden;
}
button {
  touch-action: manipulation;
}
#console {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 2em 1.5em 5em 1.5em;
  box-sizing: border-box;
  background: #1c1125;
  font-size: 1.1em;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.cli-output {
  margin: 0.4em 0;
  white-space: pre-wrap;
  line-height: 1.6;
  color: #fdfdfd;
}

.cli-input {
  color: #ffb3ff;
  font-weight: bold;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
  margin: 1.5em 0 0.3em 0;
  justify-content: flex-start;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.choices button {
  background: #d240a6;
  color: #fff;
  border: none;
  border-radius: 5px;
  border: 2px solid #d240a6;
  font-size: 1em;
  padding: 0.5em 1.2em;
  min-height: 44px;
  min-width: 96px;
  cursor: pointer;
  box-shadow: 0 2px 5px #0004;
}
.choices button.action {
  background: #34c759;
  color: #fff;
  text-shadow: 0 1px 4px #fff8, 0 0 6px #ffd16688;
  border: 2px solid #ffd166;         /* Soft gold border for prominence */
  box-shadow: 0 0 8px #34c75966;     /* Subtle green glow */
  outline: none;
  position: relative;
  z-index: 1;
}
.choices button:hover {
  background: #e650b5;
}
.choices button:active {
  background: #a02080;
  transform: translateY(2px) scale(0.98);
}

.choices button.action:hover,
.choices button.action:focus {
  background: #2fa84a;
  border-color: #fff45b;
  box-shadow: 0 0 16px #34c759cc, 0 2px 8px #0008;
  color: #fff;
}
.cli-image {
  display: block;                /* Ensures it starts at the left */
  aspect-ratio: 4 / 3;           /* Always preserves 4:3 ratio */
  width: 100vw;                  /* Try to take full viewport width... */
  height: auto;                  /* ...unless height is too much */
  max-height: 70vh;              /* ...then be limited by 70% viewport height */
  max-width: calc(70vh * 4 / 3); /* If height is limiting, width won't overflow */
  object-fit: contain;           /* Just a safety net, images should fit their box */
  margin: 0;                     /* Remove any accidental centering */
  background: #222;              /* Optional */
}
.hidden {
  display: none !important;
}
/* Lightbox */
#lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

#lightbox-image {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  background: #222;
  display: block;
}

img, .lightbox {
  touch-action: manipulation; /* or 'none' if needed */
}
#gallery-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.9);
  z-index: 1900;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}
#gallery-content {
  /* You can set a fixed max height and allow vertical scroll */
  margin-right: 64px;
  margin-left: 64px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 24px 0;
}
#gallery-content img,
#gallery-content .locked {
  display: block;
  aspect-ratio: 4 / 3;
  width: 240px;
  max-width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  background: #222;
  border-radius: 4px;
}
/* Only for locked placeholders */
#gallery-content .locked {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  color: #fff;
  user-select: none;
}
#gallery-close {
  position: absolute; top: 12px; right: 16px;
  font-size: 2rem; background: none; border: none; color: #fff;
  cursor: pointer;
}
#gallery-categories {
  max-width: calc(100vw - 128px);
  box-sizing: border-box;
  overflow-x: auto;
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  margin-bottom: 16px;
  margin-right: 64px;
  margin-left: 64px;
  padding: 16px;
  background: #23272e;
  border-radius: 8px;
  box-shadow: 0 1px 8px #0002;
}
#gallery-categories button {
  background: #384054;
  color: #fff;
  border: none;
  padding: 8px 18px;
  font-size: 1em;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.15s;
  font-family: inherit;
  outline: none;
  box-shadow: 0 2px 4px #0001;
}
#gallery-categories button.selected {
  background: #e74ca4;
  color: #fff;
}
#settings-btn {
  position: fixed;
  top: 1.1em;
  right: 1.2em;
  font-size: 1.7em;
  color: white;
  opacity: 0.42;
  cursor: pointer;
  z-index: 1000;
}
#settings-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(30, 13, 40, 0.7); /* dim, accessible */
  z-index: 2200;
  display: none;
}

#settings-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-width: 280px;
  max-width: 90vw;
  background: #26152d;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 32px #000a;
  z-index: 2300;
  padding: 2em 1.2em 1.2em 1.2em;
  display: none;
  font-size: 1em;
}
#settings-panel button {
  margin: 0.7em 0.4em 0 0;
  padding: 0.6em 1.2em;
  font-size: 1em;
}

#lang-select {
  font-size: 1em;
}
/* Mobile tweaks */
@media (max-width: 700px) {
  #console {
    font-size: 1em;
    padding: 1em 0.5em 4em 0.5em;
  }
  .choices button {
    min-width: 120px;
    font-size: 1em;
    padding: 0.7em 1em;
  }
}