* { margin: 0; padding: 0; box-sizing: border-box; }
body { padding: 0; margin: 0; background: #0a0808; font-family: 'Segoe UI', Arial, sans-serif; }
#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas { background: #000000 }
.unity-mobile #unity-canvas { width: 100%; height: 100% }

/* ===== Desktop fullscreen: 설계 종횡비 유지 + 검은 레터박스 =====
   브라우저 UA 스타일이 !important로 100% 강제 확장하므로 여기서도 !important로 되돌린 뒤,
   flex 중앙정렬 + 검은 배경으로 남는 공간을 레터박스 처리한다.
   캔버스의 실제 px 크기는 resizeCanvas()가 종횡비에 맞춰 설정한다. */
#unity-container:fullscreen,
#unity-container:-webkit-full-screen {
  position: fixed !important;
  left: 0 !important; top: 0 !important;
  width: 100vw !important; height: 100vh !important;
  transform: none !important;
  display: flex !important;
  align-items: center; justify-content: center;
  background: #000;
}
#unity-container:fullscreen #unity-footer,
#unity-container:-webkit-full-screen #unity-footer { display: none !important; }

/* ===== Background layers ===== */
#bg-map {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: url('bg-login.jpg') center center / cover no-repeat;
  filter: brightness(0.3) saturate(0.6) blur(3px);
  transform: scale(1.05);
  z-index: 1;
}

#bg-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(10,8,8,0.3) 0%, rgba(10,8,8,0.85) 70%, rgba(10,8,8,0.95) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Gold border lines */
.border-line {
  position: absolute; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(208,170,80,0.3), transparent);
  z-index: 2;
}
.border-line.top { top: 40px; }
.border-line.bottom { bottom: 40px; }

/* Corner ornaments */
.corner {
  position: absolute; width: 20px; height: 20px;
  border-color: rgba(208,170,80,0.4); border-style: solid; border-width: 0;
  z-index: 2;
}
.corner.tl { top: 32px; left: calc(5% - 8px); border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 32px; right: calc(5% - 8px); border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 32px; left: calc(5% - 8px); border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 32px; right: calc(5% - 8px); border-bottom-width: 1px; border-right-width: 1px; }

/* ===== Game Logo ===== */
.game-logo {
  width: 320px; height: auto;
  margin-bottom: 10px;
  animation: logoFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 20px rgba(208,170,80,0.3));
}
.game-logo-large { width: 400px; }

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== Loading Screen ===== */
#unity-loading-bar {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: none; flex-direction: column; align-items: center; text-align: center;
  width: 400px; z-index: 3;
}

#loading-subtitle {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: rgba(208,170,80,0.5);
  margin-bottom: 44px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#unity-progress-bar-empty {
  width: 320px; height: 4px; border-radius: 2px;
  background: rgba(208,170,80,0.1);
  overflow: hidden; position: relative;
  border: 1px solid rgba(208,170,80,0.15);
}

#unity-progress-bar-full {
  width: 0%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #8b6914, #d4a840, #f0d060, #d4a840, #8b6914);
  background-size: 300% 100%;
  animation: goldShimmer 3s ease-in-out infinite;
  transition: width 0.3s ease-out;
  box-shadow: 0 0 10px rgba(208,170,80,0.4);
}

@keyframes goldShimmer {
  0% { background-position: 300% 0; }
  100% { background-position: -300% 0; }
}

#loading-percentage {
  font-size: 20px; font-weight: 600; color: #d4a840;
  margin-top: 16px; letter-spacing: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#loading-status {
  font-size: 12px; color: rgba(208,170,80,0.4);
  margin-top: 8px; letter-spacing: 1px;
}

/* ===== Start Overlay ===== */
#start-overlay {
  display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 3; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center;
}

#start-button {
  margin-top: 44px; padding: 14px 50px;
  border: 1px solid rgba(208,170,80,0.5);
  background: linear-gradient(180deg, rgba(208,170,80,0.15) 0%, rgba(208,170,80,0.05) 100%);
  color: #d4a840; font-size: 16px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  transition: all 0.3s ease;
}
#start-button:hover {
  background: linear-gradient(180deg, rgba(208,170,80,0.25) 0%, rgba(208,170,80,0.1) 100%);
  border-color: rgba(208,170,80,0.8);
  box-shadow: 0 0 20px rgba(208,170,80,0.2), inset 0 0 20px rgba(208,170,80,0.05);
}

#start-hint {
  font-size: 11px; color: rgba(255,255,255,0.25);
  margin-top: 20px; letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

/* ===== Footer ===== */
#unity-logo { display: none }
#unity-webgl-logo { display: none }
#unity-footer { position: relative; z-index: 4 }
.unity-mobile #unity-footer { display: none }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-size: 11px; color: rgba(255,255,255,0.2); letter-spacing: 0.5px }
#unity-fullscreen-button { cursor: pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center; opacity: 0.5; transition: opacity 0.2s }
#unity-fullscreen-button:hover { opacity: 1 }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

/* ===== Page Footer (copyright) ===== */
#page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 10px 20px;
    font-size: 11px;
    letter-spacing: 0.5px;
    z-index: 10;
}

    #page-footer .footer-copy {
        color: rgba(255,255,255,0.2);
    }

    #page-footer .footer-sep {
        color: rgba(255,255,255,0.1);
        margin: 0 8px;
    }

    #page-footer .footer-link {
        color: rgba(208,170,80,0.3);
        text-decoration: none;
        transition: color 0.2s;
    }

        #page-footer .footer-link:hover {
            color: rgba(208,170,80,0.6);
        }

.unity-mobile #page-footer {
    display: none;
}
