:root {
  color-scheme: dark;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background: #030303;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #030303;
}

body {
  overflow-x: hidden;
}

.wall {
  display: flex;
  min-height: 100svh;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 56%, rgba(164, 140, 103, 0.14), transparent 22%),
    #030303;
}

.stage {
  position: relative;
  width: min(130vw, calc(100svh * 1.749 * 1.3));
  aspect-ratio: 3000 / 1715;
  overflow: hidden;
  flex-shrink: 0;
  background: #050505;
}

.wall-image {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.screen {
  --x: 50%;
  --y: 50%;
  --w: 7%;
  --h: 10%;
  --r: 2px;
  --rot: 0deg;
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  border-radius: var(--r);
  clip-path: inset(0 round var(--r));
  color: #f7efe3;
  background: #10100e;
  box-shadow:
    inset 0 0 16px rgba(0, 0, 0, 0.78),
    0 0 16px rgba(170, 152, 116, 0);
  opacity: 0;
  transform: rotate(var(--rot, 0deg)) scale(0.005);
  transition: 
    opacity 0.6s ease var(--delay, 0s),
    transform 0.6s cubic-bezier(.2,.8,.2,1) var(--delay, 0s),
    filter 180ms ease,
    box-shadow 180ms ease;
}

.screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  filter: saturate(0.72) contrast(1.24) brightness(0.76);
  mix-blend-mode: screen;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 55%, transparent 18%, rgba(0, 0, 0, 0.38) 72%);
  opacity: 0.42;
  pointer-events: none;
}

.screen span {
  position: absolute;
  left: 50%;
  bottom: 7%;
  z-index: 2;
  max-width: 90%;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 246, 225, 0.9);
  background: rgba(0, 0, 0, 0.42);
  font-size: clamp(6px, 0.62vw, 11px);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  transform: translateX(-50%);
  white-space: nowrap;
}

.screen:is(:hover, :focus-visible) span {
  opacity: 1;
}

.screen:is(:hover, :focus-visible) {
  outline: none;
  filter: brightness(1.18);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.22),
    0 0 22px rgba(226, 199, 136, 0.4);
  transform: rotate(var(--rot, 0deg)) scale(1.07);
  transition: filter 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  transition-delay: 0s !important;
}


.stage.booted .screen {
  opacity: 1;
  transform: rotate(var(--rot, 0deg)) scale(1.01);
}

.s01 { --x: 53.8000%; --y: 21.1662%; --w: 3.8333%; --h: 8.9796%; --rot: 3deg; --delay: 0.1s; }
.s02 { --x: 40.1000%; --y: 23.3236%; --w: 5.2333%; --h: 7.8134%; --rot: -3.5deg; --delay: 0.25s; }
.s03 { --x: 47.2000%; --y: 31.2536%; --w: 4.5333%; --h: 6.9388%; --rot: 3deg; --delay: 0.15s; }
.s04 { --x: 54.6667%; --y: 32.3615%; --w: 4.1667%; --h: 7.8134%; --rot: -2deg; --delay: 0.3s; }
.s05 { --x: 38.3333%; --y: 34.8105%; --w: 5.0000%; --h: 8.1633%; --rot: -3.5deg; --delay: 0.2s; }
.s06 { --x: 47.2667%; --y: 41.6327%; --w: 5.0333%; --h: 6.5306%; --rot: 3.5deg; --delay: 0.4s; }
.s07 { --x: 57.0667%; --y: 43.2070%; --w: 4.9333%; --h: 8.1050%; --rot: 1.5deg; --delay: 0.35s; }
.s08 { --x: 37.0000%; --y: 46.5889%; --w: 4.9667%; --h: 7.6968%; --rot: -3deg; --delay: 0.5s; }
.s09 { --x: 45.9667%; --y: 49.2711%; --w: 5.6000%; --h: 8.2799%; --rot: 0.5deg; --delay: 0.45s; }
.s10 { --x: 59.7333%; --y: 54.2274%; --w: 5.3333%; --h: 8.2799%; --rot: 3.5deg; --delay: 0.6s; }
.s11 { --x: 53.7333%; --y: 54.2857%; --w: 3.9333%; --h: 4.7230%; --rot: -2deg; --delay: 0.55s; }
.s12 { --x: 38.8000%; --y: 57.6093%; --w: 5.5333%; --h: 8.2799%; --rot: -3deg; --delay: 0.7s; }
.s13 { --x: 45.9667%; --y: 60.1749%; --w: 5.7333%; --h: 8.2216%; --rot: 3.5deg; --delay: 0.65s; }
.s14 { --x: 54.9000%; --y: 60.2915%; --w: 5.0333%; --h: 8.1050%; --rot: -1.5deg; --delay: 0.8s; }
.s15 { --x: 61.5000%; --y: 68.8047%; --w: 3.9667%; --h: 8.9796%; --rot: 3deg; --delay: 0.75s; }
.s16 { --x: 35.2667%; --y: 69.2711%; --w: 5.5667%; --h: 8.7464%; --rot: -3.5deg; --delay: 0.9s; }
.s17 { --x: 52.0000%; --y: 71.5452%; --w: 6.1667%; --h: 9.0962%; --rot: -1.5deg; --delay: 0.85s; }
.s18 { --x: 44.2000%; --y: 71.8950%; --w: 6.1333%; --h: 9.0962%; --rot: 3.5deg; --delay: 0.95s; }

@media (max-width: 760px) {
  .stage {
    width: 250vw;
    max-width: none;
    flex-shrink: 0;
    aspect-ratio: 3000 / 1715;
  }

  .screen span {
    display: none;
  }
}

/* Intro Boot Screen Style */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #030303;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: Courier, Monaco, monospace;
  color: #33ff33;
  padding: 20px;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  user-select: none;
}
#intro-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}
.terminal-loader {
  width: 90%;
  max-width: 600px;
  background: #000;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 0 50px rgba(51, 255, 51, 0.05);
  position: relative;
  overflow: hidden;
}
.terminal-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 10;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
}
.terminal-loader p {
  margin: 8px 0;
  line-height: 1.4;
  font-size: clamp(11px, 1.2vw, 15px);
  min-height: 1.4em;
  white-space: pre-wrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.terminal-loader p.visible {
  opacity: 1;
}
.click-prompt {
  color: #ffb700;
  font-weight: bold;
  animation: blink 1s steps(2, start) infinite;
  margin-top: 24px !important;
}
@keyframes blink {
  to { visibility: hidden; }
}

/* HUD overlay styles */
.hud {
  position: fixed;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 40px;
  font-family: Courier, Monaco, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(226, 199, 136, 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease 1s;
  text-transform: uppercase;
}
.hud-top {
  top: 30px;
  left: 0;
}
.hud-bottom {
  bottom: 30px;
  left: 0;
}
.stage.booted ~ .hud {
  opacity: 1;
}

/* On mobile, stack HUD elements vertically or hide them to avoid overlap */
@media (max-width: 760px) {
  .hud {
    padding: 0 20px;
    font-size: 9px;
  }
  .hud-top {
    top: 15px;
  }
  .hud-bottom {
    bottom: 15px;
  }
  .hud-right {
    display: none;
  }
}
