/* 기본 공통 */
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
}
body {
  margin: 0;
  background: #f3f4f6;
  color: #111827;
}

/* ───────── 상단 헤더 (네이버 느낌) ───────── */
header {
  background: #03c75a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo::after {
  content: " BETA";
  font-size: 10px;
  margin-left: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
}

/* 메인 네비 */
.main-nav {
  display: flex;
  gap: 6px;
}
.nav-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  white-space: nowrap;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* 헤더 오른쪽 영역 */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 510px;
  justify-content: flex-end;
}

/* 헤더 로그인 영역 깜빡임 방지용: JS가 준비되기 전엔 숨겨두기 */
#header-auth,
#header-user {
  visibility: hidden;
}

/* JS에서 body에 header-ready 클래스를 붙이면 그때부터 보이게 */
body.header-ready #header-auth,
body.header-ready #header-user {
  visibility: visible;
}

/* 로그인 박스 */
#header-auth {
  background: rgba(255, 255, 255, 0.13);
  padding: 6px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
}
#header-auth input {
  height: 28px;
  border-radius: 999px;
  border: none;
  padding: 0 10px;
  font-size: 13px;
  min-width: 90px;
}
#header-auth input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.95);
}
#header-auth button {
  height: 28px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease;
}
#header-login-btn {
  background: #ffffff;
  color: #03c75a;
  font-weight: 700;
}
#header-login-btn:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}
#header-signup-btn {
  background: #1d7a3f;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
}
#header-signup-btn:hover {
  background: #166034;
}

/* 로그인 후 상단 유저 박스 */
#header-user {
  background: rgba(0, 0, 0, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
#header-user-name {
  font-weight: 700;
}
#header-user-stardust {
  font-weight: 700;
}
.header-sep {
  opacity: 0.8;
}
#header-logout-btn {
  height: 26px;
  border-radius: 999px;
  border: none;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  background: #ffffff;
  color: #03c75a;
  font-weight: 600;
}
#header-logout-btn:hover {
  background: #e5f7ee;
}

/* ───────── 메인 (체스보드 느낌 섹션) ───────── */
main {
  max-width: 1024px;
  margin: 32px auto;
  padding: 0 16px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 24px 28px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
.hero-left h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.hero-left p {
  margin: 0 0 18px 0;
  color: #4b5563;
  font-size: 14px;
}
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-buttons button {
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.05s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.btn-primary {
  background: #2f80ed;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
  background: #1f6ed1;
  transform: translateY(-1px);
}
.btn-ghost {
  background: #f3f4f6;
  color: #111827;
}
.btn-ghost:hover {
  background: #e5e7eb;
}

/* 오른쪽 체스보드 느낌 박스 */
.hero-right {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-image: linear-gradient(
    45deg,
    #f9fafb 25%,
    #e5e7eb 25%,
    #e5e7eb 50%,
    #f9fafb 50%,
    #f9fafb 75%,
    #e5e7eb 75%,
    #e5e7eb 100%
  );
  background-size: 40px 40px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.5);
}
.hero-right::after {
  content: "♟";
  position: absolute;
  font-size: 64px;
  color: rgba(15, 23, 42, 0.15);
  bottom: 10px;
  right: 16px;
}
.hero-right::before {
  content: "♞";
  position: absolute;
  font-size: 32px;
  color: rgba(15, 23, 42, 0.2);
  top: 10px;
  left: 16px;
}

/* 아래 설명 섹션(옵션) */
.section {
  margin-top: 20px;
  font-size: 14px;
  color: #4b5563;
}

/* ───────── 탭 페이지 공통 ───────── */
.page {
  display: none;
}
.page-active {
  display: block;
}

/* ───────── 로그인/회원가입 카드 공통 ───────── */
.fullscreen-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top, #e0f2fe, #f3f4f6);
}

.card {
  background: #ffffff;
  width: 360px;
  max-width: 90vw;
  padding: 30px 26px 26px;
  border-radius: 18px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(56, 189, 248, 0.18),
    transparent 55%
  );
  pointer-events: none;
}
.card-inner {
  position: relative;
  z-index: 1;
}
.card .logo-mini {
  font-size: 13px;
  font-weight: 700;
  color: #03c75a;
  margin-bottom: 4px;
}
.card h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
}
.card .sub {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #6b7280;
}
.field {
  margin-bottom: 14px;
  text-align: left;
}
.field label {
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
  color: #4b5563;
}
.input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 14px;
}
.input:focus {
  outline: 2px solid #2f80ed;
  border-color: transparent;
  background: #ffffff;
}
.btn {
  width: 100%;
  padding: 10px 0;
  margin-top: 8px;
  font-size: 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #2f80ed;
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.1s ease;
}
.btn:hover {
  background: #1f6ed1;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.5);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}
.link {
  margin-top: 14px;
  font-size: 13px;
}
.link a {
  color: #2f80ed;
  text-decoration: none;
  font-weight: 500;
}
.link a:hover {
  text-decoration: underline;
}
.message {
  margin-top: 10px;
  font-size: 12px;
  color: #e03131;
  min-height: 16px;
}

/* ───────── 마이페이지 카드 ───────── */
.mypage-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 22px 24px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}
.mypage-card h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
}
.mypage-sub {
  margin: 0 0 18px 0;
  font-size: 13px;
  color: #6b7280;
}
.mypage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}
.mypage-label {
  font-weight: 600;
  color: #4b5563;
}
.mypage-value {
  color: #111827;
}
.mypage-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0 14px;
}
.mypage-form label {
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
  color: #4b5563;
}
.mypage-hint {
  font-size: 12px;
  margin: 6px 0 0 0;
  color: #6b7280;
}
.mypage-message {
  font-size: 13px;
  color: #374151;
}

/* 반응형 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .main-nav {
    order: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .header-right {
    order: 3;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }
  #header-auth {
    width: 100%;
    flex-wrap: wrap;
  }
  #header-auth input {
    flex: 1;
  }
  main {
    margin-top: 20px;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}
