/* ── 리셋 & 기본 ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #111112;
  --surface:    #1c1c1e;
  --surface2:   #2a2a2d;
  --accent:     #e94560;
  --accent2:    #4a4a52;
  --text:       #eaeaea;
  --text-muted: #888;
  --border:     #303035;
  --radius:     8px;
  --shadow:     0 4px 16px rgba(0,0,0,.5);
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 이름 링크: 현재 색 유지, 밑줄만 */
.name-link { color: inherit; }
.name-link:hover { color: var(--accent); text-decoration: underline; }

/* ── 네비게이션 바 ───────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .04em;
}

.navbar-nav { display: flex; align-items: center; gap: 16px; }
.nav-user   { color: var(--text-muted); font-size: .9rem; }
.nav-link   { font-size: .9rem; color: var(--text); }
.nav-link:hover { color: var(--accent); text-decoration: none; }

.nav-link-user {
  color: var(--text);
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: .85rem;
  transition: border-color .15s, color .15s;
}
.nav-link-user:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── 메인 영역 ───────────────────────────────────────────── */
.main-content { padding: 32px 24px; max-width: 1200px; margin: 0 auto; }

/* ── 플래시 메시지 ───────────────────────────────────────── */
.flash-messages { margin-bottom: 20px; }
.flash {
  background: #252527;
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: .9rem;
}

/* ── 버튼 ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s, border-color .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(1.25); transform: translateY(-1px); }
.btn:active { filter: brightness(1.1); transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: none; }

.btn-primary   { background: var(--accent);   color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: #6b7280; filter: none; }
.btn-full      { width: 100%; }
.btn-sm        { padding: 5px 12px; font-size: .82rem; }
.btn-lg        { padding: 13px 32px; font-size: 1rem; }

/* ── 랜딩 페이지 ─────────────────────────────────────────── */
.landing-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.landing-hero {
  text-align: center;
  padding-bottom: 60px;
}

.landing-title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--accent);
  margin-bottom: 12px;
}

.landing-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.landing-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}

.feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.feature-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── 인증 폼 ─────────────────────────────────────────────── */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.auth-form   { display: flex; flex-direction: column; gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .85rem; color: var(--text-muted); }
.hint { font-size: .75rem; }

.form-group input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .95rem;
  transition: border-color .2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: #ff6b6b;
  font-size: .88rem;
  background: rgba(233,69,96,.12);
  border: 1px solid rgba(233,69,96,.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 4px;
}

.auth-footer { text-align: center; margin-top: 14px; font-size: .88rem; color: var(--text-muted); }
.landing-desc { max-width: 400px; margin: 24px auto 0; font-size: .8rem; color: var(--text-muted); text-align: center; line-height: 1.6; }

/* ── 로비 ────────────────────────────────────────────────── */
.lobby-container { max-width: 860px; margin: 0 auto; }
.lobby-header    { margin-bottom: 24px; }
.lobby-header h2 { font-size: 1.3rem; }

.lobby-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.create-room-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.create-room-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.create-room-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.timer-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  font-size: .85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.timer-input {
  width: 56px;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .88rem;
  text-align: center;
}
.timer-input:focus { outline: none; border-color: var(--accent); }
.timer-sep { color: var(--border); }
.timer-label { white-space: nowrap; }
.create-room-form input {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
}
.create-room-form input:focus { outline: none; border-color: var(--accent); }

.toggle-private {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-size: .88rem;
  color: var(--text-muted);
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  user-select: none;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.toggle-private:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
}
.toggle-private input { display: none; }

.room-pw-input { max-width: 160px; flex-shrink: 0; }

.room-list-section { margin-top: 8px; }
.room-list-header  {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.room-list-header h3 { font-size: 1rem; }

.room-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.room-table th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: .83rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.room-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
.room-table tr:hover td { background: rgba(255,255,255,.03); }

.empty-cell { text-align: center; color: var(--text-muted); padding: 32px 0; }

.lock-icon { font-size: .85em; margin-right: 4px; opacity: .8; }

.room-pw-input { max-width: 180px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-waiting { background: #1e2e22; color: #4caf7d; }
.badge-playing { background: #2e2e33; color: #a0a0b0; }

/* ── 프로필 호버 카드 ────────────────────────────────────── */
.phc-wrap {
  position: fixed;
  z-index: 9999;
  width: 240px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0,0,0,.6);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .15s, transform .15s;
}
.phc-wrap.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.phc-inner {
  padding: 14px 16px;
}
.phc-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}
.phc-frame {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  flex-shrink: 0;
}
.phc-icon { font-size: 1.5rem; line-height: 1; }
.phc-info { flex: 1; min-width: 0; }
.phc-name { font-size: .95rem; font-weight: 700; display: block; }
.phc-bio {
  font-size: .76rem;
  color: rgba(255,255,255,.55);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phc-stats {
  display: flex;
  gap: 6px;
}
.phc-stat {
  flex: 1;
  text-align: center;
  padding: 4px 2px;
  background: rgba(255,255,255,.05);
  border-radius: 5px;
  font-size: .78rem;
  line-height: 1.3;
}
.phc-stat span { display: block; font-size: .68rem; color: var(--text-muted); }
.phc-stat.win   { color: #4caf7d; }
.phc-stat.loss  { color: var(--accent); }
.phc-stat.draw  { color: #c084fc; }
.phc-stat.rate  { color: var(--text); }
.phc-no-games {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 0 4px;
}
.phc-guest {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  font-size: .88rem;
  color: var(--text-muted);
}
.phc-guest-icon { font-size: 1.4rem; }
.phc-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
  background: var(--surface);
}

/* ── 토스트 알림 ─────────────────────────────────────────── */
.phc-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .88rem;
  padding: 10px 22px;
  border-radius: 99px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 10000;
  white-space: nowrap;
}
.phc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 신고 플로팅 버튼 ──────────────────────────────────── */
.report-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.report-fab:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── 신고 모달 ─────────────────────────────────────────── */
.report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.report-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 420px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
}
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  font-weight: 600;
}
.report-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .95rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.report-close:hover { color: var(--text); }
.report-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.report-categories {
  display: flex;
  gap: 8px;
}
.report-cat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-muted);
  transition: border-color .12s, color .12s;
}
.report-cat-label:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
}
.report-cat-label input { display: none; }
.report-user-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-size: .88rem;
}
.report-user-input:focus { outline: none; border-color: var(--accent); }
.report-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: .88rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}
.report-textarea:focus { outline: none; border-color: var(--accent); }
.report-char-count { font-size: .75rem; color: var(--text-muted); text-align: right; }
.report-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-error { font-size: .8rem; color: var(--accent); margin-left: 4px; }

/* ── 신고 토스트 ────────────────────────────────────────── */
.report-toast {
  position: fixed;
  bottom: 76px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid #4ade8066;
  color: #4ade80;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: .88rem;
  z-index: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.report-toast.show {
  opacity: 1;
  transform: translateY(0);
}
