/* ==========================================================
   사기 슬라임 판매합니다 — style.css
   목차
   1. 폰트 / 디자인 토큰
   2. 기본(reset)
   3. 공통 컴포넌트 (버튼, 입력, 패널)
   4. 헤더 / 네비게이션
   5. 상품 그리드 + 호버/터치 애니메이션
   6. 동영상
   7. 구매 레이어 (모달 / 바텀시트)
   8. 장바구니
   9. 경매장
   10. 게시판
   11. 판매자 정보
   12. 푸터 / 토스트
   13. 반응형 (PC)
   ========================================================== */

/* ---------- 1. 폰트 / 디자인 토큰 ---------- */
/* @font-face 는 css/font.css 에 있음 (없는 글자 고딕체 대체 처리) */

:root {
  /* 색상 */
  --bg: #b690fc;            /* 메인 보라 배경 (시안) */
  --line: #8c71c3;          /* 구분선 (시안) */
  --ph: #d9d9d9;            /* 이미지 placeholder */
  --ink: #141019;
  --ink-2: rgba(20, 16, 25, .66);
  --ink-3: rgba(20, 16, 25, .45);
  --surface: #ffffff;
  --surface-2: #f5f3f8;
  --lavender: #efe7ff;
  --lavender-2: #e3d6ff;
  --point: #6a3be0;
  --sale: #b62133;
  --up: #2f6bff;             /* 가격 인상 표시 */
  --divider: #ece9f1;

  /* 그림자 */
  --shadow-sm: 0 1px 2px rgba(49, 24, 110, .05), 0 4px 14px rgba(49, 24, 110, .08);
  --shadow-md: 0 10px 34px rgba(49, 24, 110, .22);

  /* 타이포 (손글씨체라 일반 고딕보다 1~2px 크게 잡음) */
  --font: 'GangwonEduSaeeum', 'SaeeumFallback', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-price: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;  /* 금액 글자 */
  --fs-xs: 16px;
  --fs-sm: 17px;
  --fs-base: 19px; /*기본 글자*/
  --fs-md: 22px;
  --fs-lg: 23px;
  --fs-xl: 30px;
  --lh: 1.5;

  /* 레이아웃 */
  --container: 1304px;
  --gutter: 16px;
  --radius: 14px;
  --radius-sm: 10px;

  /* 반동 이징 */
  --ease-elastic: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 2. 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

:focus-visible { outline: 2px solid var(--point); outline-offset: 2px; }

.muted { color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- 3. 공통 컴포넌트 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  white-space: nowrap;
  transition: background-color .15s, transform .15s var(--ease-elastic), opacity .15s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-lg { height: 52px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c2438; }
.btn-soft { background: var(--lavender); color: var(--ink); }
.btn-soft:hover { background: var(--lavender-2); }

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-base);
  transition: box-shadow .15s, background-color .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--point) inset; }

.field { display: block; }
.field-label { display: block; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.input-suffix { position: relative; display: block; }
.input-suffix .input { padding-right: 40px; text-align: right; font-size: var(--fs-md); }
.input-suffix > span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.panel-head h3, .panel-title { font-size: var(--fs-md); font-weight: normal; }
.panel-title { padding-bottom: 14px; border-bottom: 1px solid var(--divider); }

/* 이미지 placeholder */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--ph);
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.7;
  overflow: hidden;
}
.ph img { width: 100%; height: 100%; object-fit: fill; }   /* 상품 사진: 비율 무시하고 칸에 꽉 채움 (찌그러짐) */

/* 정보 목록 (라벨 - 값) */
.info-rows > div {
  display: flex;
  gap: 16px;
  padding: 7px 0;
  font-size: var(--fs-sm);
}
.info-rows dt { flex: 0 0 72px; color: var(--ink-3); }
.info-rows dd { flex: 1; color: var(--ink); }

/* ---------- 4. 헤더 / 네비게이션 ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 모바일: 탭이 맨 위, 헤더가 아래 (시안 기준) */
.gnb { order: 0; }
.site-header { order: 1; }
.main { order: 2; flex: 1; }
.site-footer { order: 3; }

