/* =========================================================
   SSO'S HUB — 07 여드름 톡톡 (무한 힐링 미니게임)
   다크 블랙핑크 테마 · 제목은 카페24 숑숑 · 본문은 프리텐다드
   ========================================================= */

@font-face {
  font-family: 'Cafe24Syongsyong';
  src: url('https://cdn.jsdelivr.net/npm/@noonnu/cafe24-syongsyong@0.1.0/fonts/cafe24syongsyong-normal.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-syong: 'Cafe24Syongsyong', 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --skin-line: rgba(255, 255, 255, .16);
}

.pimple-page { max-width: 1180px; }

/* 오른쪽 책갈피 리본은 옆 패널과 겹쳐서 이 페이지에서는 숨깁니다 */
.bookmark { display: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── 머리말 ──────────────────────────────────────────── */

.pimple-page .kicker { letter-spacing: .22em; }

.pimple-page .subhead h1 {
  font-family: var(--font-syong);
  font-weight: 400;
  font-size: clamp(34px, 5.6vw, 50px);
  line-height: 1.14;
  letter-spacing: -.005em;
  color: #fff2f7;
  text-shadow: 0 0 26px rgba(255, 77, 141, .38), 0 2px 0 rgba(0, 0, 0, .2);
}
.pimple-page .subhead .sub {
  font-family: var(--font-syong);
  font-size: 21px;
  letter-spacing: 0;
  color: var(--pink-3);
}
.pimple-page .subhead .sub::before {
  content: "🫧 ";
  font-size: 17px;
}

.subhead-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}
.subhead-note {
  margin: 0;
  max-width: 32ch;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-4);
  word-break: keep-all;
}

/* ── 전체 배치 ────────────────────────────────────────── */

.play { margin-top: 22px; }

.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 16px;
  align-items: start;
}

.stage-card {
  position: relative;
  padding: 14px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 130% at 100% -14%, rgba(255, 77, 141, .14), transparent 58%),
    linear-gradient(180deg, rgba(28, 22, 36, .94), rgba(17, 13, 22, .96));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 2px 4px 11px;
}

.stage-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  font-family: var(--font-syong);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--text);
}
.stage-title em {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--pink-2);
}

.stage-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.stage-count {
  margin: 0;
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.stage-count b {
  font-family: var(--font-syong);
  font-size: 14px;
  font-weight: 400;
  color: var(--pink-3);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  background: rgba(255, 255, 255, .035);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s, color .16s;
}
.icon-btn:hover { border-color: var(--line); background: rgba(255, 77, 141, .12); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.96); }
.icon-btn[aria-pressed="false"] { color: var(--text-4); border-style: dashed; }

/* ── 피부 캔버스 ──────────────────────────────────────── */

.skin-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(62vh, 552px);
  border-radius: 18px;
  overflow: hidden;
  background: #e7b6a3;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28), 0 18px 34px -28px #000;
}

.skin-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* 캔버스 위 얇은 유리 테두리 (사진 프레임 느낌) */
.skin-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .22),
    inset 0 0 34px rgba(120, 40, 40, .18),
    inset 0 -28px 40px -30px rgba(80, 20, 20, .5);
}

.skin-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 12px 20px;
  border: 1px solid rgba(255, 77, 141, .45);
  border-radius: 999px;
  background: rgba(20, 12, 18, .86);
  color: var(--pink-3);
  font-family: var(--font-syong);
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 18px 40px -20px #000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: badge-in .3s cubic-bezier(.33, 1, .68, 1) both;
  pointer-events: none;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes badge-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 캔버스 위쪽에 잠깐 뜨는 게임 안내 — 아래 도구 바를 가리지 않게 */
.skin-toast {
  position: absolute;
  left: 50%;
  top: 10px;
  z-index: 2;
  transform: translate(-50%, -8px);
  margin: 0;
  max-width: calc(100% - 20px);
  padding: 7px 14px;
  border: 1px solid rgba(255, 77, 141, .38);
  border-radius: 999px;
  background: rgba(22, 12, 20, .86);
  color: var(--pink-3);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: -.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.skin-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── 도구 선택 ────────────────────────────────────────── */

.toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 8px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 15px;
  background: linear-gradient(180deg, #1d1725, #151019);
  color: var(--text-2);
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .16s, border-color .16s, background .16s, color .16s, box-shadow .16s;
}
.tool:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 14px 26px -22px #000;
}
.tool:active { transform: translateY(0) scale(.985); }

