/* 테닝테닝 수배열판 놀이터 (pages/tening-board.html 전용)
   - 공통 색(베이지, 갈색)은 css/style.css 의 :root 를 그대로 써요.
   - 큐브 색(분홍, 파랑)은 제품 사진 속 투명 큐브 색을 흉내 냈어요. */
.tb {
  --tb-pink: #F8D3D9;
  --tb-pink-d: #E39AA8;
  --tb-blue: #CFE7F6;
  --tb-blue-d: #86BEE0;
  --tb-cell: #FFFDF9;
  --tb-cell-line: #E9DFD3;
  --tb-ink: #4A3D38;
  --tb-round: "Jua", var(--font);
  overflow-x: clip;
}
.tb [hidden] { display: none !important; }

/* ---------- 놀이터 메뉴 ---------- */
.tb-nav { position: sticky; top: var(--header-h); z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--color-line); }
.tb-nav-inner { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.tb-sign { display: inline-flex; align-items: center; gap: 8px; flex: none; text-decoration: none; color: var(--color-text); font-family: var(--tb-round); font-size: 17px; }
.tb-sign b { color: var(--color-primary-strong); font-weight: 400; }
.tb-sign-cube { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tb-pink); border: 2px solid var(--tb-pink-d); font-size: 14px; color: var(--tb-ink); }
.tb-nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tb-nav-links::-webkit-scrollbar { display: none; }
.tb-nav-links a { flex: none; padding: 6px 10px; border-radius: 999px; font-size: 14px; color: var(--color-text-sub); text-decoration: none; white-space: nowrap; }
.tb-nav-links a:hover { background: var(--color-surface); color: var(--color-primary-strong); }

