/* 짐로그 — 디자인 시스템. 체육관 철판 다크 + 초크 화이트 + 세이프티 옐로 */
:root {
  --bg: #131417;          /* 철판 다크 */
  --panel: #1c1e22;
  --panel-2: #24262c;
  --line: #30333a;
  --ink: #eceae4;         /* 초크 화이트 */
  --ink-dim: #8f929b;
  --yellow: #f2c928;      /* 세이프티 옐로 (포인트 1색) */
  --pr: #ff6a3d;          /* PR 전용 오렌지 */
  --ok: #58c08a;          /* 스트릭/성공 */
  --radius: 10px;
  --tab-h: 58px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  max-width: 640px; margin: 0 auto; min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; cursor: pointer; background: none; color: inherit; }
input, textarea, select {
  font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 13px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--yellow); border-color: transparent; }
.num { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* 상단 헤더 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px;
       position: sticky; top: 0; z-index: 30; background: linear-gradient(var(--bg) 82%, transparent); }
.logo { font-size: 20px; font-weight: 900; letter-spacing: -0.5px; }
.logo em { font-style: normal; color: var(--yellow); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--panel); }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--ink-dim); fill: none; stroke-width: 1.8; }
.streak-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line);
               border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 800; }
.streak-pill .fire { color: var(--yellow); }

/* 하단 탭바 */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px;
          height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
          background: rgba(19,20,23,0.97); border-top: 1px solid var(--line); display: flex; z-index: 40; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
       font-size: 10.5px; color: var(--ink-dim); font-weight: 700; }
.tab svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tab.active { color: var(--yellow); }
/* 중앙 기록 버튼 (탭바 3번째) */
.tab.log-cta { position: relative; }
.tab.log-cta .fab { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); color: #131417;
                    display: grid; place-items: center; margin-top: -22px; border: 4px solid var(--bg); }