.tool-ico {
  font-size: 19px;
  line-height: 1.1;
  filter: saturate(.92);
}
.tool-txt { display: block; min-width: 0; }
.tool-txt b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.tool-txt i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 10px;
  color: var(--text-4);
  white-space: nowrap;
}

.tool.is-on {
  border-color: transparent;
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
  color: var(--on-pink);
  box-shadow: 0 14px 26px -16px var(--pink-glow), inset 0 1px 0 rgba(255, 255, 255, .34);
}
.tool.is-on .tool-txt i { color: rgba(26, 7, 17, .62); }
.tool.is-on:hover { color: var(--on-pink); }

.tool-hint {
  min-height: 19px;
  margin: 10px 4px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
  word-break: keep-all;
}

/* ── 무한 리필 · 새 피부 ──────────────────────────────── */

.stage-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-soft);
}

.btn--lg {
  padding: 12px 20px;
  font-size: 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  transition: background .18s, border-color .18s;
}
.switch-track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #9a8d97;
  transition: transform .2s cubic-bezier(.33, 1, .68, 1), background .2s;
}
.switch input:checked + .switch-track {
  border-color: transparent;
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
}
.switch input:checked + .switch-track::after {
  transform: translateX(17px);
  background: #fff5f9;
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--pink-2);
  outline-offset: 3px;
}
.switch-txt {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.3;
}
.switch-txt i {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-4);
}

.stage-note {
  margin: 9px 4px 1px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-4);
  word-break: keep-all;
}

/* ── 오른쪽 패널 ──────────────────────────────────────── */

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  padding: 13px 14px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    radial-gradient(120% 130% at 100% -20%, rgba(255, 77, 141, .09), transparent 60%),
    linear-gradient(180deg, rgba(26, 20, 34, .9), rgba(16, 13, 21, .92));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px dashed var(--line-soft);
}
.panel-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-family: var(--font-syong);
  font-size: 16.5px;
  font-weight: 400;
  color: var(--text);
}
.panel-title em {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--pink-2);
}
.panel-badge {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: .04em;
  color: var(--text-4);
}

/* ── 숫자 ─────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 11px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, .03);
}
.stat-noise { display: none; }
.stat-no {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.1;
  color: var(--pink-2);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 10.5px;
  letter-spacing: -.01em;
  color: var(--text-4);
}

/* ── 도감 ─────────────────────────────────────────────── */

