/* style.css */
/* iOS Safari: 동적 뷰포트(주소창 표시 시에도 화면에 맞춤) + safe area(노치/홈인디케이터) */
html, body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }
/* iOS Safari 자동 글자 확대 방지 (온도 등 폰트 크기/글씨체 일치) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: #0b0f14;
  color: rgba(255,255,255,.92);
  /* Galmuri11: 11px 그리드 설계 — 작은 화면(논리 320px 폭)에서 도트 느낌 유지 */
  font-family: Galmuri11, Galmuri9, ui-monospace, monospace;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  text-rendering: geometricPrecision;
}

#app {
  min-height: 100%;
  min-height: 100dvh;
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #0b0f14;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

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

.loading-text {
  color: #7ec8e3;
  font-size: 1rem;
  letter-spacing: 0.05em;
  font-family: monospace;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.2s steps(1) infinite;
}

@keyframes loadingDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

/* ── Login Overlay ── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #060c14 0%, #081522 40%, #0a1a2a 100%);
}

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

.login-card {
  position: relative;
  z-index: 2;
  width: min(88%, 280px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.login-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}

.login-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: normal;
  color: #9fd7ef;
  line-height: 1.6;
}

.login-btn {
  width: 100%;
  padding: 11px 0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 120ms;
  outline: none;
}

.login-btn:active {
  opacity: 0.72;
}

.login-btn-google {
  background: rgba(80, 180, 255, 0.18);
  border: 1px solid rgba(100, 200, 255, 0.45);
  color: #c8eeff;
}

.login-btn-guest {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.login-privacy {
  margin: 4px 0 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.6;
}

.login-privacy-link {
  color: rgba(126, 200, 227, 0.6);
}

/* ── Login Language Toggle Button ── */
.login-lang-btn {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: 14px;
  z-index: 10;
  padding: 3px 7px;
  background: rgba(15, 28, 48, 0.72);
  border: 1px solid rgba(90, 170, 210, 0.32);
  color: rgba(190, 225, 255, 0.88);
  font-family: inherit;
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 120ms;
}

.login-lang-btn:active {
  opacity: 0.68;
}

/* ── Login Aquarium Background ── */
.login-aquarium {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* 320px 고정 너비 기준 — JS에서 translateX(-50%) scale(vw/320) 로 화면 폭에 맞춤 */
.login-aquarium-inner {
  position: absolute;
  top: 0;
  left: 50%;
  width: 320px;
  height: 640px;
  transform-origin: top center;
}

.login-ripple {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 100%;
  height: 240px;
  pointer-events: none;
  background-image: url('./assets/tank-bg-ripple.png');
  background-size: 320px 1920px;
  background-position: 0 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  opacity: 0.42;
  animation: login-ripple-anim 2.4s steps(8, end) infinite;
}

@keyframes login-ripple-anim {
  from { background-position: 0 0; }
  to   { background-position: 0 -1920px; }
}

.login-rays {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -10%, rgba(0, 198, 255, 0.10) 0%, transparent 55%);
  pointer-events: none;
}

.login-bubble-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-bubble {
  position: absolute;
  pointer-events: none;
  bottom: -20px;
  animation: login-bubble-rise var(--d) linear infinite;
}

.login-bubble img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@keyframes login-bubble-rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { transform: translateY(-100vh) translateX(var(--sway)); opacity: 0; }
}

.login-plant-layer {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  height: 160px;
  pointer-events: none;
}

.login-plant {
  position: absolute;
  bottom: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  width: auto;
}

.login-plant:nth-child(1) {
  left: 8%;
  height: 130px;
  filter: blur(2px);
  opacity: 0.82;
}

.login-plant:nth-child(2) {
  left: 50%;
  transform: translateX(-50%);
  height: 110px;
  filter: blur(1.5px);
  opacity: 0.88;
}

.login-plant:nth-child(3) {
  right: 9%;
  height: 140px;
  filter: blur(1px);
  opacity: 0.94;
}

.login-gravel-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  pointer-events: none;
}

.login-gravel-underlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(180deg, rgba(38,52,66,0.88) 0%, rgba(26,37,47,0.96) 58%, rgba(20,30,40,0.98) 100%);
  clip-path: polygon(
    0% 30%, 7% 26%, 14% 31%, 22% 25%, 31% 32%, 40% 27%, 50% 33%,
    60% 28%, 70% 34%, 80% 29%, 89% 35%, 100% 30%,
    100% 100%, 0% 100%
  );
}

.login-gravel {
  position: absolute;
  border-radius: 50%;
  filter: brightness(0.7);
  z-index: 2;
  pointer-events: none;
}