.tab.log-cta .fab svg { stroke: #131417; width: 22px; height: 22px; }

/* 섹션/카드 */
.section-title { font-size: 15px; font-weight: 800; padding: 16px 16px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title small { font-weight: 600; color: var(--ink-dim); font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 16px 10px; padding: 14px; }
.seg { display: flex; gap: 8px; padding: 4px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg .s { flex-shrink: 0; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 700;
          background: var(--panel); color: var(--ink-dim); border: 1px solid var(--line); }
.seg .s.on { background: var(--yellow); color: #131417; border-color: var(--yellow); }

/* 기록 카드 (피드) */
.log-card .head { display: flex; align-items: center; gap: 9px; }
.log-card .avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--panel-2); display: grid; place-items: center;
                    font-weight: 900; font-size: 14px; color: var(--yellow); }
.log-card .who { flex: 1; min-width: 0; }
.log-card .who .nick { font-size: 13.5px; font-weight: 800; }
.log-card .who .sub { font-size: 11.5px; color: var(--ink-dim); margin-top: 1px; }
.log-card .vol { text-align: right; }
.log-card .vol .n { font-size: 19px; font-weight: 900; color: var(--ink); }
.log-card .vol .u { font-size: 10.5px; color: var(--ink-dim); }
.log-card .summary { margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.log-card .memo { margin-top: 7px; font-size: 13px; color: var(--ink-dim); line-height: 1.5; }
.log-card .foot { display: flex; align-items: center; gap: 14px; margin-top: 11px; font-size: 12.5px; color: var(--ink-dim); font-weight: 700; }
.like-btn { display: inline-flex; align-items: center; gap: 5px; }
.like-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.like-btn.on { color: var(--pr); }
.like-btn.on svg { fill: var(--pr); stroke: var(--pr); }

/* PR 뱃지 */
.pr-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,106,61,0.14); color: var(--pr);
            font-size: 10.5px; font-weight: 900; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.5px; }

/* 세트 테이블 (기록 상세/작성) */
.set-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.set-table th { text-align: left; font-size: 11px; color: var(--ink-dim); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.set-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.set-table td.r, .set-table th.r { text-align: right; }
.set-table .ex-name { font-weight: 800; }
.set-table tr:last-child td { border-bottom: 0; }

/* 스트릭 캘린더 점 */
.streak-dots { display: flex; gap: 5px; padding: 4px 0; }
.streak-dots .d { width: 14px; height: 14px; border-radius: 4px; background: var(--panel-2); }
.streak-dots .d.on { background: var(--ok); }

/* 랭킹 */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.rank-row .no { font-size: 15px; font-weight: 900; min-width: 24px; color: var(--ink-dim); }
.rank-row.top3 .no { color: var(--yellow); }
.rank-row .name { flex: 1; font-weight: 800; font-size: 14px; }
.rank-row .val { font-weight: 900; font-size: 15px; }

/* 공유 카드 (정사각 의식) */
.share-stage { padding: 24px 16px; }
.share-card { aspect-ratio: 1/1; border-radius: 18px; border: 2px solid var(--yellow); background:
              linear-gradient(160deg, #1c1e22 0%, #131417 70%); display: flex; flex-direction: column;
              justify-content: center; align-items: center; text-align: center; padding: 24px; gap: 10px; }
.share-card .sc-label { font-size: 12px; font-weight: 900; letter-spacing: 3px; color: var(--yellow); }
.share-card .sc-ex { font-size: 21px; font-weight: 800; }
.share-card .sc-weight { font-size: 52px; font-weight: 900; color: var(--pr); line-height: 1; }
.share-card .sc-weight small { font-size: 20px; color: var(--ink); }
.share-card .sc-who { font-size: 13.5px; color: var(--ink-dim); }
.share-card .sc-foot { font-size: 11px; color: var(--ink-dim); letter-spacing: 1px; }

/* 버튼/폼/기타 */
.btn { display: block; width: calc(100% - 32px); margin: 0 16px 10px; padding: 14px; border-radius: 10px;
       text-align: center; font-weight: 900; font-size: 15px; background: var(--yellow); color: #131417; }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--pr); border: 1px solid var(--pr); }
.btn:disabled { opacity: 0.4; }
.form-block { padding: 6px 16px; display: flex; flex-direction: column; gap: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-dim); margin-bottom: 6px; }
.empty { text-align: center; color: var(--ink-dim); padding: 46px 20px; font-size: 14px; line-height: 1.6; }
.empty .big { font-size: 30px; font-weight: 900; margin-bottom: 8px; color: var(--ink); }
#toast { position: fixed; bottom: calc(var(--tab-h) + 16px); left: 50%; transform: translateX(-50%);
         background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 800; padding: 11px 18px;
         border-radius: 999px; z-index: 60; opacity: 0; transition: opacity 0.25s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; }
.ai-note { margin: 10px 16px; padding: 12px 14px; border-radius: 10px; background: var(--panel);
           border-left: 3px solid var(--yellow); font-size: 13.5px; line-height: 1.55; }
.ai-note b { color: var(--yellow); font-size: 11px; display: block; margin-bottom: 3px; letter-spacing: 1px; }

/* 히어로 */
.hero { margin: 0 16px 14px; border-radius: var(--radius); overflow: hidden; background-color: #17181c;
        background-image: url("../assets/hero.jpg"); background-size: cover; background-position: center;
        padding: 34px 20px 22px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero h1 { font-size: 28px; font-weight: 900; letter-spacing: -1px; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero p { font-size: 13px; margin-top: 4px; color: rgba(255,255,255,0.82); text-shadow: 0 1px 6px rgba(0,0,0,0.6); }

/* Q&A */
.qa-item { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.qa-item .t { font-size: 14.5px; font-weight: 800; line-height: 1.45; }
.qa-item .m { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--ink-dim); }
.adopted { color: var(--ok); font-weight: 800; }
.answer { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.55; }
.answer.adopted-box { background: rgba(88,192,138,0.07); border-left: 3px solid var(--ok); }

@media (min-width: 641px) { body { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
