/* ==========================================================================
   Golf Score v6.0 — Fairway Light design system
   흰/오프화이트 바탕, 그린 프라이머리, 승=파랑·패=빨강, 남색 표 헤더, 연두 PAR 행.
   ========================================================================== */

:root {
  /* 표면 */
  --bg:        #F3F5F1;
  --surface:   #FFFFFF;
  --surface-2: #F7F8F5;
  --surface-3: #EEF1EC;

  /* 프라이머리 — 그린 (흰 바탕 대비 5.6:1) */
  --green:      #1F7A3A;
  --green-hi:   #2A9449;
  --green-deep: #155C2B;
  --green-wash: #E8F3EB;
  --green-edge: #BCDCC5;

  /* 표 */
  --navy:      #2B3A5C;
  --navy-2:    #3B4C72;
  --lime:      #B9D24E;
  --lime-ink:  #26330A;

  /* 승패 */
  --win:       #2563EB;
  --win-wash:  #EBF1FE;
  --win-edge:  #C3D4FB;
  --lose:      #DC2F2F;
  --lose-wash: #FDEDED;
  --lose-edge: #F6C4C4;
  --gold:      #A86B12;
  --gold-wash: #FBF3E3;
  --streak:      #7B3FC4;
  --streak-wash: #F3ECFC;

  /* 스코어 등급 — dataviz 검증 팔레트 (라벨 병기 필수) */
  --sc-eagle:  #F08C00;
  --sc-birdie: #D9480F;
  --sc-par:    #2B8A3E;
  --sc-bogey:  #1C9FC4;
  --sc-double: #3B5BDB;
  --sc-triple: #9C36B5;

  /* 잉크 */
  --ink:   #16201A;
  --ink-2: #47534B;
  --ink-3: #66726A;
  --ink-4: #9AA39C;

  /* 선 */
  --line:      #E3E7E1;
  --line-firm: #D2D8D0;

  /* 형태 */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;

  /* 공간 */
  --gut: 16px;
  --tab-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --shadow-1: 0 1px 2px rgba(22,32,26,.05), 0 1px 1px rgba(22,32,26,.03);
  --shadow-2: 0 8px 24px -12px rgba(22,32,26,.18), 0 2px 4px rgba(22,32,26,.04);
  --ease: cubic-bezier(.22,.61,.36,1);
}

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

html { -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: hidden; overflow-x: clip; }

body {
  font-family: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;   /* 두 번 탭 확대 없이 즉시 반응 */
  padding-top: var(--safe-t);
  padding-bottom: calc(var(--tab-h) + var(--safe-b));
  overscroll-behavior-y: none;
}

input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
summary { cursor: pointer; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}

.icon { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor;
        stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── 앱 바 ───────────────────────────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--gut);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--green); color: #fff;
}
.brand-logo .icon { width: 17px; height: 17px; stroke-width: 2; }
.brand-mark { font-size: 1.08rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.brand-mark b { color: var(--green); font-weight: 800; }
.brand-ver {
  font-size: .64rem; font-weight: 700; color: var(--green);
  padding: 2px 6px; background: var(--green-wash); border-radius: 5px;
}
.appbar-action {
  margin-left: auto; width: 44px; height: 44px; margin-right: -6px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .18s;
}
.appbar-action .icon { width: 22px; height: 22px; }
.appbar-action:hover { background: var(--surface-3); }

/* ── 페이지 ──────────────────────────────────────────────────────────────── */
.page { display: none; padding: 4px var(--gut) 32px; max-width: 560px; margin: 0 auto; }
.page.active { display: block; }
@media (min-width: 720px) { .page { max-width: 640px; } }

.block { margin-top: 24px; }
.page > .block:first-child { margin-top: 16px; }

.block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.block-icon {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--green);
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.block-title { font-size: 1rem; font-weight: 750; letter-spacing: -.025em; color: var(--ink); }
.block-note { margin-left: auto; font-size: .74rem; color: var(--ink-3); line-height: 1.4; text-align: right; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-1);
}
.panel {
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px;
}
.panel-cap { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }

/* ── 게임 방식 카드 ──────────────────────────────────────────────────────── */
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 92px; padding: 13px 13px 12px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1);
  transition: border-color .16s, background .16s, transform .12s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.game:active { transform: scale(.98); }
