/* 도리존 — 허브와 대시보드가 같이 쓰는 스타일 */
:root {
  --bg: #f1f1ef;
  --card: #ffffff;
  --line: #e2e2de;
  --ink: #111111;
  --muted: #6b6b66;
  --lime: #c8f52e;
  --night: #16161a;
  --night-2: #1f1f25;
  --display: 'Black Han Sans', 'Pretendard Variable', Pretendard, sans-serif;
  --body: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --r: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
body > .wrap { flex: 1; width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

/* ── 머리 ─────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand b { font: 400 24px/1 var(--display); letter-spacing: 0.01em; padding-top: 2px; }
.brand small { font-size: 12.5px; color: var(--muted); margin-left: 2px; }
.top-link { font-size: 13px; color: var(--muted); text-underline-offset: 3px; }
.top-link:hover { color: var(--ink); }

/* ── 공통 조각 ─────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--lime); }
.btn:active { transform: none; box-shadow: none; }
.btn.lime { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn.lime:hover { box-shadow: 3px 3px 0 rgba(255, 255, 255, .35); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { box-shadow: 3px 3px 0 var(--ink); }
.pill {
  display: inline-block; padding: 3px 9px 2px; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-size: 11.5px; font-weight: 800; white-space: nowrap;
}

/* ── 방 코드 ───────────────────────────── */
.room { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-bottom: 26px; }
.room label { font-weight: 700; }
.room form { display: flex; gap: 8px; flex: 0 1 460px; }
.room input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--ink); background: #fff;
  font: 400 17px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
}
.room input::placeholder { color: #a5a5a0; letter-spacing: 0.06em; }

/* ── 이어서 하기 ───────────────────────── */
.eyebrow { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-weight: 700; font-size: 13.5px; text-decoration: none;
  transition: border-color .12s ease;
}
.chip:hover { border-color: var(--ink); }
.chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ── 이번 주 추천 ──────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden;
  background: var(--night); color: #fff; border-radius: 22px; margin-bottom: 34px;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-copy { padding: clamp(24px, 3.4vw, 44px); display: flex; flex-direction: column; align-items: flex-start; }
.hero h2 { font: 400 clamp(32px, 5.4vw, 64px)/1.08 var(--display); margin: 14px 0 10px; letter-spacing: 0.005em; word-break: keep-all; }
.hero p { margin: 0 0 26px; color: #b9b9b4; font-size: clamp(15px, 1.5vw, 18px); }
.hero .btn { min-width: 168px; height: 48px; margin-top: auto; }
.hero-media {
  position: relative; min-height: clamp(210px, 28vw, 340px); background: var(--night-2);
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px); background-size: 14px 14px;
  display: grid; place-items: center;
}
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media .mascot { position: relative; z-index: 1; width: 44%; max-width: 260px; height: auto; object-fit: contain; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .35)); }
.hero-media::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 34%; background: linear-gradient(90deg, var(--night), transparent); pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ── 게임 목록 ─────────────────────────── */
.sec { margin-bottom: 30px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.sec-head h2 { font: 400 clamp(23px, 2.2vw, 27px)/1.1 var(--display); margin: 0; }
.sec-head span { font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card {
  display: flex; align-items: center; gap: 13px; padding: 11px 12px; min-height: 74px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; position: relative;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card .pill { position: absolute; top: -9px; right: 12px; }
.card-text span i { font-style: normal; white-space: nowrap; }
a.card:hover { transform: translate(-2px, -2px); border-color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }
a.card:active { transform: none; box-shadow: none; }
.tile { flex: none; width: 50px; height: 50px; border-radius: 12px; object-fit: cover; background: #ecece8; }
.card-text { min-width: 0; flex: 1; }
.card-text b { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.card-text span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; word-break: keep-all; }
.card.soon { background: transparent; border-style: dashed; border-color: #cfcfca; }
.card.soon .tile { filter: grayscale(1); opacity: .55; }
.card.soon b { color: #55554f; }
.card .wait { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ── 투표 ─────────────────────────────── */
.vote { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; margin: 6px 0 44px; flex-wrap: wrap; }
.vote > b { font-size: 15px; }
.vote-options { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.vote-options .btn { height: 40px; padding: 0 16px; font-size: 13.5px; }

/* ── 바닥 ─────────────────────────────── */
.foot { border-top: 1px solid var(--line); }
.foot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; padding-top: 22px; padding-bottom: 34px; font-size: 12.5px; color: var(--muted); }
.foot nav { display: flex; gap: 18px; }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ── 대시보드 ──────────────────────────── */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; background: #e6e6e2; border-radius: 12px; }
.seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.controls select { height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.kpi { padding: 14px 16px 12px; }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); }
.kpi b { display: block; font: 400 30px/1.2 var(--display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi.accent { background: var(--night); border-color: var(--night); color: #fff; }
.kpi.accent span { color: #b9b9b4; }
.kpi.accent b { color: var(--lime); }
.box { padding: 16px; margin-bottom: 10px; }
.box h2 { font: 400 18px/1.2 var(--display); margin: 0 0 4px; }
.box > p { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cols .box { margin-bottom: 0; }
.cols { margin-bottom: 10px; }
.chart { display: block; width: 100%; height: 150px; }
.chart rect { fill: var(--ink); }
.chart rect:hover { fill: #5c7a00; }
.chart rect.zero { fill: #dcdcd7; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.rows { display: grid; gap: 7px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 13px; }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .val { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.row .val b { color: var(--ink); }
.row .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #ecece8; overflow: hidden; }
.row .track i { display: block; height: 100%; border-radius: 3px; background: var(--ink); }
.row:first-child .track i { background: #9bc400; }
.funnel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.funnel + .funnel-name, .funnel-name { font-weight: 700; font-size: 13.5px; margin-top: 14px; }
.funnel-name:first-of-type { margin-top: 0; }
.step { padding: 10px 12px; border-radius: 10px; background: #f4f4f1; }
.step span { display: block; font-size: 12px; color: var(--muted); }
.step b { font: 400 22px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.step em { font-style: normal; font-size: 12px; font-weight: 700; margin-left: 6px; color: #5c7a00; }
.empty { padding: 18px 0 8px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .room { flex-direction: column; align-items: stretch; gap: 10px; }
  .room form { flex: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 22px 20px 22px; }
  .hero .btn { width: 100%; max-width: 220px; }
  .hero-media { min-height: 170px; }
  .hero-media::after { inset: 0 0 auto 0; width: auto; height: 30%; background: linear-gradient(180deg, var(--night), transparent); }
  .grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .foot .wrap { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
