/* Gravity Universe — 로그인/로비 (우주 히어로 + 콘텐츠 섹션) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --lobby-void: #03060f;
  --lobby-ink: #e8eef8;
  --lobby-muted: #8fa3bc;
  --lobby-star: #f0d78c;
  --lobby-cyan: #6ec6ff;
  --lobby-dust: #94d82d;
  --lobby-line: rgba(110, 198, 255, 0.28);
  --lobby-glass: rgba(6, 12, 28, 0.72);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body.lobby-page {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  color: var(--lobby-ink);
  font-family: var(--font-body);
  background: #000;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* 뷰포트: 전체 폭 (좌우 여백 없음) — 내부 1280 레이어는 absolute */
.lobby-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
  flex: 0 0 auto;
  box-sizing: border-box;
}

/* 고정 디자인 좌표계 — absolute + scale 로 레이아웃 폭 오염 방지 */
.lobby-layer {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--lobby-design-w, 1280px);
  height: calc(50px + var(--lobby-stage-h, 720px));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transform-origin: top center;
  will-change: transform;
  background: #000;
  box-sizing: border-box;
}

.lobby-topbar {
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  padding: 0 10px;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  background: #0b0b12;
  border-bottom: none;
  flex-shrink: 0;
  overflow: hidden;
}

.lobby-lang-toggle .lang-short { display: none; }

/* ----- 스테이지: 우주 + 브랜드 + 로그인 ----- */
.lobby-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0 32px;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  isolation: isolate;
  overflow: hidden;
  background: var(--lobby-void);
  width: 100%;
  height: var(--lobby-stage-h, 720px);
  box-sizing: border-box;
  flex: 0 0 var(--lobby-stage-h, 720px);
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.lobby-nebula {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 40% at 20% 30%, rgba(40, 90, 140, 0.35), transparent 60%),
    radial-gradient(ellipse 45% 35% at 78% 55%, rgba(30, 70, 50, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(20, 40, 80, 0.4), transparent 70%);
  animation: nebula-drift 28s ease-in-out infinite alternate;
}

@keyframes nebula-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1.2%, 0) scale(1.04); }
}

.lobby-hero-inner {
  position: relative;
  z-index: 2;
  width: 440px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.lobby-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--lobby-star);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  min-width: 0;
}

.lobby-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.lobby-logo-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-logo:hover {
  color: #ffe6a8;
}

.lobby-top-right {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.lobby-lang-toggle {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid rgba(110, 198, 255, 0.35);
  background: rgba(6, 12, 28, 0.55);
  color: var(--lobby-cyan);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lobby-lang-toggle:hover {
  background: rgba(110, 198, 255, 0.16);
  border-color: rgba(110, 198, 255, 0.55);
  color: var(--lobby-ink);
}

.lobby-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px 14px;
  justify-content: flex-end;
}

.lobby-nav a {
  color: var(--lobby-cyan);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.lobby-nav a:hover {
  color: var(--lobby-star);
}

.lobby-brand {
  text-align: center;
  margin: 0;
}

.lobby-brand-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem; /* 고정 — 화면은 .lobby-layer scale로만 축소 */
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--lobby-star);
  text-shadow: 0 0 28px rgba(240, 215, 140, 0.25);
  line-height: 1.15;
  animation: brand-glow 4.5s ease-in-out infinite alternate;
}

@keyframes brand-glow {
  from { text-shadow: 0 0 18px rgba(240, 215, 140, 0.15); }
  to { text-shadow: 0 0 36px rgba(110, 198, 255, 0.35), 0 0 18px rgba(240, 215, 140, 0.2); }
}

.lobby-tagline {
  margin: 8px auto 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--lobby-ink);
  letter-spacing: 0.01em;
  text-align: center;
}

.lobby-sub {
  margin: 6px auto 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--lobby-muted);
  max-width: 34ch;
  text-align: center;
}

.lobby-scroll-hint {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--lobby-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  animation: hint-pulse 2.4s ease-in-out infinite;
}

.lobby-scroll-hint:hover {
  color: var(--lobby-star);
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}

#about-game {
  scroll-margin-top: 24px;
}

.lobby-back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid rgba(110, 198, 255, 0.35);
  border-radius: 999px;
  background: rgba(6, 12, 28, 0.82);
  color: var(--lobby-ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.15s ease;
}

