/* ===== 공통 ===== */
body {
    min-width: 1280px;
    min-height: 720px;
    overflow: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #e8f4ff, #f5f6ff);
    height: 100vh;
    overflow: hidden;
}
.kiosk-root {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.screen {
    width: 100%;
    height: 100%;
}
.hidden {
    display: none !important;
}

/* ===== 기본 레이아웃 ===== */
.kiosk-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr); /* 기본값 (작은 화면용) */
    gap: 40px;
    padding: 40px 60px;
    height: 100%;
    align-items: stretch;
    box-sizing: border-box;
}

/* 📌 키오스크(태블릿) 해상도에서는 로그인 패드 폭 더 넓게 */
@media (min-width: 1024px) {
  .kiosk-layout {
    grid-template-columns: 520px minmax(0, 1fr);  /* ← 왼쪽 로그인 폭 크게 */
  }
}


/* 왼쪽 로그인 카드 */
.login-container {
    background: #fff;
    border-radius: 28px;
    padding: 30px 30px 40px;
    box-shadow: 0 18px 40px rgba(15, 35, 95, 0.12);
}
/* 🔥 전체화면 버튼 포함한 헤더 영역 */
.login-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.login-full-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 15px;
    background: #f2f4ff;
    color: #333;
    cursor: pointer;
}
.login-full-btn:hover {
    background: #e0e5ff;
}
.login-container h1 {
    font-size: 36px;
    margin-bottom: 8px;
}
.login-container p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}
#login-id {
    width: 100%;
    padding: 20px 22px;
    border-radius: 12px;
    border: 1px solid #ddd;
    margin-bottom: 16px;
    font-size: 26px;
}
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.key {
    border: none;
    border-radius: 22px;
    padding: 26px 0;
    font-size: 34px;
    font-weight: 700;                 /* ← 숫자 두껍게 */
    box-shadow: 0 10px 24px rgba(0,0,0,0.08); /* 약한 그림자 */
    background: #f5f7ff;
    cursor: pointer;
}
.key.clear {
    background: #ffe1e4;
    color: #c43b4c;
}
.key.enter {
    background: linear-gradient(135deg, #2979ff, #4c6fff);
    font-size: 34px; !important;
    font-weight: 800;
    color: #fff;
}
.status-msg {
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
}
.status-msg.error {
    color: #e53935;
}

/* ===== 오른쪽 HERO ===== */
.hero-card {
    position: relative;
    background: linear-gradient(135deg, #7b5cff, #f54ea2);
    border-radius: 32px;
    padding: 20px 28px 20px;
    box-shadow: 0 20px 45px rgba(60, 20, 120, 0.35);
    color: #fff;

    display: flex;
    flex-direction: column;
    gap: 8px;

    /* 🔒 부모(kiosk-right) 높이 안에서만 사용 */
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* 🔥 왼쪽(설명+랭킹) / 오른쪽(미디어) 2열 그리드 */
.hero-main-grid {
    flex: 1;                       /* hero-card 안 남는 높이 전부 사용 */
    display: grid;
    grid-template-columns: 0.9fr 1.6fr;   /* 왼쪽 조금, 오른쪽 넓게 */
    gap: 20px;
    min-height: 0;                 /* 자식이 높이 밀어올리는 것 방지 */
}

/* 왼쪽 컬럼 : 위 설명 + 아래 랭킹 세로 스택 */
.hero-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    justify-content: space-between;
}
/* 설명 블럭은 내용만, 높이 강제 X */
.hero-top {
    flex: 0 0 auto;
}

/* 랭킹 카드는 남는 높이를 모두 먹도록 */
.hero-ranking-card {
    background: rgba(255, 255, 255, 0.09);
    border-radius: 20px;
    padding: 18px 20px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 40%;
    margin-top: auto;     
}

.hero-ranking-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 16px 18px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    flex: 1;       /* ⬅ 왼쪽 컬럼 아래쪽 공간을 꽉 채움 */
    min-height: 0;
}

.hero-ranking-header {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
}


.hero-ranking-desc {
    font-size: 18px;
    opacity: 0.95;
    margin-bottom: 12px;
}

.hero-ranking-columns {
    /* ✅ 3개 종목 칼럼이 좁아져서 '벤치프레스'가 2줄로 줄바꿈되는 문제 해결
       - grid로 배치 + 벤치 칼럼을 조금 더 넓게
       - 헤더는 줄바꿈 금지
    */
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr; /* bench를 약간 더 넓게 */
    gap: 12px;
    align-items: start;
}

.ranking-col {
    min-width: 0; /* grid에서 내용이 칼럼 폭을 밀어내지 않게 */
}

.ranking-col h4 {
    /* '벤치프레스'가 2줄로 깨지는 문제 방지 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 17px;
    margin-bottom: 6px;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-list li {
    margin-bottom: 2px;
}

.hero-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 11px;
    letter-spacing: 0.08em;
}
.hero-title {
    font-size: 42px;      /* 이전보다 약간만 줄이기 */
    margin-top: 0;
    margin-bottom: 4px;   /* 제목 아래 여백 최소화 */
}
.hero-sub {
    font-size: 22px;
    margin-top: 0;
    line-height: 1.3;     /* 줄 간격 타이트하게 */
    margin-bottom: 4px;
}

.hero-list {
    margin-top: 0;
    margin-bottom: 4px;
    font-size: 20px;
    line-height: 1.25;    /* 리스트 줄 간격도 타이트하게 */
}
.hero-list li + li {
    margin-top: 0;        /* 항목 간 여백 제거 */
}
/* 오른쪽 컬럼 : 통짜 미디어 카드 */
.hero-right {
    display: flex;
    flex-direction: column;
    min-height: 0;           /* 여기서도 자식이 높이 못 늘리게 */
}
/* 미디어 카드 */

.hero-media-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.hero-rank-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
/* ✅ 미디어 프레임 : hero-right의 남은 높이를 전부 사용 */
.hero-media {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 18px;

    flex: 1;                 /* hero-right 안 남는 높이 전부 사용 */
    min-height: 0;
    width: 100%;

    overflow: hidden;        /* 🔑 프레임 밖으로는 절대 안 나가게 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-media-item {
    width: 100%;
    height: 100%;
    background: #000;      /* 영상 여백 생겨도 자연스럽게 */
    object-fit: contain;  /* 비율 유지 + 프레임 안에서만 */
}
.hero-rank-list {
    font-size: 13px;
    line-height: 1.5;
}

/* HERO dots */
.hero-dots {
    position: absolute;
    bottom: 14px;
    right: 20px;
    display: flex;
    gap: 6px;
}
.hero-dots .dot {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    cursor: pointer;
}
.hero-dots .dot.active {
    width: 16px;
    background: #fff;
}

/* ===== 메인 화면 ===== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px 12px;
}
.main-title span {
    font-size: 28px;
    font-weight: 600;
}
.ghost-btn,
.primary-btn {
    border-radius: 999px;
    padding: 10px 22px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}
.ghost-btn {
    background: #f2f4ff;
    margin-right: 8px;
}
.primary-btn {
    background: linear-gradient(135deg, #2979ff, #4c6fff);
    color: #fff;
}

/* 탭 메뉴 */
.tab-menu {
    display: flex;
    gap: 14px;
    padding: 0 48px 14px;
}
.tab-btn {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    background: #eef1ff;
    font-size: 15px;
    cursor: pointer;
}
.tab-btn.active {
    background: #4c6fff;
    color: #fff;
}

/* 탭 컨텐츠 */
.tab-content {
    padding: 0 48px 36px;
}
.menu-list {
    display: flex;
    gap: 20px;
}
.menu-card {
    flex: 1;
    background: #fff;
    border-radius: 24px;
    padding: 24px 24px 26px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
    cursor: pointer;
}
.menu-card h3 {
    margin-bottom: 8px;
    font-size: 20px;
}



/* 체형 / 영상 리스트 공통 */
.posture-list,
.video-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.posture-item {
    background: #fff;
    border-radius: 20px;
    padding: 20px 24px 24px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
}
.posture-item h3 {
    margin-bottom: 10px;
    font-size: 20px;                    /* 날짜 글씨 키움 */
}
.posture-photos {
    display: flex;
    gap: 24px;
}
.posture-photo span {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}
.posture-photo img {
    width: 220px;
    height: 290px;
    object-fit: cover;
    border-radius: 14px;
}

.video-item {
    background: #fff;
    border-radius: 20px;
    padding: 20px 24px 24px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.04);
    max-height: 420px;
    width: 100%;
    object-fit: contain;
    background: #000;
}
/* 운동 영상 기록 카드 – 검정 배경용 흰색 텍스트 */
#video-tab .video-item {
    color: #ffffff;
}

