/* ==========================================================
   HORIZON ALLIANCE - 전역 스타일
   다크 / SF 톤. 색상은 아래 :root 변수만 바꿔도 사이트 전체가 바뀝니다.
   (개인 커스터마이징은 custom.css 에 적으면 이 파일을 덮어써도 유지됩니다)
   ========================================================== */

:root {
  --bg: #05070d;
  --bg-panel: #0c1119;
  --bg-panel-2: #111826;
  --border: #1e2a3d;
  --accent: #35d0ff;
  --accent-dim: #1a7fa0;
  --gold: #c9a35c;
  --text: #d8e2ef;
  --text-dim: #8a97ab;
  --danger: #ff5d5d;
  --success: #5cffb0;
  --radius: 6px;
  --notice-row: 54px;           /* 공지 한 줄 높이. 3줄 높이만큼 보이고 나머지는 스크롤 */
  --font: "Segoe UI", "Malgun Gothic", "Pretendard", -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(53, 208, 255, 0.06), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(201, 163, 92, 0.05), transparent 35%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Topbar + 드롭다운 메뉴 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 13, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
}
.brand span { color: var(--accent); }

.menu { position: relative; }

.menu-button {
  list-style: none;
  cursor: pointer;
  padding: 9px 16px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  user-select: none;
}
.menu-button::-webkit-details-marker { display: none; }
.menu-button:hover, .menu[open] .menu-button { background: var(--accent); color: #04121a; }

.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 250px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.menu-panel a,
.menu-panel .menu-link {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu-panel a:hover,
.menu-panel .menu-link:hover { background: rgba(53, 208, 255, 0.1); color: #fff; }

.menu-label {
  padding: 12px 12px 4px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.menu-divider { height: 1px; margin: 8px 0; background: var(--border); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  background: transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { background: var(--accent); color: #04121a; border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #04121a; border-color: var(--accent); }
.btn-primary:hover { background: #fff; border-color: #fff; color: #000; }
.btn-gold { border-color: var(--gold); color: var(--gold); }
.btn-gold:hover { background: var(--gold); color: #1a1204; border-color: var(--gold); }
.btn-small { padding: 5px 12px; font-size: 12px; }

/* ---------------- 대표 페이지 히어로 ---------------- */
.alliance-hero {
  padding: 120px 20px 70px;
  text-align: center;
}
.alliance-title {
  margin: 0;
  font-size: clamp(42px, 10.5vw, 108px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 40px rgba(53, 208, 255, 0.25);
}
.alliance-title span { color: var(--accent); }
.alliance-sub {
  max-width: 620px;
  margin: 26px auto 0;
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 15px;
}

/* ---------------- Section ---------------- */
.section { padding: 60px 20px; }
.section-title {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.section-heading { text-align: center; font-size: 26px; margin: 0 0 36px; }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.panel:hover { border-color: var(--accent-dim); }

.card-title { color: #fff; font-size: 15px; margin: 0 0 10px; letter-spacing: 1px; }
.card-text { color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* ---------------- 함대 카드 / 로고 ---------------- */
.fleet-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.fleet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 30px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  text-align: center;
  transition: all .15s ease;
}
.fleet-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(53, 208, 255, 0.12); }
.fleet-card-name { font-size: 17px; font-weight: 700; letter-spacing: 2px; }

.fleet-logo-badge,
.fleet-logo-img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fleet-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  background: var(--bg-panel-2);
  border: 2px solid var(--accent-dim);
}
.fleet-logo-img { object-fit: cover; border: 2px solid var(--accent-dim); }
.fleet-logo-sm .fleet-logo-badge, .fleet-logo-sm .fleet-logo-img { width: 64px; height: 64px; font-size: 26px; }

/* ---------------- 공지 영역 (3줄 보이고 나머지 스크롤) ---------------- */
.notice-box {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.notice-scroll {
  max-height: calc(var(--notice-row) * 3);
  overflow-y: auto;
  overscroll-behavior: contain;
  cursor: grab;
}
.notice-scroll.dragging { cursor: grabbing; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li:last-child .notice-item { border-bottom: 0; }

.notice-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: var(--notice-row);
  padding: 0 20px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.notice-item:hover { background: rgba(53, 208, 255, 0.06); }
.notice-date { flex-shrink: 0; color: var(--text-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.notice-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 올라온 당일 공지에만 붙는 New 표시: 둥근 네모 박스 + 초록 글자 */
.new-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--success);
  border-radius: 6px;
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.5;
}

/* ---------------- 공지 전문 팝업 ---------------- */
dialog.notice-dialog {
  width: min(660px, 92vw);
  max-height: 84vh;
  padding: 0;
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text);
  overflow: hidden;
}
dialog.notice-dialog[open] { display: flex; flex-direction: column; }
dialog.notice-dialog::backdrop { background: rgba(0, 0, 0, 0.68); }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.dialog-title { margin: 0 0 8px; font-size: 20px; letter-spacing: 0; word-break: break-word; }
.dialog-meta { margin: 0; font-size: 13px; color: var(--text-dim); }
.dialog-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}
.dialog-close:hover { border-color: var(--accent); color: var(--accent); }
.dialog-body {
  padding: 22px 24px 28px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.85;
  font-size: 15px;
}

/* ---------------- 함대 페이지 ---------------- */
.fleet-header {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 50px 20px 26px;
}
.fleet-header h1 { margin: 0; font-size: clamp(26px, 5vw, 42px); letter-spacing: 4px; }
.fleet-header p { margin: 8px 0 0; color: var(--text-dim); }

.fleet-subnav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}
.fleet-subnav a, .fleet-subnav .locked {
  padding: 12px 16px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
}
.fleet-subnav a:hover { color: var(--accent); }
.fleet-subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.fleet-subnav .locked { margin-left: auto; font-size: 12px; }

.access-panel { text-align: center; margin-top: 30px; }
.access-panel p { color: var(--text-dim); line-height: 1.7; }

.page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}
.page-title-bar h2 { margin: 0; }

/* ---------------- Forms ---------------- */
.auth-wrap {
  max-width: 420px;
  margin: 70px auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.auth-wrap h2 { text-align: center; font-size: 20px; margin: 0 0 26px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password], textarea, select, input[type=number], input[type=date] {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.helptext { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.errorlist { color: var(--danger); font-size: 13px; list-style: none; padding: 0; margin: 5px 0 0; }
.form-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-dim); }

/* ---------------- Messages ---------------- */
.messages { list-style: none; padding: 0 20px; max-width: 1080px; margin: 16px auto 0; }
.messages li {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.messages .success { border-color: var(--success); color: var(--success); }
.messages .error { border-color: var(--danger); color: var(--danger); }
.messages .info, .messages .warning { border-color: var(--accent-dim); color: var(--accent); }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-dim); font-size: 11px; letter-spacing: 1px; }
tr:hover td { background: rgba(53, 208, 255, 0.03); }
.table-wrap { overflow-x: auto; }
.rank-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}
.mine { background: rgba(53, 208, 255, 0.06); }

/* ---------------- Dashboard stat cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 36px; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-card .label { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; margin-top: 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.badge-pinned { color: var(--gold); font-size: 11px; border: 1px solid var(--gold); padding: 2px 8px; border-radius: 20px; margin-right: 8px; }
.empty-state { text-align: center; color: var(--text-dim); padding: 50px 20px; }

footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 40px;
}

/* ---------------- 모바일 ---------------- */
@media (max-width: 680px) {
  .alliance-hero { padding: 80px 16px 50px; }
  .two-col { grid-template-columns: 1fr; }
  .fleet-header { flex-direction: column; text-align: center; }
  .fleet-subnav .locked { margin-left: 0; }
  .notice-item { padding: 0 14px; gap: 10px; }
}

/* 공지 사진 (연합 공지 팝업 · 함대 공지 상세) - static/css/style.css 맨 아래에 붙여 넣기 */
.notice-image {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto 18px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}