.lobby-back-top:hover {
  background: rgba(110, 198, 255, 0.2);
  color: var(--lobby-star);
  transform: translateY(-1px);
}

.lobby-back-top[hidden] {
  display: none !important;
}

#auth-section {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0;
}

/* auth box — 유리 패널 (우주 위) */
.lobby-page .auth-box {
  width: 400px;
  max-width: 100%;
  border: 1px solid var(--lobby-line);
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: var(--lobby-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: var(--lobby-ink);
  font-family: var(--font-body);
  box-sizing: border-box;
}

.lobby-page .auth-box h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--lobby-star);
  margin: 4px 0 10px;
}

.lobby-page .auth-box input[type="text"],
.lobby-page .auth-box input[type="password"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(110, 198, 255, 0.22);
  border-radius: 8px;
  color: var(--lobby-ink);
  font-family: var(--font-body);
}

.lobby-page .auth-box input:focus {
  border-color: var(--lobby-cyan);
  outline: none;
  box-shadow: 0 0 0 2px rgba(110, 198, 255, 0.15);
}

.lobby-page .auth-box button[type="submit"],
.lobby-page .auth-box button:not([data-set-lang]) {
  background: linear-gradient(180deg, #3d9be0, #2a7ab8);
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 12px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.lobby-page .auth-box button[type="submit"]:hover,
.lobby-page .auth-box button:not([data-set-lang]):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  background: linear-gradient(180deg, #4dabf7, #2f86c7);
}

.lobby-page .auth-lang-toggle button {
  background: transparent;
  color: var(--lobby-cyan);
  border: 1px solid rgba(110, 198, 255, 0.3);
  border-radius: 6px;
  padding: 4px 8px !important;
  width: auto;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.lobby-page .auth-lang-toggle button.active,
.lobby-page .auth-lang-toggle button[aria-pressed="true"] {
  background: var(--lobby-cyan);
  color: #07101a;
}

.lobby-page .auth-box small {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--lobby-cyan);
}

.lobby-page .auth-box small a {
  color: var(--lobby-cyan);
  text-decoration: none;
  font-weight: 700;
  font-size: inherit;
  font-family: inherit;
}

.lobby-page .auth-box small a:hover,
.lobby-page .auth-box small a:focus {
  text-decoration: underline;
  color: var(--lobby-star);
}

.lobby-page .universe-info-inline {
  color: var(--lobby-muted);
  font-size: 0.78rem;
}

/* ----- 콘텐츠: AdSense용 실질 정보 (접힌 아래, 전용 페이지로 연결) ----- */
.lobby-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(3, 6, 15, 0.2) 0%, var(--lobby-void) 48px),
    var(--lobby-void);
  padding: 48px 20px 32px;
  margin: 0 auto;
  overflow-x: hidden;
}

.lobby-content-inner {
  max-width: 720px;
  margin: 0 auto;
}

.lobby-section {
  margin: 0 0 40px;
  padding: 0;
}

.lobby-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--lobby-star);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lobby-line);
}

.lobby-section p,
.lobby-section li {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--lobby-muted);
  margin: 0 0 12px;
}

.lobby-section ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}

.lobby-section a {
  color: var(--lobby-cyan);
  font-weight: 600;
  text-decoration: none;
}

.lobby-section a:hover {
  color: var(--lobby-star);
  text-decoration: underline;
}

.lobby-section strong {
  color: var(--lobby-ink);
  font-weight: 600;
}

