/* Labirinto3D — dark, spooky menu styling */
:root {
  --red: #a01212;
  --red-bright: #e02020;
  --bone: #cfc7b8;
  --panel: rgba(8, 6, 6, 0.82);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--bone);
  font-family: Georgia, 'Times New Roman', serif;
  user-select: none;
}

#view {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

/* dark red-tinged vignette over everything */
#vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
              transparent 45%, rgba(0,0,0,0.55) 82%, rgba(20,0,0,0.9) 100%);
  z-index: 5;
}

/* ---------------- overlays ---------------- */
.overlay {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(90,8,8,0.25), transparent 60%),
    linear-gradient(rgba(0,0,0,0.88), rgba(0,0,0,0.94));
  backdrop-filter: blur(3px);
}
/* NB: no !important here — main.js shows/hides these overlays with inline
   styles, which must win over this rule */
.hidden { display: none; }

/* start menu shows the artwork behind the usual dark red-tinted dimming */
#menu {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(90,8,8,0.25), transparent 60%),
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.68)),
    url('../assets/menu-bg.jpg') center / cover no-repeat #000;
}

/* in-game HUD: markers left (under the overlays, above the vignette) */
#hud {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 6;
  pointer-events: none;
  font-size: 12px;
  letter-spacing: 2px;
  color: #a99c89;
  text-shadow: 0 1px 2px #000;
}

.menu-inner {
  text-align: center;
  max-width: 460px;
  width: 92%;
  animation: rise 0.8s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- title ---------------- */
.title {
  font-size: 64px;
  letter-spacing: 8px;
  font-weight: normal;
  color: #e8e0d0;
  text-shadow:
    0 0 18px rgba(200, 20, 20, 0.55),
    0 0 60px rgba(120, 0, 0, 0.5),
    0 2px 2px #000;
  animation: flicker 6s infinite;
}
.title span {
  color: var(--red-bright);
  font-size: 40px;
  vertical-align: super;
  letter-spacing: 2px;
}
.title.small { font-size: 44px; }
.title.win {
  color: #dff0d8;
  text-shadow:
    0 0 18px rgba(40, 220, 60, 0.55),
    0 0 60px rgba(0, 120, 20, 0.5),
    0 2px 2px #000;
  animation: none;
}

@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 0 0 18px rgba(200,20,20,0.55), 0 0 60px rgba(120,0,0,0.5), 0 2px 2px #000;
    opacity: 1;
  }
  20%, 24%, 55% {
    text-shadow: 0 0 4px rgba(200,20,20,0.2);
    opacity: 0.55;
  }
}

.subtitle {
  margin: 6px 0 26px;
  font-style: italic;
  color: #7d7365;
  letter-spacing: 2px;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ---------------- panel ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid #2a1010;
  border-top: 2px solid var(--red);
  padding: 28px 30px 22px;
  box-shadow: 0 0 40px rgba(0,0,0,0.9), inset 0 0 60px rgba(30,0,0,0.35);
}

.field { margin-bottom: 20px; text-align: left; }
.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #8d7f6d;
  margin-bottom: 10px;
}

/* slider */
input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0%, #3a1414 100%);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #d8cfc0;
  border: 2px solid var(--red);
  box-shadow: 0 0 10px rgba(220, 30, 30, 0.8);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #d8cfc0;
  border: 2px solid var(--red);
}
.size-row { margin-top: 8px; font-size: 13px; color: #a99c89; letter-spacing: 1px; }

/* checkbox (SSAO toggle) */
label.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8d7f6d;
  cursor: pointer;
  margin-bottom: 0;
}
label.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 16px; height: 16px;
  background: #060404;
  border: 1px solid #33201c;
  cursor: pointer;
  position: relative;
}
label.check input:checked {
  background: var(--red);
  border-color: #c02525;
  box-shadow: 0 0 10px rgba(180, 20, 20, 0.5);
}
label.check input:checked::after {
  content: '✕';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #f0e7d8;
  font-size: 11px;
}
label.check:hover input { border-color: var(--red); }
label.check.ack { margin-top: 2px; font-size: 11px; color: #a99c89; }

/* flashing-lights / jump-scare disclaimer */
.warning {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #5a4418;
  border-left: 3px solid #c8951e;
  background: rgba(40, 28, 6, 0.45);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: #c8b48a;
}
.warning b { color: #e8b84a; letter-spacing: 1px; }

/* seed input */
input[type="text"] {
  width: 100%;
  background: #060404;
  border: 1px solid #33201c;
  color: var(--bone);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  outline: none;
}
input[type="text"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(180, 20, 20, 0.35);
}

/* buttons */
button {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  background: linear-gradient(#8c1414, #520a0a);
  border: 1px solid #c02525;
  color: #f0e7d8;
  font-family: inherit;
  font-size: 19px;
  letter-spacing: 6px;
  cursor: pointer;
  transition: box-shadow 0.25s, background 0.25s, transform 0.1s;
  text-shadow: 0 1px 2px #000;
}
button:hover {
  background: linear-gradient(#a81818, #640c0c);
  box-shadow: 0 0 26px rgba(220, 30, 30, 0.55);
}
button:active { transform: scale(0.985); }
button:disabled { opacity: 0.5; cursor: wait; }
button.secondary {
  margin-top: 10px;
  background: linear-gradient(#26221e, #171310);
  border-color: #4a4038;
  font-size: 15px;
  letter-spacing: 4px;
}
button.secondary:hover { box-shadow: 0 0 18px rgba(120, 100, 80, 0.35); }

/* loading */
#loading { margin-top: 18px; }
.loading-track {
  width: 100%; height: 6px;
  background: #1a1210;
  border: 1px solid #3a201c;
  overflow: hidden;
}
#loading-bar {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, #6e0e0e, var(--red-bright));
  box-shadow: 0 0 12px rgba(230, 30, 30, 0.8);
  transition: width 0.25s ease-out;
}
#loading-text {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #8d7f6d;
  text-transform: uppercase;
}

.seed-used {
  margin-top: 12px;
  font-size: 12px;
  color: #6d6355;
  letter-spacing: 1px;
}

.controls {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #241412;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  font-size: 12px;
  color: #7a6f60;
  letter-spacing: 1px;
}
.controls b { color: #b9ab95; }

.hint {
  margin-top: 16px;
  font-style: italic;
  font-size: 13px;
  color: #6d6355;
  animation: breathe 3s ease-in-out infinite;
}
.hint.warn {
  color: #c06a4a;
  font-style: normal;
  animation: none;
}

.footnote {
  margin-top: 22px;
  font-size: 11px;
  color: #4d453c;
  letter-spacing: 2px;
}

@media (max-height: 640px) {
  .title { font-size: 42px; }
  .subtitle { margin-bottom: 14px; }
  .panel { padding: 18px 22px 14px; }
}