/* ---------- 첫 화면 ---------- */
.tb-hero { padding: 28px 0 40px; background: linear-gradient(180deg, var(--color-surface), #fff); }
.tb-hero-grid { display: grid; gap: 22px; align-items: center; }
.tb-back { display: block; width: fit-content; margin-bottom: 10px; font-size: 14px; text-decoration: none; }
.tb-title { font-family: var(--tb-round); font-weight: 400; font-size: clamp(32px, 8.6vw, 54px); line-height: 1.22; color: var(--tb-ink); margin-bottom: 14px; }
.tb-hero .lead { color: var(--color-text-sub); }
.tb-hero-photo { order: 2; }
.tb-hero-photo img { width: 100%; max-width: 240px; margin: 0 auto; border-radius: var(--radius-photo); box-shadow: 0 10px 30px rgba(136, 106, 96, .16); }
.tb-starbox { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding: 8px 10px 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--color-line); font-size: 15px; }
.tb-star-ico { color: #F0B429; font-size: 20px; line-height: 1; }
.tb-starbox b { font-family: var(--tb-round); font-weight: 400; font-size: 20px; color: var(--color-primary-strong); }
.tb-mini-btn { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--color-line); background: var(--color-surface); color: var(--color-text-sub); font: inherit; font-size: 13px; cursor: pointer; }

.tb-pick { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-pick-card { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px; border-radius: var(--radius-card); background: #fff; border: 1px solid var(--color-line); text-decoration: none; color: var(--color-text); transition: transform .15s ease, box-shadow .15s ease; }
.tb-pick-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(136, 106, 96, .12); }
.tb-pick-card b { font-family: var(--tb-round); font-weight: 400; font-size: 18px; line-height: 1.3; }
.tb-pick-card small { font-size: 13px; color: var(--color-text-sub); line-height: 1.45; }
.tb-pick-ico { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 8px; border-radius: 12px; font-family: var(--tb-round); font-size: 20px; color: var(--tb-ink); border: 2px solid; }
.c1 .tb-pick-ico, .c3 .tb-pick-ico { background: var(--tb-pink); border-color: var(--tb-pink-d); }
.c2 .tb-pick-ico, .c4 .tb-pick-ico { background: var(--tb-blue); border-color: var(--tb-blue-d); }

/* ---------- 놀이 칸 ---------- */
.tb-play { padding: 52px 0; scroll-margin-top: calc(var(--header-h) + 52px); }
.tb-play.alt { background: var(--color-surface); }
.tb-play-head { margin-bottom: 18px; }
.tb-play-head p { color: var(--color-text-sub); }
.tb-num { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: var(--color-primary-strong); color: #fff; font-size: 13px; font-weight: 600; }
.tb-h2 { font-family: var(--tb-round); font-weight: 400; font-size: clamp(26px, 6.6vw, 36px); line-height: 1.3; color: var(--tb-ink); margin-bottom: 6px; }
.tb-h3 { font-family: var(--tb-round); font-weight: 400; font-size: 20px; color: var(--tb-ink); margin: 0 0 10px; }
.tb-h3 small { font-family: var(--font); font-size: 14px; color: var(--color-text-sub); margin-left: 6px; }

.tb-opts, .tb-brush { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--color-line); background: #fff; color: var(--color-text); font: inherit; font-size: 15px; cursor: pointer; touch-action: manipulation; }
.tb-chip.is-on { border-color: var(--color-primary-strong); background: var(--color-primary-strong); color: #fff; }
.sw { width: 16px; height: 16px; border-radius: 4px; border: 2px solid; }
.sw.pink { background: var(--tb-pink); border-color: var(--tb-pink-d); }
.sw.blue { background: var(--tb-blue); border-color: var(--tb-blue-d); }

.tb-question { min-height: 1.75em; margin: 10px 0 12px; font-family: var(--tb-round); font-size: clamp(20px, 5.4vw, 26px); line-height: 1.45; color: var(--tb-ink); }
.tb-question b { color: #C2566B; font-weight: 400; }

/* ---------- 숫자판 ---------- */
.tb-board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; max-width: 520px; margin: 6px auto 0; padding: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--color-line); box-shadow: 0 6px 18px rgba(136, 106, 96, .08); }
.tb-cell { position: relative; aspect-ratio: 1 / 1; min-width: 0; padding: 0; border: 1.5px solid var(--tb-cell-line); border-radius: 6px; background: var(--tb-cell); color: var(--tb-ink); font-family: var(--tb-round); font-size: clamp(11px, 3.3vw, 17px); line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background .2s ease, border-color .2s ease, transform .12s ease; }
.tb-cell:active { transform: scale(.93); }
.tb-cell.is-blank { background: #fff; border: 2px dashed #CDB8A7; }
.tb-cell.is-sel { border: 2.5px solid var(--color-primary-strong); background: #FFF6D6; box-shadow: 0 0 0 3px rgba(240, 180, 41, .35); animation: tb-glow 1.2s ease-in-out infinite; }
.tb-cell.is-found, .tb-cell.is-pink { background: var(--tb-pink); border-color: var(--tb-pink-d); animation: tb-pop .3s ease; }
.tb-cell.is-blue { background: var(--tb-blue); border-color: var(--tb-blue-d); animation: tb-pop .3s ease; }
.tb-cell.is-trail { background: var(--tb-blue); border-color: var(--tb-blue-d); }
.tb-cell.is-hint { background: #FFF1C9; border-color: #F0B429; }
.tb-cell.is-hint::before { content: attr(data-count); position: absolute; top: 1px; right: 3px; font-size: 9px; color: #B9811A; font-family: var(--font); font-weight: 700; }
.tb-cell.is-bunny { color: transparent; background: #fff; border-color: var(--color-primary-strong); }
.tb-cell.is-bunny::after { content: "🐰"; position: absolute; inset: 0; display: grid; place-items: center; color: initial; font-size: clamp(16px, 5vw, 24px); animation: tb-hop .3s ease; }
.tb-cell.is-off { opacity: .28; cursor: default; pointer-events: none; }

.tb-panel { max-width: 520px; margin: 14px auto 0; text-align: center; }
.tb-msg { min-height: 3.4em; font-size: 16px; color: var(--color-text); }
.tb-msg b { color: var(--color-primary-strong); }
.tb-pad { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 12px; min-height: 0; }
.tb-pad button { min-width: 56px; height: 56px; padding: 0 10px; border-radius: 16px; border: 2px solid var(--tb-blue-d); background: #fff; font-family: var(--tb-round); font-size: 24px; color: var(--tb-ink); cursor: pointer; touch-action: manipulation; box-shadow: 0 3px 0 var(--tb-blue-d); }
.tb-pad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tb-blue-d); }
.tb-pad button:disabled { opacity: .35; box-shadow: none; }
.tb-progress { font-family: var(--tb-round); font-size: 18px; color: var(--color-text-sub); margin-bottom: 10px; }
.tb-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tb-row .btn { min-height: 46px; }
.tb-dots { display: flex; gap: 8px; justify-content: center; margin: 4px 0 14px; }
.tb-dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--color-line); }
.tb-dots span.on { background: #F0B429; }

.tb-tip { margin-top: 26px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px dashed var(--color-primary); font-size: 15px; color: var(--color-text-sub); }
.tb-play.alt .tb-tip { background: rgba(255, 255, 255, .7); }
.tb-tip b { display: block; color: var(--color-primary-strong); margin-bottom: 2px; }

/* ---------- 10 만들기 ---------- */
.tb-ten { max-width: 520px; margin: 0 auto; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--color-line); }
.tb-bar { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.tb-bar + .tb-bar { margin-top: 6px; }
.tb-slot { aspect-ratio: 1 / 1; border: 2px dashed #D9C6B4; border-radius: 8px; background: #fff; }
.tb-slot.is-pink { background: var(--tb-pink); border: 2px solid var(--tb-pink-d); }
.tb-slot.is-blue { background: var(--tb-blue); border: 2px solid var(--tb-blue-d); animation: tb-drop .25s ease; }
.tb-over { display: flex; gap: 4px; justify-content: flex-end; min-height: 0; margin-top: 6px; }
.tb-over .tb-slot { width: calc((100% - 36px) / 10); flex: none; }
.tb-slot.is-over { opacity: .7; border-style: dashed; }
.tb-friends { max-width: 520px; margin: 22px auto 0; }
.tb-friend-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tb-friend-list li { display: grid; place-items: center; min-height: 46px; border-radius: 12px; border: 1.5px dashed #D9C6B4; background: #fff; font-family: var(--tb-round); font-size: 18px; color: #C9B6A6; }
.tb-friend-list li.on { border-style: solid; border-color: var(--color-line); color: var(--tb-ink); }
.tb-friend-list .p { color: #C2566B; }
.tb-friend-list .b { color: #2F7FB0; }

/* ---------- 배지 ---------- */
.tb-badges { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 8px; border-radius: var(--radius-card); background: #fff; border: 1.5px dashed #D9C6B4; opacity: .62; }
.tb-badge.is-on { opacity: 1; border-style: solid; border-color: #F0B429; background: #FFFBEE; }
.tb-badge-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--color-surface); font-family: var(--tb-round); font-size: 18px; color: var(--tb-ink); margin-bottom: 4px; }
.tb-badge.is-on .tb-badge-ico { background: #F0B429; color: #fff; }
.tb-badge b { font-family: var(--tb-round); font-weight: 400; font-size: 17px; }
.tb-badge small { font-size: 12.5px; color: var(--color-text-sub); line-height: 1.4; }
.tb-row.center { justify-content: center; }

/* ---------- 부모님께 ---------- */
.tb-steps { margin: 0 0 22px; padding: 0; list-style: none; counter-reset: tb; display: grid; gap: 10px; }
.tb-steps li { counter-increment: tb; position: relative; padding: 14px 16px 14px 56px; border-radius: 14px; background: #fff; color: var(--color-text-sub); font-size: 15px; }
.tb-steps li::before { content: counter(tb); position: absolute; left: 14px; top: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tb-pink); border: 2px solid var(--tb-pink-d); font-family: var(--tb-round); color: var(--tb-ink); }
.tb-steps li:nth-child(even)::before { background: var(--tb-blue); border-color: var(--tb-blue-d); }
.tb-steps b { display: block; color: var(--color-text); }
.tb-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- 움직임 ---------- */
@keyframes tb-pop { 0% { transform: scale(.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes tb-drop { 0% { transform: translateY(-12px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes tb-hop { 0% { transform: translateY(0); } 45% { transform: translateY(-40%); } 100% { transform: translateY(0); } }
@keyframes tb-glow { 50% { box-shadow: 0 0 0 6px rgba(240, 180, 41, .2); } }
@keyframes tb-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.tb-shake { animation: tb-shake .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .tb *, .tb *::before, .tb *::after { animation: none !important; transition: none !important; }
}

/* ---------- 넓은 화면 ---------- */
@media (min-width: 768px) {
  .tb-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb-board { gap: 4px; padding: 10px; }
}
@media (min-width: 1024px) {
  .tb-hero { padding: 48px 0 56px; }
  .tb-hero-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .tb-hero-photo img { max-width: 420px; }
  .tb-play { padding: 72px 0; }
}

/* ---------- 인쇄 ---------- */
.tb-print { display: none; }
@media print {
  body.tb-printing > *:not(main) { display: none !important; }
  body.tb-printing main > *:not(.tb) { display: none !important; }
  body.tb-printing .tb > *:not(.tb-print) { display: none !important; }
  body.tb-printing .tb-print { display: block; color: #222; font-family: var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tb-p-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #886A60; padding-bottom: 6px; margin-bottom: 8px; }
  .tb-p-head b { font-family: var(--tb-round); font-weight: 400; font-size: 24pt; }
  .tb-p-guide { font-size: 12pt; margin: 0 0 10px; }
  .tb-p-board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2mm; }
  .tb-p-cell { display: grid; place-items: center; height: 15mm; border: 1.2pt solid #B8A595; border-radius: 2mm; font-family: var(--tb-round); font-size: 15pt; }
  .tb-p-cell.blank { border-style: dashed; }
  .tb-p-cell.pink { background: #F8D3D9; border-color: #E39AA8; }
  .tb-p-cell.blue { background: #CFE7F6; border-color: #86BEE0; }
  .tb-p-cell.off { opacity: .3; }
  .tb-p-foot { margin-top: 8px; font-size: 9pt; color: #888; text-align: right; }
  @page { size: A4; margin: 12mm; }
}
