/* 폰트는 index.html / dashboard.html의 <link> 태그에서 미리 연결·로드해요 (렌더링 차단 최소화) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hidden {
  display: none !important;
}

:root {
  --bg: #000000;
  --bg-panel: #111111;
  --border: rgba(201, 169, 110, 0.15);
  --text: #f5f5f5;
  --text-dim: #9a9a9a;
  --gold: #C9A96E;
  --gold-light: #F0D070;
  --gold-dark: #7A5520;
  /* 홈페이지 제목(.gold-text)과 동일한 그라데이션 */
  --gradient-text: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold-light) 45%, var(--gold) 100%);
  /* 홈페이지 버튼(.btn-gold)과 동일한 그라데이션 — 실제로 가장 많이 쓰이는 "진짜" 브랜드 컬러 */
  --gradient-cta: linear-gradient(135deg, #A07840, #E8C050, #C9A040);
  --danger: #f87171;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  user-select: none;
}

.layout {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
}

.screen {
  flex: 0 1 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* 옆에 랭킹 패널 없이 혼자 나오는 화면(대시보드)은 더 크게 표시해서 시인성을 높여요 */
.screen.wide {
  flex-basis: 560px;
}

@media (max-width: 820px) {
  .layout {
    flex-direction: column;
    align-items: center;
  }
}

.brand {
  text-align: center;
}

.brand-logo {
  height: 72px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.brand-sub {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-dim);
}

/* ===== 출석 체크 화면 ===== */
.phone-display {
  display: flex;
  gap: 14px;
}

.phone-digit {
  width: 54px;
  height: 64px;
  border-radius: 14px;
  background: var(--bg-panel);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  transition: border-color 0.15s ease;
}

.phone-digit.filled {
  border-color: var(--gold);
}

.keypad {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  transition: opacity 0.2s ease;
}

.keypad.locked {
  opacity: 0.35;
  pointer-events: none;
}

.key {
  padding: 20px 0;
  font-size: 22px;
  font-weight: 700;
  border-radius: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}

.key:active {
  transform: scale(0.96);
  background: #1c1c1c;
}

.key.func {
  color: var(--text-dim);
  font-size: 16px;
}

.status-msg {
  min-height: 22px;
  font-size: 15px;
  color: var(--danger);
  text-align: center;
}

.status-msg.loading {
  color: var(--text-dim);
}

/* ===== 이름 선택 모달 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.success-card {
  width: 100%;
  max-width: 420px;
}

.nickname-prompt {
  width: 100%;
}

.nickname-toggle {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.nickname-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avatar-preview {
  align-self: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-dim);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.avatar-preview.filled {
  border: 2px solid var(--gold);
  background: rgba(201, 169, 110, 0.12);
}

.avatar-preview.clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.avatar-preview.clickable:active {
  transform: scale(0.94);
}

.avatar-preview-lg {
  align-self: center;
  width: 108px;
  height: 108px;
  font-size: 40px;
}

.avatar-preview-lg img {
  width: 60px;
  height: 60px;
}

.avatar-preview img {
  width: 42px;
  height: 42px;
}

.handoff-hint {
  font-size: 13px;
  color: var(--gold-light);
  text-align: center;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}

.emoji-picker-label {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: -8px;
}

.emoji-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 2px;
}

.emoji-option {
  padding: 8px 0;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-img-picker {
  width: 22px;
  height: 22px;
}

.emoji-img-inline {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 4px;
}

.emoji-option.selected {
  background: var(--gradient-cta);
  border-color: transparent;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.modal-sub {
  margin-top: -8px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

.name-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.name-item {
  padding: 16px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.name-item:active {
  background: #232323;
}

.name-item .branch-tag {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 6px;
}

.confirm-actions {
  display: flex;
  gap: 12px;
}

.confirm-btn {
  flex: 1;
  padding: 16px 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.confirm-btn.yes {
  background: var(--gradient-cta);
  color: #000000;
}

.confirm-btn.no {
  background: #1a1a1a;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.confirm-btn:active {
  transform: scale(0.97);
}

.modal-cancel {
  text-align: center;
  padding: 12px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

/* ===== 대시보드 화면 ===== */
.dash-card {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.dash-greeting {
  font-size: 20px;
  color: var(--text-dim);
}

.dash-name {
  font-weight: 800;
  color: var(--text);
}

.level-badge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--gradient-cta);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #000000;
  position: relative;
  overflow: hidden;
}

.level-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  animation: shimmerSweep 3s ease-in-out infinite;
}

@keyframes shimmerSweep {
  0%   { left: -100%; }
  60%  { left: 120%; }
  100% { left: 120%; }
}