.guide {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.guide-row {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 11px;
  transition: background .16s;
}
.guide-row + .guide-row { border-top: 1px solid rgba(255, 255, 255, .04); }
.guide-row:hover { background: rgba(255, 255, 255, .035); }

.guide-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.guide-dot--whitehead {
  background: radial-gradient(circle at 34% 30%, #fffdf6 0 34%, #f6d9c6 60%, #e8a892 100%);
}
.guide-dot--inflamed {
  background: radial-gradient(circle at 34% 30%, #ffd9a8 0 22%, #ef9a88 55%, #c9505c 100%);
}
.guide-dot--blackhead {
  background: radial-gradient(circle at 38% 34%, #6d5348 0 30%, #33231d 62%, #e0a68f 100%);
}
.guide-dot--cyst {
  background: radial-gradient(circle at 34% 30%, #f6c98f 0 16%, #d97a76 52%, #9d3f4d 100%);
}

.guide-text { display: block; min-width: 0; }
.guide-text b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.guide-text i {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-4);
  word-break: keep-all;
}

.guide-count {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: right;
}
.guide-row.is-hit .guide-count { color: var(--pink-2); }
.guide-row.is-hit .guide-dot { box-shadow: 0 0 0 3px rgba(255, 77, 141, .22), inset 0 0 0 1px rgba(0, 0, 0, .2); }

/* ── 놀이 방법 ────────────────────────────────────────── */

.how {
  margin: 10px 0 0;
  padding: 0 0 0 2px;
  list-style: none;
  counter-reset: how;
  display: grid;
  gap: 6px;
}
.how li {
  position: relative;
  padding-left: 22px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
  word-break: keep-all;
}
.how li::before {
  counter-increment: how;
  content: counter(how);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 77, 141, .14);
  color: var(--pink-3);
  font-size: 9px;
  font-weight: 600;
}
.how b {
  color: var(--text-2);
  font-weight: 500;
}

/* ── 아래쪽 ───────────────────────────────────────────── */

.btn--sm { padding: 8px 14px; font-size: 12.5px; }

/* =========================================================
   반응형
   ========================================================= */

@media (max-width: 979px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
  .side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .panel--tip { grid-column: 1 / -1; }
  .skin-wrap { max-height: min(58vh, 520px); }
}

@media (max-width: 699px) {
  .play { margin-top: 18px; }
  .play-grid { gap: 12px; }
  .stage-card { padding: 12px 11px 11px; border-radius: 20px; }
  .stage-head { padding-bottom: 9px; }
  .stage-title { font-size: 18px; }
  .stage-count { font-size: 10.5px; padding: 4px 9px; }
  .skin-wrap { aspect-ratio: 1 / 1; max-height: none; border-radius: 16px; }
  .toolbar { gap: 5px; margin-top: 9px; }
  .tool { padding: 8px 2px 7px; border-radius: 13px; }
  .tool-ico { font-size: 17px; }
  .tool-txt b { font-size: 11.5px; }
  .tool-txt i { font-size: 9.5px; }
  .tool-hint { font-size: 11.5px; margin-top: 8px; }
  .stage-foot { gap: 9px 10px; margin-top: 9px; padding-top: 9px; }
  .switch { margin-left: 0; }
  .stage-note { font-size: 10.5px; }
  .side { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 12px 12px 13px; border-radius: 18px; }
  .subhead-side { align-items: flex-start; text-align: left; }
  .subhead-note { max-width: 100%; }
}

@media (max-width: 420px) {
  .tool-txt i { display: none; }
  .tool { padding: 9px 2px; }
  .tool-txt b { font-size: 12px; }
  .stat-no { font-size: 19px; }
  .stage-title { font-size: 17px; }
}

/* 아이폰 가로처럼 높이가 낮을 때: 옆 칸으로 붙여 스크롤을 줄인다 */
@media (max-height: 540px) and (min-width: 700px) and (orientation: landscape) {
  .play-grid {
    grid-template-columns: minmax(0, 1fr) 252px;
    gap: 12px;
  }
  .side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .panel--tip { display: none; }
  .skin-wrap {
    aspect-ratio: auto;
    height: min(58vh, 268px);
    max-height: none;
  }
  .stage-title { font-size: 17px; }
  .stage-foot { padding-top: 8px; margin-top: 8px; }
  .stage-note { display: none; }
  .stat-no { font-size: 18px; }
  .guide-row { padding: 5px 4px; }
  .how { gap: 3px; }
}

/* 가로로 낮은 화면: 머리말을 줄여 무대가 바로 보이게 */
@media (max-height: 540px) and (orientation: landscape) {
  .pimple-page { padding: 12px 18px 40px; }
  .subhead { padding: 0 4px 9px; }
  .backlink { margin-bottom: 7px; padding: 5px 11px; font-size: 11.5px; }
  .pimple-page .kicker { margin-bottom: 2px; font-size: 9px; }
  .pimple-page .subhead h1 { font-size: 27px; }
  .pimple-page .subhead .sub { margin-top: 2px; font-size: 15px; }
  .subhead-side { display: none; }
  .tabs {
    display: flex;
    grid-template-columns: none;
    margin-top: 8px;
    overflow-x: auto;
  }
  .tab { padding: 7px 10px 6px; font-size: 11.5px; border-radius: 12px 12px 8px 8px; }
  .tab b { font-size: 12.5px; }
  .play { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .skin-badge { animation: none; }
  .skin-toast { transition: opacity .001ms; }
}
