/* 야간 구장의 네이비와 유니폼의 아이보리: 애니메이션 코치와 상황 관찰실 */
.coach, .scene-room { --coach-navy: #17213e; --coach-paper: #fff8e9; --coach-gold: #edc985; --coach-muted: #bdc9df; --coach-line: #ffffff24; color: var(--coach-paper); font-family: var(--font-sans, sans-serif); }
.coach { display: grid; grid-template-columns: 124px minmax(0, 1fr); overflow: hidden; border: 1px solid #e8c88a66; border-radius: 16px; background: linear-gradient(115deg, #263454, #121c34); box-shadow: 0 10px 30px #0a10202b; text-align: left; }
.coach__portrait { position: relative; align-self: stretch; min-height: 180px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #6d7e9a, #233252 75%); }
.coach__portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 52% 12%; }
.coach__badge { position: absolute; bottom: 0; inset-inline: 0; padding: 5px; background: #15213dd9; color: var(--coach-gold); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-align: center; }
.coach__body { min-width: 0; padding: 17px 19px 12px; }
.coach__heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 11px; }
.coach__name { font: 800 1.2rem var(--font-display, sans-serif); color: var(--coach-gold); }
.coach__name small { margin-left: 6px; font: 500 .75rem var(--font-sans, sans-serif); color: var(--coach-muted); }
.coach__chapter { margin-left: auto; font-size: .72rem; color: var(--coach-muted); }
.coach__text { min-height: 3.2em; margin: 0 0 12px; font-size: 1rem; font-weight: 500; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; text-wrap: pretty; }
.coach__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.coach-btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; border: 1px solid var(--coach-line, #ffffff24); border-radius: 9px; padding: 7px 12px; background: #ffffff09; color: var(--coach-paper, #fff8e9); font: 700 .82rem var(--font-sans, sans-serif); cursor: pointer; transition: background .18s, transform .18s; }
.coach-btn:hover:not(:disabled) { background: #ffffff1a; }
.coach-btn:active:not(:disabled) { transform: translateY(1px); }
.coach-btn:disabled { opacity: .38; cursor: default; }
.coach-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.coach-btn--gold { color: #1c2843; background: var(--coach-gold, #edc985); border-color: transparent; }
.coach-btn--gold:hover:not(:disabled) { background: #ffe0a8; }
.coach__pages { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--coach-muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.coach__pages button { width: 44px; padding: 0; font-size: 1.4rem; }
.coach__settings { margin-top: 12px; border-top: 1px solid var(--coach-line); padding-top: 8px; color: var(--coach-muted); font-size: .74rem; }
.coach__settings summary { width: fit-content; padding: 6px 0; cursor: pointer; }
.coach__settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-block: 10px; }
.coach__settings label { display: grid; gap: 5px; min-width: 0; }
.coach__settings select { width: 100%; min-height: 44px; border: 1px solid #ffffff40; border-radius: 7px; padding: 6px; color: #fff8e9; background: #15203a; font: inherit; }
.coach__auto { display: flex; align-items: center; min-height: 44px; margin-top: 6px; font-size: .74rem; color: var(--coach-muted); cursor: pointer; }
.coach__auto input { width: 18px; height: 18px; accent-color: var(--coach-gold); margin-right: 5px; }
.coach__status { font-size: .68rem; color: var(--coach-muted); line-height: 1.5; margin: 6px 0 0; }
.coach :focus-visible, .scene-room :focus-visible { outline: 3px solid #edc985; outline-offset: 3px; }
.coach.is-speaking .coach__name::after { content: ' • • •'; font-size: .6em; }
.coach--hero { grid-template-columns: minmax(160px, .9fr) minmax(0, 1.3fr); }
.coach--hero .coach__portrait { min-height: 300px; }
.coach--hero .coach__portrait img { object-fit: cover; object-position: center 10%; }
.coach--hero .coach__body { align-self: center; padding: 24px; }
.coach-entry { margin: 0 auto 24px; max-width: 1280px; }
.game-coach-slot { margin-top: 16px; }
.g-title__companion { display: grid; gap: 18px; min-width: 0; }
.g-title__companion .coach { grid-template-columns: 145px minmax(0, 1fr); }
.g-title__companion .coach__portrait { min-height: 340px; }
.g-title__companion .g-card { justify-self: stretch; width: 100%; transform: none; border-radius: 14px; padding: 1px; box-shadow: none; }
.g-title__companion .g-card__photo, .g-title__companion .g-card__no { display: none; }
.g-title__companion .g-card__body { padding: 16px; background: #15203a; color: var(--g-ink); border-radius: 13px; }
.g-title__companion .g-card__name { font-size: 1rem; }
.g-title__companion .g-card__rank, .g-title__companion .g-card__next { font-size: .78rem; }
.g-title__companion .g-card__stats div { background: #ffffff09; }
.game-coach-slot .coach { max-width: 100%; }
.game-coach-slot .coach__text { min-height: 0; }
.g-observe { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.g-observe small { color: var(--g-muted); font-size: .78rem; }
.g-study-note { padding: 8px 12px; margin-bottom: 10px; background: #edc98515; color: var(--g-gold); font-size: .8rem; border-radius: 8px; }
.g-hud__lesson { color: var(--g-muted); font-size: .72rem; font-weight: 600; white-space: normal; }
.sim-coach-slot { margin-top: 4px; }
.sim-coach-slot .coach { grid-template-columns: 96px minmax(0, 1fr); }
.sim-coach-slot .coach__body { padding: 13px; }
.sim-coach-slot .coach__chapter { display: none; }
.sim-observe { width: 100%; color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.sim-observe:hover:not(:disabled) { background: var(--surface-2); }
.sim-ready { margin: 4px 0; display: flex; align-items: center; gap: 10px; }
.sim-ready p { font-size: .83rem; color: var(--muted); }
.scene-open { overflow: hidden; }
.scene-room { width: min(1160px, calc(100% - 32px)); max-width: 1160px; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #e8c88a70; border-radius: 22px; margin: auto; background: #101a30; box-shadow: 0 30px 120px #050b18bd; }
.scene-room::backdrop { background: #070d1ddd; backdrop-filter: blur(10px); }
.scene-room__shell { padding: clamp(16px, 3vw, 28px); }
.scene-room__header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 8px 0; background: #101a30; }
.scene-room__header p { font-size: .64rem; letter-spacing: .19em; color: var(--coach-gold); margin: 0 0 5px; }
.scene-room__header h2 { font: 800 clamp(1.4rem, 3vw, 2rem) var(--font-display, sans-serif); margin: 0; }
.scene-room__layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; }
.scene-room__match { min-width: 0; position: relative; border-radius: 14px; overflow: hidden; background: #172c38; border: 1px solid #ffffff1c; }
.scene-room__score { position: absolute; top: 16px; left: 16px; right: 16px; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; padding: 10px 13px; border-left: 3px solid var(--coach-gold); border-radius: 4px; background: #101a30ec; }
.scene-room__score b { color: var(--coach-paper); font-size: 1rem; }
.scene-room__score span { font-size: .76rem; color: var(--coach-muted); }
.scene-room__score span:last-child { margin-left: auto; color: var(--coach-gold); font-variant-numeric: tabular-nums; }
.scene-room__field { --grass: #367857; --grass-2: #438966; --dirt: #bb8862; --chalk: #fff4d5; --ink: #f9f4e8; --ink-2: #fff; --muted: #bac6db; --surface: #233854; --navy: #244a80; --honey: #f5cf75; --sbo: #70cda2; --crown: #ec9b9b; --ok: #9df4ae; --danger: #ff8787; position: relative; height: 400px; perspective: 700px; background: radial-gradient(ellipse at 50% 45%, #3c6557, #162c34 80%); }
.scene-room [data-scene-field] { position: absolute; inset: 42px 8px 0; display: grid; place-items: center; }
.scene-room [data-scene-3d] { position: absolute; inset: 0; overflow: hidden; }
.scene-room [data-scene-3d] canvas { display: block; width: 100%; height: 100%; }
.scene-room [data-scene-field][hidden], .scene-room [data-scene-3d][hidden] { display: none; }
.scene-room .g3-label { position: absolute; top: 0; left: 0; pointer-events: none; white-space: nowrap; color: #fff8e9; font: 800 11px var(--font-sans); text-shadow: 0 2px 4px #000; background: #17213ebb; padding: 3px 7px; border-radius: 5px; }
.scene-room .g3-label--me { color: #ffe0a0; }
.scene-room__field::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, #fff5cf0b, transparent 30%, transparent 70%, #fff5cf0b); }
.scene-room__field .sim-field { width: 100%; height: 100%; max-height: 360px; transform: rotateX(23deg) scale(1.03); transform-origin: 50% 70%; transition: transform .45s ease; filter: drop-shadow(0 15px 15px #08152066); }
.scene-room.is-top .sim-field { transform: none; }
.scene-room__field .f-grass { stroke: #fff2c622; stroke-width: .6; }
.scene-room__field .f-me__ring { stroke: #fff1c0; stroke-width: 1.4; }
.scene-room__field .ball-path { stroke: #fff4cd; stroke-width: 1.4; }
.scene-room__caption { position: relative; min-height: 94px; padding: 14px 18px; background: #12233bed; border-top: 1px solid #ffffff14; }
.scene-room__caption > span { font: 800 .64rem var(--font-sans); letter-spacing: .17em; color: var(--coach-gold); }
.scene-room__caption p { font-size: .94rem; line-height: 1.65; margin: 6px 0 0; word-break: keep-all; }
.scene-room__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 10px 12px; background: #101d33; }
.scene-room__toolbar > span { flex: 1; font-size: .64rem; color: var(--coach-muted); }
.scene-room__toolbar .coach-btn { font-size: .73rem; }
.scene-room__steps { display: grid; grid-template-columns: repeat(3, 1fr); background: #0d172b; }
.scene-room__steps button { min-height: 60px; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 8px; background: none; border: 0; border-top: 2px solid transparent; color: var(--coach-muted); font: 700 .8rem var(--font-sans); }
.scene-room__steps small { font-size: .65rem; opacity: .65; }
.scene-room__steps [aria-pressed='true'] { background: #edc98510; border-color: var(--coach-gold); color: var(--coach-gold); }
.scene-room [data-scene-coach] { min-width: 0; }
.scene-room .coach { display: flex; flex-direction: column; height: 100%; }
.scene-room .coach__portrait { height: 220px; flex-shrink: 0; background: radial-gradient(ellipse at 50% 30%, #788698, #293958 75%); }
.scene-room .coach__portrait img { object-fit: contain; height: 420px; max-width: none; object-position: center top; }
.scene-room .coach__badge { display: none; }
.scene-room .coach__body { flex: 1; }
.scene-room .coach__chapter { font-size: .66rem; }
.scene-room__footer { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.scene-room__footer p { margin: 0; color: var(--coach-muted); font-size: .78rem; }
@media (min-width: 761px) and (max-height: 800px) {
  .scene-room__field { height: 260px; }
  .scene-room .coach__portrait { height: 180px; }
  .scene-room__header { margin-bottom: 12px; }
}
@media (max-width: 760px) {
  .g-title__companion .coach { grid-template-columns: 120px minmax(0, 1fr); }
  .g-title__companion .coach__portrait { min-height: 260px; }
  .coach--hero { grid-template-columns: 130px minmax(0, 1fr); }
  .coach--hero .coach__body { padding: 16px; }
  .coach--hero .coach__portrait { min-height: 260px; }
  .scene-room { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .scene-room__layout { grid-template-columns: 1fr; gap: 12px; }
  .scene-room__field { height: 310px; }
  .scene-room .coach { display: grid; grid-template-columns: 100px minmax(0, 1fr); }
  .scene-room .coach__portrait { height: auto; min-height: 200px; }
  .scene-room .coach__portrait img { height: 100%; object-fit: cover; object-position: center top; }
  .scene-room__footer .coach-btn { width: 100%; }
}
@media (max-width: 440px) {
  .coach, .coach--hero { grid-template-columns: 84px minmax(0, 1fr); }
  .coach__body, .coach--hero .coach__body { padding: 12px; }
  .coach__chapter { display: none; }
  .coach__text { font-size: 1rem; }
  .coach__pages { margin-left: 0; }
  .coach__settings-grid { grid-template-columns: 1fr; }
  .scene-room__field { height: 280px; }
  .scene-room__toolbar > span { order: 3; flex-basis: 100%; }
  .scene-room__steps button { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .coach *, .scene-room * { animation: none !important; transition: none !important; }
}
