/* 추석 뽑기 제어판 - "Royal Harvest" 팔레트 */
:root {
  --bg0: #0a1128;
  --bg1: #0e1733;
  --surface: #131f42;
  --surface-2: #192850;
  --surface-3: #20315f;
  --line: #243463;
  --line-2: #33477e;
  --text: #eef1ff;
  --muted: #9aa7c7;
  --faint: #6f7ea8;
  --gold: #f2c94c;
  --gold-hi: #ffe259;
  --gold-lo: #ffa751;
  --persimmon: #ff7a59;
  --jade: #4cc3ae;
  --danger: #ff6b7f;
  --radius: 18px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, 'Malgun Gothic', sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
}
body {
  min-height: 100vh;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(242, 201, 76, 0.1), transparent 60%),
    linear-gradient(180deg, #0b1530 0%, #141e30 55%, #1b2c45 100%);
  background-attachment: fixed;
}
a {
  color: var(--gold);
  text-decoration: none;
}
a .i {
  width: 12px;
  height: 12px;
  margin-left: 2px;
}
b {
  font-weight: 700;
}
.muted {
  color: var(--muted);
}

/* ---------- 아이콘 (Lucide) ---------- */
.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(10, 17, 40, 0.86);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(242, 201, 76, 0.35);
}
.brand-txt {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-txt b {
  font-family: 'Jua', sans-serif;
  font-weight: 400;
  font-size: 21px;
  color: var(--gold);
}
.brand-txt small {
  color: var(--faint);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  min-width: 0;
}
.pill.chat {
  padding-right: 4px;
  margin-left: auto;
  max-width: 460px;
}
.pill.chat #chatText {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: #5b6788;
}
.dot.on {
  background: var(--jade);
  box-shadow: 0 0 0 4px rgba(76, 195, 174, 0.18);
  animation: breathe 1.6s ease-in-out infinite;
}
.dot.connecting {
  background: var(--gold);
  animation: breathe 0.9s ease-in-out infinite;
}
.dot.error,
.dot.login {
  background: var(--danger);
}
@keyframes breathe {
  50% {
    box-shadow: 0 0 0 7px rgba(76, 195, 174, 0);
    opacity: 0.75;
  }
}
/* 진행 상태 pill: 상태마다 색을 확실히 다르게 */
.phase.idle {
  color: var(--muted);
}
.phase.collect {
  background: rgba(76, 195, 174, 0.14);
  border-color: rgba(76, 195, 174, 0.55);
  color: #8ee6d6;
}
.phase.collect .dot {
  background: var(--jade);
  animation: breathe 1.6s ease-in-out infinite;
}
.phase.closed {
  background: rgba(255, 122, 89, 0.12);
  border-color: rgba(255, 122, 89, 0.5);
  color: #ffb39f;
}
.phase.closed .dot {
  background: var(--persimmon);
}
.phase.draw {
  background: rgba(242, 201, 76, 0.16);
  border-color: rgba(242, 201, 76, 0.6);
  color: var(--gold-hi);
}
.phase.draw .dot {
  background: var(--gold);
  animation: breathe 0.9s ease-in-out infinite;
}
.phase.prize {
  background: rgba(255, 167, 81, 0.14);
  border-color: rgba(255, 167, 81, 0.55);
  color: #ffc98f;
}
.phase.prize .dot {
  background: var(--gold-lo);
}
.phase b {
  font-variant-numeric: tabular-nums;
}
.top-actions {
  display: flex;
  gap: 6px;
}

/* ---------- 요약 영역 ---------- */
.hero {
  position: relative;
  margin: 16px 20px 0;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(11, 21, 48, 0.96) 0%, rgba(11, 21, 48, 0.82) 55%, rgba(11, 21, 48, 0.35) 100%),
    url('../img/bg-night.webp') right 30% / cover no-repeat;
}
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 150px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(19, 31, 66, 0.75);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.stat > .i {
  width: 22px;
  height: 22px;
  color: var(--gold);
}
.stat small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.stat b {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat.hurry b {
  color: var(--persimmon);
}
.stat b.bump {
  animation: bump 0.45s var(--spring);
}
@keyframes bump {
  30% {
    transform: translateY(-3px) scale(1.08);
    color: var(--gold-hi);
  }
}

.flow {
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.flow li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  color: var(--faint);
  font-weight: 700;
  font-size: 13px;
  background: rgba(10, 17, 40, 0.55);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-out);
}
.flow li + li::before {
  content: '';
  width: 14px;
  height: 2px;
  margin: 0 4px 0 -12px;
  background: var(--line-2);
}
.flow li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
}
.flow li.done {
  color: var(--muted);
}
.flow li.done span {
  background: var(--jade);
  color: #06201b;
}
.flow li.now {
  color: #2a1a00;
  background: linear-gradient(90deg, var(--gold-hi), var(--gold-lo));
  box-shadow: 0 6px 20px rgba(242, 201, 76, 0.28);
}
.flow li.now span {
  background: rgba(42, 26, 0, 0.15);
}

