/* ============================================
   LANDING PAGE – Gameboy Game Maker
   ============================================ */

/* === TOUCH: Text-Selektion & Markup-Menü deaktivieren === */
.landing,
.input-card,
.card-header,
.genre-tags,
.btn-generate,
.btn-action,
.btn-help,
.genre-tag,
.example-item,
.examples h3,
.footer,
.header h1,
.header .subtitle {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Eingabefelder explizit wieder erlauben */
.prompt-textarea,
input {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* === LAYOUT === */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 60px;
  background:
    radial-gradient(ellipse at 50% 0%, var(--glow-header) 0%, transparent 60%),
    var(--bg-dark);
  transition: background 0.3s ease;
}

/* === HEADER === */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 22px;
  color: var(--text-light);
  letter-spacing: 3px;
  line-height: 2;
  text-shadow: 2px 2px 0px rgba(155, 27, 48, 0.3);
}

.header .subtitle {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: 8px;
}

/* === MAIN AREA === */
.main-area {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1060px;
  width: 100%;
}

/* === INPUT PANEL === */
.input-panel {
  flex: 1;
  min-width: 320px;
  max-width: 460px;
}

.input-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Card Header mit Toggle */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  min-height: 28px;
}

.card-header h2 {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 1px;
  margin: 0;
  padding: 0;
}

.input-card h2 {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.prompt-textarea {
  width: 100%;
  height: 130px;
  background: var(--bg-input);
  border: 2px solid var(--bg-input-border);
  border-radius: 10px;
  padding: 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--gb-lightest);
  line-height: 2.2;
  resize: vertical;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}

[data-theme="light"] .prompt-textarea {
  color: var(--gb-darkest);
}

.prompt-textarea::placeholder {
  color: rgba(155, 171, 63, 0.4);
}

[data-theme="light"] .prompt-textarea::placeholder {
  color: rgba(60, 80, 20, 0.4);
}

.prompt-textarea:focus {
  border-color: var(--accent-red);
}

/* Genre Tags */
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.genre-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 8px 14px;
  background: var(--bg-tag);
  border: 1px solid var(--bg-tag-border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.genre-tag:hover,
.genre-tag.active {
  background: rgba(155, 27, 48, 0.2);
  border-color: var(--accent-red);
  color: var(--text-light);
}

/* === PROGRESS BAR === */
.progress-wrap {
  margin-top: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
}

.progress-wrap.visible {
  display: flex;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(155, 171, 63, 0.15);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9bbc0f, #c8d44a);
  border-radius: 99px;
  transition: width 1s linear;
  box-shadow: 0 0 6px rgba(155, 188, 15, 0.5);
}

.progress-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: right;
}

/* Generate Button */
.btn-generate {
  width: 100%;
  padding: 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  background: var(--accent-red);
  background: linear-gradient(145deg, #ab2b40, #8b0b20);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(155, 27, 48, 0.3);
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(155, 27, 48, 0.4);
}

.btn-generate:active {
  transform: translateY(1px);
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Beispiele */
.examples {
  margin-top: 16px;
}

.examples h3 {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.example-item {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text-example);
  padding: 10px 12px;
  background: var(--bg-example);
  border: 1px solid var(--bg-example-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.6;
  text-align: center;
}

.example-item:hover {
  background: rgba(155, 171, 63, 0.12);
  color: var(--gb-lightest);
  transform: translateY(-1px);
}

[data-theme="light"] .example-item:hover {
  color: var(--gb-darkest);
}

/* Hilfe-Button */
.btn-help {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  transform: translateY(-7px);
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.btn-help:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-light);
}

[data-theme="light"] .btn-help {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.05);
}

/* ========== HILFE-MODAL ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-dark);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

[data-theme="light"] .modal {
  background: #f0ece6;
  border-color: rgba(0,0,0,0.12);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

[data-theme="light"] .modal-header {
  border-bottom-color: rgba(0,0,0,0.08);
}

.modal-header h2 {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 1px;
  margin: 0;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: sans-serif;
}

.modal-close:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-light);
}

.modal-body {
  padding: 16px 20px 20px;
}

.help-section {
  margin-bottom: 16px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.help-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}

[data-theme="light"] .help-row {
  background: rgba(0,0,0,0.04);
}

.help-keys {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--gb-lightest);
  letter-spacing: 1px;
}

[data-theme="light"] .help-keys {
  color: var(--gb-darkest);
}

.help-desc {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-muted);
}

.help-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-muted);
  line-height: 2;
}

.help-text strong {
  color: var(--gb-lightest);
}

[data-theme="light"] .help-text strong {
  color: var(--gb-darkest);
}

/* === STATUS BAR === */
.status-bar {
  margin-top: 14px;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-bar .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(155, 171, 63, 0.3);
  border-top-color: var(--gb-lightest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-bar .status-text {
  font-size: 10px;
  color: var(--gb-lightest);
  letter-spacing: 1px;
}

.status-bar.error .status-text {
  color: var(--accent-red);
}

.status-bar.hidden {
  display: none;
}

/* === GAME ACTIONS (unter dem Gameboy) === */
.game-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.game-actions.hidden {
  display: none;
}

.btn-action {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 10px 18px;
  background: var(--bg-action);
  border: 1px solid var(--bg-action-border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.btn-action:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-light);
}

/* === FOOTER === */
.footer {
  margin-top: 50px;
  text-align: center;
}

.footer p {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 2px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .main-area {
    flex-direction: column-reverse;
    align-items: center;
  }

  .input-panel {
    min-width: auto;
    width: 100%;
    max-width: 400px;
  }

  .header h1 {
    font-size: 16px;
  }

  .header .subtitle {
    font-size: 8px;
  }
}
