:root {
  --bd-bg: #0b0907;
  --bd-panel: #14110e;
  --bd-panel-2: #1a1511;
  --bd-line: rgba(212, 140, 48, 0.35);
  --bd-line-soft: rgba(255, 220, 170, 0.08);
  --bd-gold: #e0a84a;
  --bd-gold-2: #f0c56a;
  --bd-amber: #c47a28;
  --bd-text: #efe6d8;
  --bd-muted: #9b8f80;
  --bd-danger: #c44b3a;
  --bd-radius: 10px;
  --bd-max: 1240px;
}

html, body {
  background: radial-gradient(1200px 600px at 50% -10%, #24180f 0%, var(--bd-bg) 55%) fixed !important;
  color: var(--bd-text) !important;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif !important;
  min-height: 100%;
}

a { color: var(--bd-gold-2); text-decoration: none; }
a:hover { color: #fff3d2; }

.bd-wrap {
  width: min(var(--bd-max), calc(100% - 24px));
  margin: 0 auto;
}

.bd-top {
  padding: 22px 0 8px;
  text-align: center;
}
.bd-logo {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 42px;
  letter-spacing: 0.18em;
  color: var(--bd-gold);
  text-shadow: 0 0 18px rgba(224, 168, 74, 0.25);
  margin: 0;
  font-weight: 700;
}
.bd-logo a { color: inherit; }

.bd-hero {
  margin: 10px auto 18px;
  border: 1px solid var(--bd-line);
  background:
    linear-gradient(90deg, rgba(80, 35, 12, 0.35), rgba(20, 14, 10, 0.2)),
    var(--bd-panel);
  border-radius: var(--bd-radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.bd-hero-kicker {
  font-size: 12px;
  color: var(--bd-muted);
  letter-spacing: 0.04em;
}
.bd-hero h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  color: #ffe4b0;
  font-weight: 700;
}
.bd-hero p {
  margin: 0;
  color: var(--bd-muted);
  font-size: 13px;
  line-height: 1.5;
}
.bd-hero-link {
  white-space: nowrap;
  font-size: 13px;
  color: var(--bd-gold);
  border: 1px solid var(--bd-line);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
}

.bd-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding-bottom: 40px;
  align-items: start;
}

.bd-main {
  min-width: 0;
}
.bd-side {
  position: sticky;
  top: 12px;
}

.bd-card {
  background: linear-gradient(180deg, var(--bd-panel-2), var(--bd-panel));
  border: 1px solid var(--bd-line-soft);
  border-radius: var(--bd-radius);
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.bd-card + .bd-card { margin-top: 12px; }
.bd-card-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bd-line-soft);
  color: var(--bd-gold-2);
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.bd-card-b {
  padding: 8px 10px 10px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.bd-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.bd-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.bd-home .bd-grid-3 > .bd-card,
.bd-home .bd-grid-2 > .bd-card {
  height: 100%;
}
.bd-home .bd-grid-3 .bd-card-b {
  min-height: 168px; /* ~5 list rows */
}
.bd-home .bd-grid-3 .bd-empty {
  margin-top: 0;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  padding: 10px 4px;
}

.bd-notice {
  border: 1px solid var(--bd-line);
  border-radius: var(--bd-radius);
  background: rgba(80, 30, 12, 0.35);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #ffd9a8;
  display: flex;
  gap: 10px;
  align-items: center;
}
.bd-notice-tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1006;
  background: linear-gradient(180deg, #e0a84a, #b87420);
  border-radius: 4px;
  padding: 2px 7px;
}
.bd-card-b:has(ul li) > .bd-empty-fallback,
.bd-card-b:has(.widgetOutput li) > .bd-empty-fallback,
.bd-shots:has(img[src]) + .bd-empty-fallback {
  display: none;
}

.bd-home .zbxe_widget_output,
.bd-home .widgetOutput { display: block; }
.bd-home .widgetContainer,
.bd-home .widgetContainer.black {
  background: transparent !important;
  color: var(--bd-text) !important;
}
.bd-home .bd-card-b ul.widgetA,
.bd-home .bd-card-b ul,
.bd-home .bd-card-b ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bd-home .bd-card-b li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  padding: 6px 2px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  line-height: 1.35;
  min-height: 28px;
}
.bd-home .bd-card-b li:last-child { border-bottom: 0; }
.bd-home .bd-card-b a,
.bd-home .bd-card-b a.title { color: var(--bd-text) !important; }
.bd-home .bd-card-b a:hover { color: var(--bd-gold-2) !important; }
.bd-home .bd-card-b .date,
.bd-home .bd-card-b .hour,
.bd-home .bd-card-b .time {
  color: var(--bd-muted) !important;
  font-size: 11px;
  white-space: nowrap;
}
.bd-empty {
  color: var(--bd-muted);
  font-size: 13px;
  padding: 14px 4px;
  text-align: center;
}

/* RIFT-like: one row of small screenshot thumbs */
.bd-shots {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.bd-shot {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--bd-line-soft);
  background: #0d0b09;
}
.bd-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s ease, opacity .2s ease;
  opacity: .92;
}
.bd-shot:hover img { transform: scale(1.04); opacity: 1; }
.bd-shot-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1511, #0a0908);
}
.bd-gallery-ph {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--bd-muted);
  border: 1px dashed rgba(224,168,74,0.25);
  border-radius: 8px;
  background: rgba(0,0,0,0.25);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.bd-side .login-btn,
