:root{
  --bg:#0b0b0f;
  --card:#141420;
  --text:#f2f2f7;
  --muted:#a3a3b2;
  --brand:#4f7cff;
  --line:rgba(255,255,255,.08);
  --ok:#1fda89;
  --err:#ff5a6a;
}

*{box-sizing:border-box;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:linear-gradient(180deg,#0b0b0f,#0f0f18);
  color:var(--text);
}

/* header/nav */
.header{
  position:sticky; top:0; z-index:10;
  padding:14px 16px;
  background:rgba(11,11,15,.75);
  backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav a{
  color:#cfd2ff; text-decoration:none;
  margin-right:10px; font-weight:800;
}

/* layout */
.container{max-width:720px;margin:0 auto;padding:14px 14px 28px;}
.card{
  background:var(--card);
  border:1px solid rgba(255,255,255,.06);
  border-radius:16px;
  padding:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  margin-bottom:12px;
}
.muted{color:var(--muted);font-size:13px;line-height:1.5;}

/* notices */
.notice{
  margin:12px 0;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  font-size:14px;
  line-height:1.4;
  word-break:break-word;
}

/* forms */
label{display:block;margin:12px 0 8px;color:var(--muted);font-size:13px;}
.input,.file{
  width:100%;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:14px 12px;
  border-radius:14px;
  font-size:16px;
  outline:none;
}
.file{padding:12px;}
.btn{
  width:100%;
  margin-top:14px;
  border:none;
  border-radius:14px;
  padding:14px;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
  background:var(--brand);
  color:#fff;
}
.btn[disabled]{opacity:.55;cursor:not-allowed;}
.hint{margin-top:12px;color:var(--muted);font-size:12px;line-height:1.45;}

/* upload overlay */
.overlay{
  display:none; position:fixed; inset:0; z-index:9999;
  background:rgba(0,0,0,.55);
  align-items:center; justify-content:center;
  padding:24px;
}
.overlay .box{
  width:100%; max-width:360px;
  background:#12121b;
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:18px;
  text-align:center;
}
.spinner{
  width:34px;height:34px;margin:0 auto 10px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.20);
  border-top-color:rgba(255,255,255,.85);
  animation:spin 0.9s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg);}}

