:root {
  --bg: #090b10;
  --bg-soft: #10151d;
  --surface: rgba(18, 22, 30, 0.9);
  --surface-strong: #141922;
  --surface-panel: #0f131b;
  --text: #eef3ff;
  --muted: #96a2bc;
  --line: rgba(186, 198, 223, 0.12);
  --accent: #d3a45b;
  --accent-strong: #f0c778;
  --accent-soft: rgba(211, 164, 91, 0.14);
  --danger: #ff7f7f;
  --danger-soft: rgba(255, 127, 127, 0.12);
  --card-bg: linear-gradient(180deg, rgba(21, 26, 36, 0.95), rgba(14, 18, 26, 0.94));
  --panel-bg:
    linear-gradient(180deg, rgba(17, 18, 23, 0.92), rgba(18, 21, 27, 0.94)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 6px, transparent 6px 12px);
  --selector-title-text: #ebe76a;
  --selector-headline-text: rgba(240, 241, 244, 0.84);
  --selector-titlebar-bg: linear-gradient(180deg, #2d3244, #242836);
  --selector-footer-bg: linear-gradient(180deg, #17181d, #0f1014);
  --server-link-text: #101114;
  --ad-code-text: #d7def1;
  --ad-slot-bg: linear-gradient(180deg, rgba(17, 21, 29, 0.96), rgba(11, 14, 19, 0.96));
  --ad-preview-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  --primary-button-text: #120c03;
  --secondary-button-text: #f4f8ff;
  --pager-text: rgba(239, 243, 255, 0.64);
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}

body[data-theme="light"] {
  --bg: #f4efe5;
  --bg-soft: #ece4d6;
  --surface: rgba(255, 250, 242, 0.92);
  --surface-strong: #fff9ef;
  --surface-panel: #f4ebdc;
  --text: #25190f;
  --muted: #766554;
  --line: rgba(78, 51, 24, 0.12);
  --accent: #b4752c;
  --accent-strong: #8b5315;
  --accent-soft: rgba(180, 117, 44, 0.14);
  --danger: #b23d3d;
  --danger-soft: rgba(178, 61, 61, 0.1);
  --card-bg: linear-gradient(180deg, rgba(255, 250, 242, 0.97), rgba(245, 237, 226, 0.96));
  --panel-bg:
    linear-gradient(180deg, rgba(250, 243, 233, 0.94), rgba(245, 235, 221, 0.96)),
    repeating-linear-gradient(135deg, rgba(96, 68, 35, 0.03) 0 6px, transparent 6px 12px);
  --selector-title-text: #8b5315;
  --selector-headline-text: #5d4634;
  --selector-titlebar-bg: linear-gradient(180deg, #efe4d3, #e4d4bd);
  --selector-footer-bg: linear-gradient(180deg, #f3e6d4, #ead9c0);
  --server-link-text: #2b1c10;
  --ad-code-text: #4e3b2d;
  --ad-slot-bg: linear-gradient(180deg, rgba(251, 245, 236, 0.98), rgba(241, 231, 216, 0.98));
  --ad-preview-bg:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 250, 243, 0.72)),
    rgba(255, 248, 240, 0.72);
  --primary-button-text: #fffaf3;
  --secondary-button-text: #fffaf3;
  --pager-text: rgba(78, 59, 41, 0.72);
  --shadow: 0 26px 60px rgba(84, 54, 19, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(218, 169, 97, 0.14), transparent 28%),
    radial-gradient(circle at right 20%, rgba(76, 117, 195, 0.12), transparent 24%),
    linear-gradient(180deg, #05070b 0%, #090d14 38%, #0d1219 100%);
  position: relative;
  overflow-x: hidden;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(214, 160, 75, 0.18), transparent 28%),
    radial-gradient(circle at right 20%, rgba(124, 158, 213, 0.14), transparent 24%),
    linear-gradient(180deg, #faf4ea 0%, #f3ecde 38%, #efe7da 100%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(100px);
  opacity: 0.46;
  pointer-events: none;
}

.orb-a {
  width: 340px;
  height: 340px;
  top: -120px;
  right: -80px;
  background: rgba(215, 146, 59, 0.16);
}

.orb-b {
  width: 300px;
  height: 300px;
  bottom: 8%;
  left: -100px;
  background: rgba(87, 104, 193, 0.18);
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 36px;
  display: grid;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Do Hyeon", sans-serif;
  font-weight: 400;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

h2 {
  font-size: 1.8rem;
}

.hero-copy,
.section-note,
.empty-copy,
.character-comment,
.request-body,
.info-list,
.character-meta,
.result-count,
.admin-state,
.cooldown-note,
.delete-timer,
.modal-copy,
.ad-copy {
  color: var(--muted);
}

.hero-copy {
  max-width: 760px;
  line-height: 1.7;
  margin: 14px 0 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.theme-toggle-row {
  display: flex;
  justify-content: flex-end;
}

.page-topbar-toggle {
  width: 100%;
}

.theme-toggle-button {
  white-space: nowrap;
}

.hero-badges span,
.character-badge,
.request-status {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid rgba(240, 199, 120, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.admin-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.landing-card {
  padding-bottom: 24px;
}

.selector-shell {
  overflow: hidden;
  padding: 0;
}

.selector-titlebar {
  padding: 18px 24px;
  font-family: "Do Hyeon", sans-serif;
  font-size: 2rem;
  color: var(--selector-title-text);
  background: var(--selector-titlebar-bg);
  border-bottom: 1px solid rgba(255, 215, 133, 0.18);
}

.selector-inner {
  margin: 24px;
  background: var(--panel-bg);
  border: 1px solid rgba(245, 205, 130, 0.12);
  border-radius: 24px;
  padding: 28px 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.selector-headline {
  text-align: center;
  font-family: "Do Hyeon", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: var(--selector-headline-text);
  margin-bottom: 24px;
}

.landing-search-row {
  margin-bottom: 18px;
}

.landing-search-input {
  font-size: 1.05rem;
}

.server-search-empty {
  margin: 8px 0 18px;
  text-align: center;
  color: var(--muted);
}

.server-page {
  display: none;
}

.server-page-active {
  display: block;
}

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

.server-grid.image-style {
  align-items: start;
}

.server-link {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--server-link-text);
  font-family: "Do Hyeon", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.02em;
  text-align: center;
  background:
    linear-gradient(180deg, #c9ced9 0%, #edf1f8 45%, #c1c6d0 100%);
  border: 2px solid #8e6133;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.18);
}

.server-link:hover {
  transform: translateY(-1px);
}

.server-link.locked {
  opacity: 0.86;
}

.server-link.active {
  background:
    linear-gradient(180deg, #f2dca6 0%, #fff4d0 46%, #d7b060 100%);
}

.server-link span {
  line-height: 1.1;
}

.selector-footer {
  margin: 12px 24px 24px;
  background: var(--selector-footer-bg);
  border-radius: 999px;
  border: 1px solid rgba(255, 202, 118, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
}

.selector-pages {
  display: flex;
  gap: 8px;
}

.selector-page-button,
.selector-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--pager-text);
  border: 1px solid transparent;
  font-family: "Do Hyeon", sans-serif;
  font-size: 1.4rem;
}

.selector-page-button.is-current {
  color: var(--accent-strong);
  border-color: rgba(240, 199, 120, 0.22);
  background: rgba(240, 199, 120, 0.08);
}

.selector-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.ad-banner {
  margin-top: 20px;
}

.ad-slot {
  background: var(--ad-slot-bg);
  border: 1px dashed rgba(240, 199, 120, 0.22);
  border-radius: 20px;
  padding: 12px;
}

.ad-preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--ad-preview-bg);
  text-align: center;
}

.ad-preview strong {
  color: var(--text);
  font-size: 1.1rem;
}

.ad-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ad-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(240, 199, 120, 0.2);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ad-preview-minimal {
  gap: 0;
  align-content: center;
}

.ad-preview-banner {
  min-height: 86px;
}

.ad-preview-rectangle {
  min-height: 120px;
}

.ad-preview-sidebar {
  min-height: 160px;
}

.top-nav {
  margin: 0 0 16px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.content-column,
.sidebar-column {
  display: grid;
  gap: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
}

.section-note {
  margin: 0;
  text-align: right;
}

.card > * {
  padding-left: 24px;
  padding-right: 24px;
}

.card > :first-child {
  padding-top: 24px;
}

.card > :last-child {
  padding-bottom: 24px;
}

.search-row,
.login-row,
.admin-toolbar,
.admin-filter-row,
.request-actions,
.character-top,
.modal-head,
.modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-row {
  margin-bottom: 18px;
}

.search-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.search-icon-button {
  width: 92px;
  min-width: 92px;
  padding: 13px 0;
  font-size: 1.7rem;
  line-height: 1;
}

.add-icon-button {
  width: 72px;
  min-width: 72px;
  padding: 13px 0;
  font-size: 2rem;
  line-height: 1;
}

.text-input {
  width: 100%;
  border: 1px solid rgba(196, 207, 230, 0.12);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
}

.text-input:focus {
  outline: 2px solid rgba(240, 199, 120, 0.12);
  border-color: rgba(240, 199, 120, 0.4);
}

.text-area {
  min-height: 110px;
  resize: vertical;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  font: inherit;
  font-weight: 600;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  padding: 13px 18px;
}

.primary-button {
  background: linear-gradient(180deg, #cc9a48, #a86d28);
  color: var(--primary-button-text);
}

.secondary-button {
  background: linear-gradient(180deg, #31445d, #213144);
  color: var(--secondary-button-text);
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form span {
  font-weight: 600;
}

.card-grid,
.request-list {
  display: grid;
  gap: 14px;
}

.character-card,
.request-card,
.empty-state,
.modal-card {
  background: var(--card-bg);
  border: 1px solid rgba(182, 194, 220, 0.1);
  border-radius: 22px;
  padding: 18px;
}

.character-top {
  justify-content: space-between;
  align-items: start;
}

.character-name {
  font-size: 1.45rem;
}

.character-meta,
.character-comment,
.request-title,
.request-body,
.empty-title,
.empty-copy,
.info-list,
.result-count,
.cooldown-note,
.delete-timer {
  margin: 10px 0 0;
}

.delete-timer {
  margin-bottom: 18px;
  line-height: 1.6;
}

.request-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.request-title {
  font-weight: 700;
  color: var(--text);
}

.request-actions {
  margin-top: 14px;
}

.result-count,
.cooldown-note,
.delete-timer {
  font-size: 0.94rem;
}

.admin-toolbar {
  justify-content: space-between;
  margin: 18px 0;
}

.admin-filter-row {
  margin-bottom: 18px;
}

.admin-select {
  max-width: 280px;
}

.info-list {
  padding-left: 18px;
  line-height: 1.7;
}

.empty-state {
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 9, 0.72);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.modal-card {
  width: min(100%, 560px);
  box-shadow: var(--shadow);
}

.modal-head {
  justify-content: space-between;
}

.modal-copy {
  margin: 14px 0 18px;
  line-height: 1.6;
}

.modal-actions {
  justify-content: flex-end;
}

.modal-close {
  flex-shrink: 0;
}

.hidden {
  display: none;
}

.hidden-by-search {
  display: none !important;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .section-head,
  .login-row,
  .admin-toolbar,
  .request-actions,
  .character-top,
  .modal-head,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .section-note {
    text-align: left;
  }

  .search-row {
    flex-direction: row;
    align-items: center;
  }

  .search-actions {
    gap: 10px;
  }

  .search-icon-button {
    width: 76px;
    min-width: 76px;
  }

  .add-icon-button {
    width: 64px;
    min-width: 64px;
  }

  .server-grid {
    grid-template-columns: 1fr;
  }

  .server-link {
    font-size: 1.7rem;
    min-height: 54px;
  }

  .selector-footer {
    gap: 10px;
  }

  .page {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }

  .hero,
  .card > * {
    padding-left: 18px;
    padding-right: 18px;
  }

  .selector-inner,
  .selector-footer {
    margin-left: 18px;
    margin-right: 18px;
  }
}