.bd-side .bd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  text-align: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}
.bd-btn-primary {
  background: linear-gradient(180deg, #e0a84a, #b87420);
  color: #1a1006 !important;
  border-color: rgba(0,0,0,0.35);
}
.bd-btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--bd-text) !important;
  border-color: var(--bd-line-soft);
}
.bd-side-actions {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.bd-login-form {
  display: grid;
  gap: 8px;
  margin: 0;
}
.bd-login-form input[type="text"],
.bd-login-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--bd-line-soft);
  background: rgba(0, 0, 0, 0.35);
  color: var(--bd-text);
  font-size: 13px;
  outline: none;
}
.bd-login-form input[type="text"]:focus,
.bd-login-form input[type="password"]:focus {
  border-color: rgba(224, 168, 74, 0.65);
}
.bd-login-form input::placeholder {
  color: rgba(232, 224, 210, 0.45);
}
.bd-keep {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--bd-muted);
  user-select: none;
}
.bd-keep input {
  margin: 0;
}
.bd-login-extra {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--bd-muted);
  text-decoration: none;
  padding: 2px 0 4px;
}
.bd-login-extra:hover {
  color: var(--bd-gold, #e0a84a);
}
.bd-chatbox {
  height: 420px;
  border-top: 1px solid var(--bd-line-soft);
  position: relative;
  overflow: hidden;
  background: #000;
}
.bd-chatbox .elkhacord,
.bd-chatbox .elkhacord-iframe,
.bd-chatbox iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
  background: #000;
  display: block;
}
.bd-chatbox .elkhacord {
  display: block !important;
}

/* full chat pages (page1 등): 카드 안에서 높이 확보
   elkhacord_init 이후 .elkhacord 가 iframe 으로 바뀌므로 :has(iframe) 도 포함 */
.bd-main .bd-card-b:has(.elkhacord),
.bd-main .bd-card-b:has(iframe[src*="elkhacord"]) {
  height: min(72vh, 720px);
  min-height: 520px;
  padding: 0 !important;
  overflow: hidden;
}
.bd-main .bd-card-b .elkhacord,
.bd-main .bd-card-b .elkhacord-iframe,
.bd-main .bd-card-b iframe[src*="elkhacord"] {
  width: 100% !important;
  height: 100% !important;
  min-height: 520px;
  display: block !important;
  border: 0;
}
.bd-status {
  padding: 10px 12px;
  font-size: 12px;
  color: #ffb4a4;
  line-height: 1.55;
}
.bd-status strong { color: var(--bd-gold-2); }
.bd-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #ffd0c4;
}
.bd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf6a;
  box-shadow: 0 0 8px rgba(62, 207, 106, 0.7);
}

.bd-footer {
  text-align: center;
  color: var(--bd-muted);
  font-size: 12px;
  padding: 8px 0 28px;
}

/* tame inherited light skins inside content */
.bd-main .x, .bd-main .board, .bd-main .content {
  color: var(--bd-text);
}
.bd-main table,
.bd-main .board_list,
.bd-main .bd_lst {
  background: transparent !important;
  color: var(--bd-text) !important;
}

@media (max-width: 980px) {
  .bd-shell { grid-template-columns: 1fr; }
  .bd-side { position: static; }
  .bd-grid-3 { grid-template-columns: 1fr 1fr; }
  .bd-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bd-hero { grid-template-columns: 1fr; }
  .bd-logo { font-size: 34px; letter-spacing: 0.12em; }
}
@media (max-width: 640px) {
  .bd-grid-3, .bd-grid-2 { grid-template-columns: 1fr; }
  .bd-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