.site-header {
  border-bottom: 2px solid var(--line);
  padding: 22px var(--gutter);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand-logo { flex: 0 0 27%; max-width: 150px; }
.brand-logo { display: block; }
.brand-logo img { width: 100%; height: auto; will-change: transform; }
/* 로고 호버: 회전·흔들림은 js/app.js, 그림자는 빨주노초파남보로 빛남 */
.brand-logo.is-spinning img { animation: logo-glow .6s linear infinite; }
@keyframes logo-glow {
  0%     { filter: drop-shadow(0 0 6px #ff2a2a) drop-shadow(0 0 16px #ff2a2a); }
  14.3%  { filter: drop-shadow(0 0 6px #ff8a00) drop-shadow(0 0 16px #ff8a00); }
  28.6%  { filter: drop-shadow(0 0 6px #ffe600) drop-shadow(0 0 16px #ffe600); }
  42.9%  { filter: drop-shadow(0 0 6px #2ed12e) drop-shadow(0 0 16px #2ed12e); }
  57.1%  { filter: drop-shadow(0 0 6px #1e6bff) drop-shadow(0 0 16px #1e6bff); }
  71.4%  { filter: drop-shadow(0 0 6px #3a1fb8) drop-shadow(0 0 16px #3a1fb8); }
  85.7%  { filter: drop-shadow(0 0 6px #a020f0) drop-shadow(0 0 16px #a020f0); }
  100%   { filter: drop-shadow(0 0 6px #ff2a2a) drop-shadow(0 0 16px #ff2a2a); }
}
.brand-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.brand-title {
  font-size: clamp(24px, 9vw, 44px);
  font-weight: normal;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.yt-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--lavender);
  box-shadow: 0 2px 6px rgba(49, 24, 110, .22);
  font-size: var(--fs-sm);
  transition: transform .2s var(--ease-elastic);
}
.yt-pill:active { transform: scale(.95); }

.gnb {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.gnb-inner {
  display: flex;
  align-items: center;
  max-width: var(--container);
  margin: 0 auto;
}
.gnb-tabs {
  display: flex;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 6px;
}
.gnb-tabs::-webkit-scrollbar { display: none; }
.gnb-tabs a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;
  padding: 0 12px;
  font-size: var(--fs-md);
  white-space: nowrap;
  color: var(--ink-2);
  transition: color .15s;
}
.gnb-tabs a:hover { color: var(--ink); }
.gnb-tabs a.is-active { color: var(--ink); }
.gnb-tabs a.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.cart-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.cart-badge.is-bump { animation: bump .45s var(--ease-elastic); }
.gnb-yt { display: none; }

/* ---------- 5. 상품 그리드 ---------- */
.main {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 28px var(--gutter) 64px;
}
.page { animation: page-in .35s var(--ease-out); }

/* 상품 수 + 정렬 */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 20px;
}
.shop-count { font-size: var(--fs-sm); color: var(--ink-2); }
.shop-count b { color: var(--ink); }
.sort-tabs { display: flex; align-items: center; }
.sort-tab {
  position: relative;
  padding: 4px 10px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: color .15s;
}
.sort-tab + .sort-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: .9em;
  transform: translateY(-50%);
  background: rgba(20, 16, 25, .2);
}
.sort-tab:hover { color: var(--ink); }
.sort-tab.is-active { color: var(--ink); font-weight: 700; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 16px;
}
/* 정렬을 바꾸면 카드가 순서대로 통통 튀어나옴 */
.product-grid.is-resorted .product-card { animation: card-in .45s var(--ease-elastic) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }

/* 가격 수식 (KaTeX): 칸보다 넓으면 js 가 줄여서 맞춤 */
.price-formula { width: 100%; min-width: 0; overflow: hidden; }
.price-formula > div { display: inline-block; transform-origin: left top; white-space: nowrap; }
.price-formula .katex-display { margin: 0; text-align: left; }
.price-formula .katex { font-size: 1.1em; }
.sheet-price .price-formula { flex-basis: 100%; }
.price-formula.is-large .katex { font-size: 1.5em; }

/* 가격 퀴즈 입력칸 */
.price-quiz { display: block; margin-top: 12px; }
.price-quiz .input { font-size: var(--fs-md); }

/* 품절: 사진 어둡게 + 가운데 품절 표시 */
.soldout-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: .08em;
}
.ph { position: relative; }
.is-soldout .product-name, .is-soldout .product-price { color: var(--ink-3); }
.btn-add:disabled { opacity: .5; cursor: default; }
.product-card { position: relative; display: flex; flex-direction: column; }
.product-card .product-hit { flex: 1; }   /* 카드 높이가 달라도 담기 버튼 줄 맞춤 */
.product-hit {
  display: block;
  width: 100%;
  text-align: left;
}
.product-thumb { aspect-ratio: 305 / 290; }
.thumb-spin {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  will-change: transform;
}
/* 무지개 색 덮개 (호버 시 표시) */
.thumb-spin::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity .15s;
}
.product-name {
  /* 두 줄까지 표시, 넘치면 … (가격 줄이 카드끼리 맞도록 두 줄 높이 확보) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  min-height: calc(1.4em * 2);
  margin-top: 12px;
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--ink);
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* 할인·인상률 줄: 표시가 없는 상품도 같은 높이를 차지해서 가격 줄이 카드끼리 맞음 */
.product-rate {
  min-height: 1.3em;
  margin-top: 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.product-rate .rate { color: var(--sale); }
span.rate.is-up { color: var(--up); }
.product-price {
  font-size: var(--fs-md);
  line-height: 1.35;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

/* 금액이 나오는 모든 곳: 가독성을 위해 손글씨체 대신 Noto Sans KR 900.
   이 폰트는 같은 px에서 손글씨체보다 커 보여서, font-size-adjust 로 글자 높이를 줄여 맞춤 (숫자가 클수록 커짐) */
.product-price, .product-rate,
.sheet-price, .option-line, .sheet-total strong, #sheetShip,
.cart-unit, .cart-line, .summary-rows dd, .summary-total strong,
.auction-price strong, #auctionStart, #auctionStep, .bid-amount,
.wallet strong, .game-stats strong, .lb-clicks, .profile-wallet strong,
.input-suffix .input, .price-quiz .input {
  font-family: var(--font-price);
  font-weight: 900;
  font-size-adjust: cap-height .53;
}
/* 수식 가격(KaTeX)은 자체 폰트 크기를 그대로 사용 */
.price-formula, .price-formula * { font-size-adjust: none; }
.btn-add {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .28);
  box-shadow: inset 0 0 0 1px rgba(20, 16, 25, .75);
  font-size: var(--fs-sm);
  transition: background-color .15s, transform .2s var(--ease-elastic);
}
.btn-add:active { transform: scale(.95); background: rgba(255, 255, 255, .5); }

/* PC 호버: 회전은 js/app.js (계속 돌면서 점점 빨라짐), 색은 빨주노초파남보로 정신없이 왔다갔다 */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover { z-index: 2; }
  .product-hit:hover .thumb-spin::after { opacity: .8; animation: rainbow .7s linear infinite alternate; }
  .btn-add:hover { background: rgba(255, 255, 255, .45); }
}

/* 터치: 한 바퀴 돌고 튕기는 반동 */
.product-card.is-tapped .thumb-spin { animation: slime-tap .6s var(--ease-out); }
/* 모바일: 상품을 누르는 동안 무지개색 (회전은 js/app.js) */
.product-card.is-spinning { z-index: 2; }
.product-card.is-spinning .thumb-spin::after { opacity: .8; animation: rainbow .7s linear infinite alternate; }
/* 길게 눌러도 이미지 저장 메뉴가 뜨지 않게 */
.thumb-spin img, .brand-logo img, .sheet-media img { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

@keyframes rainbow {
  0%     { background: #ff2a2a; }
  16.6%  { background: #ff8a00; }
  33.3%  { background: #ffe600; }
  50%    { background: #2ed12e; }
  66.6%  { background: #1e6bff; }
  83.3%  { background: #3a1fb8; }
  100%   { background: #a020f0; }
}
@keyframes slime-tap {
  0%   { transform: rotate(0) scale(1); }
  15%  { transform: rotate(-14deg) scale(.86, .8); }
  55%  { transform: rotate(385deg) scale(.76); }
  72%  { transform: rotate(352deg) scale(1.06, .92); }
  87%  { transform: rotate(363deg) scale(.97, 1.04); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 6. 동영상 ---------- */
.video-section { margin-top: 72px; }
.section-head, .page-head { margin-bottom: 18px; }
.section-head h2, .page-head h2 { font-size: var(--fs-xl); font-weight: normal; line-height: 1.3; }
.page-head h2 { font-weight: 700; }   /* 실시간 경매장·장바구니·소통 게시판·판매자 정보 제목 */
.section-head p, .page-head p { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1c1426;
  box-shadow: var(--shadow-sm);
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-web-only { display: none; }   /* 모바일에서는 두 번째 영상 숨김 */

/* 유튜브: 썸네일이 먼저 보이고, 재생이 시작되면 사라짐 */
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #1c1426;
  transition: opacity .5s ease, visibility .5s;
}
.yt-cover img { width: 100%; height: 100%; object-fit: cover; }
.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
  transition: transform .35s var(--ease-elastic);
}
.yt-cover:hover .yt-play { transform: translate(-50%, -50%) scale(1.12); }
.video-frame.is-playing .yt-cover { opacity: 0; visibility: hidden; }
.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: rgba(255, 255, 255, .85);
  background: repeating-linear-gradient(135deg, #251a33 0 18px, #2b1f3b 18px 36px);
}
.video-fallback strong { font-size: var(--fs-lg); font-weight: normal; color: #fff; }
.video-fallback span { font-size: var(--fs-sm); }

/* ---------- 7. 구매 레이어 ---------- */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-dim {
  position: absolute;
  inset: 0;
  background: rgba(22, 12, 40, .5);
  animation: fade-in .25s ease;
}
.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-md);
  animation: sheet-up .62s var(--ease-out) both;
  touch-action: pan-y;
}
.sheet-grab {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
}
.sheet-grab span { width: 40px; height: 4px; border-radius: 2px; background: #d6d1de; }
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--ink);
}
.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 20px;
}
.sheet-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 30vh;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sheet-media .ph { width: 100%; height: 100%; animation: media-pop .7s .12s var(--ease-elastic) both; }
/* 구매 창 사진을 누르는 동안 무지개색 (회전·흔들림은 js/app.js) */
.sheet-media .ph::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
}
.sheet-media.is-spinning .ph::after { opacity: .8; animation: rainbow .7s linear infinite alternate; }
.sheet-info { padding-top: 18px; }
.sheet-store { font-size: var(--fs-xs); color: var(--ink-3); }
.sheet-name { margin-top: 2px; font-size: var(--fs-lg); font-weight: normal; line-height: 1.35; }
.sheet-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: 8px; }
.sheet-price .rate { color: var(--sale); font-size: var(--fs-lg); font-weight: 700; }
.sheet-price strong { font-size: 26px; line-height: 1.2; }
.sheet-price strong small { font-size: var(--fs-base); font-weight: normal; margin-left: 1px; }
.sheet-price del { width: 100%; order: -1; font-size: var(--fs-sm); color: var(--ink-3); }
.sheet-desc { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.sheet-rows { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--divider); }
.sheet-rows .free { color: var(--point); }

.option-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.option-name { font-size: var(--fs-sm); color: var(--ink-2); }
.option-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 10px; }
.option-line { min-width: 0; font-size: var(--fs-md); overflow-wrap: anywhere; }

.stepper {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(49, 24, 110, .12);
}
.stepper button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--ink);
  transition: transform .2s var(--ease-elastic);
}
.stepper button:active { transform: scale(.85); }
.stepper button:disabled { color: #cbc6d3; cursor: default; }
.stepper input {
  width: 38px;
  height: 36px;
  border: 0;
  background: none;
  text-align: center;
  font-size: var(--fs-base);
}
.stepper input:focus { outline: none; }
.stepper.is-small { height: 32px; }
.stepper.is-small button { width: 30px; height: 32px; }
.stepper.is-small input { width: 32px; height: 32px; }

.sheet-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16px;
}
.sheet-total span { font-size: var(--fs-sm); color: var(--ink-2); }
.sheet-total em { font-style: normal; color: var(--ink-3); }
.sheet-total strong { font-size: 26px; color: var(--point); }
.sheet-total strong.is-bump { animation: bump .4s var(--ease-elastic); display: inline-block; }

.sheet-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -1px 0 var(--divider);
}
.sheet-actions .btn { flex: 1; padding: 0 12px; }
.btn-wish {
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.1;
  color: var(--ink-2);
}
.btn-wish svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn-wish[aria-pressed=true] { color: var(--sale); }
.btn-wish[aria-pressed=true] svg { fill: var(--sale); stroke: var(--sale); animation: bump .45s var(--ease-elastic); }

/* 닫힘 */
.sheet-root.is-closing .sheet-dim { animation: fade-out .22s ease forwards; }
.sheet-root.is-closing .sheet { animation: sheet-down .24s ease-in forwards; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-up {
  0%   { transform: translateY(100%) scale(.9); }
  55%  { transform: translateY(-16px) scale(1.02); }
  75%  { transform: translateY(5px) scale(.995); }
  90%  { transform: translateY(-2px) scale(1); }
  100% { transform: none; }
}
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes media-pop {
  0%   { transform: scale(.6) rotate(-6deg); }
  100% { transform: none; }
}

/* ---------- 8. 장바구니 ---------- */
.cart-layout { display: grid; gap: 16px; }
.cart-list-panel { padding: 4px 20px; }
.cart-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--divider);
}
.cart-item:last-child { border-bottom: 0; }
.cart-thumb { grid-row: span 2; width: 76px; height: 76px; border-radius: 8px; font-size: 11px; line-height: 1.4; }
.cart-name { font-size: var(--fs-base); line-height: 1.4; }
.cart-unit { font-size: var(--fs-xs); color: var(--ink-3); }
.cart-remove {
  grid-row: 1;
  grid-column: 3;
  align-self: start;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-3);
}
.cart-remove:hover { background: var(--surface-2); color: var(--ink); }
.cart-bottom {
  flex-wrap: wrap;
  min-width: 0;
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cart-line { min-width: 0; font-size: var(--fs-md); font-weight: 700; overflow-wrap: anywhere; text-align: right; }
.cart-item.is-leaving { animation: leave .28s ease-in forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(24px) scale(.96); } }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px 0;
  color: var(--ink-2);
}

.cart-summary h3 { font-size: var(--fs-md); font-weight: normal; }
.summary-rows { margin-top: 12px; }
.summary-rows > div { display: flex; justify-content: space-between; padding: 6px 0; font-size: var(--fs-sm); }
.summary-rows dt { color: var(--ink-2); }
.summary-note { font-size: var(--fs-xs); color: var(--point); min-height: 1em; }
.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}
.summary-total strong { font-size: 26px; }

/* ---------- 9. 경매장 ---------- */
.auction-layout { display: grid; gap: 16px; }
.auction-main { display: grid; gap: 20px; }
.auction-media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); }
.live-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #b8b3c1; }
.live-state.is-live .live-dot { background: #16c35f; animation: pulse 1.6s ease-out infinite; }
.live-state.is-demo .live-dot { background: #f2a93b; }
.live-state.is-error .live-dot { background: var(--sale); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 195, 95, .5); }
  100% { box-shadow: 0 0 0 8px rgba(22, 195, 95, 0); }
}
.countdown {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.countdown.is-ended { background: #8b8594; }
.auction-name { margin-top: 12px; font-size: var(--fs-lg); font-weight: normal; line-height: 1.35; }
.auction-desc { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.auction-price {
  display: flex;
  flex-direction: column;
  margin: 16px 0 8px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--lavender);
}
.auction-price span { font-size: var(--fs-sm); color: var(--ink-2); }
.auction-price strong { font-size: 34px; line-height: 1.2; color: var(--point); }
.auction-price strong.is-bump { animation: price-jump .6s var(--ease-elastic); transform-origin: left center; }
@keyframes price-jump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18) rotate(-2deg); }
  100% { transform: scale(1); }
}

.bid-form { display: grid; gap: 12px; margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--divider); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: 17px;
  background: var(--surface-2);
  font-size: var(--fs-sm);
  transition: background-color .15s, transform .2s var(--ease-elastic);
}
.chip:hover { background: var(--lavender); }
.chip:active { transform: scale(.92); }
.form-hint { font-size: var(--fs-sm); color: var(--ink-3); text-align: center; min-height: 1.5em; }
.form-hint.is-error { color: var(--sale); }

.bid-list { max-height: 560px; overflow-y: auto; }
.bid-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}
.bid-list li:first-child .bid-amount { color: var(--point); }
.bid-list li.is-new { animation: slide-in .45s var(--ease-elastic); }
.bid-who { display: flex; flex-direction: column; min-width: 0; }
.bid-who b { font-weight: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bid-who span { font-size: var(--fs-xs); color: var(--ink-3); }
.bid-amount { font-weight: 700; white-space: nowrap; }
.list-empty { padding: 40px 0; text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------- 10. 게시판 ---------- */
.board-layout { display: grid; gap: 16px; max-width: 760px; }
.comment-form { display: grid; gap: 10px; }
.comment-nick { max-width: 240px; }
.comment-text { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 b { color: var(--point); font-weight: normal; }
.comment-list li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
}
.comment-list li:last-child { border-bottom: 0; }
.comment-list li.is-new { animation: slide-in .45s var(--ease-elastic); }
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: var(--fs-base);
  color: var(--ink);
}
.comment-meta { display: flex; align-items: baseline; gap: 8px; }
.comment-meta b { font-weight: normal; }
.comment-meta time { font-size: var(--fs-xs); color: var(--ink-3); }
.comment-body { margin-top: 2px; font-size: var(--fs-base); white-space: pre-wrap; word-break: break-word; }
.comment-del {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.comment-del:hover { background: var(--surface-2); color: var(--sale); }

/* ---------- 10-1. 로그인 상태 (게시판·게임) ---------- */
.account-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .6);
  box-shadow: var(--shadow-sm);
}
.account-bar:empty { display: none; }
.account-msg { font-size: var(--fs-sm); color: var(--ink-2); }
.account-me { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-info { display: flex; flex-direction: column; min-width: 0; }
.account-info b { font-weight: normal; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet { font-size: var(--fs-sm); color: var(--ink-2); }
.admin-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-xs);
  font-style: normal;
  vertical-align: middle;
}
.wallet strong { color: var(--point); }
.account-actions { display: flex; gap: 8px; }
.account-actions .btn { height: 38px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-google { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(49, 24, 110, .2); }
.btn-google:hover { background: #f7f5fb; }

/* ---------- 10-2. 게임하기 ---------- */
.game-layout { display: grid; gap: 16px; }
.game-main { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 28px; }
/* 누른 횟수 / 내 순위: 칸 없이 "글자 숫자"를 한 줄씩 */
.game-stats { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.game-stats > div { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.game-stats span { font-size: var(--fs-sm); color: var(--ink); }
.game-stats strong { font-size: 30px; line-height: 1.3; color: var(--point); }
.game-button {
  width: min(62vw, 260px);
  margin-top: 24px;
  border-radius: 50%;
  touch-action: manipulation;           /* 빠르게 연타해도 확대되지 않게 */
  -webkit-user-select: none;
  user-select: none;
  transition: transform .1s;
}
.game-button img { width: 100%; height: auto; pointer-events: none; -webkit-touch-callout: none; }
.game-button:active { transform: scale(.94); }
/* 누를 때마다 빛나면서 커지는 반동 */
.game-button.is-pop img { animation: game-pop .35s var(--ease-elastic); }
@keyframes game-pop {
  0%   { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
  35%  { transform: scale(1.18); filter: drop-shadow(0 0 14px #fff) drop-shadow(0 0 28px #ffe600); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
}
/* 손글씨체는 굵기가 하나뿐이라 font-weight + 글자 테두리(text-stroke)로 두껍게. 더 두껍게: 1.2px → 2px */
.game-cta { margin-top: 12px; font-size: var(--fs-xl); line-height: 1.2; font-weight: 500; -webkit-text-stroke: 1.2px currentColor; }
.game-note { margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-3); }

.leaderboard .prize {
  margin: 14px 0 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #fff4cc;
  font-size: var(--fs-sm);
  text-align: center;
}
.leaderboard-list { margin-bottom: 14px; }
.leaderboard-list li {
  display: grid;
  grid-template-columns: 32px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--divider);
}
.leaderboard-list li.list-empty { display: block; }
.lb-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.leaderboard-list li.is-first .lb-rank { background: #ffd43b; font-weight: 700; }
.leaderboard-list li.is-me { background: var(--lavender); border-radius: 8px; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--surface-2); }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name em { font-style: normal; color: var(--point); font-size: var(--fs-xs); }

/* 1위 / 5위 안 축하 문구 */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: rgba(22, 12, 40, .35);
}
.celebrate span {
  padding: 18px 28px;
  border-radius: 20px;
  background: linear-gradient(120deg, #ff5a5a, #ffa53d, #ffe94d, #5ee46b, #4da3ff, #6b5bff, #d36bff, #ff5a5a);
  background-size: 400% 400%;
  box-shadow: var(--shadow-md);
  font-size: clamp(30px, 9vw, 64px);
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .7);
  animation: rainbow-flow 1.6s linear infinite, pop-elastic .6s var(--ease-out) both;
}
/* 1위: 글자가 빙글빙글 */
.celebrate.is-first span { animation: rainbow-flow 1.6s linear infinite, celebrate-spin 1.2s var(--ease-out) both; }
@keyframes celebrate-spin {
  0%   { transform: scale(.2) rotate(-720deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(15deg); opacity: 1; }
  80%  { transform: scale(.95) rotate(-6deg); }
  100% { transform: scale(1) rotate(0); }
}

/* 프로필 동그라미: 모바일은 화면 오른쪽 아래 고정 (웹은 반응형 부분에서 오른쪽 위로) */
.profile-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px #fff, var(--shadow-md);
  font-size: 24px;
  color: var(--ink);
  transition: transform .25s var(--ease-elastic);
}
.profile-fab:hover { transform: scale(1.08); }
.profile-fab:active { transform: scale(.92); }
.profile-fab img, .profile-photo img { width: 100%; height: 100%; object-fit: cover; }

/* 프로필 창 */
.profile-card { padding-top: 32px; }
.profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--ink-2);
}
.profile-close:hover { background: var(--surface-2); }
.profile-photo {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--lavender);
  font-size: 40px;
}
.profile-name { margin-top: 14px; font-size: var(--fs-lg); font-weight: normal; }
.profile-wallet { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-2); }
.profile-wallet strong { color: var(--point); }
.profile-actions { display: flex; gap: 8px; margin: 18px 0 10px; }
.profile-actions .btn { flex: 1; padding: 0 10px; }
/* 결제 팝업·사진 고르기 창은 프로필 창 위에 뜨도록 */
#popup, .avatar-root { z-index: 160; }

/* 프로필 사진 고르기 */
.avatar-picker { max-width: 360px; padding: 20px; }
/* 3개씩 줄 맞춰서 (6개면 두 줄) */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-height: 60vh;
  padding: 4px;
  overflow-y: auto;
}
.avatar-grid .list-empty { grid-column: 1 / -1; padding: 24px 0; }
.avatar-option {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px transparent;
  transition: transform .2s var(--ease-elastic), box-shadow .15s;
}
.avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.avatar-option:hover { transform: scale(1.06); }
.avatar-option.is-selected { box-shadow: 0 0 0 3px var(--point); }
.avatar-option:disabled { opacity: .6; }
/* 로그인 영역 동그라미 안 사진 */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 닉네임 정하기 창 */
.nick-form { text-align: left; }
.nick-title { font-size: var(--fs-lg); font-weight: normal; }
.nick-desc { margin: 6px 0 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.nick-form .form-hint { margin-top: 8px; text-align: left; }
.nick-actions { display: flex; gap: 8px; margin-top: 12px; }
.nick-actions .btn { flex: 1; }

/* ---------- 11. 판매자 정보 ---------- */
.seller-layout { display: grid; gap: 16px; max-width: 860px; }
.notice-table > div {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-sm);
}
.notice-table > div:last-child { border-bottom: 0; }
.notice-table dt { color: var(--ink-3); }
.seller-note { padding-top: 12px; border-top: 1px solid var(--divider); font-size: var(--fs-sm); color: var(--sale); }
.seller-note:empty { display: none; }
.legal-note { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.6; }
/* 판매자 영상 목록 */
.seller-videos { display: grid; gap: 16px; }
.seller-videos:empty { display: none; }
.seller-videos .panel-title { margin-bottom: 16px; }
.yt-cover.is-loading .yt-play { opacity: .6; transform: translate(-50%, -50%) scale(.9); }

/* ---------- 12. 푸터 / 토스트 ---------- */
.site-footer {
  margin: 0 var(--gutter);
  border-top: 2px solid var(--line);
  padding: 36px 0 calc(40px + env(safe-area-inset-bottom, 0px));
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}
.footer-promo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-promo-title { font-size: 22px; }   /* 푸터 글자: 기본보다 5px 크게 */
.footer-yt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 23px;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 1px 4px rgba(49, 24, 110, .15);
  font-size: 20px;
  transition: background-color .15s, transform .2s var(--ease-elastic);
}
.footer-yt:hover { background: rgba(255, 255, 255, .75); }
.footer-yt:active { transform: scale(.95); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 20px; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.footer-biz, .footer-copy { font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.footer-biz span { display: inline-block; margin: 0 5px; }

/* 도망가는 버튼(구매 창의 구매하기·장바구니): 다른 요소 위로 */
.is-fleeing { position: relative; z-index: 5; box-shadow: var(--shadow-md); }

/* 화면 지진 */
.is-quake .app,
.is-quake .sheet-root,
.is-quake .popup-root { animation: quake .85s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes quake {
  0%, 100% { transform: none; }
  8%  { transform: translate(-12px, 5px) rotate(-1.2deg); }
  16% { transform: translate(11px, -6px) rotate(1.1deg); }
  24% { transform: translate(-10px, -4px) rotate(-.9deg); }
  32% { transform: translate(9px, 6px) rotate(1deg); }
  40% { transform: translate(-8px, 3px) rotate(-.7deg); }
  50% { transform: translate(7px, -4px) rotate(.6deg); }
  60% { transform: translate(-5px, 3px) rotate(-.4deg); }
  70% { transform: translate(4px, -2px) rotate(.3deg); }
  80% { transform: translate(-2px, 1px); }
  90% { transform: translate(1px, -1px); }
}

/* 알림 팝업 */
.popup-root {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.popup-dim { position: absolute; inset: 0; background: rgba(22, 12, 40, .5); animation: fade-in .2s ease; }
.popup {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px 20px 16px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: pop-elastic .55s var(--ease-out) both;
}
.popup { max-width: 360px; }
/* 비매품 팝업: 무지개 배경이 흐르면서 테두리 빛도 색이 바뀜 */
.popup.is-rainbow {
  background: linear-gradient(120deg, #ff5a5a, #ffa53d, #ffe94d, #5ee46b, #4da3ff, #6b5bff, #d36bff, #ff5a5a);
  background-size: 400% 400%;
  animation: pop-elastic .55s var(--ease-out) both, rainbow-flow 2.4s linear infinite, rainbow-glow 1.2s linear infinite;
}
.popup.is-rainbow .popup-msg { text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
@keyframes rainbow-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
@keyframes rainbow-glow {
  0%     { box-shadow: 0 0 28px 6px rgba(255, 60, 60, .75); }
  16.6%  { box-shadow: 0 0 28px 6px rgba(255, 150, 30, .75); }
  33.3%  { box-shadow: 0 0 28px 6px rgba(255, 230, 40, .75); }
  50%    { box-shadow: 0 0 28px 6px rgba(60, 220, 90, .75); }
  66.6%  { box-shadow: 0 0 28px 6px rgba(60, 140, 255, .75); }
  83.3%  { box-shadow: 0 0 28px 6px rgba(110, 80, 255, .75); }
  100%   { box-shadow: 0 0 28px 6px rgba(210, 90, 255, .75); }
}
.popup-msg { margin-bottom: 22px; font-size: 22px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.popup .btn { font-size: var(--fs-md); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(20, 16, 25, .9);
  color: #fff;
  font-size: var(--fs-sm);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 16px) scale(.9);
  transition: opacity .2s, transform .45s var(--ease-elastic);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sheet-open .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 13. 반응형 ---------- */

/* 태블릿 이상: 시안 PC 레이아웃 (헤더 위 → 탭 아래) */
@media (min-width: 768px) {
  :root { --gutter: 32px; }

  /* 웹: 본문 글자 한 단계 크게 (헤더·탭·푸터는 그대로) */
  .main, .sheet-root, .popup-root, .toast {
    --fs-xs: 20px;
    --fs-sm: 22px;
    --fs-base: 25px;
    --fs-md: 27px;
    --fs-lg: 32px;
    --fs-xl: 39px;
  }
  .sheet-price strong, .sheet-total strong { font-size: 36px; }
  .auction-price strong { font-size: 45px; }
  .sheet-actions .btn-lg { height: 58px; }
  .btn-wish { flex-basis: 58px; height: 58px; font-size: 16px; }
  .popup-msg { font-size: 29px; }
  .summary-total { flex-wrap: wrap; gap: 4px 12px; }

  /* 프로필 동그라미: 웹은 페이지 오른쪽 위 (헤더 자리, 스크롤하면 같이 올라감) */
  .profile-fab { position: absolute; top: 24px; right: 3.5%; bottom: auto; width: 60px; height: 60px; }
  .site-header { order: 0; border-bottom: 0; padding: 56px var(--gutter) 40px; }
  .gnb { order: 1; margin: 0 3.5%; border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); }
  .brand { flex-direction: column; gap: 16px; }
  .brand-logo { flex: none; width: 150px; }
  .brand-title { font-size: clamp(44px, 5vw, 64px); }
  .yt-pill { display: none; }

  .gnb-inner { padding: 0 var(--gutter); }
  .gnb-tabs { gap: clamp(8px, 4vw, 64px); padding: 0; overflow: visible; }
  .gnb-tabs a { height: 74px; padding: 0 4px; }
  .gnb-tabs a.is-active::after { left: 4px; right: 4px; bottom: 18px; }
  .gnb-yt { display: grid; place-items: center; transition: transform .25s var(--ease-elastic); }
  .gnb-yt:hover { transform: scale(1.12) rotate(-4deg); }

  .main { padding-top: 34px; padding-bottom: 120px; }

  /* 웹: 영상 두 개를 가로로 나란히 (하나만 있으면 전체 폭) */
  .video-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 24px; }
  .video-web-only { display: block; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }

  /* 구매 레이어: 가운데 모달 */
  .sheet-root { align-items: center; padding: 24px; }
  .sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    max-width: 960px;
    max-height: min(800px, 94vh);
    border-radius: 20px;
    overflow: hidden;
    animation: pop-elastic .62s var(--ease-out) both;
  }
  .sheet-grab { display: none; }
  .sheet-scroll { display: contents; }
  .sheet-media {
    grid-column: 1;
    grid-row: 1 / 3;
    aspect-ratio: auto;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .sheet-info { grid-column: 2; grid-row: 1; overflow-y: auto; padding: 32px 28px 16px; }
  .sheet-actions { grid-column: 2; grid-row: 2; padding: 12px 28px 24px; box-shadow: none; }
  .sheet-root.is-closing .sheet { animation: pop-out .2s ease-in forwards; }

  .panel { padding: 24px; }
  .cart-list-panel { padding: 4px 24px; }

  /* 장바구니: 웹에서 글자 한 단계 크게 */
  .cart-item { grid-template-columns: 100px minmax(0, 1fr) auto; }
  .cart-thumb { width: 100px; height: 100px; font-size: 15px; }
  .cart-name { font-size: var(--fs-md); }
  .cart-unit { font-size: var(--fs-sm); }
  .cart-line { font-size: 29px; }
  .stepper.is-small input { font-size: var(--fs-md); }
  .cart-summary h3 { font-size: 29px; }
  .summary-rows > div { font-size: var(--fs-base); }
  .summary-note { font-size: var(--fs-sm); }
  .summary-total span { font-size: var(--fs-md); }
  .summary-total strong { font-size: 37px; }
  .cart-summary .btn { font-size: 28px; }
  .empty { font-size: var(--fs-md); }

  .auction-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .auction-media { aspect-ratio: auto; min-height: 100%; }

  .site-footer { margin: 0 3.5%; border-top-width: 3px; padding-top: 48px; }
}

@media (min-width: 1024px) {
  /* 게임하기: 게임판 | 순위표 */
  .game-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .game-layout .account-bar { grid-column: 1 / -1; }

  /* 장바구니: 넓은 화면에서만 목록 | 결제 요약 두 칸 (좁은 웹 화면은 위아래로) */
  .cart-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .cart-summary { position: sticky; top: 100px; }

  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* PC 시안에는 카드 담기 버튼이 없음 → 호버 시 이미지 회전만 */
  .btn-add { display: none; }
  .auction-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}

@keyframes pop-elastic {
  0%   { opacity: 0; transform: scale(.55); }
  45%  { opacity: 1; transform: scale(1.06); }
  65%  { transform: scale(.97); }
  82%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}
@keyframes pop-out { to { opacity: 0; transform: scale(.9); } }

/* 움직임 줄이기 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
