/* 태블릿 크기 맞춤(2026-10-29 사용자: "작은 폰일 수도, 태블릿일 수도 있어") — 맨 마지막에 불러옴.
   아이 화면은 폰(최대 480px 한 줄)에 맞춰 그려져 있어서, 태블릿에서는 화면 전체를 비례로 키운다(zoom).
   세로 태블릿은 폭으로, 가로 태블릿은 높이로 배율을 고름(가로에서 키우면 세로가 모자라니 높이 기준).
   마을 지도·내 방은 화면 전체를 쓰는 따로 맞춤이 있어 키우지 않음(:has 로 뺌). 보호자 화면은 넓은 칸(720)이라 덜 키움. */

/* 세로 태블릿: 폭 기준 */
body.theme-child .app-screen { margin-left: auto; margin-right: auto; }
@media (min-width: 700px) and (orientation: portrait) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.4; }
  body.theme-parent { zoom: 1.12; }
}
@media (min-width: 800px) and (orientation: portrait) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.5; }
  body.theme-parent { zoom: 1.25; }
}
@media (min-width: 1000px) and (orientation: portrait) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.8; }
}

/* 세로지만 네모에 가까운 태블릿(아이패드 3:4 등)은 높이가 모자라 조금 덜 키움 — 홈이 아래 탭에 가리지 않게 */
@media (min-width: 700px) and (orientation: portrait) and (min-aspect-ratio: 74/100) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.3; }
}
@media (min-width: 1000px) and (orientation: portrait) and (min-aspect-ratio: 74/100) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.7; }
}

/* 가로 태블릿: 높이 기준(한 화면에 들어가야 하는 홈·연습이 넘치지 않게 효과 높이 ≈ 640 이상) */
@media (min-width: 900px) and (min-height: 700px) and (orientation: landscape) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.1; }
  body.theme-parent { zoom: 1.1; }
}
@media (min-width: 900px) and (min-height: 790px) and (orientation: landscape) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.22; }
}
@media (min-width: 1100px) and (min-height: 950px) and (orientation: landscape) {
  body.theme-child:not(:has(.home-screen[data-state="map"])):not([data-route="room"]) { zoom: 1.45; }
  body.theme-parent { zoom: 1.2; }
}

/* 아주 작은 폰(폭 360 미만): 카드 안 여백을 줄여 글이 좁아지지 않게 */
@media (max-width: 359px) {
  .app-screen { padding-left: 10px; padding-right: 10px; }
  .theme-parent .content-card, .p-card, .p-menu-card { padding-left: 12px; padding-right: 12px; }
}

/* 가로 태블릿 홈: 두 칸(왼쪽 = 인사·오늘의 연습·시작, 오른쪽 = 다른 곳에서 놀기 2×2 큰 타일) — 좁은 한 줄이 가운데만 차지하지 않게 */
@media (min-width: 900px) and (orientation: landscape) {
  .home-screen[data-state="today"] { max-width: 920px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; row-gap: 10px; align-content: center; }
  .app-screen:has(> .home-screen[data-state="today"]) { max-width: 920px; }
  .home-screen[data-state="today"] > .home-head { grid-column: 1 / -1; }
  .home-screen[data-state="today"] > .home-hero { grid-column: 1; grid-row: 2; }
  .home-screen[data-state="today"] > .home-today { grid-column: 1; grid-row: 3; }
  .home-screen[data-state="today"] > .home-today-go { grid-column: 1; grid-row: 4; }
  .home-screen[data-state="today"] > .home-foot { grid-column: 1; grid-row: 5; }
  .home-screen[data-state="today"] > .home-others { grid-column: 2; grid-row: 2 / 6; align-self: center; }
  .home-screen[data-state="today"] .home-tiles { grid-template-columns: 1fr 1fr; gap: 14px; }
  .home-screen[data-state="today"] .home-tile.ghost-button { min-height: 150px; }
  .home-screen[data-state="today"] .home-tile-pic img { width: 84px; height: 84px; }
  .home-screen[data-state="today"] .home-tile-name { font-size: 17px; }
  .home-tabs { max-width: 620px; }
}
/* 세로 태블릿 홈: 타일을 크게 */
@media (min-width: 700px) and (orientation: portrait) {
  .home-screen[data-state="today"] .home-tile.ghost-button { min-height: 124px; }
}