#video-tab .video-item h3,
#video-tab .video-item .video-date,
#video-tab .video-item p,
#video-tab .video-item span {
    color: #ffffff;
}

.video-item video {
    width: 100%;
    height: 360px;          /* ★ 고정 */
    object-fit: contain;    /* 잘림 방지 */
    background: #000;
    border-radius: 12px;
}
.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.video-date {
    font-size: 14px;
    color: #666;
}

.empty-message {
    text-align: center;
    color: #888;
    margin-top: 40px;
}
/* 체형 / 영상 탭도 화면 높이 안에서만 스크롤 */
#posture-tab,
#video-tab {
  height: calc(100vh - 160px);   /* 헤더 + 탭 버튼 영역 제외한 높이 */
  overflow-y: auto;
}

#posture-tab .posture-list,
#video-tab .video-list {
  padding-bottom: 32px;
}
/* ===== 체형 비교 모달 ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 24px 24px;
    width: 80%;
    max-width: 1100px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-header span {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow: auto;
}

.compare-column {
    flex: 1;
    text-align: center;
}

.compare-column h4 {
    margin-bottom: 10px;
}

.compare-column img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 14px;
    object-fit: contain;
    background: #f3f4f6;
}

/* 랭킹 리스트 스타일 (수정) */
.ranking-list {
    list-style: none; /* 숫자 1. 2. 3. 제거 (우리가 메달 넣었으니까) */
    padding: 0;
    margin: 0;
}
.rank-card {
  padding: 28px 26px;
}
.rank-row {
  display: flex;
  flex-direction: column;      /* 세로 쌓기 */
  align-items: flex-start;
  margin-bottom: 10px;
}
.rank-row:last-child {
    border-bottom: none;
}
/* "🥇 이가람" 줄 – 굵게/크게 */
.rank-name {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}
/* "200kg" 줄 – 약간 작게, 위/아래 여백 조금 */
.rank-weight {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2px;
}
.rank-section-title,
.hero-ranking-title {
  font-size: 1.4rem;
}
.rank-section-desc {
  font-size: 1rem;
}