.level-badge .lv-label {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.level-badge .lv-num {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.dash-title {
  font-family: 'Oswald', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.xp-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #1a1a1a;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-cta);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dash-message {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  padding: 16px 18px;
  border-radius: 14px;
  background: #1a1a1a;
}

.weekly-box {
  width: 100%;
  padding: 20px 22px;
  border-radius: 18px;
  background: #1a1a1a;
  border: 1.5px solid rgba(201, 169, 110, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.weekly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.weekly-label {
  font-size: 15px;
  color: var(--gold-light);
  font-weight: 700;
}

.weekly-streak-badge {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  background: var(--gradient-cta);
  padding: 4px 12px;
  border-radius: 999px;
}

.weekly-streak-badge.hidden {
  display: none;
}

.weekly-dots {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weekly-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: transparent;
}

.weekly-dot.filled {
  background: var(--gradient-cta);
  border-color: transparent;
}

.weekly-extra {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-left: 4px;
}

.weekly-bonus-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.weekly-bonus-num {
  font-family: 'Oswald', sans-serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.weekly-bonus-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
}

.weekly-bonus-sub {
  margin-top: -8px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.weekly-ladder {
  display: flex;
  gap: 6px;
}

.ladder-step {
  flex: 1;
  padding: 8px 2px;
  border-radius: 10px;
  background: #141414;
  border: 1px solid var(--border);
  text-align: center;
}

.ladder-step .ladder-week {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.ladder-step .ladder-xp {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.ladder-step.done {
  background: rgba(201, 169, 110, 0.15);
  border-color: var(--gold-dark);
}

.ladder-step.done .ladder-xp {
  color: var(--gold-light);
}

.ladder-step.next {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.ladder-step.next .ladder-week,
.ladder-step.next .ladder-xp {
  color: var(--gold);
}

.weekly-hint {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gold-light);
  font-weight: 600;
  text-align: center;
}

.dash-back {
  margin-top: 4px;
  padding: 14px 32px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

.dash-countdown {
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== 출석 랭킹 ===== */
.ranking-card {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ranking-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  color: var(--gold-light);
}

.ranking-title::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px var(--gold-light);
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.7); }
}

.ranking-list {
  max-height: 260px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}

.ranking-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-track.scrolling {
  animation: rankingScroll linear infinite;
}

@keyframes rankingScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1a1a1a;
}

.ranking-row.me {
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid var(--gold-dark);
}

.ranking-rank {
  font-family: 'Oswald', sans-serif;
  width: 26px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}

.ranking-row:nth-child(1) .ranking-rank { color: var(--gold-light); }
.ranking-row:nth-child(2) .ranking-rank { color: var(--gold); }
.ranking-row:nth-child(3) .ranking-rank { color: var(--gold-dark); }

.ranking-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.ranking-name-text {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-level {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: #5a5a5a;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 칭호(레벨 구간)별 배지 색상 — 루키(동)→챌린저(청)→엘리트(은)→챔피언(보라)→레전드(브랜드 골드) 순으로 점점 화려해짐 */
.ranking-level.tier-rookie {
  background: #8c6a4f;
  color: #ffffff;
}

.ranking-level.tier-challenger {
  background: #4a7ba6;
  color: #ffffff;
}

.ranking-level.tier-elite {
  background: #a8b2bd;
  color: #000000;
}

.ranking-level.tier-champion {
  background: #8b5fbf;
  color: #ffffff;
}

.ranking-level.tier-legend {
  background: var(--gradient-cta);
  color: #000000;
}

.ranking-count {
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== 직원 메뉴 ===== */
.staff-step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.staff-link {
  position: fixed;
  bottom: 18px;
  right: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  opacity: 0.85;
}

.staff-link:active {
  opacity: 1;
  background: #1f1f1f;
}

.register-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.register-input {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
}

.register-input::placeholder {
  color: var(--text-dim);
}

.branch-scroll {
  width: 100%;
  max-height: 168px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.branch-item {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

.branch-item:active {
  background: #1f1f1f;
}

.branch-item.selected {
  background: var(--gradient-cta);
  color: #000000;
  border-color: transparent;
}

.register-submit {
  width: 100%;
}

/* ===== 대형 모니터 화면 (display.html) ===== */
.display-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.display-idle {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.brand-logo-lg {
  height: 140px;
  width: auto;
}

.display-idle-cards {
  width: 100%;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
}

@media (max-width: 900px) {
  .display-idle-cards {
    flex-direction: column;
    align-items: center;
  }
}

.display-ranking-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: 640px;
  padding: 40px 36px;
}

.display-idle .ranking-title {
  font-size: 24px;
  gap: 12px;
  margin-bottom: 8px;
}

.display-idle .ranking-title::before {
  width: 10px;
  height: 10px;
}

.display-idle .ranking-list {
  max-height: 560px;
}

.display-idle .ranking-row {
  padding: 16px 20px;
  gap: 20px;
}

.display-idle .ranking-rank {
  font-size: 22px;
  width: 40px;
}

.display-idle .ranking-name-text {
  font-size: 22px;
}

.display-idle .ranking-level {
  font-size: 15px;
  padding: 5px 12px;
}

.display-idle .ranking-count {
  font-size: 18px;
}

.display-celebrate {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.celebrate-xp-flash {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 태블릿 대시보드 카드를 그대로 재사용하되, 큰 모니터에서 잘 보이도록 전체적으로 확대 */
.celebrate-card {
  padding: 44px 40px;
}

.celebrate-card .dash-greeting {
  font-size: 26px;
}

.celebrate-card .level-badge {
  width: 180px;
  height: 180px;
}

.celebrate-card .lv-label {
  font-size: 16px;
}

.celebrate-card .lv-num {
  font-size: 68px;
}

.celebrate-card .dash-title {
  font-size: 30px;
}

.celebrate-card .xp-row {
  font-size: 16px;
}

.celebrate-card .progress-track {
  height: 20px;
}

.celebrate-card .dash-message {
  font-size: 20px;
}

.celebrate-card .weekly-label {
  font-size: 18px;
}

.celebrate-card .weekly-bonus-num {
  font-size: 60px;
}

.celebrate-card .weekly-hint {
  font-size: 16px;
}
