/* 나무 바닥과 남색 점수판을 쓰는 체육관. */
#game:has(.gym-hub), #game:has(.gym-game), #game:has(.gym-summary) { width: min(660px, 100% - 24px); }
.gym-hub, .gym-game { display: grid; gap: 8px; max-width: 560px; margin: auto; color: var(--navy); }
.gym-game [hidden], .gym-hub [hidden] { display: none !important; }
.gym-hub img, .gym-game img, .gym-summary img { image-rendering: pixelated; }
.gym-panorama { position: relative; border: 2px solid var(--navy); background: #d8b079; }
.gym-panorama>img { display: block; width: 100%; height: auto; }
.gym-panorama>span { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: #fffcf2; padding: 3px 9px; font-size: 12px; white-space: nowrap; border: 1px solid var(--navy); }
.gym-events { display: grid; gap: 8px; }
.gym-event { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; text-align: left; cursor: pointer; }.gym-event:active { transform: translate(2px,2px); }
.gym-event strong { display: block; font-family: var(--font-title); font-size: 20px; }
.gym-event small { display: block; font-size: 12px; line-height: 1.6; }
.gym-event-record { margin-left: auto; text-align: right; font-size: 13px; white-space: nowrap; }
.gym-event-record small { color: var(--muted); font-size: 12px; }
.gym-trophy { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #e8eddf; border: 1px solid #b9c4aa; }
.gym-trophy>img { opacity: .55; }.gym-trophy.is-earned { background: #fff0bf; border-color: #bb8e39; }.gym-trophy.is-earned>img { opacity: 1; }
.gym-trophy strong { font-size: 14px; }.gym-trophy p { margin: 3px 0 0; font-size: 12px; }
.gym-note, .gym-help, .gym-rewards { margin: 0; font-size: 12px; line-height: 1.45; text-align: center; color: var(--muted); }
.gym-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: #fffcf2; padding: 7px 10px; font-size: 13px; }
.gym-score { font-size: 16px; }.gym-round { white-space: nowrap; }
.gym-field { position: relative; width: min(100%, 440px); margin: auto; border: 2px solid var(--navy); background: #d8b079; }
.gym-field canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; touch-action: none; image-rendering: pixelated; user-select: none; -webkit-user-select: none; }
.gym-overlay { position: absolute; inset: 14px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 12px; text-align: center; background: #fffcf2f5; border: 2px solid var(--navy); }
.gym-overlay h3 { margin: 0; font: 24px var(--font-title); }.gym-overlay p { margin: 0; font-size: 13px; }.gym-overlay .btn { min-height: 44px; }
.gym-message { font-family: var(--font-title); font-size: 17px; line-height: 1.35; text-align: center; min-height: 23px; margin: 0; }
.gym-setup { display: flex; justify-content: center; gap: 8px; }.gym-setup .btn { flex: 1; min-height: 44px; padding: 9px; font-size: 13px; }
.gym-controls { display: flex; gap: 10px; justify-content: center; }
.gym-controls button { padding: 9px 14px; min-height: 48px; font: 20px var(--font-title); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.gym-controls .gym-main-action { flex: 1; }
.gym-controls button:active:not(:disabled) { transform: translateY(3px); }.gym-game:not([data-phase]) .gym-controls, .gym-game:not([data-phase]) .gym-curling-controls { display: none; }
.gym-controls button[data-action=left], .gym-controls button[data-action=right] { min-width: 70px; }
.gym-curling-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gym-curling-controls label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px; font-size: 12px; }
.gym-curling-controls input { grid-column: 1 / 3; width: 100%; height: 44px; accent-color: #365c53; margin: 0; }
.gym-tools { display: flex; justify-content: center; gap: 6px; padding-top: 3px; }.gym-tools .btn { flex: 1; padding: 6px 4px; min-height: 44px; font-size: 12px; }
.gym-rewards { color: var(--navy); }.gym-summary { text-align: center; }.gym-summary h3 { font: 23px var(--font-title); margin: 5px 0; }.gym-summary p { font-size: 14px; margin: 5px 0; }.gym-complete-note { display: block; margin-top: 10px; color: #795314; }
.gym-game button:focus-visible, .gym-event:focus-visible, .gym-field canvas:focus-visible { outline: 3px solid #d87542; outline-offset: 3px; }
@media(max-width: 760px) {
  #game:has(.gym-hub), #game:has(.gym-game), #game:has(.gym-summary) { width: 100%; }
  #game:has(.gym-game) .game-body, #game:has(.gym-hub) .game-body { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .gym-hub, .gym-game { gap: 7px; }.gym-event { gap: 8px; padding: 6px 8px; }.gym-event-record { font-size: 12px; }
  .gym-event-record small { max-width: 100px; white-space: normal; }.gym-event strong { font-size: 19px; }.gym-panorama { max-height: 196px; overflow: hidden; }
}
@media(max-width: 599px) and (max-height: 720px) {
  .gym-game { gap: 5px; }
  .gym-field { width: min(100%, 320px); }.gym-controls button { min-height: 44px; padding: 7px 10px; font-size: 19px; }.gym-message { font-size: 15px; }
  .gym-hud { padding: 5px 8px; }.gym-tools .btn { min-height: 44px; }.gym-help, .gym-rewards { font-size: 12px; }
}
@media(max-height: 500px) and (min-width: 600px) {
  .gym-game { max-width: 920px; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); column-gap: 14px; row-gap: 5px; }
.senior-card { grid-column: 1; grid-row: 1;}
  .gym-field { grid-column: 1; grid-row: 2 / 9; width: min(100%, 292px); align-self: start; }
  .gym-hud { grid-column: 2; grid-row: 1; padding: 5px 7px; font-size: 12px; }.gym-score { font-size: 14px; }
  .gym-message { grid-column: 2; grid-row: 2; font-size: 16px; }.gym-setup { grid-column: 2; grid-row: 3; flex-wrap: wrap; }
  .gym-curling-controls { grid-column: 2; grid-row: 3; gap: 9px; }.gym-controls { grid-column: 2; grid-row: 4; }.gym-controls button { min-height: 44px; font-size: 18px; padding: 6px; }
  .gym-controls button[data-action=left], .gym-controls button[data-action=right] { min-width: 52px; }
  .gym-help { grid-column: 2; grid-row: 5; }.gym-tools { grid-column: 2; grid-row: 6; }.gym-rewards { grid-column: 2; grid-row: 7; }
  .gym-tools .btn { min-height: 44px; }.gym-help, .gym-rewards { font-size: 12px; }
  .gym-hub { max-width: 900px; grid-template-columns: 1fr 1.2fr; }
.gym-hub .senior-card { grid-column: 1 / 3;}.gym-panorama { grid-column: 1; grid-row: 2; align-self: start; }.gym-events { grid-column: 2; grid-row: 2 / 4; gap: 5px; }.gym-event img { width: 32px; height: 32px; }.gym-event { padding: 4px 6px; }.gym-event strong { font-size: 17px; }.gym-trophy { grid-column: 1; grid-row: 3; padding: 4px; }.gym-trophy img { width: 32px; height: 32px; }.gym-trophy strong { font-size: 12px; }.gym-note { grid-column: 1 / 3; }
}
@media(prefers-reduced-motion: reduce) { .gym-controls button:active:not(:disabled), .gym-event:active { transform: none; } }
/* 상태는 한 칩으로 고정하고 트로피의 윤곽을 살린다. */
.gym-hub, .gym-game, .gym-summary { color-scheme: only light; }
.gym-event { min-height: 64px; }
.gym-event > img { flex: none; }
.gym-event strong { min-width: 0; }
.gym-event-record { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 60px; padding: 5px 7px; border: 1px solid #a4b4a6; background: #e8eee6; color: var(--navy); font-size: 12px; line-height: 1.4; border-radius: 4px; }
.gym-event-record.is-earned { background: #fff0bf; border-color: #b18a38; }
.gym-trophy { border: 2px solid var(--navy); border-left: 6px solid #b58b36; background: #fff8e2; box-shadow: 3px 3px 0 #d0c6a3; }
.gym-trophy > img { opacity: 1; flex: none; }
.gym-trophy.is-earned { border-color: #8b641b; background: #ffe6a0; }
.gym-tools .btn, .gym-setup .btn, .gym-overlay .btn { min-width: 44px; }
.gym-curling-controls input { min-height: 44px; cursor: pointer; }
.gym-curling-controls input:focus-visible { outline: 3px solid #d87542; outline-offset: 2px; }