/* ---------- 레이아웃 ---------- */
.grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(360px, 1.12fr) minmax(330px, 1fr);
  gap: 16px;
  padding: 16px 20px 48px;
  align-items: start;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
@media (max-width: 1280px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .flow {
    margin-left: 0;
  }
}
@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
    padding: 12px 12px 40px;
  }
  .hero {
    margin: 12px 12px 0;
  }
  .topbar {
    height: auto;
    padding: 10px 12px;
    flex-wrap: wrap;
  }
  .pill.chat {
    margin-left: 0;
    order: 5;
    width: 100%;
    max-width: none;
  }
  .top-actions .btn span {
    display: none;
  }
}

.card {
  background: linear-gradient(180deg, rgba(25, 40, 80, 0.72), rgba(19, 31, 66, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  min-width: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 30px rgba(3, 8, 24, 0.25);
}
.card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-h h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.card-h .h-ic {
  color: var(--gold);
}
.step-no {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  color: #2a1a00;
  font-weight: 800;
  font-size: 13px;
}
.count {
  margin-left: auto;
  min-width: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg1);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
details.card > summary {
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
}
details.card > summary::-webkit-details-marker {
  display: none;
}
details.card > summary .chev {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s;
}
details.card[open] > summary {
  margin-bottom: 14px;
}
details.card[open] > summary .chev {
  transform: rotate(180deg);
}

/* ---------- 입력 ---------- */
input[type='text'],
input[type='search'],
input[type='number'],
input[type='password'],
select {
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text);
  font: inherit;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder {
  color: var(--faint);
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2);
}
input[type='range'] {
  width: 100%;
  accent-color: var(--gold);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.row.tight {
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  margin-bottom: 8px;
}
.grow {
  flex: 1;
  min-width: 0;
}

/* 스테퍼 (-/+) */
.stepper {
  display: inline-flex;
  align-items: center;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg1);
  overflow: hidden;
}
.stepper button {
  width: 34px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stepper button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.stepper input {
  width: 64px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper input:focus {
  box-shadow: none;
}
.stepper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.2);
}
.stepper.sm {
  height: 34px;
}
.stepper.sm input {
  width: 46px;
}

.chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 3px;
}
.chips button {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.chips button:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.chips button.on {
  color: var(--gold-hi);
  border-color: rgba(242, 201, 76, 0.6);
  background: rgba(242, 201, 76, 0.1);
}

/* 스위치 */
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  margin: 4px 0 10px;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch i {
  position: relative;
  width: 36px;
  height: 21px;
  flex: none;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  transition: background 0.2s;
}
.switch i::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #c7cff0;
  transition: transform 0.25s var(--spring), background 0.2s;
}
.switch input:checked + i {
  background: linear-gradient(90deg, var(--gold-hi), var(--gold-lo));
  border-color: transparent;
}
.switch input:checked + i::after {
  transform: translateX(15px);
  background: #2a1a00;
}
.switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.3);
}
.switches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
  padding-top: 8px;
}
.switches .switch {
  margin: 4px 0;
}

details.sub {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(14, 23, 51, 0.6);
  border: 1px solid var(--line);
}
details.sub summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}
details.sub summary::-webkit-details-marker {
  display: none;
}
details.sub summary .i {
  width: 16px;
  height: 16px;
  transform: rotate(-90deg);
  transition: transform 0.2s;
}
details.sub[open] summary .i {
  transform: none;
}

