/* 고기 굽기 10점 — site.css·assets/hall.css 위에 이 페이지에 필요한 것만
   색: 흰 바탕·검정 글자·회색 1개 + 강조색(#8f2f2a). 고기 조각 그림은 assets/ten-icons/piece.svg */

.tn-play { scroll-margin-top: 10px; }
.gr-score .tn-left { margin-left: auto; text-align: right; }
.tn-left b { min-width: 3.2em; }

/* 남은 시간 막대 (단색) */
.tn-time { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.tn-time i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 3px; transform-origin: left center; }

/* 지금 고른 합 (줄 높이 고정 → 판이 위아래로 흔들리지 않게) */
.tn-sum { height: 34px; display: flex; align-items: center; margin-top: 4px; color: var(--sub); font-size: 14.5px; white-space: nowrap; overflow: hidden; }
.tn-sum b { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 4px; font-variant-numeric: tabular-nums; }
.tn-sum.ok, .tn-sum.ok b { color: var(--accent); font-weight: 700; }
.tn-sum.over, .tn-sum.over b { color: var(--sub); }

/* 불판 (10열 × 14행): 페이지는 흰 바탕 그대로, 판만 짙은 회색 불판 + 격자선 (단색)
   게임 중에만 판 위 터치가 화면 스크롤을 막음 (assets/board-lock.js). 시작 전·끝난 뒤(.idle/.over)는 판 위에서도 세로 스크롤 */
.tn-board {
  position: relative; width: 100%; aspect-ratio: 10 / 14;
  container-type: inline-size;
  background: #2f2f32; border-radius: 12px; overflow: hidden;
  touch-action: none; overscroll-behavior: contain;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.tn-board.idle, .tn-board.over { touch-action: pan-y; overscroll-behavior: auto; }
@media (prefers-color-scheme: dark) { .tn-board { background: #29292c; box-shadow: inset 0 0 0 1px #3a3a3e; } }
.tn-board * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tn-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(14, 1fr); }
.tn-c { position: relative; display: flex; align-items: center; justify-content: center; border-right: 1px solid #434347; border-bottom: 1px solid #434347; }
.tn-c:nth-child(10n) { border-right: 0; }
.tn-c:nth-child(n+131) { border-bottom: 0; }
/* 구운 자리: 불판 구멍 점 */
.tn-c.empty::before { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #4c4c51; }
/* 고기 조각: 가로로 살짝 긴 고기 슬라이스(살코기 + 비계 줄) 위에 크림색 숫자를 크게.
   숫자별로 색을 바꾸지 않고 같은 고기, 행마다 결 무늬만 3가지로 돌아감(.va/.vb/.vc = piece-a/b/c.svg)
   손가락 대상은 판(조각 아님) → 조각이 지워져도 스크롤 막기 유지 */
.tn-p {
  width: 100%; height: 100%; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: url(../assets/ten-icons/piece-a.svg) center / 100% 100% no-repeat;
  color: #fff4e2; font-size: 5.6cqw; /* 칸 너비(10cqw)의 56% */ font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 2px #5a1c16, 0 1px 1px #5a1c16;
  transform: rotate(var(--rot, 0deg)) scale(var(--sc, 1));
  transition: transform .08s ease-out;
}
/* 불판 위에 손으로 놓은 듯 아주 살짝씩 기울임 (숫자는 그대로 읽힘) */
.tn-c:nth-child(3n+1) .tn-p { --rot: -2.5deg; }
.tn-c:nth-child(5n+2) .tn-p { --rot: 2deg; }
.tn-c:nth-child(7n+3) .tn-p { --rot: -1.5deg; }
.tn-c.vb .tn-p { background-image: url(../assets/ten-icons/piece-b.svg); }
.tn-c.vc .tn-p { background-image: url(../assets/ten-icons/piece-c.svg); }
.tn-c.empty .tn-p { visibility: hidden; }
.tn-c.on .tn-p { --sc: 1.08; }

/* 드래그 중 네모 */
.tn-sel { position: absolute; pointer-events: none; border: 3px solid #ffffff; border-radius: 8px; background: rgba(255, 255, 255, .12); }
.tn-sel.ok { border-color: #f08a7e; background: rgba(240, 138, 126, .24); } /* 강조색 계열을 짙은 불판 위에서 보이게 밝게 */
.tn-sel.over { border-color: #8b8b8b; border-style: dashed; background: rgba(0, 0, 0, .3); }

/* 딱 익음: 짧게 지글 → 사라짐 (+ 김 두 줄) */
.tn-c.hiss .tn-p { visibility: visible; animation: tn-sizzle .36s ease-out forwards; }
.tn-c.hiss::before, .tn-c.hiss::after {
  content: ""; position: absolute; top: 4%; width: 3px; height: 30%; border-radius: 2px; background: var(--sub);
  margin: 0; opacity: 0; animation: tn-steam .4s ease-out;
}
.tn-c.hiss::before { left: 38%; }
.tn-c.hiss::after { left: 58%; animation-delay: .05s; }
@keyframes tn-sizzle {
  0% { transform: scale(1); filter: none; opacity: 1; }
  35% { transform: scale(1.1) rotate(-4deg); filter: brightness(.8) saturate(1.4); opacity: 1; }
  70% { transform: scale(.95) rotate(3deg); filter: brightness(.6) sepia(.4); opacity: .8; }
  100% { transform: scale(.6); filter: brightness(.5); opacity: 0; }
}
@keyframes tn-steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) {
  .tn-p { transition: none; }
  .tn-c.hiss .tn-p { animation: none; visibility: hidden; }
  .tn-c.hiss::before, .tn-c.hiss::after { animation: none; display: none; }
}

/* 시작 전·끝난 뒤 덮개 */
.tn-cover {
  position: absolute; inset: 0; border-radius: 12px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, .55);
}
.tn-cover .btn { width: auto; min-width: 180px; padding-left: 28px; padding-right: 28px; }
.tn-cover p { color: var(--text); background: var(--bg); border-radius: 8px; padding: 4px 12px; font-size: 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .tn-cover { background: rgba(28, 28, 30, .72); } }
.tn-board.over .tn-grid { opacity: .35; }

.tn-how ol { margin: 0; padding-left: 20px; color: var(--body); line-height: 1.75; }

/* 판은 페이지 좌우 여백(24px)을 일부 써서 넓게: 화면 끝에서 8px만 남김 → 390폭에서 칸 약 37px */
.tn-board { width: calc(100% + 32px); margin-left: -16px; }
/* 좁은 화면(320px, 페이지 여백 20px): 화면 끝에서 6px만 남김 → 칸 약 31px */
@media (max-width: 359px) {
  .tn-board { width: calc(100% + 28px); margin-left: -14px; }
}
