:root {
  --bg: #08090c;
  --surface: #121419;
  --surface-2: #191b22;
  --line: #34303a;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f3efe7;
  --muted: #b8b0a5;
  --faint: #7f7a72;
  --gold: #d5ac63;
  --gold-2: #ffe1a0;
  --crimson: #982f3d;
  --crimson-2: #d24d5b;
  --green: #75c58b;
  --danger: #e36a6a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(139, 41, 53, 0.2), transparent 26rem),
    linear-gradient(180deg, #090a0d 0%, #111016 42%, #08090c 100%);
  color: var(--text);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 8, 11, 0.94);
  border-bottom: 1px solid rgba(213, 172, 99, 0.25);
  backdrop-filter: blur(14px);
}

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: fit-content;
  font-size: 23px;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  margin-right: 10px;
  display: block;
  border: 1px solid rgba(213, 172, 99, 0.7);
  background: #0d0f13;
  object-fit: cover;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.nav-link,
.nav-drop-button {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #e9dfd0;
  white-space: nowrap;
}

.nav-link:hover,
.nav-drop-button:hover,
.nav-link.active {
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item {
  position: relative;
}

.dropdown-menu {
  min-width: 170px;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: none;
  padding: 8px;
  background: #111217;
  border: 1px solid rgba(213, 172, 99, 0.28);
  box-shadow: var(--shadow);
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: grid;
}

.dropdown-menu a {
  padding: 10px 12px;
  color: var(--muted);
}

.dropdown-menu a:hover {
  color: var(--gold-2);
  background: rgba(213, 172, 99, 0.08);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 64px;
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(250px, 3fr) minmax(0, 7fr);
  gap: 18px;
  align-items: start;
}

.left-rail,
.home-main,
.stack {
  display: grid;
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, rgba(25, 27, 34, 0.96), rgba(15, 16, 21, 0.96));
  border: 1px solid var(--line-soft);
  border-radius: 0;
  box-shadow: var(--shadow);
}

.panel-head {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-title {
  margin: 0;
  color: var(--gold-2);
  font-size: 16px;
  font-weight: 800;
}

.panel-body {
  padding: 16px;
}

.hero {
  min-height: 360px;
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(213, 172, 99, 0.26);
  border-radius: 0;
  background-image:
    linear-gradient(90deg, rgba(7, 8, 11, 0.9) 0%, rgba(7, 8, 11, 0.64) 38%, rgba(7, 8, 11, 0.12) 100%),
    url("../assets/hero-castle.png");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.hero-content {
  max-width: 520px;
  padding: clamp(28px, 5vw, 56px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 440px;
  margin: 0 0 24px;
  color: #e5d8c7;
  font-size: 17px;
}

.hero-actions,
.form-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.btn:hover {
  border-color: rgba(213, 172, 99, 0.55);
  color: var(--gold-2);
}

.btn.primary {
  border-color: rgba(213, 172, 99, 0.72);
  background: linear-gradient(180deg, #d2a24f, #9e6a2c);
  color: #170f08;
}

.btn.danger {
  border-color: rgba(227, 106, 106, 0.45);
  color: #ffd0d0;
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.input,
input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0d0f13;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(213, 172, 99, 0.75);
  box-shadow: 0 0 0 3px rgba(213, 172, 99, 0.13);
}

.form-note,
.muted,
.empty {
  color: var(--muted);
  font-size: 14px;
}

.message {
  margin-top: 12px;
  color: var(--gold-2);
  font-weight: 700;
}

.message.error {
  color: var(--danger);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.post-list li {
  border-bottom: 1px solid var(--line-soft);
}

.post-list li:last-child {
  border-bottom: 0;
}

.post-link {
  min-height: 42px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.post-link:hover .post-title {
  color: var(--gold-2);
}

.post-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.post-meta {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.badge {
  min-height: 24px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(213, 172, 99, 0.36);
  border-radius: 0;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-profile {
  display: grid;
  gap: 12px;
}

.profile-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--gold-2);
}

.profile-points {
  padding: 10px 12px;
  background: rgba(213, 172, 99, 0.08);
  border: 1px solid rgba(213, 172, 99, 0.18);
  border-radius: 0;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.content-page {
  min-height: 440px;
}

.content-page h1,
.content-page h2,
.content-page h3 {
  color: var(--gold-2);
}

.board-toolbar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-detail {
  white-space: pre-wrap;
  color: #eadfce;
}

.reply-box {
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
}

.admin-tabs {
  display: grid;
  gap: 8px;
  align-content: start;
}

.admin-tab {
  justify-content: flex-start;
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  text-align: left;
}

.admin-table th {
  color: var(--gold-2);
  font-size: 13px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.html-editor {
  min-height: 280px;
  padding: 16px;
  background: #0d0f13;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
}

.html-editor:focus {
  border-color: rgba(213, 172, 99, 0.75);
}

.post-admin-item {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.post-admin-item:last-child {
  border-bottom: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-menu {
    display: none;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link,
  .nav-drop-button {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown-menu {
    position: static;
    display: grid;
    margin: 0 0 8px 12px;
    box-shadow: none;
  }

  .home-shell,
  .board-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 320px;
    background-position: 62% center;
  }
}

@media (max-width: 540px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 16px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .post-link {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }
}
