/* 메인 지도 영역 */
.map-stage {
  position: relative;
  flex: 1;
  background: var(--bg-map);
  overflow: hidden;
}

.map-legend {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.legend-caption {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-sub);
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-scale-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-scale-label.is-full {
  color: var(--text-main);
  font-weight: 700;
}

.legend-gradient-bar {
  width: 68px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E2E8F0 0%, #93C5FD 45%, #2563EB 100%);
}

.scoreboard-text {
  font-size: 20px;
  font-weight: 700;
  fill: #F8FAFC;
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.04em;
}

.landmark-text {
  font-size: 14px;
  font-weight: 700;
  fill: #64748B;
  text-anchor: middle;
  dominant-baseline: middle;
}

.landmark-text.is-dark {
  font-size: 12px;
  fill: #0F172A;
}

.landmark-text.is-station {
  font-size: 15px;
  fill: #334155;
}

.landmark-text.is-white {
  font-size: 11px;
  fill: #FFFFFF;
}

.exciting-text {
  font-size: 14px;
  font-weight: 700;
  fill: #FFFFFF;
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.04em;
}

.map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.stadium-svg {
  position: absolute;
  left: 12px;
  top: 46px;
  width: calc(100% - 24px);
  height: calc(100% - 62px);
  display: block;
  transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-stage.has-recent-dock .stadium-svg {
  height: calc(100% - 236px);
}

.field-hint-text {
  font-size: 11px;
  font-weight: 700;
  fill: rgba(255, 255, 255, 0.88);
  text-anchor: middle;
  dominant-baseline: middle;
  letter-spacing: 0.04em;
}

.field-hint-text.is-outfield {
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.16em;
}

/* 좌석 구역 SVG 스타일 */
.seat-zone-group {
  cursor: pointer;
  outline: none;
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.seat-zone-group:focus,
.seat-zone-group:focus-visible {
  outline: none;
}

.seat-zone-group:hover {
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.34)) brightness(1.06);
}

.seat-zone-group:active {
  opacity: 0.68;
}

.seat-zone-group.is-selected {
  opacity: 0.72;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.22));
}

.seat-zone {
  stroke: #FFFFFF;
  stroke-width: 2;
  transition: fill 0.28s ease;
}

/* 구역 라벨 (기본 전체화면에서는 숨김 -> 확대 시 부드럽게 표시) */
.labels-layer {
  opacity: 0;
  transition: opacity 0.22s ease;
}

.labels-layer.is-zoomed {
  opacity: 1;
}

.zone-label-pill {
  transition: opacity 0.18s ease;
}

.zone-pill-bg {
  fill: rgba(52, 52, 52, 0.78);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
  transition: fill 0.18s ease, opacity 0.18s ease;
}

.zone-pill-text {
  font-family: "Noto Sans KR", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  letter-spacing: -0.02em;
}

.zone-pill-name {
  fill: #FFFFFF;
  transition: fill 0.18s ease;
}

.zone-pill-count {
  fill: #34C759;
  transition: fill 0.18s ease;
}

.zone-pill-count.is-zero {
  fill: #A1A1AA;
}

.zone-label-pill.is-selected .zone-pill-bg {
  fill: rgba(51, 51, 51, 0.6);
}

/* 마우스 호버 시 나머지 구역 및 텍스트 일시적으로 흐릿하게 처리 */
#mapTransformGroup.has-hover .seat-zone-group:not(.is-hovered) {
  opacity: 0.26;
}

#mapTransformGroup.has-hover .zone-label-pill:not(.is-hovered) {
  opacity: 0.24;
}

.zone-label-pill.is-selected .zone-pill-name {
  fill: #CBD5E1;
}

/* 줌 컨트롤 */
.map-controls {
  position: absolute;
  left: 14px;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: bottom 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-stage.has-recent-dock .map-controls {
  bottom: 186px;
}

/* 최근 업로드 사진 미리보기 도크 (기본/최대 축소 시 표시) */
.recent-photos-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 176px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  max-height: 78%;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  padding: 0 0 14px;
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.22s ease,
              height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.recent-photos-dock.is-sheet-dragging {
  transition: none !important;
}

.map-stage.has-recent-dock .recent-photos-dock {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.recent-photos-dock.is-expanded {
  height: 76%;
  padding-bottom: 0;
  z-index: 14;
}

.dock-handle-area {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 9px 0 5px;
  cursor: ns-resize;
  touch-action: none;
}

.dock-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #D4D4D8;
  transition: background 0.15s ease, width 0.15s ease;
}

.dock-handle-area:hover .dock-handle {
  background: #A1A1AA;
  width: 46px;
}

.recent-photos-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 10px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.recent-photos-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}

.recent-photos-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.recent-photos-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.recent-photos-toggle-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.recent-photos-toggle-btn:hover {
  background: var(--primary-soft);
  color: var(--text-main);
}

.recent-photos-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 16px 2px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  cursor: grab;
  user-select: none;
}

.recent-photos-strip.is-dragging {
  cursor: grabbing;
}

.recent-photos-strip::-webkit-scrollbar {
  display: none;
}

.recent-photos-dock.is-expanded .recent-photos-strip {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 12px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
  padding: 4px 16px 84px;
  cursor: default;
}

@media (max-width: 350px) {
  .recent-photos-dock.is-expanded .recent-photos-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.recent-photo-card {
  flex: 0 0 124px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.recent-photos-dock.is-expanded .recent-photo-card {
  flex: initial;
  width: 100%;
}

.recent-photo-card:active {
  transform: scale(0.96);
}

.recent-photo-thumb {
  width: 124px;
  height: 82px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--primary-soft);
}

.recent-photos-dock.is-expanded .recent-photo-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
}

.recent-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}

.recent-photo-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px;
}

.recent-photo-seat {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-photo-user {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-photos-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 22px 16px;
}

.map-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease;
}

.map-ctrl-btn:active {
  transform: scale(0.94);
  background: #F1F5F9;
}

.map-ctrl-btn.is-reset {
  font-size: 15px;
}

/* 플로팅 '+' 버튼 */
.fab-upload {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 15;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease, bottom 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.map-stage.has-recent-dock .fab-upload {
  bottom: 186px;
}

.map-stage:has(.recent-photos-dock.is-expanded) .fab-upload {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.fab-upload:hover {
  background: var(--primary-hover);
}

.fab-upload:active {
  transform: scale(0.92);
}