/* =========================
   인바디 탭 차트 레이아웃 고정
   ========================= */

/* 인바디 탭 전체 높이를 화면에 맞추고, 넘치면 스크롤 */
#inbody-tab {
  height: calc(100vh - 160px); /* 필요하면 숫자만 조금씩 조절 */
  overflow-y: auto;
}

/* 안쪽 콘텐츠 폭 & 정렬 */
#inbody-tab .tab-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* 2x2 그리드로 카드 배치 */
#inbody-tab .chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 24px 0 40px;
}

/* 각 차트 카드 높이 고정 */
#inbody-tab .chart-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  padding: 20px 24px;
  height: 360px;            /* ★ 핵심: 카드 세로 높이 고정 */
  display: flex;
  flex-direction: column;
}

/* 카드 타이틀 */
#inbody-tab .chart-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

/* 차트는 카드 안에서만 꽉 차게 */
#inbody-tab .chart-card canvas {
  flex: 1;                  /* 남은 세로 공간만 사용 */
  width: 100% !important;
  height: 100% !important;  /* canvas 자체도 카드 높이에 맞춤 */
}
/* =========================
   (옵션) 로그인 패드도 키우고 싶다면
   ========================= */
#login-screen .login-card {
  width: 520px;
  padding: 40px 40px;
}
#login-screen .login-card h1 {
  font-size: 2.4rem;
}
#login-screen #login-id {
  height: 72px;
  font-size: 1.6rem;
}
#login-screen .key {
  height: 90px;
  font-size: 2rem;
  font-weight: 600;
  border-radius: 20px;
}
#login-screen .key.clear,
#login-screen .key.enter {
  height: 90px;
  font-size: 1.8rem;
  font-weight: 700;
}