.game-ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
  transition: background .16s, color .16s;
}
.game-ico .icon { width: 18px; height: 18px; }
.game-name { font-size: .95rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.game-desc { font-size: .7rem; color: var(--ink-3); line-height: 1.35; }
.game-check {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-firm); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: background .16s, border-color .16s;
}
.game-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.game.on { border-color: var(--green); background: var(--green-wash); }
.game.on .game-ico { background: var(--green); color: #fff; }
.game.on .game-check { background: var(--green); border-color: var(--green); color: #fff; }
.game.disabled { cursor: not-allowed; background: var(--surface-2); box-shadow: none; }
.game.disabled .game-name, .game.disabled .game-ico { opacity: .45; }
.game-why { display: none; font-size: .68rem; font-weight: 650; color: var(--lose); line-height: 1.35; }
.game.disabled .game-why { display: flex; align-items: center; gap: 4px; }
.game.disabled .game-desc { display: none; }
.game-why .icon { width: 11px; height: 11px; }

/* ── 게임 옵션 ───────────────────────────────────────────────────────────── */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { padding: 0; overflow: hidden; }
.opt-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.opt-head .icon { width: 16px; height: 16px; color: var(--green); }
.opt-head b { font-size: .86rem; font-weight: 750; }
.opt-head span { margin-left: auto; font-size: .7rem; color: var(--ink-3); }
.opt-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.opt-empty {
  padding: 14px; text-align: center; font-size: .8rem; color: var(--ink-3);
  border: 1.5px dashed var(--line-firm); border-radius: var(--r);
}

.field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field > label { font-size: .84rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.field-sub { display: block; font-size: .72rem; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.money { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.money span { font-size: .8rem; color: var(--ink-3); }
.amount {
  width: 112px; text-align: right;
  background: var(--surface-2); border: 1px solid var(--line-firm);
  border-radius: 10px; padding: 9px 12px; min-height: 44px;
  color: var(--ink); font-size: 1rem; font-weight: 750;
  outline: none; -moz-appearance: textfield;
}
.amount::-webkit-inner-spin-button, .amount::-webkit-outer-spin-button { display: none; }
.amount:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px var(--green-wash); }

/* 세그먼트 */
.seg { display: flex; padding: 3px; gap: 3px; background: var(--surface-3); border-radius: 11px; }
.seg button {
  flex: 1; min-height: 44px; padding: 6px 8px; border-radius: 9px;
  font-size: .78rem; font-weight: 650; color: var(--ink-3);
  transition: background .16s, color .16s;
}
.seg button.on { background: #fff; color: var(--green-deep); box-shadow: var(--shadow-1); font-weight: 750; }

/* 토글 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-firm); background: var(--surface);
  font-size: .78rem; font-weight: 650; color: var(--ink-2);
  cursor: pointer; user-select: none;
  transition: border-color .16s, color .16s, background .16s;
  -webkit-tap-highlight-color: transparent;
}
.chip:active { transform: scale(.97); }
.chip.on { border-color: var(--green); background: var(--green); color: #fff; }
.chip.off { opacity: .5; }
.chip.off .chip-name { text-decoration: line-through; }
.chip.disabled { opacity: .38; cursor: not-allowed; }
.chip-qty { font-size: .66rem; font-weight: 600; opacity: .75; }
.chip-box { display: none; }
.chip-tick { width: 13px; height: 13px; stroke-width: 3; display: none; }
.chip.on .chip-tick { display: block; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chip.streak.on { border-color: var(--streak); background: var(--streak); }

.rule-note {
  border-radius: var(--r-sm); padding: 10px 12px;
  font-size: .74rem; line-height: 1.6; color: var(--ink-2);
  background: var(--surface-2);
}
.rule-note b { color: var(--ink); font-weight: 700; }
.rule-note.streak { color: var(--streak); background: var(--streak-wash); }
.rule-note.streak b { color: var(--streak); }

.subform { display: none; }

/* 접이식 (참가자 · 보유금액) */
.fold { overflow: hidden; }
.fold > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; min-height: 52px; -webkit-tap-highlight-color: transparent;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--green-wash); color: var(--green); }
.fold-ico .icon { width: 18px; height: 18px; }
.fold-body { min-width: 0; flex: 1; }
.fold-title { display: block; font-size: .9rem; font-weight: 750; }
.fold-sub { display: block; font-size: .72rem; color: var(--ink-3); }
.fold-chev { width: 18px; height: 18px; color: var(--ink-4); transition: transform .2s var(--ease); }
.fold[open] .fold-chev { transform: rotate(180deg); }
.fold-in { padding: 4px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.fold-in .field-sub { margin-top: 10px; }

.purse { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.purse-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; }
.purse-item label { display: block; font-size: .7rem; color: var(--ink-3); margin-bottom: 4px; font-weight: 650; }
.purse-item input {
  width: 100%; background: #fff; border: 1px solid var(--line-firm);
  border-radius: 8px; padding: 7px 10px; min-height: 44px;
  font-size: 1rem; font-weight: 700; outline: none; -moz-appearance: textfield;
}
.purse-item input::-webkit-inner-spin-button { display: none; }
.purse-item input:focus { border-color: var(--green); }

/* ── 촬영 카드 ───────────────────────────────────────────────────────────── */
#fileInput, #fileCam { display: none; }
.capture {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; text-align: left; overflow: hidden;
  background: var(--surface); border: 1.5px dashed var(--green-edge); border-radius: var(--r-lg);
  transition: border-color .2s, background .2s;
}
.capture.dragover { border-color: var(--green); background: var(--green-wash); }
.capture.loaded { border-style: solid; border-color: var(--green); }
.capture-art { flex-shrink: 0; width: 84px; height: 84px; border-radius: 16px;
  display: grid; place-items: center; background: var(--green-wash); position: relative; }
.capture-art svg { width: 64px; height: 64px; overflow: visible; }
.capture-art .art-sheet { fill: #fff; stroke: var(--green); stroke-width: 1.6; }
.capture-art .art-head { fill: var(--navy); }
.capture-art .art-par { fill: var(--lime); }
.capture-art .art-rule { stroke: var(--line-firm); stroke-width: 1.2; }
.capture-art .art-dot { fill: var(--sc-birdie); }
.capture-art .art-ring { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.capture-lens {
  position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--green); color: #fff;
  box-shadow: 0 0 0 3px #fff;
}
.capture-lens .icon { width: 16px; height: 16px; stroke-width: 2; }
.capture-inner { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.capture-title { font-size: 1rem; font-weight: 780; letter-spacing: -.025em; }
.capture-sub { font-size: .76rem; color: var(--ink-3); line-height: 1.45; }
@media (max-width: 374px) {
  .capture { gap: 12px; padding: 14px; }
  .capture-art { width: 68px; height: 68px; }
  .capture-art svg { width: 52px; height: 52px; }
}

/* 촬영 / 불러오기 — 두 입력을 나란히, 큰 버튼으로 */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 76px; padding: 12px 8px; border-radius: var(--r);
  background: var(--surface); border: 1.5px solid var(--green-edge); color: var(--green-deep);
  font-size: .9rem; font-weight: 750; letter-spacing: -.02em; text-align: center; line-height: 1.3;
  box-shadow: var(--shadow-1); transition: transform .12s, background .16s;
}
.pick-btn .icon { width: 24px; height: 24px; stroke-width: 2; }
.pick-btn:active { transform: scale(.98); background: var(--green-wash); }
.pick-cam { background: var(--green); border-color: var(--green); color: #fff;
  box-shadow: 0 8px 20px -12px rgba(31,122,58,.8); }
.pick-cam:active { background: var(--green-deep); }
.pick.more .pick-btn { min-height: 52px; flex-direction: row; gap: 8px; font-size: .84rem;
  background: var(--surface); border-style: dashed; color: var(--green-deep); box-shadow: none; }
.pick.more .pick-btn .icon { width: 19px; height: 19px; }

/* 넣은 사진 목록 */
.shots { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.shot { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.shot-thumb { position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot-thumb b { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; border-radius: 6px;
  background: rgba(22,32,26,.78); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; }
.shot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shot-title { font-size: .88rem; font-weight: 750; }
.shot-title small { display: block; font-size: .7rem; font-weight: 600; color: var(--green-deep); }
.shot-meta { font-size: .7rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot.busy .shot-meta { color: var(--green); }
.shot-hint { margin-top: 8px; font-size: .74rem; color: var(--ink-3); text-align: center; }
.ball.sm { width: 22px; height: 22px; border-width: 2.5px; }

.icon-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink-2); transition: background .16s; }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.danger { color: var(--lose); }

/* ── 버튼 ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 14px 22px; border-radius: 14px;
  font-size: .96rem; font-weight: 750; letter-spacing: -.015em;
  transition: background .18s, opacity .18s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn .icon { width: 18px; height: 18px; stroke-width: 2; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px -10px rgba(31,122,58,.7); }
.btn-primary:hover { background: var(--green-hi); }
.btn-primary:disabled { background: var(--surface-3); color: var(--ink-4); box-shadow: none; cursor: not-allowed; }
.btn-primary:disabled:active { transform: none; }
.btn-quiet { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-firm); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-warn { background: var(--surface); color: var(--lose); border: 1px solid var(--lose-edge); }
.btn-sm { min-height: 44px; padding: 10px 14px; font-size: .84rem; border-radius: 12px; }
.btn-pair { display: flex; gap: 8px; margin-top: 8px; }
.btn-pair .btn { flex: 1; }

.dock {
  position: sticky; bottom: calc(var(--tab-h) + var(--safe-b));
  z-index: 40; margin: 20px calc(var(--gut) * -1) 0;
  padding: 12px var(--gut) 12px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.dock.dock-end { position: static; background: none; border: 0; padding: 0; margin: 28px 0 0; }

/* ── 분석 진행 ───────────────────────────────────────────────────────────── */
.working { display: none; position: fixed; inset: 0; z-index: 300; padding: 24px;
  background: rgba(243,245,241,.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center; }
.working.on { display: flex; }
.working-card { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 26px 22px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); text-align: center; }
.meter { width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 3px; transition: width .4s var(--ease); }
.ball { width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--green-wash); border-top-color: var(--green); animation: roll .8s linear infinite; }
@keyframes roll { to { transform: rotate(360deg); } }
.working-title { font-size: .88rem; font-weight: 700; }
.working-note { font-size: .74rem; color: var(--ink-3); }

/* ── 바텀 시트 (사용법) ──────────────────────────────────────────────────── */
.sheet {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(22,32,26,.42);
  align-items: flex-end; justify-content: center;
}
.sheet.open { display: flex; }
.sheet-panel {
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto;
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px var(--gut) calc(22px + var(--safe-b));
  animation: rise .26s var(--ease); -webkit-overflow-scrolling: touch;
}
@keyframes rise { from { transform: translateY(6%); } to { transform: translateY(0); } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-firm); margin: 0 auto 14px; }
.sheet-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 2px; }
.sheet-sub { font-size: .8rem; color: var(--ink-3); margin-bottom: 16px; }

/* AI 전송 안내 */
.ai-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ai-points li { position: relative; padding: 11px 12px 11px 30px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: .84rem; line-height: 1.55; color: var(--ink-2); }
.ai-points li::before { content: ""; position: absolute; left: 13px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ai-points b { color: var(--ink); }
.ai-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .84rem; font-weight: 700; color: var(--green);
  text-decoration: underline; text-underline-offset: 3px; }

/* iOS가 확대하지 않도록 입력 글자는 16px 이상 */
.text-in { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line-firm); font-size: 1.06rem; font-weight: 700; outline: none; }
.text-in:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }

/* 점수 고치기 시트 */
.ss-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ss-title { flex: 1; min-width: 0; }
.ss-title b { display: block; font-size: 1.12rem; font-weight: 800; letter-spacing: -.03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-title small { font-size: .82rem; color: var(--ink-3); font-weight: 650; }
.ss-main { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; margin: 8px 0 16px; }
.ss-step { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-firm); color: var(--ink); box-shadow: var(--shadow-1); }
.ss-step .icon { width: 26px; height: 26px; stroke-width: 2.4; }
.ss-step:active { background: var(--green-wash); border-color: var(--green); }
.ss-val { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ss-num { width: 76px; height: 76px; display: grid; place-items: center; font-size: 2.4rem; font-weight: 850;
  letter-spacing: -.04em; border: 2.5px solid transparent; border-radius: 12px; color: var(--ink); }
.ss-num.g-par    { border-radius: 50%; border-color: var(--ink-4); }
.ss-num.g-birdie { border-radius: 50%; background: var(--sc-birdie); border-color: var(--sc-birdie); color: #fff; }
.ss-num.g-eagle  { border-radius: 50%; background: var(--sc-eagle); border-color: #fff; color: #3B2200; box-shadow: 0 0 0 2.5px var(--sc-eagle); }
.ss-num.g-bogey  { border-color: var(--sc-bogey); color: #0E5E75; }
.ss-num.g-double { background: var(--sc-double); border-color: var(--sc-double); color: #fff; }
.ss-num.g-triple { background: var(--sc-triple); border-color: var(--sc-triple); color: #fff; }
.ss-lbl { font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.ss-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ss-quick button { min-height: 56px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--line-firm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.ss-quick b { font-size: 1.2rem; font-weight: 850; line-height: 1.1; }
.ss-quick small { font-size: .7rem; color: var(--ink-3); font-weight: 650; }
.ss-quick button.on { background: var(--green); border-color: var(--green); color: #fff; }
.ss-quick button.on small { color: rgba(255,255,255,.85); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ── 확인: 합계 카드 ─────────────────────────────────────────────────────── */
.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.tally-item { text-align: center; padding: 11px 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-1); }
.tally-name { font-size: .72rem; color: var(--ink-2); font-weight: 650; margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-total { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.15; }
.tally-total.mismatch { color: var(--lose); }
.tally-split { font-size: .66rem; color: var(--ink-3); margin-top: 2px; }

.notice { border-radius: var(--r-sm); padding: 11px 13px; margin-top: 10px; font-size: .78rem; line-height: 1.6;
  display: flex; gap: 8px; align-items: flex-start; }
.notice .icon { width: 16px; height: 16px; margin-top: 2px; }
.notice-ok { background: var(--green-wash); color: var(--green-deep); }
.notice-bad { background: var(--lose-wash); color: var(--lose); }

.proof { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface-3); cursor: zoom-in; margin-bottom: 8px; }
.proof img { width: 100%; display: block; object-fit: contain; max-height: 240px; }
.proof.big { cursor: zoom-out; }
.proof.big img { max-height: none; }

/* ── 스코어카드 표 (ref2 스타일) ─────────────────────────────────────────── */
.sc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--gut) * -1) 12px; padding: 0 var(--gut); }
.sc-cap { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 750; color: var(--navy); margin: 0 0 6px; }
.sc-cap i { width: 7px; height: 7px; border-radius: 50%; background: var(--win); }
/* 360px(내용 폭 328px) 기준: 이름 48 + 홀 9칸 × 약 27 + 소계 32 — 가로 스크롤 없이 들어간다 */
.sc {
  border-collapse: separate; border-spacing: 0; width: 100%;
  table-layout: fixed; font-size: .78rem;
  background: var(--surface); border: 1px solid var(--line-firm); border-radius: 10px; overflow: hidden;
}
.sc th, .sc td { text-align: center; padding: 0; height: 32px; border-right: 1px solid rgba(0,0,0,.06); }
.sc tbody tr:not(.r-par) td, .sc tbody tr:not(.r-par) th { height: 42px; }
.sc th:last-child, .sc td:last-child { border-right: 0; }
.sc col.c-name { width: 48px; }
.sc col.c-sum { width: 32px; }
@media (min-width: 390px) { .sc col.c-name { width: 56px; } .sc col.c-sum { width: 34px; } }
.sc thead th { background: var(--navy); color: #fff; font-weight: 700; font-size: .72rem; }
.sc thead th:first-child { text-align: left; padding-left: 8px; }
.sc .r-par td, .sc .r-par th { background: var(--lime); color: var(--lime-ink); font-weight: 750; font-size: .78rem; }
.sc .r-par th { text-align: left; padding-left: 8px; }
.sc tbody td, .sc tbody th { border-top: 1px solid var(--line); }
.sc tbody .r-par td, .sc tbody .r-par th { border-top: 0; }
.sc .c-who { text-align: left; padding: 0; font-weight: 700; font-size: .74rem; background: var(--surface-2); }
.sc .c-sum { font-weight: 800; background: var(--surface-2); color: var(--ink); }
.sc thead .c-sum { background: var(--navy-2); }
.sc .r-par .c-sum { background: #A9C23F; }
.sc td.is-par3 { background: #F6F9FE; }
.sc .who {
  display: block; width: 100%; height: 42px; padding: 0 2px 0 8px; text-align: left;
  font-weight: 700; font-size: .74rem; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: underline dotted var(--ink-4); text-underline-offset: 3px;
}

/* 18홀 합계 — 표 밖 요약 줄 */
.sc-total { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.sc-total-cap { font-size: .74rem; font-weight: 800; color: var(--navy); margin-right: 2px; }
.sc-total-cap small { font-weight: 650; color: var(--ink-3); margin-left: 4px; }
.sc-total-item { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); font-size: .74rem; color: var(--ink-2); font-weight: 650; max-width: 100%; }
.sc-total-item .who-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; }
.sc-total-item b { font-size: .92rem; font-weight: 850; color: var(--ink); }

/* 기호 칸: 파=빈 원, 버디=빨간 원, 이글=이중 원, 보기=네모, 더블=채운 네모, 트리플+=보라 네모.
   탭하면 점수 고치기 시트가 열린다. 보이는 기호는 24px, 누르는 영역은 칸 전체. */
.score-in {
  position: relative; width: 24px; height: 24px; padding: 0; margin: 0 auto; display: grid; place-items: center;
  font-size: .82rem; font-weight: 800; line-height: 1;
  background: transparent; color: var(--ink);
  border: 1.5px solid transparent; border-radius: 6px;
}
.score-in::after { content: ""; position: absolute; inset: -9px -3px; }
.score-in:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.score-in.g-par    { border-radius: 50%; border-color: var(--ink-4); }
.score-in.g-birdie { border-radius: 50%; background: var(--sc-birdie); border-color: var(--sc-birdie); color: #fff; }
.score-in.g-eagle  { border-radius: 50%; background: var(--sc-eagle); border-color: #fff; color: #3B2200;
                     box-shadow: 0 0 0 1.5px var(--sc-eagle); }
.score-in.g-bogey  { border-color: var(--sc-bogey); color: #0E5E75; }
.score-in.g-double { background: var(--sc-double); border-color: var(--sc-double); color: #fff; }
.score-in.g-triple { background: var(--sc-triple); border-color: var(--sc-triple); color: #fff; }

.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .7rem; color: var(--ink-3); margin-top: 2px; }
.sc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sym { width: 14px; height: 14px; display: inline-block; border: 1.5px solid transparent; border-radius: 3px; }
.sym.g-par { border-radius: 50%; border-color: var(--ink-4); }
.sym.g-birdie { border-radius: 50%; background: var(--sc-birdie); }
.sym.g-eagle { border-radius: 50%; background: var(--sc-eagle); border-color: #fff; box-shadow: 0 0 0 1.5px var(--sc-eagle); }
.sym.g-bogey { border-color: var(--sc-bogey); }
.sym.g-double { background: var(--sc-double); }
.sym.g-triple { background: var(--sc-triple); }

/* 니어리스트 지정 */
.near-list { display: flex; flex-direction: column; gap: 8px; }
.near-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.near-hole { flex-shrink: 0; width: 54px; }
.near-hole b { display: block; font-size: .92rem; font-weight: 800; }
.near-hole small { font-size: .66rem; color: var(--ink-3); }
.near-picks { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nearest-pick {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-firm); background: var(--surface);
  font-size: .8rem; font-weight: 650; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .16s, color .16s, border-color .16s;
}
.nearest-pick .icon { width: 13px; height: 13px; display: none; }
.nearest-pick.picked { background: var(--win); border-color: var(--win); color: #fff; }
.nearest-pick.picked .icon { display: block; }
.near-none { font-size: .78rem; color: var(--ink-3); padding: 4px 2px; }

/* 스코어 등급 글자색 (홀별 내역 등) */
.t-eagle  { color: #B06500; }
.t-birdie { color: var(--sc-birdie); }
.t-par    { color: var(--ink); }
.t-bogey  { color: #0E7A98; }
.t-double { color: var(--sc-double); }
.t-triple { color: var(--sc-triple); }

/* ── 정산: 히어로 (ref1 스타일) ──────────────────────────────────────────── */
.hero { padding: 18px 18px 16px; }
.hero-top { display: flex; align-items: center; gap: 8px; }
.hero-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--gold-wash); color: var(--gold); font-size: .72rem; font-weight: 800; }
.hero-badge .icon { width: 14px; height: 14px; }
.hero-meta { margin-left: auto; font-size: .72rem; color: var(--ink-3); text-align: right; }
.hero-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; }
.hero-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; }
.hero-over { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.hero-amt { margin-left: auto; font-size: 2.3rem; font-weight: 850; letter-spacing: -.045em; line-height: 1; }
.hero-amt small { font-size: 1rem; font-weight: 700; margin-left: 2px; }
.hero-amt.up { color: var(--win); }
.hero-amt.down { color: var(--lose); }
.hero-amt.flat { color: var(--ink-3); }
.hero-break { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; justify-content: flex-end; }
.hero-break span { font-size: .7rem; font-weight: 650; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; }

.me { margin-top: 10px; padding: 14px 16px; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-label { font-size: .86rem; font-weight: 750; }
.me-label small { font-size: .74rem; color: var(--ink-3); font-weight: 600; margin-left: 4px; }
.me-amt { margin-left: auto; font-size: 1.6rem; font-weight: 850; letter-spacing: -.04em; }
.me-pick { margin-top: 10px; }

/* WIN / LOSE 블록 */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; align-items: start; }
.vs-col { display: flex; flex-direction: column; gap: 6px; }
.vs-head { height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-size: .9rem; font-weight: 850; letter-spacing: .04em; }
.vs-head.win { background: var(--win); }
.vs-head.lose { background: var(--lose); }
.vs-card { position: relative; padding: 11px 12px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-1); min-height: 68px; }
.vs-rank { position: absolute; top: 10px; right: 10px; font-size: .68rem; font-weight: 800; color: var(--ink-4); }
.vs-name { font-size: .9rem; font-weight: 750; padding-right: 22px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-name small { font-size: .72rem; color: var(--ink-3); font-weight: 600; margin-left: 3px; }
.vs-amt { font-size: 1.05rem; font-weight: 850; letter-spacing: -.02em; margin-top: 2px; }
.vs-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
.mini-tag { font-size: .62rem; font-weight: 700; color: #fff; background: var(--ink-2); border-radius: 4px; padding: 1px 5px; }
.vs-empty { font-size: .74rem; color: var(--ink-4); text-align: center; padding: 14px 0; }
.vs-even { grid-column: 1 / -1; }
.up   { color: var(--win); }
.down { color: var(--lose); }
.flat { color: var(--ink-3); }

/* 홀별 내역 */
.hole { padding: 12px 14px; margin-bottom: 8px; }
.hole-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.hole-no { font-size: .92rem; font-weight: 850; color: var(--ink); }
.hole-par { font-size: .74rem; color: var(--ink-3); font-weight: 650; margin-right: 2px; }
.tag { font-size: .66rem; font-weight: 700; border-radius: 5px; padding: 2px 7px; line-height: 1.5; }
.tag-double { color: #fff; background: var(--lose); }
.tag-streak { color: #fff; background: var(--streak); }
.tag-flag   { color: #fff; background: var(--win); }
.tag-green  { color: var(--green-deep); background: var(--green-wash); }
.tag-dark   { color: #fff; background: var(--ink-2); }

.hole-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; margin-bottom: 10px; }
.hole-score { display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  background: var(--surface-2); border-radius: 8px; min-width: 0; }
.hole-score .sym-n { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; border: 1.5px solid transparent; border-radius: 5px; }
.sym-n.g-par { border-radius: 50%; border-color: var(--ink-4); }
.sym-n.g-birdie { border-radius: 50%; background: var(--sc-birdie); color: #fff; }
.sym-n.g-eagle { border-radius: 50%; background: var(--sc-eagle); color: #3B2200; border-color: #fff; box-shadow: 0 0 0 1.5px var(--sc-eagle); }
.sym-n.g-bogey { border-color: var(--sc-bogey); color: #0E5E75; }
.sym-n.g-double { background: var(--sc-double); color: #fff; }
.sym-n.g-triple { background: var(--sc-triple); color: #fff; }
.hole-score-who { display: block; font-size: .7rem; font-weight: 650; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hole-score-lbl { display: block; font-size: .62rem; color: var(--ink-3); }

.moves { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--line-firm); padding-top: 8px; }
.move { display: flex; align-items: center; gap: 6px; font-size: .76rem; }
.move-from { color: var(--lose); font-weight: 700; }
.move-arrow { color: var(--ink-4); width: 12px; height: 12px; }
.move-to { color: var(--win); font-weight: 700; }
.move-tag { font-size: .62rem; font-weight: 700; color: var(--ink-3); background: var(--surface-3); border-radius: 4px; padding: 0 5px; }
.move-amt { margin-left: auto; font-weight: 800; color: var(--ink); }
.moves-none { font-size: .74rem; color: var(--ink-4); }

/* 정산 표 */
.ledger { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ledger th { color: var(--ink-3); font-size: .7rem; font-weight: 700; text-align: left;
  padding: 7px 8px; border-bottom: 1px solid var(--line-firm); }
.ledger td { padding: 9px 8px; border-bottom: 1px solid var(--line); font-weight: 650; }
.ledger td.num { font-weight: 800; }
.ledger tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap .ledger { white-space: nowrap; }
.ledger-head th { background: var(--navy); color: #fff; border: 0; }
.ledger-head th:first-child { border-radius: 8px 0 0 8px; }
.ledger-head th:last-child { border-radius: 0 8px 8px 0; }
.ledger tr.r-sum td { background: var(--surface-2); font-weight: 850; }

.split3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 520px) { .split3 { grid-template-columns: 1fr; } }
.split3 .panel { margin: 0; padding: 12px; }

.grid-tbl { width: 100%; border-collapse: collapse; font-size: .74rem; white-space: nowrap; }
.grid-tbl th { background: var(--navy); color: #fff; font-size: .68rem; font-weight: 700; padding: 8px; text-align: center; }
.grid-tbl td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 650; }
.grid-tbl .r-split td { background: var(--lime); color: var(--lime-ink); font-weight: 800; }
.grid-tbl .r-split td.up, .grid-tbl .r-split td.down { color: var(--lime-ink); }
.grid-tbl .r-total td { background: var(--surface-3); font-weight: 850; }

.flow { display: flex; justify-content: center; padding: 4px 0; }
.flow svg { width: 100%; max-width: 460px; }
.flow-key { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.flow-key span { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--ink-2); }
.flow-key i { width: 9px; height: 9px; border-radius: 50%; }

/* ── 스코어 분석 (ref2 스타일) ───────────────────────────────────────────── */
.stats-pick { margin-bottom: 10px; }
.stats-top { display: grid; grid-template-columns: 148px 1fr; gap: 14px; align-items: center; }
@media (max-width: 350px) { .stats-top { grid-template-columns: 1fr; justify-items: center; } }
.donut { position: relative; width: 148px; height: 148px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-c small { font-size: .66rem; color: var(--ink-3); font-weight: 650; }
.donut-c b { font-size: 1.9rem; font-weight: 850; letter-spacing: -.04em; line-height: 1.05; }
.donut-c em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--ink-2); }
.legend { list-style: none; display: flex; flex-direction: column; gap: 3px; width: 100%; }
.legend li { display: grid; grid-template-columns: 10px 1fr auto 40px; gap: 7px; align-items: center; font-size: .76rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { color: var(--ink-2); font-weight: 600; }
.legend b { font-weight: 800; text-align: right; }
.legend em { font-style: normal; color: var(--ink-3); text-align: right; font-size: .7rem; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 9px 6px; text-align: center; background: var(--surface-2); }
.tile small { display: block; font-size: .64rem; color: var(--ink-3); font-weight: 650; white-space: nowrap; }
.tile b { display: block; font-size: 1.2rem; font-weight: 850; color: var(--lose); letter-spacing: -.03em; margin-top: 2px; }
.tile b.ink { color: var(--ink); }

.bars-cap { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 750; color: var(--navy); margin: 16px 0 6px; }
.bars-cap i { width: 7px; height: 7px; border-radius: 50%; background: var(--win); }
.bars svg { width: 100%; height: auto; display: block; overflow: visible; }

.compare { margin-top: 12px; }

/* ── 더보기 ──────────────────────────────────────────────────────────────── */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-1); }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--surface-2); }
.list-icon { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--green-wash); color: var(--green); font-weight: 800; font-size: .9rem; }
.list-icon .icon { width: 18px; height: 18px; }
.list-body { flex: 1; min-width: 0; display: block; }
.list-title { display: block; font-size: .88rem; font-weight: 700; }
.list-desc { display: block; font-size: .72rem; color: var(--ink-3); margin-top: 1px; }
.list-go { width: 18px; height: 18px; color: var(--ink-4); }

.prose { font-size: .84rem; line-height: 1.75; color: var(--ink-2); }
.prose dt { font-size: .74rem; color: var(--ink-3); margin-top: 12px; font-weight: 650; }
.prose dt:first-child { margin-top: 0; }
.prose dd { color: var(--ink); }
.prose .caution { color: var(--lose); }

.colophon { text-align: center; padding: 18px 0 4px; }
.colophon-name { font-size: .8rem; color: var(--ink-2); }
.colophon-mail { font-size: .72rem; color: var(--ink-4); margin-top: 2px; }

/* ── 탭 바 — 녹색 바 ─────────────────────────────────────────────────────── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 6px 8px var(--safe-b);
  background: var(--green);
  box-shadow: 0 -6px 18px -10px rgba(21,92,43,.55);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; margin: 0 3px; border-radius: 12px;
  font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.72);
  transition: color .18s, background .18s;
  -webkit-tap-highlight-color: transparent;
}
.tab .icon { width: 22px; height: 22px; }
.tab.active { color: var(--green-deep); background: #E4F2C4; }

/* ── 토스트 ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 66px); z-index: 900;
  transform: translate(-50%, -72px); opacity: 0;
  max-width: 320px; width: max-content; text-align: center;
  padding: 11px 16px; border-radius: 12px; font-size: .82rem; font-weight: 600;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-2);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--lose); }

/* 게임 영역 강조 (게임 미선택 상태로 정산 시도) */
@keyframes nudge { 0%,100% { box-shadow: 0 0 0 0 rgba(31,122,58,0); } 50% { box-shadow: 0 0 0 4px rgba(31,122,58,.28); } }
.nudge { animation: nudge .5s var(--ease) 3; border-radius: var(--r); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ━━━ 도움말 게임 규칙 ━━━ */
#helpRules .rule-fold { margin-top: 8px; }
.rule-body { padding: 0 14px 14px; display: grid; gap: 8px; font-size: .8rem; line-height: 1.6; color: var(--ink-2); }
.rule-body p b { color: var(--ink); font-weight: 750; }
.rule-body p > b:first-child { margin-right: 6px; }
.rule-ex { background: var(--surface-2, #F4F5F0); border-radius: 10px; padding: 10px 12px; font-size: .76rem; line-height: 1.65; color: var(--ink-2); }
.rule-ex b { display: block; color: var(--ink); margin-bottom: 2px; }
.rule-link { margin-left: 8px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line, #DADDD3); background: #fff; font-size: .72rem; font-weight: 700; color: var(--green, #1F7A3A); cursor: pointer; }

.seg.seg-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.rule-feat { border-left: 3px solid var(--green); background: var(--green-wash); border-radius: 0 10px 10px 0; padding: 9px 12px; font-size: .78rem; line-height: 1.6; color: var(--ink-2); }
.rule-feat > b { display: block; color: var(--green-deep); margin-bottom: 2px; }
.rule-feat ul, .rule-tips ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
.rule-tips { margin-top: 8px; padding: 12px 14px; font-size: .78rem; line-height: 1.6; color: var(--ink-2); }
.rule-tips > b { display: block; color: var(--ink); margin-bottom: 4px; font-size: .84rem; }
