/* 고기 등급 합치기 — site.css 공통 디자인 위에 이 페이지에 필요한 것만
   색: 흰 바탕·검정 글자·회색 1개 + 강조색(#8f2f2a) 한 계열. 조각 색은 grade/tiers.js(단계가 오를수록 진해짐)
   머리글·점수 줄·끝 화면·명예의 전당 모양은 assets/hall.css (고기 굽기 10점과 같이 씀) */

/* 판 */
.gr-board {
  --gap: 8px;
  position: relative; margin-top: 14px; aspect-ratio: 1 / 1; width: 100%;
  container-type: inline-size;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: contain; /* 판 안 터치가 화면 스크롤·당겨서 새로고침으로 번지지 않게 (막기는 assets/board-lock.js) */
  outline: none; -webkit-tap-highlight-color: transparent;
}
.gr-board:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 12px; }
.gr-cells, .gr-tiles { position: absolute; inset: 0; }
/* 조각은 손가락이 닿는 대상이 아님 → 터치가 늘 지워지지 않는 칸·판에 닿음 (합쳐지며 조각이 지워져도 스크롤 막기가 안 풀리게) */
.gr-tiles, .gr-tile { pointer-events: none; }
.gr-board * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.gr-cells { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: var(--gap); }
.gr-cells i { background: var(--soft); border-radius: 10px; }
.gr-tile {
  position: absolute; left: 0; top: 0;
  width: calc((100% - 3 * var(--gap)) / 4); height: calc((100% - 3 * var(--gap)) / 4);
  transform: translate(calc(var(--c) * (100% + var(--gap))), calc(var(--r) * (100% + var(--gap))));
  transition: transform .1s ease-out;
  will-change: transform;
}
.gr-in {
  width: 100%; height: 100%; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.gr-in i { display: flex; align-items: center; justify-content: center; width: 58%; aspect-ratio: 1; border-radius: 50%; background: #fbf6f0; }
.gr-in img { width: 82%; height: 82%; display: block; }
.gr-in span { font-size: clamp(9px, 3.1cqw, 13px); font-weight: 600; letter-spacing: -.4px; line-height: 1.25; white-space: nowrap; max-width: 96%; overflow: hidden; text-overflow: ellipsis; }
.gr-tile.new .gr-in { animation: gr-appear .16s ease-out; }
.gr-tile.pop .gr-in { animation: gr-pop .16s ease-out; }
@keyframes gr-appear { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes gr-pop { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }
.gr-board.over .gr-tiles { opacity: .35; transition: opacity .3s; }
@media (prefers-reduced-motion: reduce) {
  .gr-tile { transition: none; }
  .gr-tile.new .gr-in, .gr-tile.pop .gr-in { animation: none; }
  .gr-board.over .gr-tiles { transition: none; }
}
.gr-hint { color: var(--sub); font-size: 13.5px; margin-top: 10px; }


/* 단계 사다리 */
.gr-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.gr-steps li { text-align: center; min-width: 0; }
.gr-steps img { width: 44px; height: 44px; display: block; margin: 0 auto; }
.gr-steps li.no img { filter: brightness(0); opacity: .12; }
.gr-steps small { display: block; font-size: 12px; color: var(--sub); line-height: 1.35; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-steps li:not(.no) small { color: var(--text); font-weight: 600; }
@media (prefers-color-scheme: dark) { .gr-steps li.no img { filter: brightness(0) invert(1); opacity: .16; } }

@media (max-width: 359px) {
  .gr-board { --gap: 6px; }
  /* '전설의냉삼 +1'처럼 긴 이름은 띄어쓰기에서만 두 줄로 (320폭, 이름 가운데는 안 끊김) */
  .gr-now span { white-space: normal; justify-content: flex-end; text-align: right; gap: 3px; }
  .gr-now span b { font-size: 13px; overflow-wrap: normal; min-width: 0; line-height: 1.25; }
  .gr-now img { width: 22px; height: 22px; }
  .gr-in { border-radius: 8px; }
  .gr-steps small { white-space: normal; overflow: visible; font-size: 11px; line-height: 1.3; }
}
/* 다크모드: 작은 고기 그림 외곽선이 바탕에 묻히지 않게 밝은 둥근 바탕 (site.css의 아이콘 규칙과 같은 색) */
@media (prefers-color-scheme: dark) {
  .gr-steps li:not(.no) img, .gr-now img, .gr-end-tier img { background: #ece7df; border-radius: 28%; padding: 4px; box-sizing: border-box; }
}

/* 시작 전 화면: 고기 등급 순서 (1→12, 3칸씩 4줄, 번호 순서대로 왼쪽→오른쪽) */
.gr-top-r { display: inline-flex; align-items: center; gap: 16px; }
.gr-order-link { background: none; border: 0; padding: 0 2px; min-height: 48px; font: inherit; font-size: 14px; color: var(--sub); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gr-intro { margin-top: 14px; }
.gr-intro h2 { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.gr-intro-sub { color: var(--sub); font-size: 14px; margin-top: 2px; }
.gr-order { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gr-order li { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 10px 4px 8px; border-radius: 12px; }
.gr-order .no { position: absolute; left: 7px; top: 5px; font-size: 12px; font-weight: 700; line-height: 1; opacity: .75; font-variant-numeric: tabular-nums; }
.gr-order i { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #fbf6f0; }
.gr-order img { width: 38px; height: 38px; display: block; }
.gr-order b { font-size: 13px; font-weight: 600; letter-spacing: -.4px; line-height: 1.3; text-align: center; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* 다음 칸으로 가는 작은 화살표 (줄 끝 칸 제외) */
.gr-order li:not(:nth-child(3n)):not(:last-child)::after { content: "→"; position: absolute; right: -4px; top: 50%; transform: translate(50%, -50%); z-index: 1; font-size: 12px; font-weight: 700; color: var(--sub); }
.gr-intro-acts { margin-top: 16px; }
.gr-intro-acts .btn + .btn { margin-top: 10px; }
@media (max-width: 359px) {
  .gr-order { gap: 6px; }
  .gr-order li { padding: 9px 2px 7px; }
  .gr-order i { width: 40px; height: 40px; }
  .gr-order img { width: 33px; height: 33px; }
  .gr-order b { font-size: 12px; white-space: normal; overflow: visible; word-break: keep-all; }
  .gr-top-r { gap: 12px; }
}
