/* 더 보기 · 사진 속 글자 읽기 (scenes/ocr.html). 틀은 ta.css, 여기서는 .s-ocr 아래만.
   메뉴판은 사진처럼: 타일 벽 + 나무 틀 칠판 + 비스듬한 원근 + 조명. 분필 글씨는 굵기·기울기로. */

/* 대화가 길어지면 위쪽은 살짝 흐려지며 사라진다 */
.s-ocr .ta-thread { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }

/* ───────── 사진 폴더 ───────── */
.s-ocr .oc-grid { position: absolute; inset: 0; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); justify-content: center; align-content: start; gap: 12px 10px; background: #fff; transition: opacity .3s; }
.s-ocr .oc-tile { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.s-ocr .oc-th { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #ddd; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); transition: box-shadow .25s; }
.s-ocr .oc-th > svg { display: block; width: 100%; height: 100%; }
.s-ocr .oc-tn { max-width: 100%; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; color: #3a3a3c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .25s, color .25s; }
.s-ocr .oc-tile.lit .oc-th { box-shadow: 0 0 0 3px var(--cobalt), 0 0 0 4px #fff inset; }
.s-ocr .oc-tile.lit .oc-tn { background: var(--cobalt); color: #fff; }
.s-ocr .ta-ftab:not(:has(.oc-ftab.in)) .oc-all { color: var(--ta-tx); font-weight: 700; box-shadow: inset 0 -2px 0 var(--ta-tx); }
.s-ocr .oc-ftab { display: none; }
.s-ocr .oc-ftab.in { display: inline-grid; animation: oc-tab .35s var(--ta-glide) both; }
@keyframes oc-tab { from { opacity: 0; transform: translateY(6px); } }
.s-ocr .ta-side:has(.oc-photo.in) .oc-note0, .s-ocr .ta-side:not(:has(.oc-photo.in)) .oc-note1 { display: none; }
.s-ocr .ta-side:has(.oc-photo.in) .oc-grid { opacity: 0; }

/* 작은 그림 속 메뉴판 — 큰 메뉴판을 그대로 줄여 둔다 */
.s-ocr .oc-th-board { background: linear-gradient(180deg, #e7dccb, #d5c6ad); }
.s-ocr .oc-mini { position: absolute; left: 50%; top: 50%; zoom: .46; transform: translate(-50%, -50%) rotate(-1deg); }
.s-ocr .oc-board-mini { position: relative !important; left: auto !important; top: auto !important; transform: none !important; width: 300px; display: grid !important; }

/* ───────── 메뉴판 사진 ───────── */
.s-ocr .oc-photo { position: absolute; inset: 0; padding: 12px 14px; background: #f5f5f7; opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .55s var(--ta-glide); }
.s-ocr .oc-photo.in { opacity: 1; transform: none; }
.s-ocr .oc-img { position: relative; height: 100%; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 12px 26px -16px rgba(0, 0, 0, .4); }
.s-ocr .oc-wall { position: absolute; inset: 0; background:
  repeating-linear-gradient(0deg, rgba(90, 70, 40, .09) 0 1px, transparent 1px 30px),
  repeating-linear-gradient(90deg, rgba(90, 70, 40, .09) 0 1px, transparent 1px 30px),
  linear-gradient(180deg, #ece2d1 0%, #dccfb8 100%); }
.s-ocr .oc-board { position: absolute; left: 50%; top: 50%; width: min(292px, 82%); padding: 14px 18px 12px; border-radius: 3px; color: #f4f1e6;
  background: radial-gradient(120% 80% at 28% 18%, rgba(255, 255, 255, .09), transparent 60%), radial-gradient(60% 40% at 80% 88%, rgba(255, 255, 255, .06), transparent 70%), #263129;
  box-shadow: 0 0 0 7px #7b4a27, 0 0 0 8px #4b2b15, 0 20px 28px -10px rgba(50, 25, 5, .55);
  transform: translate(-50%, -50%) perspective(900px) rotateY(-6deg) rotateX(3deg) rotate(-.6deg); }
.s-ocr .oc-board p { margin: 0; }
.s-ocr .oc-bt { display: block; margin: 0 auto 8px !important; width: fit-content; font-size: 15px; font-weight: 800; letter-spacing: .06em; transform: rotate(-1.4deg); text-shadow: 0 0 1px rgba(255, 255, 255, .55); }
.s-ocr .oc-rows { display: grid; gap: 5px; }
.s-ocr .oc-li { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; line-height: 1.45; }
.s-ocr .oc-li b { font-weight: 700; text-shadow: 0 0 1px rgba(255, 255, 255, .45); }
.s-ocr .oc-li i { flex: 1; min-width: 12px; border-bottom: 1.5px dotted rgba(255, 255, 255, .32); transform: translateY(-3px); }
.s-ocr .oc-li em { font-style: normal; font-weight: 800; color: #f3d77a; font-variant-numeric: tabular-nums; text-shadow: 0 0 1px rgba(243, 215, 122, .5); }
.s-ocr .oc-li:nth-child(odd) { transform: rotate(-.6deg); }
.s-ocr .oc-li:nth-child(even) { transform: translateX(2px) rotate(.4deg); }
.s-ocr .oc-li:nth-child(3) b, .s-ocr .oc-li:nth-child(6) b { font-weight: 800; }
.s-ocr .oc-bn { display: block; width: fit-content; margin: 8px 0 0 auto !important; font-size: 11.5px; font-weight: 700; color: #f6abbd; transform: rotate(-2.4deg); }
.s-ocr .oc-chalk { position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"); }
.s-ocr .oc-light { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 22% 12%, rgba(255, 242, 214, .38), transparent 70%), radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(40, 25, 10, .28) 100%); }

/* 글자 칸 — 읽은 줄은 파란 테두리, 다 읽으면 초록 */
.s-ocr .oc-box { position: relative; z-index: 0; }
.s-ocr .oc-photo .oc-box::before { content: ""; position: absolute; z-index: -1; inset: -1px -6px 0; border-radius: 4px; border: 1.5px solid #5b95ff; background: rgba(91, 149, 255, .2); opacity: 0; transform: scale(.94); transition: opacity .2s, transform .3s var(--ta-spring), border-color .3s, background .3s; }
.s-ocr .oc-photo .oc-box.hit::before { opacity: 1; transform: none; }
.s-ocr.act3 .oc-photo .oc-box::before { border-color: #47c486; background: rgba(71, 196, 134, .16); }

/* 읽는 줄 — 아래 끝의 밝은 선이 지나간다 */
.s-ocr .oc-scan { position: absolute; left: 0; right: 0; top: 0; height: 54px; pointer-events: none; opacity: 0; transform: translateY(-60px);
  background: linear-gradient(180deg, rgba(91, 149, 255, 0) 0%, rgba(91, 149, 255, .16) 70%, rgba(120, 170, 255, .42) 96%, #8fb8ff 100%);
  border-bottom: 1.5px solid #cfe0ff; transition: transform .26s linear, opacity .25s; }
.s-ocr .oc-scan.show { opacity: 1; }

/* 답 속 표 */
.s-ocr .oc-tb { width: 100%; max-width: 270px; margin-top: 8px; border-collapse: separate; border-spacing: 0; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--ta-bd); font-size: 12px; }
.s-ocr .oc-tb th { padding: 5px 12px; background: #f6f6f7; font-weight: 700; text-align: left; border-bottom: 1px solid var(--ta-bd); }
.s-ocr .oc-tb td { padding: 3.5px 12px; border-top: 1px solid #f0f0f2; }
.s-ocr .oc-tb tbody tr:first-child td { border-top: 0; }
.s-ocr .oc-tb th:last-child, .s-ocr .oc-tb td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.s-ocr .oc-tb tbody tr { opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .35s var(--ta-glide); }
.s-ocr .oc-tb tbody tr.in { opacity: 1; transform: none; }
.s-ocr .oc-foot { margin-top: 6px !important; font-size: 12px; }

@container tadesk (max-width: 700px) {
  .s-ocr .ta-side { inset: 22% 0 0 0; }
  .s-ocr .oc-grid { gap: 10px 8px; padding: 10px; }
  .s-ocr .oc-tn { font-size: 12px; }
  .s-ocr .oc-mini { zoom: .4; }
  .s-ocr .oc-photo { padding: 10px; }
  .s-ocr .oc-board { width: min(330px, 88%); padding: 12px 14px 10px; }
  .s-ocr .oc-li, .s-ocr .oc-bn { font-size: 12px; }
  .s-ocr .oc-tb, .s-ocr .oc-foot { font-size: 12.5px; }
  .s-ocr .oc-tb td { padding: 3px 12px; }
}
/* 휴대폰 배치지만 칸이 넓을 때(태블릿 세로 등): 사진 폴더를 한 줄 네 칸으로 */
@container tadesk (min-width: 521px) and (max-width: 700px) {
  .s-ocr .oc-grid { grid-template-columns: repeat(4, minmax(0, 150px)); }
}
@media (max-width: 860px) {
  .s-ocr .ta-desk { --ta-h: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-ocr .oc-photo, .s-ocr .oc-grid, .s-ocr .oc-ftab.in, .s-ocr .oc-scan, .s-ocr .oc-tb tbody tr, .s-ocr .oc-box::before { transition: none; animation: none; }
}