/* 세그먼트 컨트롤 (움직이는 thumb) */
.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg1);
  border: 1px solid var(--line);
  gap: 2px;
  isolation: isolate;
}
.seg.wide {
  display: flex;
  margin-bottom: 14px;
}
.seg.wide button {
  flex: 1;
}
.seg .thumb {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: var(--w, 0);
  transform: translateX(var(--x, 0));
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  box-shadow: 0 4px 14px rgba(242, 201, 76, 0.3);
  transition: transform 0.22s var(--ease-out), width 0.22s var(--ease-out);
}
.seg.scene .thumb {
  background: linear-gradient(135deg, #6fe0cb, var(--jade));
  box-shadow: 0 4px 14px rgba(76, 195, 174, 0.3);
}
.seg button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.2s;
}
.seg button .i {
  width: 16px;
  height: 16px;
}
.seg button:hover {
  color: var(--text);
}
.seg button.on {
  color: #2a1a00;
}
.seg.scene button.on {
  color: #062a22;
}

/* ---------- 버튼 ---------- */
.btn {
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid rgba(242, 201, 76, 0.35);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:hover {
  background: rgba(242, 201, 76, 0.08);
  border-color: rgba(242, 201, 76, 0.6);
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn .i {
  width: 17px;
  height: 17px;
}
.btn.xs {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 999px;
}
.btn.sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn.lg {
  height: 50px;
  font-size: 16px;
  border-radius: 13px;
}
.btn.icon-only {
  padding: 0;
  width: 34px;
}
.btn.primary {
  border: 0;
  color: #2a1a00;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  box-shadow: 0 8px 22px rgba(242, 201, 76, 0.22), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(242, 201, 76, 0.32), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}
.btn.stop {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #ff9a7a, var(--persimmon) 50%, #f0566b);
  box-shadow: 0 8px 22px rgba(255, 122, 89, 0.25);
}
.btn.ghost {
  border-color: var(--line);
}
.btn.ghost:hover {
  border-color: var(--line-2);
  background: var(--surface-2);
}
.btn.text {
  border: 0;
  height: 30px;
  padding: 0 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
.btn.text:hover {
  color: var(--text);
  background: transparent;
  text-decoration: underline;
}
.btn.danger {
  border-color: rgba(255, 107, 127, 0.45);
  color: #ff9aa8;
}
.btn.danger:hover {
  background: rgba(255, 107, 127, 0.1);
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.actions.end {
  justify-content: flex-end;
  margin-top: 6px;
}
.micro {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.55;
}
.icon-btn {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn .i {
  width: 16px;
  height: 16px;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}
.icon-btn.del:hover {
  color: var(--danger);
}

/* ---------- 참여 타이머 ---------- */
.timer-box {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--bg1);
  border: 1px solid var(--line);
}
.tb-time {
  font-family: 'Jua', sans-serif;
  font-size: 46px;
  line-height: 1;
  min-width: 118px;
  font-variant-numeric: tabular-nums;
}
.tb-time.hurry {
  color: var(--persimmon);
  animation: tick 1s steps(1) infinite;
}
@keyframes tick {
  50% {
    transform: scale(1.04);
  }
}
.tb-meta {
  flex: 1;
  min-width: 0;
}
.tb-state {
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-state.running {
  color: #8ee6d6;
}
.tb-state.ended {
  color: #ffb39f;
}
.tb-count {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
}
.tb-count b {
  font-family: 'Jua', sans-serif;
  font-weight: 400;
  font-size: 32px;
  color: var(--gold);
  margin-right: 2px;
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg1);
  overflow: hidden;
  margin-top: 8px;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.25s linear;
}

.note {
  margin: 2px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(14, 23, 51, 0.6);
  border: 1px dashed var(--line-2);
  color: var(--muted);
  line-height: 1.55;
}
.note b {
  color: var(--text);
}
.note .warn {
  color: #ffb39f;
}
.draw-status {
  margin-top: 10px;
}
.draw-status:empty {
  display: none;
}
.st-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(76, 195, 174, 0.08);
  border: 1px solid rgba(76, 195, 174, 0.35);
  line-height: 1.5;
}
.st-box > .i {
  margin-top: 2px;
  color: var(--jade);
}
.st-box.done {
  background: rgba(242, 201, 76, 0.08);
  border-color: rgba(242, 201, 76, 0.45);
}
.st-box.done > .i {
  color: var(--gold);
}
.st-box .spin {
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.wn {
  display: inline-block;
  margin: 6px 6px 0 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  color: #2a1a00;
  font-weight: 800;
}

/* ---------- 목록 ---------- */
.plist,
.wlist,
.przlist,
.hlist,
.chatlog {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search {
  position: relative;
  margin-bottom: 8px;
}
.search .i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
}
.search input {
  width: 100%;
  padding-left: 34px;
}
.plist {
  max-height: 440px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg1);
}
.plist li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.plist li:last-child {
  border-bottom: 0;
}
.plist li.new {
  animation: rise 0.22s var(--ease-out);
}
@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}
.plist .n {
  width: 34px;
  flex: none;
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.plist .nick {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}
.plist .nick .i {
  width: 14px;
  height: 14px;
  color: var(--gold);
}
.plist .id {
  color: var(--faint);
  font-size: 12px;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plist .more {
  padding: 10px;
  text-align: center;
  color: var(--faint);
  display: block;
}

/* 빈 화면 */
.empty {
  list-style: none;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 18px 12px 16px !important;
  border: 0 !important;
  background: transparent !important;
}
.empty img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 4px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}
.empty b {
  font-size: 14px;
}
.empty span {
  color: var(--faint);
  font-size: 12.5px;
  max-width: 260px;
  line-height: 1.5;
}

.wlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}
.wlist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 10px;
  border-radius: 14px;
  background: var(--bg1);
  border: 1px solid var(--line);
}
.wlist li.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 6px 18px rgba(242, 201, 76, 0.15);
}
.wlist .rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}
.wlist .who {
  flex: 1;
  min-width: 0;
}
.wlist .who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wlist .who small {
  color: var(--faint);
}
.wlist .got {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(242, 201, 76, 0.12);
  color: var(--gold);
  font-weight: 700;
  font-size: 12.5px;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wlist .got .i {
  width: 14px;
  height: 14px;
}

/* ---------- 상품 뽑기 ---------- */
.pick-box {
  padding: 14px;
  border-radius: 16px;
  background: var(--bg1);
  border: 1px solid var(--line);
}
.pick-empty {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pick-empty img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.pick-empty span {
  color: var(--muted);
  line-height: 1.5;
}
.pick-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}
.pick-head .i {
  color: var(--gold);
}
.pick-head b {
  color: var(--gold);
}
.pick-sub {
  margin: 4px 0 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pick-sub .dot {
  background: var(--gold);
  animation: breathe 1.2s ease-in-out infinite;
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}
.pick-grid button {
  height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(242, 201, 76, 0.45);
  background: url('../img/card-back.webp') center / cover;
  color: #fff6d4;
  font-family: 'Jua', sans-serif;
  font-size: 20px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: transform 0.15s var(--spring);
}
.pick-grid button:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--gold-hi);
}
.pick-grid button.chosen {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  color: #2a1a00;
  text-shadow: none;
}
.pick-grid button:disabled:not(.chosen) {
  opacity: 0.35;
}
.pick-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(242, 201, 76, 0.1);
  border: 1px solid rgba(242, 201, 76, 0.4);
}
.pick-result img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}
.pick-result small {
  color: var(--muted);
}
.pick-result b {
  display: block;
  font-size: 16px;
  color: var(--gold);
}

