/* === Base (darkwood gate) === */
html {
  height: 100%;
  overflow: hidden;
}

body {
  background: #000;
  color: #2db569;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('https://default.seohost.pl/bg.svg');
  opacity: 0.6;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.35;
}

main {
  flex: 1;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.domain-icon {
  animation: fadeIn 0.8s ease-out;
}

.domain-icon img {
  width: 100%;
  margin: 0 auto;
  display: block;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(45, 181, 105, 0.4));
}

.domain-section {
  animation: fadeInDown 0.8s ease-out 0.3s both;
}

.domain-title {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin: 0;
  padding: 1rem 2rem;
  display: inline-block;
  position: relative;
  color: #2db569;
  text-transform: uppercase;
}

.domain-title::before,
.domain-title::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(45, 181, 105, 0.3);
}

.domain-title::before {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}

.domain-title::after {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}

/* === Layout === */
.scene {
  width: 100%;
  max-width: 800px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.scene-header {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  padding-top: 0.25rem;
}

.scene-header .domain-icon {
  margin-bottom: -3.5rem;
  position: relative;
  z-index: 0;
}

.scene-header .domain-icon img {
  height: min(400px, 38dvh);
}

.scene-header .domain-section {
  margin-bottom: 0;
  position: relative;
  z-index: 3;
}

.scene-header .domain-title {
  font-size: clamp(1.5rem, 4.5vw, 3rem);
  padding: 0.75rem 1.5rem;
}

.scene-main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  padding: 0 0.25rem;
}

.scene-ui {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

/* === Gate panel === */
.gate-wrap {
  width: 100%;
  position: relative;
}

.gate-terminal {
  background: rgba(0, 8, 4, 0.9);
  border: 1px solid rgba(45, 181, 105, 0.15);
  border-radius: 4px;
  padding: 0;
  text-align: left;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  box-shadow:
    0 0 40px rgba(45, 181, 105, 0.06),
    inset 0 1px 0 rgba(45, 181, 105, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.gate-terminal:hover {
  border-color: rgba(45, 181, 105, 0.22);
  box-shadow:
    0 0 50px rgba(45, 181, 105, 0.1),
    inset 0 1px 0 rgba(45, 181, 105, 0.1);
}

.gate-terminal.denied {
  animation: gateShake 0.55s ease;
  border-color: rgba(220, 80, 80, 0.35);
  box-shadow: 0 0 30px rgba(220, 80, 80, 0.12);
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.gate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(45, 181, 105, 0.04);
  border-bottom: 1px solid rgba(45, 181, 105, 0.08);
  color: rgba(45, 181, 105, 0.45);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate-lights {
  display: flex;
  gap: 6px;
}

.gate-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(45, 181, 105, 0.15);
}

.gate-light.red {
  background: #c44;
  box-shadow: 0 0 8px rgba(204, 68, 68, 0.6);
  animation: pulseRed 2s ease-in-out infinite;
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.gate-body {
  padding: 1.25rem 1.35rem 1.1rem;
}

.gate-boot {
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  color: rgba(45, 181, 105, 0.35);
  line-height: 1.5;
  min-height: 3.6em;
}

.gate-boot li {
  opacity: 0;
  animation: bootLine 0.35s ease forwards;
}

.gate-boot li:nth-child(1) { animation-delay: 0.9s; }
.gate-boot li:nth-child(2) { animation-delay: 1.35s; }
.gate-boot li:nth-child(3) { animation-delay: 1.8s; }

@keyframes bootLine {
  to { opacity: 1; }
}

.gate-boot .ok { color: rgba(45, 181, 105, 0.55); }
.gate-boot .warn { color: rgba(45, 181, 105, 0.7); }

.gate-prompt {
  color: rgba(45, 181, 105, 0.5);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.gate-field {
  margin-bottom: 0.85rem;
}

.gate-field label {
  display: block;
  color: rgba(45, 181, 105, 0.4);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.gate-field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(45, 181, 105, 0.12);
  border-radius: 2px;
  color: #2db569;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  caret-color: #2db569;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gate-field input::placeholder {
  color: rgba(45, 181, 105, 0.18);
}

.gate-field input:focus {
  border-color: rgba(45, 181, 105, 0.35);
  box-shadow: 0 0 12px rgba(45, 181, 105, 0.08);
}

.gate-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.gate-submit {
  background: transparent;
  border: 1px solid rgba(45, 181, 105, 0.35);
  color: #2db569;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.gate-submit:hover:not(:disabled) {
  background: rgba(45, 181, 105, 0.08);
  box-shadow: 0 0 20px rgba(45, 181, 105, 0.12);
}

.gate-submit:disabled {
  opacity: 0.45;
  cursor: wait;
}

.gate-hint {
  color: rgba(45, 181, 105, 0.22);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.gate-status {
  min-height: 1.4em;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(45, 181, 105, 0.06);
  color: rgba(45, 181, 105, 0.3);
  font-size: 0.75rem;
  line-height: 1.5;
}

.gate-status.error {
  color: #e07070;
  text-shadow: 0 0 12px rgba(224, 112, 112, 0.25);
  animation: glitchText 0.4s ease;
}

.gate-status.warn {
  color: #d4a84a;
  text-shadow: 0 0 10px rgba(212, 168, 74, 0.2);
}

@keyframes glitchText {
  0% { transform: translate(0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 0); }
  100% { transform: translate(0); }
}

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gate-footer {
  margin: 0.65rem 0 0;
  text-align: center;
  color: rgba(45, 181, 105, 0.2);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
  flex-shrink: 0;
}

.gate-footer code {
  background: rgba(45, 181, 105, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
  color: rgba(45, 181, 105, 0.35);
  font-family: monospace;
  font-size: 0.85em;
}

.cursor-blink::after {
  content: '▋';
  animation: blink 1s step-end infinite;
  color: rgba(45, 181, 105, 0.6);
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .scene-header .domain-icon img {
    height: min(250px, 34dvh);
  }

  .scene-header .domain-icon {
    margin-bottom: -2.5rem;
  }

  .domain-title {
    font-size: 2rem;
  }

  .domain-title::before,
  .domain-title::after {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0.5rem 0.75rem;
  }

  .scene-header .domain-icon img {
    height: min(180px, 30dvh);
  }

  .scene-header .domain-icon {
    margin-bottom: -1.75rem;
  }

  .domain-title {
    font-size: 1.5rem;
    letter-spacing: 0.05em;
  }

  .gate-body {
    padding: 1rem;
  }

  .gate-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gate-submit {
    width: 100%;
  }
}

@media (max-height: 720px) {
  .scene-header .domain-icon img {
    height: min(220px, 32dvh);
  }

  .scene-ui {
    transform: scale(0.94);
  }

  .gate-body {
    padding: 1rem 1.1rem 0.85rem;
  }

  .gate-prompt {
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
  }
}

@media (max-height: 620px) {
  .scene-header .domain-icon img {
    height: min(160px, 28dvh);
  }

  .scene-ui {
    transform: scale(0.88);
  }

  .gate-boot {
    display: none;
  }

  .gate-footer {
    margin-top: 0.4rem;
  }
}
