:root {
  color-scheme: dark;
  --ink: #f2eee5;
  --muted: #aaa6a0;
  --paper: #181820;
  --paper-2: #20202a;
  --line: rgba(255,255,255,.1);
  --gold: #d6ae62;
  --red: #bc4a50;
  --blue: #698db8;
  --green: #74a483;
  --shadow: 0 24px 70px rgba(0,0,0,.36);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #0e0e14; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 50% -20%, #292836 0, #121219 46%, #0d0d12 100%); font: 15px/1.55 Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; inset: 0; pointer-events: none; opacity: .22; background-image: linear-gradient(30deg, transparent 48%, rgba(255,255,255,.025) 49%, transparent 51%); background-size: 18px 18px; }
.topbar { position: relative; z-index: 5; height: 76px; max-width: 1180px; margin: auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { border: 0; background: none; display: flex; gap: 12px; align-items: center; padding: 0; cursor: pointer; text-align: left; }
.brand-mark { width: 42px; height: 42px; border: 1px solid rgba(214,174,98,.5); border-radius: 50%; display: grid; place-items: center; color: var(--gold); font-family: Georgia, serif; font-size: 12px; }
.brand strong { display: block; font: 700 17px/1.1 Georgia, "Noto Serif KR", serif; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; letter-spacing: .2em; }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
main { position: relative; z-index: 1; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 80px; }
.hero { min-height: calc(100vh - 150px); display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 70px; }
.eyebrow { color: var(--gold); text-transform: uppercase; font-size: 11px; letter-spacing: .22em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 16px 0 22px; font: 500 clamp(42px, 6vw, 78px)/1.03 Georgia, "Noto Serif KR", serif; letter-spacing: -.045em; }
h1 em { color: var(--gold); font-style: normal; }
.lede { max-width: 560px; color: #c3c0ba; font-size: 17px; }
.feature-line { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.feature-line span, .pill { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; background: rgba(255,255,255,.025); }
.panel { border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(150deg, rgba(34,34,45,.95), rgba(20,20,27,.97)); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab { padding: 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--ink); border-color: var(--gold); background: rgba(214,174,98,.05); }
.form { padding: 27px; }
.field { display: block; margin-bottom: 19px; }
.field > span { display: block; margin-bottom: 8px; color: #cbc8c1; font-size: 12px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #111118; color: var(--ink); outline: none; transition: border .18s, box-shadow .18s; }
input, select { height: 48px; padding: 0 13px; }
textarea { min-height: 150px; padding: 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(214,174,98,.7); box-shadow: 0 0 0 3px rgba(214,174,98,.09); }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 20px; }
.switch-row small { display: block; color: var(--muted); }
.switch { width: 46px; height: 26px; padding: 3px; border: 0; border-radius: 20px; background: #393943; cursor: pointer; }
.switch::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform .2s; }
.switch.on { background: var(--gold); }
.switch.on::after { transform: translateX(20px); }
.btn { min-height: 44px; padding: 0 17px; border: 1px solid var(--line); border-radius: 10px; background: #292934; cursor: pointer; transition: transform .15s, filter .15s, border .15s; }
.btn:hover { filter: brightness(1.13); border-color: rgba(255,255,255,.2); }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: #c29c58; color: #18130b; background: linear-gradient(135deg, #e0bd77, #bd8e42); font-weight: 700; }
.btn.danger { color: #ffdadd; background: rgba(188,74,80,.18); border-color: rgba(188,74,80,.4); }
.btn.good { background: rgba(116,164,131,.16); border-color: rgba(116,164,131,.4); color: #d5f0dd; }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.room-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.room-head h1 { margin: 5px 0 0; font-size: clamp(34px, 5vw, 56px); }
.room-code { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.room-code span { color: var(--muted); font-size: 11px; }
.room-code strong { color: var(--gold); font-size: 20px; letter-spacing: .12em; }
.phasebar { margin-bottom: 20px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid rgba(214,174,98,.2); border-radius: 14px; background: linear-gradient(90deg, rgba(214,174,98,.08), rgba(255,255,255,.025)); }
.phasebar h2 { margin: 2px 0 0; font: 500 25px Georgia, "Noto Serif KR", serif; }
.phase-actions { display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .7fr); gap: 20px; align-items: start; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(25,25,34,.88); box-shadow: 0 15px 40px rgba(0,0,0,.16); }
.card + .card { margin-top: 16px; }
.card h3 { margin-bottom: 4px; font-size: 15px; }
.sub { color: var(--muted); font-size: 12px; }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.player { min-width: 0; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.seat { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: #30303b; color: var(--gold); font: 14px Georgia, serif; }
.player-main { min-width: 0; flex: 1; }
.player-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.player-meta { color: var(--muted); font-size: 11px; }
.player.dead { opacity: .57; }
.player.dead .player-name { text-decoration: line-through; }
.master-star { color: var(--gold); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-dot.wait { background: var(--muted); }
.role-card { position: relative; min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: radial-gradient(circle at 100% 0, rgba(214,174,98,.15), transparent 48%), #1c1c25; }
.role-card::after { content: ""; position: absolute; right: -35px; bottom: -55px; width: 150px; height: 150px; border: 1px solid rgba(214,174,98,.2); border-radius: 50%; box-shadow: inset 0 0 0 18px rgba(214,174,98,.025), inset 0 0 0 19px rgba(214,174,98,.12); }
.role-team { color: var(--gold); font-size: 11px; letter-spacing: .16em; }
.role-name { margin: 8px 0; font: 500 31px Georgia, "Noto Serif KR", serif; }
.role-ability { position: relative; z-index: 1; max-width: 90%; color: #c9c6bf; font-size: 13px; }
.role-hidden { min-height: 150px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.notice { padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(214,174,98,.07); color: #d7d2c8; font-size: 13px; }
.notice.red { border-color: var(--red); background: rgba(188,74,80,.08); }
.stack { display: grid; gap: 10px; }
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.target-option { position: relative; }
.target-option input { position: absolute; opacity: 0; pointer-events: none; }
.target-option span { display: block; padding: 10px; border: 1px solid var(--line); border-radius: 9px; text-align: center; color: var(--muted); cursor: pointer; }
.target-option input:checked + span { color: var(--ink); border-color: var(--gold); background: rgba(214,174,98,.11); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.nomination { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.025); }
.nomination + .nomination { margin-top: 9px; }
.nomination-head { display: flex; justify-content: space-between; gap: 10px; }
.progress { height: 5px; margin: 11px 0; border-radius: 5px; background: #34343d; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }
.vote-now { margin-top: 12px; padding: 13px; border-radius: 10px; text-align: center; background: rgba(214,174,98,.08); }
.log { max-height: 360px; overflow: auto; margin-top: 13px; }
.log-item { position: relative; padding: 9px 0 9px 17px; border-left: 1px solid var(--line); color: #c3c0ba; font-size: 12px; }
.log-item::before { content: ""; position: absolute; left: -3.5px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: #696974; }
.log-item time { display: block; color: #77737a; font-size: 10px; }
.empty { padding: 35px 15px; color: var(--muted); text-align: center; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; max-width: min(440px, calc(100% - 32px)); padding: 12px 17px; border: 1px solid var(--line); border-radius: 10px; background: #292934; box-shadow: var(--shadow); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { border-color: rgba(188,74,80,.5); background: #3a2025; }
.modal { position: fixed; z-index: 15; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(4,4,8,.75); backdrop-filter: blur(7px); }
.modal-card { width: min(440px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #1d1d26; box-shadow: var(--shadow); }
.modal-card h2 { font: 500 27px Georgia, "Noto Serif KR", serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 35px; padding: 30px 0; }
  .hero-copy { text-align: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .feature-line { justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .room-head { align-items: start; }
}
@media (max-width: 560px) {
  main { width: min(100% - 22px, 1120px); padding-top: 15px; }
  .topbar { height: 66px; padding: 0 14px; }
  .hero { min-height: auto; }
  h1 { font-size: 44px; }
  .panel { border-radius: 16px; }
  .form { padding: 20px; }
  .room-head { display: block; }
  .room-code { margin-top: 15px; width: max-content; }
  .phasebar { display: block; }
  .phase-actions { margin-top: 13px; }
  .players { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .target-grid { grid-template-columns: 1fr; }
}