/* ---------- 상품 관리 ---------- */
.prize-form {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.drop {
  position: relative;
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 16px;
  border: 1.5px dashed var(--line-2);
  background: var(--bg1);
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.2s, color 0.15s;
}
.drop-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  font-weight: 700;
}
.drop-txt .i {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}
.drop small {
  font-weight: 500;
  font-size: 10.5px;
  color: var(--faint);
}
.drop:hover,
.drop.over {
  border-color: var(--gold);
  color: var(--text);
}
.drop.over {
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.18), 0 0 24px rgba(242, 201, 76, 0.35);
}
.drop img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  display: none;
}
.drop.has img {
  display: block;
}
.drop.has .drop-txt {
  display: none;
}
.prize-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.przlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow: auto;
}
.przlist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 14px;
  background: var(--bg1);
  border: 1px solid var(--line);
}
.przlist li.out {
  opacity: 0.5;
}
.przlist .thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 11px;
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  color: var(--faint);
}
.przlist .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.przlist .thumb:hover::after {
  content: '변경';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 17, 40, 0.75);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.przlist .pname {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-color: transparent;
  background: transparent;
  font-weight: 700;
}
.przlist .pname:hover {
  border-color: var(--line);
}
.przlist .stock {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.przlist .stock span {
  min-width: 50px;
  text-align: center;
  font-weight: 800;
}
.przlist .stock span small {
  color: var(--faint);
  font-weight: 500;
}

/* ---------- 미리보기 ---------- */
.dock .card-h {
  margin-bottom: 12px;
}
.live-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 107, 127, 0.12);
  border: 1px solid rgba(255, 107, 127, 0.45);
  color: #ff9aa8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.live-badge .dot {
  width: 7px;
  height: 7px;
  background: var(--danger);
  animation: breathe 1.4s ease-in-out infinite;
}
.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: repeating-conic-gradient(#172448 0% 25%, #121d3c 0% 50%) 50% / 22px 22px;
}
.preview iframe {
  /* 부모(dark)와 color-scheme 이 다르면 크롬이 흰 배경을 깔아버림 */
  color-scheme: normal;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hlist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow: auto;
}
.hlist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 8px;
  border-radius: 12px;
  background: var(--bg1);
}
.hlist .thumb {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
}
.hlist .t {
  color: var(--faint);
  font-size: 12px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.hlist .who {
  font-weight: 700;
  flex: none;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hlist .what {
  flex: 1;
  min-width: 0;
  color: var(--gold);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatlog {
  height: 220px;
  overflow: auto;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--bg1);
  border: 1px solid var(--line);
  font-size: 13px;
}
.chatlog li {
  padding: 2px 0;
  word-break: break-all;
}
.chatlog .cn {
  color: #8fb8ff;
  font-weight: 700;
  margin-right: 6px;
}
.chatlog li.hit {
  color: #8ee6d6;
}
.chatlog li.pick {
  color: var(--gold);
}

/* ---------- 모달 ---------- */
.modal {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border-radius: 22px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #16244c, #111b3a);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal[open] {
  animation: modalIn 0.28s var(--ease-out);
}
@keyframes modalIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}
.modal::backdrop {
  background: rgba(5, 8, 22, 0.7);
  backdrop-filter: blur(4px);
}
.modal-body {
  padding: 8px 24px 24px;
}
.modal-h {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 10px;
  background: linear-gradient(180deg, #16244c 70%, rgba(22, 36, 76, 0));
}
.modal-h h2 {
  margin: 0;
  font-size: 20px;
}
.m-sec {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.m-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--gold);
}
.m-sec .field {
  margin: 10px 0;
}
.m-sec .micro {
  margin: 0 0 10px;
}

.passive {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  background: rgba(5, 8, 22, 0.82);
  backdrop-filter: blur(5px);
}
.passive.show {
  display: grid;
}
.passive-box {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 28px 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  text-align: center;
  line-height: 1.7;
}
.passive-box img {
  width: 110px;
}

/* ---------- 토스트 ---------- */
.toasts {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 12px 14px 12px 14px;
  border-radius: 14px;
  background: #1c2a56;
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  font-weight: 600;
  line-height: 1.45;
  animation: toastIn 0.35s var(--spring);
}
.toast > .i {
  color: var(--muted);
}
.toast.ok > .i {
  color: var(--jade);
}
.toast.err {
  background: #3a1a2e;
  border-color: #7a2c45;
}
.toast.err > .i {
  color: var(--danger);
}
.toast .x {
  margin-left: 4px;
  width: 24px;
  height: 24px;
}
.toast.out {
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateX(16px);
}
@keyframes toastIn {
  from {
    transform: translateY(14px) scale(0.96);
    opacity: 0;
  }
}

.pin-only,
.cards-only,
.wheel-only {
  display: none !important;
}
body.m-pinball .pin-only,
body.pm-cards .cards-only,
body.pm-wheel .wheel-only {
  display: flex !important;
}

/* ---------- 참여 조건 (OR) ---------- */
.cond-sum {
  margin-left: auto;
  padding-left: 10px;
  color: var(--gold);
  font-weight: 700;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cond {
  padding-top: 10px;
}
.cond-label {
  margin: 4px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.cond-label small {
  margin-left: 6px;
  color: var(--faint);
  font-weight: 500;
}
.chips.multi {
  margin-bottom: 8px;
}
.chips.multi button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chips button.na {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}
.chips button.na small {
  font-size: 10px;
  color: var(--faint);
}
.switches .switch {
  font-size: 13px;
}

/* ---------- 상품 뽑기 (선택 기능) ---------- */
.opt-tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.head-switch {
  margin: 0 0 0 auto;
}
body.prize-off .prize-only {
  display: none !important;
}
body:not(.prize-off) .prize-off-only {
  display: none !important;
}
body.prize-off #prizeCard .card-h {
  margin-bottom: 6px;
}
.mode-desc {
  margin: -6px 0 12px;
}
.pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pick-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s var(--spring);
}
.pick-list button:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateX(3px);
}
.pick-list button:disabled:not(.chosen) {
  opacity: 0.4;
  cursor: default;
}
.pick-list button.chosen {
  border-color: var(--gold);
  background: rgba(242, 201, 76, 0.12);
}
.pick-list .no {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-lo));
  color: #2a1a00;
  font-family: 'Jua', sans-serif;
  font-size: 16px;
}
.pick-list img {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg1);
}
.pick-list .nm {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-list .lf {
  color: var(--faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chatlog li.skip {
  color: var(--faint);
}
.chatlog li .why {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 122, 89, 0.15);
  color: #ffb39f;
  font-size: 11px;
}
#tBadge {
  width: 96px;
  flex: none;
  padding: 0 6px;
}

/* ---------- 시작하기 안내 ---------- */
.setup {
  position: relative;
  margin: 12px 20px 0;
  padding: 14px 52px 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(242, 201, 76, 0.45);
  background: linear-gradient(90deg, rgba(242, 201, 76, 0.12), rgba(19, 31, 66, 0.9) 60%);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.setup.hide {
  display: none;
}
.setup-h {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}
.setup-h img {
  width: 52px;
  margin: -10px 0;
}
.setup-h b {
  display: block;
  font-size: 16px;
  color: var(--gold);
}
.setup-h small,
.setup-steps small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.setup-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}
.setup-steps li {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(10, 17, 40, 0.55);
  border: 1px solid var(--line);
}
.setup-steps li > div {
  flex: 1;
  min-width: 0;
}
.setup-steps .sn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  font-weight: 800;
  font-size: 13px;
}
.setup-steps li.done {
  border-color: rgba(76, 195, 174, 0.5);
}
.setup-steps li.done .sn {
  background: var(--jade);
  color: #06201b;
}
.setup-steps li.done .btn {
  display: none;
}
.setup > .icon-btn {
  position: absolute;
  right: 10px;
  top: 10px;
}
@media (max-width: 860px) {
  .setup {
    margin: 12px 12px 0;
  }
}