/* list */
.km{font-size:20px;font-weight:900;}
.badge{font-size:11px;padding:4px 8px;border-radius:999px;}
.badge.ok{background:#1fda8922;color:var(--ok);}
.badge.fail{background:#ff5a6a22;color:var(--err);}
.imgwrap img{width:100%;border-radius:12px;margin-top:10px;}
.paging{display:flex;justify-content:space-between;margin:12px 0;}
.pbtn{padding:8px 12px;background:var(--brand);color:#fff;border-radius:10px;text-decoration:none;}
.pbtn.disabled{background:#444;}

/* 개인통계 월별 버튼 폭 축소 */
.month_actions .pbtn{
  display:inline-block;
  padding:8px 12px;
  font-size:13px;
  border-radius:12px;
  text-align:center;
  white-space:nowrap;
  line-height:1;
}

/* 모바일에서 너무 커지지 않게 */
@media (max-width:520px){
  .month_actions{ min-width:84px; }
  .month_actions .pbtn{
    padding:7px 10px;
    font-size:12px;
    border-radius:12px;
  }
}

/* »èÁ¦ ¹öÆ° (ÀÌ¸§ ¿À¸¥ÂÊ ³¡) */
.delbtn{
  border:none;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  background:rgba(255,90,106,.92);
  color:#fff;
  white-space:nowrap;
}
.delbtn:active{transform:translateY(1px);}

/* stats */
.row{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
select,button{
  font-size:15px;border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:var(--text);
  padding:12px;
}
button{
  background:rgba(79,124,255,.85);
  border:none;font-weight:900;cursor:pointer;
}
button:active{transform:translateY(1px);}

.kpis{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}
.kpi{
  flex:1;min-width:140px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
}
.kpi .label{color:var(--muted);font-size:12px;margin-bottom:4px;}
.kpi .val{font-size:20px;font-weight:900;}
.rank{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px;border-radius:14px;border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  margin-top:10px;
}
.rank .left{min-width:0;}
.rank .name{
  font-weight:900;font-size:16px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  max-width:360px;
}
.rank .meta{color:var(--muted);font-size:12px;margin-top:2px;}
.rank .km{font-size:18px;font-weight:900;white-space:nowrap;}
.badge.rankno{
  display:inline-block;margin-right:8px;
  padding:4px 8px;border-radius:999px;
  background:rgba(79,124,255,.16);
  border:1px solid rgba(79,124,255,.30);
  color:#cfd2ff;font-size:12px;font-weight:900;
}
.small{color:var(--muted);font-size:12px;margin-top:8px;}
.empty{color:var(--muted);font-size:14px;line-height:1.5;}


select {
    color: #000 !important;
    background-color: #fff !important;
}

select option {
    color: #000;
    background-color: #fff;
}


#goTopBtn{
  position:fixed;
  right:18px;
  bottom:24px;
  width:48px;
  height:48px;
  border-radius:50%;
  border:none;
  background:#ff4fa3;
  color:#fff;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  display:none;
  z-index:9999;
  box-shadow:0 6px 18px rgba(255,79,163,.45);
}

#goTopBtn:hover {
    transform: translateY(-2px);
}

#goTopBtn:active {
    transform: translateY(0);
}

.month_actions{
  display:flex;
  flex-direction:column;   /* ✅ 세로로 2줄 */
  gap:8px;
  flex-wrap:nowrap;
  align-items:center;      /* ✅ 가운데 정렬 */
  justify-content:center;
  min-width:92px;          /* 버튼 영역 폭 고정(레이아웃 안정화) */
}

@media (max-width:520px){
  .month_actions{justify-content:flex-start;}
}

@media screen and (max-width: 520px) {
  .kpis {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .kpis .kpi {
    min-width: 0;
    padding: 10px 8px;
  }

  .kpis .kpi .label {
    font-size: 11px;
  }

  .kpis .kpi .val {
    font-size: 18px;
  }
}

/* ================================
   list.php Àü¿ë: ÀÌ¸§ ¼öÁ¤ / »èÁ¦ UI
   ================================ */

/* »ó´Ü ÀÌ¸§ + ¹öÆ° ¿µ¿ª */
.nameRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.nameLeft{
  min-width:0;
  display:flex;
  align-items:center;
  gap:8px;
}

/* ¼öÁ¤ / »èÁ¦ ¹öÆ° ¹­À½ */
.nameActions{
  display:flex;
  align-items:center;
  gap:8px;           /* ¼öÁ¤(¿ÞÂÊ) - »èÁ¦(¿À¸¥ÂÊ) */
  flex-wrap:wrap;
}

/* °øÅë ¾×¼Ç ¹öÆ° */
.actBtn{
  padding:6px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  font-size:12px;
  text-decoration:none;
  white-space:nowrap;
}

/* »èÁ¦ ¹öÆ° */
.actBtn.danger{
  background:rgba(255,90,106,.14);
  border:1px solid rgba(255,90,106,.30);
  color:#ff9aa5;
}

/* ÀÌ¸§ ¼öÁ¤ Æû */
.editForm{
  margin-top:10px;
  display:none;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.editInput{
  width:220px;
  max-width:100%;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:#fff;
  padding:10px 10px;
  border-radius:12px;
  font-size:14px;
  outline:none;
}

/* ¼ÒÇü ¹öÆ° */
.smallBtn{
  padding:10px 12px;
  border-radius:12px;
  border:none;
  background:rgba(79,124,255,.85);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  font-size:13px;
}

.smallBtn.gray{
  background:rgba(255,255,255,.12);
}

.smallBtn.red{
  background:rgba(255,90,106,.85);
}

/* ================================
   Site Footer (Copyright)
   ================================ */
.site-footer{
  margin-top:40px;
  padding:20px 10px 30px;
  text-align:center;
  font-size:12px;
  color:#a3a3b2;
  border-top:1px solid rgba(255,255,255,.06);
}

/* stats_period.php: date/month input도 select처럼 보이게 */
/* 주(날짜), 월(월선택) 입력칸을 흰배경/검정글씨로 */
input.sel{
  font-size:15px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  padding:12px;

  background-color:#fff !important;
  color:#000 !important;
}

/* PC에서 date/month input 전체 영역 클릭 가능하게 */
input.sel{
  cursor:pointer;
}


/* stats_period.php: Top3 왕관 */
.crown{
  display:inline-flex;
  vertical-align:middle;
  margin-right:6px;
  transform: translateY(1px);
}
.crown svg{ display:block; }

/* 금/은/구리 */
.crown-gold{ color:#d6b24a; }
.crown-silver{ color:#bfc7d5; }
.crown-bronze{ color:#b87333; }

/* stats_period.php: Top3 왕관 (색상 강제 적용) */
.crown{
  display:inline-flex;
  vertical-align:middle;
  margin-right:6px;
  transform: translateY(1px);
}
.crown svg{ display:block; }

/* currentColor가 안 먹는 환경 대비: stroke를 직접 지정 */
.crown-gold svg,   .crown-gold svg *   { stroke:#d6b24a !important; }
.crown-silver svg, .crown-silver svg * { stroke:#bfc7d5 !important; }
.crown-bronze svg, .crown-bronze svg * { stroke:#b87333 !important; }