.lobby-footer {
  text-align: center;
  padding: 28px 16px 40px;
  border-top: 1px solid rgba(110, 198, 255, 0.15);
  color: var(--lobby-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.lobby-footer a {
  color: var(--lobby-cyan);
  text-decoration: none;
  margin: 0 0.35em;
}

.lobby-footer a:hover {
  color: var(--lobby-star);
}

/* 기존 id 호환 */
#header-section { display: none; }
#guide-section.lobby-content { display: block; }

/* 소개 문단: 스테이지와 동일 전체 폭 */
.lobby-content {
  box-sizing: border-box;
  overflow-x: hidden;
}

/* 좁은 화면: 로그인 입력 실크기 유지 + 가로 스크롤 금지 */
body.lobby-compact .lobby-viewport {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

body.lobby-compact .lobby-layer {
  position: relative;
  left: auto;
  top: auto;
  width: 100% !important;
  max-width: 100%;
  transform: none !important;
}

body.lobby-compact .lobby-topbar {
  padding: 0;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  gap: 6px;
}

/* 오른쪽(Features/Contact/EN) 우선 표시 — 로고만 줄어듦 */
body.lobby-compact .lobby-logo {
  font-size: 0.72rem;
  max-width: none;
  min-width: 0;
  flex: 1 1 auto;
  flex-shrink: 1;
  overflow: hidden;
}

body.lobby-compact .lobby-logo-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.lobby-compact .lobby-logo-img {
  width: 22px;
  height: 22px;
}

body.lobby-compact .lobby-top-right {
  gap: 6px;
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: 8px;
}

body.lobby-compact .lobby-nav {
  gap: 6px;
  flex-shrink: 0;
}

body.lobby-compact .lobby-nav a {
  font-size: 0.75rem;
  white-space: nowrap;
}

body.lobby-compact .lobby-lang-toggle {
  font-size: 0.72rem;
  padding: 5px 8px;
  flex-shrink: 0;
}

body.lobby-compact .lobby-lang-toggle .lang-full { display: none; }
body.lobby-compact .lobby-lang-toggle .lang-short { display: inline; }

body.lobby-compact .lobby-hero {
  padding: 16px 0 20px;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

body.lobby-compact .lobby-hero-inner {
  width: 100%;
  max-width: 100%;
  gap: 14px;
  box-sizing: border-box;
  padding: 0;
}

body.lobby-page.lobby-compact #auth-section {
  width: 100%;
  box-sizing: border-box;
}

body.lobby-compact .lobby-brand-mark {
  font-size: 1.85rem;
}

body.lobby-compact .lobby-tagline {
  font-size: 1rem;
}

body.lobby-compact .lobby-sub {
  font-size: 0.88rem;
}

body.lobby-page.lobby-compact .auth-box {
  width: 100%;
  max-width: none;
  padding: 18px 16px 16px;
  box-sizing: border-box;
}

body.lobby-page.lobby-compact .auth-box h2 {
  font-size: 1.2rem;
}

body.lobby-page.lobby-compact .auth-box input[type="text"],
body.lobby-page.lobby-compact .auth-box input[type="password"] {
  font-size: 16px;
  padding: 12px 14px;
  margin-top: 10px;
}

body.lobby-page.lobby-compact .auth-box button[type="submit"] {
  font-size: 16px;
  padding: 12px;
  margin-top: 12px;
}

body.lobby-compact .lobby-content {
  padding: 28px 0 22px;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
}

/* 사이트 페이지(로그인/Features/Contact): 모바일에서 세로 고정 안내 */
#lobbyRotateHint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 24px;
  background: rgba(3, 6, 15, 0.96);
  color: var(--lobby-ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
}

body.is-landscape-blocked #lobbyRotateHint {
  display: flex;
}

body.is-landscape-blocked .lobby-viewport,
body.is-landscape-blocked .lobby-content,
body.is-landscape-blocked .features-frame,
body.is-landscape-blocked .lobby-site-main {
  visibility: hidden;
}

/* Features/Contact도 로그인과 동일한 로비 셸 */
body.lobby-page.features-page,
body.lobby-page.contact-page {
  width: 100%;
  max-width: 100%;
}

body.lobby-page.features-page .features-frame,
body.lobby-page.contact-page .lobby-site-main {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.lobby-compact.features-page .lobby-topbar,
body.lobby-compact.contact-page .lobby-topbar {
  width: 100% !important;
  max-width: 100% !important;
}

body.lobby-page.contact-page .lobby-content {
  width: 100%;
  max-width: 100%;
  padding: 28px 16px 40px;
}

body.lobby-compact.contact-page .lobby-content {
  padding: 24px 12px 36px;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
}

body.lobby-compact .lobby-footer {
  padding: 22px 14px 32px;
}

body.lobby-compact .lobby-section p,
body.lobby-compact .lobby-section li {
  font-size: 0.92rem;
  line-height: 1.65;
}

body.lobby-compact .lobby-back-top {
  right: 12px;
  bottom: 12px;
  padding: 9px 12px;
  font-size: 0.8rem;
}