.login-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-weight: 700;
}
.dot.waiting {
  background: var(--gold);
  animation: breathe 1.6s ease-in-out infinite;
}

/* ---------- 처음 연결 중 ---------- */
.boot {
  display: none;
}
body.booting .boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: rgba(10, 17, 40, 0.72);
  backdrop-filter: blur(3px);
  font-weight: 700;
  color: var(--muted);
}
body.booting .boot img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  animation: bootPulse 1.2s ease-in-out infinite;
}
@keyframes bootPulse {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(242, 201, 76, 0.5);
  }
}

/* ---------- 숲 로그인 창 ---------- */
.login-modal {
  width: min(460px, calc(100vw - 32px));
}
.login-modal .modal-h h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-modal .modal-h h2 img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.login-body {
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--bg1);
  border: 1px solid var(--line);
  text-align: center;
}
.login-body .lb-ic {
  width: 40px;
  height: 40px;
  color: var(--gold);
  margin-bottom: 6px;
}
.login-body .lb-ic.spin {
  animation: spin 1.2s linear infinite;
}
.login-body .lb-ic.ok {
  color: var(--jade);
}
.login-body .lb-ic.bad {
  color: var(--danger);
}
.login-body .lb-title {
  font-size: 16px;
  font-weight: 800;
}
.login-body .lb-sub {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.55;
}
.login-body .btn.lg {
  margin-top: 14px;
  width: 100%;
  text-decoration: none;
}
.login-body .lb-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.login-body .lb-wait {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.login-body .lb-wait .dot {
  background: var(--gold);
  animation: breathe 1.2s ease-in-out infinite;
}
.login-steps {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.login-steps li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.login-steps b {
  color: var(--text);
}

/* ---------- 미리보기: 스킨 / 캠 자리 ---------- */
.dock-opts {
  display: flex;
  align-items: flex-end;
  gap: 10px 18px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}
.dock-opts .switch {
  margin: 0 0 7px;
}

.micro.cam-tip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(242, 201, 76, 0.07);
  border: 1px solid rgba(242, 201, 76, 0.3);
  color: var(--muted);
}
.micro.cam-tip .i {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--gold);
}
.micro.cam-tip b {
  color: var(--text);
}
