:root {
  --bg-twilight: rgba(20, 16, 36, 0.56);
  --bg-twilight-strong: rgba(24, 18, 42, 0.78);
  --border-warm: rgba(255, 179, 120, 0.28);
  --accent-amber: #ff8e42;
  --accent-coral: #ff5e62;
  --accent-gold: #ffd085;
  --text-main: #fff5ea;
  --text-sub: rgba(255, 228, 204, 0.78);
  --shadow-soft: 0 12px 32px rgba(9, 6, 20, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Pretendard', 'Noto Sans KR', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: linear-gradient(180deg, #1b1730 0%, #4b273c 55%, #b55449 100%);
  user-select: none;
  -webkit-user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  z-index: 1;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 3D 투영 네임태그 레이어 */
#labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.player-label {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 15, 34, 0.68);
  border: 1px solid rgba(255, 198, 146, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff4e8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-label.is-local {
  background: linear-gradient(135deg, rgba(255, 130, 67, 0.85), rgba(227, 81, 88, 0.85));
  border-color: rgba(255, 232, 198, 0.72);
  color: #ffffff;
}

.player-label.is-casting {
  border-color: #ffd085;
  box-shadow: 0 0 12px rgba(255, 184, 92, 0.55);
}

.player-label .seat-tag {
  font-size: 10px;
  opacity: 0.85;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

/* 캐릭터 머리 위 말풍선 ("다른곳에서 해주세요") */
.speech-bubble {
  position: absolute;
  transform: translate(-50%, -100%) scale(0.9);
  padding: 7px 13px;
  border-radius: 14px;
  background: rgba(255, 248, 240, 0.96);
  border: 1.5px solid #ff7d4d;
  color: #261824;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(10, 6, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 8;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #ff7d4d;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 248, 240, 0.96);
  z-index: 1;
}

.speech-bubble.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1);
  animation: bubblePop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bubblePop {
  0% {
    opacity: 0;
    transform: translate(-50%, -82%) scale(0.76);
  }
  65% {
    opacity: 1;
    transform: translate(-50%, -104%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

/* 캐릭터 머리 위 중앙 포획 어종 이름 배지 */
.catch-fish-name-badge {
  position: absolute;
  transform: translate(-50%, 0);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(16, 12, 28, 0.88);
  border: 1.5px solid rgba(255, 208, 133, 0.85);
  color: #fff5e6;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 9;
}

.catch-fish-name-badge[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .catch-fish-name-badge {
    padding: 3.5px 11px;
    font-size: 13px;
  }
}

/* HUD 공통 레이어 */
.hud-layer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
  padding: 18px 22px;
}

.glass-card {
  pointer-events: auto;
  background: linear-gradient(145deg, var(--bg-twilight-strong), var(--bg-twilight));
  border: 1px solid var(--border-warm);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

/* 상단 HUD */
#top-hud {
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.title-card {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 580px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 11px;
}

.title-icon {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(255, 142, 66, 0.5));
}

.title-card h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0.86;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 214, 175, 0.22);
  color: var(--text-main);
}

.badge-room {
  background: rgba(255, 142, 66, 0.22);
  border-color: rgba(255, 172, 108, 0.45);
  color: #ffe2c4;
}

.badge-count {
  background: rgba(93, 122, 201, 0.24);
  border-color: rgba(149, 177, 255, 0.36);
}

.badge-sound {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  justify-content: center;
  gap: 0;
  padding: 5px 8px;
  min-width: 30px;
  background: rgba(130, 140, 165, 0.18);
  border-color: rgba(205, 215, 235, 0.32);
  color: #dbe3f0;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.badge-sound:hover {
  background: rgba(255, 194, 128, 0.22);
  border-color: rgba(255, 214, 165, 0.56);
}

.badge-sound:active {
  transform: scale(0.95);
}

.badge-sound.is-muted {
  opacity: 0.88;
}

.badge-sound.is-active {
  background: linear-gradient(135deg, rgba(64, 186, 142, 0.34), rgba(52, 140, 210, 0.34));
  border-color: rgba(128, 240, 198, 0.65);
  color: #e6fff5;
  box-shadow: 0 0 12px rgba(72, 214, 162, 0.32);
}

.sound-toggle-icon {
  font-size: 13px;
  line-height: 1;
}

.vibration-toggle-icon {
  display: block;
  width: 1em;
  height: 1em;
}

.badge-vibration.is-active .vibration-off,
.badge-vibration.is-muted .vibration-lines {
  display: none;
}

.badge-rank {
  background: linear-gradient(135deg, rgba(255, 190, 72, 0.24), rgba(255, 132, 56, 0.22));
  border-color: rgba(255, 212, 118, 0.52);
  color: #ffeab3;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-timer {
  background: rgba(185, 118, 255, 0.18);
  border-color: rgba(215, 166, 255, 0.38);
  color: #f3dcff;
}

.badge-timer.is-ready {
  background: linear-gradient(135deg, rgba(255, 200, 75, 0.36), rgba(255, 115, 65, 0.36));
  border-color: rgba(255, 224, 130, 0.8);
  color: #fff3bd;
  box-shadow: 0 0 14px rgba(255, 198, 72, 0.45);
}

/* 다금바리 획득 중앙 상단 대형 축하 배너 */
.legendary-banner {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(48, 22, 18, 0.92), rgba(22, 16, 44, 0.94));
  border: 2px solid #ffd86f;
  color: #fff5c8;
  font-size: clamp(17px, 2.6vw, 25px);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.6),
    0 0 32px rgba(255, 204, 72, 0.65);
  animation: bannerCelebrate 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.legendary-banner[hidden] {
  display: none;
}

.banner-crown {
  font-size: 1.2em;
}

@keyframes bannerCelebrate {
  0% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.86);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* 물고기 획득 결과 카드 */
.catch-card {
  position: fixed;
  right: 22px;
  bottom: 108px;
  z-index: 16;
  width: 248px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: toastIn 0.28s ease forwards;
}

.catch-card[hidden],
#catch-result-card[hidden] {
  display: none !important;
}

.catch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.catch-species {
  font-size: 16px;
  font-weight: 800;
  color: #fff6ec;
}

.tier-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  color: #ffffff;
}

.tier-1 { background: #5a7a8c; }
.tier-2 { background: #3e8e6e; }
.tier-3 { background: #3b72cc; }
.tier-4 { background: #8e4ec6; }
.tier-5 { background: #e06d32; }
.tier-6 {
  background: linear-gradient(135deg, #f6b93b, #e55039);
  box-shadow: 0 0 12px rgba(246, 185, 59, 0.7);
}

.catch-preview-wrap {
  width: 100%;
  height: 132px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 45%, rgba(62, 74, 108, 0.65), rgba(16, 14, 30, 0.9));
  border: 1px solid rgba(255, 214, 175, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.catch-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  border-radius: 10px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
}

.catch-species-caption {
  font-size: 16px;
  font-weight: 800;
  color: #ffe8c8;
  text-align: center;
  letter-spacing: -0.01em;
}

.catch-meta {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

/* 우측 보조 컨트롤 */
.control-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 205px;
}

.btn-secondary {
  appearance: none;
  border: 1px solid rgba(255, 205, 165, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 162, 102, 0.22);
  border-color: rgba(255, 189, 132, 0.55);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 토스트 알림 */
#toast-container {
  position: fixed;
  top: 124px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(24, 17, 39, 0.84);
  border: 1px solid rgba(255, 186, 126, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff2e3;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.28s ease forwards;
}

.toast.fade-out {
  animation: toastOut 0.35s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

/* 하단 메인 컨트롤 바 */
#bottom-ui {
  bottom: 0;
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
}

.action-bar {
  padding: 10px 14px 10px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-cast {
  appearance: none;
  border: 1px solid rgba(255, 227, 194, 0.55);
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-coral));
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  box-shadow:
    0 8px 22px rgba(255, 102, 74, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-cast:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 12px 28px rgba(255, 102, 74, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-cast:active:not(:disabled),
.btn-cast.is-charging {
  transform: translateY(1px) scale(0.97);
}

.btn-cast.is-charging {
  box-shadow:
    0 0 24px rgba(255, 178, 92, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: chargeBtnPulse 0.7s ease-in-out infinite;
}

.btn-cast.is-biting {
  background: linear-gradient(135deg, #2ecc71, #f39c12);
  border-color: rgba(255, 246, 178, 0.9);
  box-shadow:
    0 0 28px rgba(72, 235, 154, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: biteBtnPulse 0.45s ease-in-out infinite alternate;
}

@keyframes biteBtnPulse {
  from {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(72, 235, 154, 0.65);
  }
  to {
    transform: scale(1.05);
    box-shadow: 0 0 32px rgba(255, 214, 72, 0.95);
  }
}

.btn-cast.is-cooldown,
.btn-cast:disabled {
  background: linear-gradient(135deg, rgba(110, 92, 108, 0.7), rgba(74, 61, 82, 0.8));
  border-color: rgba(255, 214, 180, 0.22);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}

.btn-cast-icon {
  font-size: 18px;
  line-height: 1;
}

/* 파워 게이지 UI */
.power-gauge-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 148px;
  padding: 2px 4px;
}

.power-gauge-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(14, 10, 26, 0.65);
  border: 1px solid rgba(255, 208, 158, 0.26);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.power-gauge-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd085 0%, #ff8e42 52%, #ff4b4b 100%);
  box-shadow: 0 0 10px rgba(255, 142, 66, 0.6);
  transition: width 0.04s linear;
}

.power-gauge-container.is-charging .power-gauge-fill {
  animation: chargeBarGlow 0.55s ease-in-out infinite alternate;
}

.power-gauge-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-gold);
  text-align: center;
  letter-spacing: -0.01em;
}

@keyframes chargeBtnPulse {
  0%, 100% {
    filter: brightness(1.0);
  }
  50% {
    filter: brightness(1.16);
  }
}

@keyframes chargeBarGlow {
  from {
    box-shadow: 0 0 8px rgba(255, 168, 92, 0.55);
  }
  to {
    box-shadow: 0 0 16px rgba(255, 86, 74, 0.95);
  }
}

/* 체력(Stamina) 게이지 UI (우측 상단 '내 어항 보기' 바로 아래) */
.stamina-gauge-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 180px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(10, 14, 26, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.stamina-gauge-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(14, 10, 26, 0.65);
  border: 1px solid rgba(132, 235, 178, 0.32);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
}

.stamina-gauge-fill {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%);
  box-shadow: 0 0 10px rgba(56, 239, 125, 0.55);
  transition: width 0.12s linear, background 0.25s ease;
}

.stamina-gauge-fill.is-low {
  background: linear-gradient(90deg, #ff9966 0%, #ff5e62 100%);
  box-shadow: 0 0 10px rgba(255, 94, 98, 0.75);
}

.stamina-gauge-fill.is-recovering {
  background: linear-gradient(90deg, #56ccf2 0%, #38ef7d 100%);
  box-shadow: 0 0 14px rgba(86, 204, 242, 0.85);
}

.stamina-gauge-fill.is-fainted {
  width: 100% !important;
  opacity: 0.52;
  background: linear-gradient(90deg, #ff385c 0%, #b31237 100%);
  box-shadow: 0 0 14px rgba(255, 56, 92, 0.9);
  animation: faintedPulse 0.65s ease-in-out infinite alternate;
}

@keyframes faintedPulse {
  from {
    opacity: 0.32;
  }
  to {
    opacity: 0.82;
  }
}

.stamina-gauge-label {
  font-size: 11px;
  font-weight: 700;
  color: #b8f5d0;
  text-align: center;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.stamina-gauge-label.is-fainted {
  color: #ff8a9e;
  font-weight: 800;
}

/* '앉아서 쉬기' 버튼 (우측 상단 체력 게이지 바로 아래) */
.btn-sit {
  appearance: none;
  border: 1px solid rgba(164, 232, 205, 0.48);
  background: linear-gradient(135deg, rgba(46, 134, 112, 0.88), rgba(32, 88, 108, 0.88));
  color: #f2fff9;
  border-radius: 12px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  box-shadow: 0 6px 18px rgba(18, 64, 58, 0.42);
  transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.btn-sit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-sit.is-sitting {
  background: linear-gradient(135deg, #26a69a, #2ecc71);
  border-color: rgba(220, 255, 236, 0.9);
  box-shadow: 0 0 22px rgba(46, 204, 113, 0.75);
}

.btn-sit.is-fainted {
  background: linear-gradient(135deg, rgba(168, 36, 62, 0.85), rgba(102, 20, 42, 0.9));
  border-color: rgba(255, 138, 158, 0.65);
  color: #ffd9e0;
}

.btn-sit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sit-icon {
  font-size: 15px;
  line-height: 1;
}

/* '내 어항 보기' 버튼 & 배지 */
.btn-aquarium {
  justify-content: space-between;
  background: rgba(74, 152, 224, 0.18);
  border-color: rgba(132, 206, 255, 0.42);
}

.btn-aquarium:hover:not(:disabled) {
  background: rgba(84, 172, 245, 0.3);
  border-color: rgba(164, 224, 255, 0.72);
}

.aquarium-count-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(18, 28, 52, 0.75);
  border: 1px solid rgba(154, 220, 255, 0.42);
  color: #bce6ff;
}

/* 십자(+) 모양 챔질 파이팅 미니게임 오버레이 — 화면 하단 중앙 배치 & 완전 투명 컨테이너 */
body.is-minigame-active #bottom-ui {
  opacity: 0;
  pointer-events: none;
}

.minigame-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px max(16px, env(safe-area-inset-bottom));
  background: transparent;
  pointer-events: none;
}

.minigame-overlay[hidden] {
  display: none;
}

.minigame-panel {
  --cross-board-size: 216px;
  pointer-events: auto;
  width: var(--cross-board-size);
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.minigame-header,
.minigame-title,
.minigame-fish-hint,
.minigame-hold-text,
.minigame-dir-hint {
  display: none !important;
}

.minigame-hold-wrap {
  width: var(--cross-board-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

.minigame-hold-track {
  width: var(--cross-board-size);
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 10, 26, 0.52);
  border: 1px solid rgba(255, 230, 110, 0.55);
  overflow: hidden;
}

.minigame-hold-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd04d 0%, #6ef3a5 100%);
  box-shadow: 0 0 12px rgba(255, 224, 96, 0.7);
  transition: width 0.04s linear;
}

.cross-gauge-board {
  position: relative;
  width: var(--cross-board-size);
  height: var(--cross-board-size);
  margin: 0 auto;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  touch-action: none;
  user-select: none;
}

.cross-arm {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 92, 54, 0.25);
  pointer-events: none;
}

.cross-arm-h {
  width: calc(var(--cross-board-size) - 26px);
  height: 28px;
  background: linear-gradient(90deg, #ff1e1e 0%, #ff6b2b 25%, #ffe64d 50%, #ff6b2b 75%, #ff1e1e 100%);
  border: 1px solid rgba(255, 232, 168, 0.42);
}

.cross-arm-v {
  width: 28px;
  height: calc(var(--cross-board-size) - 26px);
  background: linear-gradient(180deg, #ff1e1e 0%, #ff6b2b 25%, #ffe64d 50%, #ff6b2b 75%, #ff1e1e 100%);
  border: 1px solid rgba(255, 232, 168, 0.42);
}

.cross-center-zone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 120, 0.52) 0%, rgba(255, 230, 77, 0.14) 70%, transparent 100%);
  border: 2px dashed rgba(255, 244, 150, 0.92);
  box-shadow: 0 0 20px rgba(255, 230, 77, 0.55);
  pointer-events: none;
  z-index: 2;
}

.cross-dir-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1.5px solid rgba(255, 230, 210, 0.65);
  background: rgba(24, 16, 38, 0.78);
  color: #fff3e6;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.48);
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cross-dir-up {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.cross-dir-down {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.cross-dir-left {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.cross-dir-right {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.cross-dir-btn.is-recommended {
  border-color: #74f2b5;
  background: rgba(24, 88, 66, 0.88);
  color: #d8ffeb;
  box-shadow: 0 0 18px rgba(116, 242, 181, 0.65);
}

.cross-dir-btn.is-active {
  background: linear-gradient(135deg, #ffbe4d, #ff6c42);
  border-color: #fff6c8;
  color: #1f1210;
  box-shadow: 0 0 22px rgba(255, 206, 92, 0.9);
}

.cross-dir-up.is-active,
.cross-dir-down.is-active {
  transform: translateX(-50%) scale(0.93);
}

.cross-dir-left.is-active,
.cross-dir-right.is-active {
  transform: translateY(-50%) scale(0.93);
}

.cross-fish-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #ffd685 60%, #ff8242 100%);
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 18px rgba(255, 224, 130, 0.95), 0 4px 12px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
}

.cross-fish-marker.in-center {
  box-shadow: 0 0 22px rgba(110, 243, 165, 0.95), 0 4px 12px rgba(0, 0, 0, 0.65);
  border-color: #9effcc;
}

/* '내 어항 보기' 인벤토리 팝업 모달 */
.aquarium-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 7, 20, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.aquarium-modal[hidden] {
  display: none;
}

.aquarium-dialog {
  width: min(94vw, 760px);
  max-height: 84vh;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1.5px solid rgba(145, 214, 255, 0.4);
}

.aquarium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 224, 190, 0.16);
  padding-bottom: 12px;
}

.aquarium-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #fff6ea;
}

.aquarium-summary {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #b4e2ff;
  font-weight: 600;
}

.btn-close-modal {
  padding: 7px 14px;
  flex-shrink: 0;
}

.aquarium-empty {
  padding: 42px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-sub);
  background: rgba(14, 12, 28, 0.45);
  border: 1px dashed rgba(255, 214, 175, 0.25);
  border-radius: 14px;
}

.aquarium-empty[hidden] {
  display: none;
}

.aquarium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.aquarium-item-card {
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(28, 34, 58, 0.85), rgba(16, 18, 34, 0.92));
  border: 1px solid rgba(175, 216, 255, 0.24);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

.aquarium-img-wrap {
  width: 100%;
  height: 104px;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(62, 82, 118, 0.62), rgba(12, 14, 28, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.aquarium-fish-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  border-radius: 9px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.aquarium-item-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.aquarium-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.aquarium-item-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff6ec;
}

.aquarium-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-sub);
}

.aquarium-photo-credit {
  cursor: default;
  font-size: 9px;
  color: #a6afbd;
  text-decoration: none;
}

.aquarium-credits-link {
  align-self: flex-start;
  font-size: 11px;
  color: #a6afbd;
}

.aquarium-credits-link:hover,
.aquarium-credits-link:focus-visible {
  color: #e4ecf5;
  text-decoration: underline;
}

.aquarium-count-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(114, 216, 255, 0.18);
  border: 1px solid rgba(114, 216, 255, 0.42);
  color: #ccefff;
  font-weight: 700;
}

@media (max-width: 768px) {
  .hud-layer {
    padding: 6px 8px;
  }
  #top-hud {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
  }
  .title-card {
    width: auto;
    max-width: 48vw;
    margin: 0;
    padding: 5px 8px;
    gap: 4px;
    border-radius: 10px;
  }
  .title-row {
    gap: 5px;
  }
  .title-icon {
    font-size: 13px;
  }
  .title-card h1 {
    font-size: 11px;
    line-height: 1.15;
  }
  .subtitle {
    display: none;
  }
  .badges-row {
    gap: 3px;
  }
  .badge {
    padding: 2px 6px;
    font-size: 9.5px;
    gap: 3px;
  }
  .badge-sound {
    padding: 2px 5px;
    min-width: 22px;
  }
  .sound-toggle-icon {
    font-size: 10px;
  }
  .badge-rank {
    max-width: 48vw;
  }
  #sim-panel.control-panel,
  .control-panel {
    width: auto;
    min-width: 118px;
    max-width: 46vw;
    padding: 5px 7px;
    gap: 4px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
  }
  .btn-secondary {
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 7px;
    gap: 4px;
  }
  .aquarium-count-pill {
    padding: 1px 5px;
    font-size: 9px;
  }
  .stamina-gauge-container {
    min-width: 0;
    padding: 3px 6px;
    gap: 2px;
    border-radius: 7px;
  }
  .stamina-gauge-track {
    height: 5px;
  }
  .stamina-gauge-label {
    font-size: 8.5px;
  }
  .btn-sit {
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 7px;
    gap: 4px;
  }
  .btn-sit-icon {
    font-size: 11px;
  }
  .legendary-banner {
    top: 66px;
    padding: 8px 14px;
    font-size: 13.5px;
    gap: 6px;
  }
  #toast-container {
    top: auto;
    bottom: 62px;
    width: min(90vw, 340px);
  }
  .toast {
    font-size: 11px;
    padding: 6px 12px;
    text-align: center;
  }
  .catch-card {
    right: 8px;
    left: 8px;
    bottom: max(68px, calc(60px + env(safe-area-inset-bottom)));
    width: auto;
    max-width: min(86vw, 240px);
    margin: 0 auto;
    padding: 9px 10px;
    gap: 6px;
  }
  .catch-species {
    font-size: 14px;
  }
  .catch-preview-wrap {
    height: 104px;
  }
  .catch-species-caption {
    font-size: 14px;
  }
  .catch-meta {
    font-size: 11px;
  }
  #bottom-ui {
    padding: 0 8px max(6px, env(safe-area-inset-bottom));
  }
  .action-bar {
    flex-direction: row;
    border-radius: 999px;
    padding: 5px 9px;
    gap: 7px;
    width: auto;
    max-width: min(94vw, 310px);
  }
  .power-gauge-container {
    min-width: 92px;
    width: auto;
    gap: 2px;
    padding: 1px 2px;
  }
  .power-gauge-track {
    height: 6px;
  }
  .power-gauge-label {
    font-size: 9px;
  }
  .btn-cast {
    width: auto;
    justify-content: center;
    padding: 6px 12px;
    font-size: 11px;
    gap: 4px;
  }
  .btn-cast-icon {
    font-size: 12px;
  }
  .minigame-overlay {
    padding: 0 12px max(16px, env(safe-area-inset-bottom));
  }
  .minigame-panel {
    --cross-board-size: 182px;
    padding: 0;
    gap: 6px;
  }
  .minigame-hold-track {
    height: 8px;
  }
  .cross-arm-h {
    width: calc(var(--cross-board-size) - 22px);
    height: 24px;
  }
  .cross-arm-v {
    width: 24px;
    height: calc(var(--cross-board-size) - 22px);
  }
  .cross-center-zone {
    width: 46px;
    height: 46px;
  }
  .cross-dir-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
    border-radius: 11px;
  }
  .cross-fish-marker {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .hud-layer {
    padding: 5px 6px;
  }
  .title-card {
    max-width: 49vw;
    padding: 4px 7px;
    gap: 3px;
  }
  .title-icon {
    font-size: 12px;
  }
  .title-card h1 {
    font-size: 10.5px;
  }
  .badge {
    padding: 2px 5px;
    font-size: 9px;
  }
  .badge-sound {
    padding: 2px 4px;
    min-width: 20px;
  }
  .badge-rank {
    max-width: 44vw;
  }
  #sim-panel.control-panel,
  .control-panel {
    min-width: 110px;
    max-width: 47vw;
    padding: 4px 6px;
    gap: 3px;
  }
  .btn-secondary,
  .btn-sit {
    padding: 3.5px 6px;
    font-size: 9.5px;
  }
  .minigame-panel {
    --cross-board-size: 166px;
  }
  .cross-arm-h {
    width: calc(var(--cross-board-size) - 20px);
    height: 22px;
  }
  .cross-arm-v {
    width: 22px;
    height: calc(var(--cross-board-size) - 20px);
  }
  .cross-center-zone {
    width: 42px;
    height: 42px;
  }
  .cross-dir-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: 10px;
  }
  .cross-fish-marker {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

/* ============================================================================
 * 메인 로비 화면 & 3D 한반도 전체 지도 / 안면도 닭섬 마커 & 인게임 UI 트랜지션
 * ============================================================================ */
#top-hud,
#bottom-ui,
#labels-layer {
  transition: opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1), transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-in-lobby #top-hud,
body.is-in-lobby #bottom-ui,
body.is-in-lobby #labels-layer,
body.is-in-lobby #catch-result-card,
body.is-in-lobby #legendary-banner {
  opacity: 0 !important;
  pointer-events: none !important;
}

.btn-exit-map {
  background: linear-gradient(135deg, rgba(64, 126, 178, 0.32), rgba(40, 74, 126, 0.38));
  border-color: rgba(154, 214, 255, 0.42);
  color: #e6f4ff;
  font-size: 12px;
  padding: 6px 10px;
}

.btn-exit-map:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(84, 152, 214, 0.44), rgba(52, 96, 158, 0.48));
  border-color: rgba(182, 228, 255, 0.68);
}

.main-lobby-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 138, 86, 0.28), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(44, 108, 152, 0.25), transparent 52%),
    linear-gradient(175deg, #121024 0%, #241936 46%, #3f2238 80%, #63313c 100%);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.65s ease, transform 0.65s ease, visibility 0.65s ease;
}

.main-lobby-overlay.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
  visibility: hidden;
}

.main-lobby-overlay[hidden] {
  display: none;
}

.lobby-backdrop-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 68% 42% at 50% 62%, rgba(56, 148, 198, 0.16), transparent 70%);
  pointer-events: none;
}

.lobby-inner {
  position: relative;
  z-index: 2;
  width: min(94vw, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.lobby-copy-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
}

.lobby-copy-line {
  margin: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 18px rgba(8, 6, 18, 0.72);
}

.lobby-copy-main {
  font-size: 31px;
  font-weight: 800;
  color: #fff8eb;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-shadow:
    0 4px 20px rgba(0, 0, 0, 0.75),
    0 0 28px rgba(255, 180, 95, 0.34);
}

.lobby-copy-mid {
  font-size: 15.5px;
  font-weight: 500;
  color: rgba(232, 240, 252, 0.88);
  letter-spacing: 0.06em;
  line-height: 1.45;
}

.lobby-copy-sub {
  font-size: 16.5px;
  font-weight: 600;
  color: rgba(255, 228, 198, 0.92);
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.lobby-title-accent {
  background: linear-gradient(120deg, #ffd085 0%, #ff8e52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lobby-map-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  /* 지도 내부 확대 배율 (카드 각도는 그대로, 지도 그래픽만 하단 기준으로 확대) */
  --map-zoom: 1.4;
  padding-top: 40px; /* 확대된 북한 상단이 제목 문구와 겹치지 않도록 여유 확보 */
  perspective: 1100px;
}

.korea-3d-map-card {
  position: relative;
  width: min(88vw, 390px);
  aspect-ratio: 340 / 370; 
  height: min(60vh, 440px);
  min-height: 340px;
  border-radius: 26px;
  background: transparent;
  border: none;
  box-shadow: none;
  margin-top: 55px;
  transform-style: preserve-3d;
  transform: rotateX(20deg) rotateZ(-2.5deg);
  transition: transform 0.35s ease;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.korea-3d-map-card:hover {
  transform: rotateX(15deg) rotateZ(-1deg) translateY(-3px);
  box-shadow: none;
}

.korea-sea-grid {
  position: absolute;
  inset: 0;
  border-radius: 25px;
  background-image:
    linear-gradient(to right, rgba(132, 206, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(132, 206, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.korea-compass {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  font-weight: 800;
  color: rgba(188, 230, 255, 0.76);
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(12, 22, 42, 0.65);
  border: 1px solid rgba(154, 214, 255, 0.26);
  pointer-events: none;
}

.korea-sea-label {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  color: rgba(172, 220, 255, 0.58);
  letter-spacing: 0.04em;
  pointer-events: none;
}

.korea-sea-west {
  left: 4%;
  top: 53%;
}

.korea-sea-east {
  right: 5%;
  top: 28%;
}

.korea-sea-south {
  left: 62%;
  top: 76%;
}

.korea-island-tag {
  position: absolute;
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(196, 234, 255, 0.68);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.korea-tag-jeju {
  left: 19.5%;
  bottom: 6.2%;
}

.korea-tag-ulleung {
  right: 4%;
  top: 41%;
}

.korea-3d-relief-wrap {
  position: relative;
  height: 92%;
  aspect-ratio: 360 / 520;
  width: auto;
  max-width: 88%;
  transform-style: preserve-3d;
  /* 하단(남한) 기준 확대: 남한은 카드를 채우고 북한은 위로 밀려 올라감 */
  transform-origin: 50% 100%;
  transform: scale(var(--map-zoom));
}

.korea-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.korea-map-extrude-2 {
  transform: translate3d(6px, 13px, -18px);
  fill: #07111a;
  opacity: 0.88;
  filter: blur(2px);
}

.korea-map-extrude-1 {
  transform: translate3d(3px, 6.5px, -9px);
  fill: #15313e;
  stroke: rgba(114, 188, 198, 0.34);
  stroke-width: 1.2;
}

.korea-map-surface {
  transform: translate3d(0, 0, 8px);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
}

.korea-land-path {
  stroke: #a0ede0;
  stroke-width: 1.75;
  stroke-linejoin: round;
}

.korea-contour-line {
  stroke: rgba(255, 226, 178, 0.4);
  stroke-width: 1.4;
  stroke-dasharray: 4 3;
}

.korea-river-line {
  stroke: rgba(124, 212, 255, 0.34);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.korea-dmz-line {
  stroke: rgba(255, 168, 148, 0.48);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}

.dakseom-map-marker {
  position: absolute;
  left: 32.6%;
  top: 63.7%;
  /* 래퍼 확대(--map-zoom)를 상쇄해 마커 크기는 그대로 유지 (위치 %는 확대된 지도와 함께 이동) */
  transform: translate(-50%, -50%) translateZ(28px) scale(calc(1 / var(--map-zoom)));
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.marker-label-card {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 9px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 138, 66, 0.95), rgba(226, 76, 82, 0.95));
  border: 1.5px solid rgba(255, 240, 206, 0.9);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(255, 138, 66, 0.45);
  white-space: nowrap;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.marker-spot-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.marker-spot-action {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff0d4;
  opacity: 0.95;
}

.dakseom-map-marker:hover .marker-label-card,
.dakseom-map-marker:focus-visible .marker-label-card {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.dakseom-map-marker:active .marker-label-card {
  transform: scale(0.97);
}

.lobby-footer-info-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 22px;
}

@media (max-width: 768px) {
  .btn-exit-map {
    padding: 4px 7px;
    font-size: 9.5px;
  }
  .lobby-inner {
    gap: 12px;
  }
  .lobby-copy-main {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .lobby-copy-mid {
    font-size: 13px;
  }
  .lobby-copy-sub {
    font-size: 14px;
  }
  .korea-3d-map-card {
    width: min(88vw, 310px);
    height: min(52vh, 390px);
    min-height: 290px;
    border-radius: 20px;
    transform: rotateX(16deg) rotateZ(-2deg);
  }
  .marker-label-card {
    right: auto;
    left: auto;
    padding: 5px 8px;
    border-radius: 5px;
  }
  .marker-spot-name {
    font-size: 11.5px;
  }
  .marker-spot-action {
    font-size: 9.5px;
  }
  .korea-island-tag {
    font-size: 8.5px;
  }
  .korea-tag-jeju {
    left: 14.5%;
    bottom: 5.8%;
  }
 .lobby-footer-info-wrap {
    margin-top: 14px;
  }
}

@media (max-width: 480px) {
  .lobby-copy-main {
    font-size: 19.5px;
    margin-bottom: 3px;
  }
  .lobby-copy-mid {
    font-size: 12px;
  }
  .lobby-copy-sub {
    font-size: 13px;
  }
  .korea-3d-map-card {
    width: min(88vw, 276px);
    height: min(49vh, 348px);
    min-height: 265px;
  }
  .korea-sea-label {
    font-size: 9.5px;
  }
}


/* Dongho: SVG east-coast point near (208, 259), same marker design and zoom.
   The existing relief map is illustrative, not a georeferenced GIS map. */
.dongho-map-marker {
  left: 59.44%; top: 49.81%;
  transform-origin: left center;
  transform: translateY(-50%) translateZ(28px) scale(calc(1 / var(--map-zoom)));
}
@media (max-width: 768px) {
  .dongho-map-marker {
    transform-origin: center center;
    transform: translate(-32%, -50%) translateZ(28px) scale(calc(1 / var(--map-zoom)));
  }
}
.fish-photo-credit { display: block; color: #d8cfba; font-size: 9px; line-height: 1.3; padding: 3px 8px; overflow-wrap: anywhere; }


/* Catch / name overlays: keep the fishing pose and water unobstructed. */
.player-label { font-size: 10px; padding: 2px 6px; background: rgba(19,15,34,.35); border-color: rgba(255,198,146,.18); box-shadow: none; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); pointer-events: none; }
.player-label.is-local { background: rgba(120,65,48,.4); border-color: rgba(255,232,198,.3); }
.player-label.is-casting { box-shadow: none; }
.player-label.is-fishing { font-size: 9px; padding: 1px 5px; background: rgba(19,15,34,.28); }
.player-label.is-distant { font-size: 8px; }
.catch-announce-badge {
  position: absolute;
  transform: translate(-50%, -100%) translateY(6px) scale(0.92);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(20, 14, 34, 0.84);
  border: 1px solid rgba(255, 208, 133, 0.78);
  color: #fff3dc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(8, 5, 18, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 6;
}
.catch-announce-badge.is-visible {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0) scale(1);
}
@media (max-width: 768px) {
  .catch-announce-badge {
    font-size: 11px;
    padding: 4px 9px;
  }
}
.badge-net-status[hidden] {
  display: none !important;
}
.badge-net-status {
  background: rgba(255, 178, 72, 0.24);
  border-color: rgba(255, 204, 112, 0.62);
  color: #ffe8b8;
  font-size: 10.5px;
  font-weight: 700;
}
.badge-net-status.is-offline {
  background: rgba(235, 86, 86, 0.26);
  border-color: rgba(255, 134, 134, 0.65);
  color: #ffd8d8;
}
.fish-photo-credit { display: none !important; }
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  #catch-result-card:not([hidden]) { display: block; width: 180px; padding: 8px 10px; }
  .catch-preview-wrap, #catch-species-caption { display: none !important; }
}


/* All map labels have their final position before game scripts initialize. */
.geumjin-map-marker { left: 42.5%; top: 81.9230769231%; }
.geomeunyeo-map-marker { left: 41.5%; top: 98.4%; }

/* 메인지도 오른쪽 아래 최소 하단 링크(개인정보처리방침 · 문의) */
.lobby-bottom-links {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.lobby-bottom-sep {
  color: rgba(186, 196, 212, 0.52);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.lobby-privacy-link,
.lobby-inquiry-btn {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  margin: 0;
  padding: 6px 4px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(196, 205, 220, 0.76);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: color 0.16s ease;
}

.lobby-privacy-link:hover,
.lobby-privacy-link:focus-visible,
.lobby-inquiry-btn:hover,
.lobby-inquiry-btn:focus-visible {
  color: rgba(236, 240, 248, 0.96);
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

.lobby-privacy-link:active,
.lobby-inquiry-btn:active {
  color: rgba(236, 240, 248, 0.96);
}

.inquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 7, 20, 0.64);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  touch-action: auto;
}

.inquiry-modal[hidden] {
  display: none !important;
}

.inquiry-dialog {
  width: min(100%, 340px);
  max-width: calc(100vw - 32px);
  padding: 18px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: left;
  border: 1px solid rgba(255, 204, 150, 0.38);
  box-shadow: 0 18px 40px rgba(6, 4, 16, 0.62);
}

.inquiry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inquiry-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #fff6ea;
}

.inquiry-close-x {
  padding: 4px 9px;
  min-width: 30px;
  font-size: 13px;
  line-height: 1.2;
}

.inquiry-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 234, 214, 0.88);
  overflow-wrap: anywhere;
}

.inquiry-email-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 165, 0.38);
  background: rgba(12, 10, 26, 0.78);
  color: #fff8ee;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  outline: none;
}

.inquiry-email-input:focus {
  border-color: rgba(255, 208, 133, 0.82);
}

.inquiry-copy-status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  color: transparent;
}

.inquiry-copy-status.is-success {
  color: #9effc7;
}

.inquiry-copy-status.is-fallback {
  color: #ffd699;
}

.inquiry-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inquiry-btn-copy {
  flex: 1 1 160px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 138, 66, 0.34), rgba(226, 76, 82, 0.34));
  border-color: rgba(255, 198, 138, 0.56);
  color: #fff8ef;
}

.inquiry-btn-close {
  flex: 0 0 auto;
  padding: 9px 14px;
  font-size: 13px;
}

@media (max-width: 768px) {
  .lobby-bottom-links {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(4px, env(safe-area-inset-bottom));
    gap: 1px;
  }

  .lobby-bottom-sep {
    font-size: 10px;
  }

  .lobby-privacy-link,
  .lobby-inquiry-btn {
    padding: 8px 4px;
    min-height: 32px;
    font-size: 10px;
  }

  .inquiry-dialog {
    padding: 15px;
    gap: 10px;
  }

  .inquiry-email-input {
    font-size: 13px;
    padding: 9px 10px;
  }
}

/* ============================================================================
 * 포인트별 기록관 (TOP 5 대어 점수 랭킹 + 하단 광고 예정 영역)
 * ============================================================================ */
.archivist-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(8, 10, 22, 0.68);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.archivist-modal[hidden] {
  display: none;
}

.archivist-dialog {
  box-sizing: border-box;
  width: min(92vw, 860px);
  height: min(84vh, 720px);
  height: min(84dvh, 720px);
  min-height: 0;
  max-height: min(90vh, 840px);
  max-height: min(90dvh, 840px);
  padding: 24px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 206, 128, 0.44);
  background: linear-gradient(165deg, rgba(22, 22, 40, 0.94), rgba(14, 15, 29, 0.96));
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.56);
}

.archivist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 214, 152, 0.2);
  padding-bottom: 13px;
  flex-shrink: 0;
}

.archivist-title-wrap {
  min-width: 0;
}

.archivist-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff6e4;
  letter-spacing: -0.01em;
}

.archivist-subtitle {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffd89b;
  line-height: 1.35;
}

.archivist-close-btn {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
  border-color: rgba(255, 214, 152, 0.44);
}

.archivist-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.archivist-scope-note {
  font-size: 12.5px;
  color: #c8d3e4;
}

.archivist-status-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffe3b3;
  background: rgba(255, 198, 108, 0.14);
  border: 1px solid rgba(255, 206, 128, 0.34);
}

.archivist-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.archivist-empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px;
  text-align: center;
  font-size: 15px;
  line-height: 1.7;
  color: #cfd7e6;
  background: rgba(14, 16, 32, 0.56);
  border: 1px dashed rgba(255, 208, 138, 0.28);
  border-radius: 14px;
}

.archivist-empty[hidden] {
  display: none;
}

.archivist-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archivist-rank-item {
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(31, 35, 58, 0.86), rgba(18, 20, 36, 0.92));
  border: 1px solid rgba(255, 224, 178, 0.18);
}

.archivist-rank-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.archivist-rank-item.is-self {
  background: linear-gradient(155deg, rgba(34, 74, 104, 0.92), rgba(19, 42, 66, 0.96));
  border-color: rgba(114, 226, 255, 0.78);
  box-shadow: inset 4px 0 0 #6be6ff, 0 0 16px rgba(84, 206, 255, 0.22);
}

.archivist-rank-badge {
  width: 44px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef8;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.archivist-row-sep {
  color: rgba(255, 226, 180, 0.32);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

.archivist-rank-badge.rank-1 {
  background: linear-gradient(135deg, rgba(255, 208, 72, 0.34), rgba(245, 148, 36, 0.28));
  border-color: rgba(255, 222, 118, 0.72);
  color: #fff2b8;
}

.archivist-rank-badge.rank-2 {
  background: linear-gradient(135deg, rgba(210, 222, 240, 0.28), rgba(145, 162, 188, 0.22));
  border-color: rgba(220, 232, 250, 0.56);
  color: #edf5ff;
}

.archivist-rank-badge.rank-3 {
  background: linear-gradient(135deg, rgba(226, 152, 98, 0.30), rgba(164, 96, 56, 0.22));
  border-color: rgba(235, 172, 124, 0.54);
  color: #ffe2cc;
}

.archivist-angler-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.archivist-angler-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff8ee;
  line-height: 1.3;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.archivist-self-pill {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
  color: #dff8ff;
  background: rgba(68, 198, 255, 0.28);
  border: 1px solid rgba(128, 232, 255, 0.68);
}

.archivist-species-chips {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 226, 180, 0.24);
}

.archivist-species-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.archivist-species-chip.tier-6 {
  background: rgba(245, 176, 39, 0.2);
  border-color: rgba(245, 198, 86, 0.56);
  color: #ffe8a6;
}

.archivist-species-chip.tier-5 {
  background: rgba(224, 109, 50, 0.2);
  border-color: rgba(240, 140, 84, 0.52);
  color: #ffd8c2;
}

.archivist-species-chip.tier-4 {
  background: rgba(142, 78, 198, 0.22);
  border-color: rgba(182, 128, 232, 0.5);
  color: #ebd6ff;
}

.archivist-self-summary {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #d6f3ff;
  background: rgba(44, 96, 134, 0.24);
  border: 1px solid rgba(122, 216, 255, 0.34);
}

.archivist-self-summary[hidden] {
  display: none;
}

/* 하단 광고 예정 영역: 닫기 버튼 및 게임 조작 버튼과 물리적·시각적 명확 분리 */
.archivist-ad-area {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 224, 186, 0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.archivist-ad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archivist-ad-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9ba7bb;
}

.archivist-ad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.archivist-ad-slot {
  box-sizing: border-box;
  height: 112px;
  min-height: 112px;
  max-height: 112px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(12, 14, 26, 0.62);
  border: 1px dashed rgba(176, 192, 218, 0.3);
  color: #8f9db3;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

@media (max-width: 768px) {
  .archivist-modal {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .archivist-dialog {
    width: min(100%, 520px);
    height: min(90vh, calc(100vh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom))));
    height: min(90dvh, calc(100dvh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom))));
    min-height: 0;
    max-height: calc(100vh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
    padding: 14px 12px 12px;
    gap: 10px;
  }

  .archivist-header {
    padding-bottom: 10px;
  }

  .archivist-header h2 {
    font-size: 16px;
  }

  .archivist-subtitle {
    font-size: 12px;
  }

  .archivist-scope-note {
    font-size: 11px;
  }

  .archivist-body {
    flex: 1 1 0;
    min-height: 0;
    padding-right: 2px;
  }

  .archivist-empty {
    padding: 28px 14px;
    font-size: 13px;
  }

  .archivist-close-btn {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 11.5px;
  }

  .archivist-rank-list {
    gap: 8px;
  }

  .archivist-rank-item {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
    column-gap: 7px;
    padding: 9px 10px;
  }

  .archivist-rank-head {
    gap: 6px;
  }

  .archivist-rank-badge {
    width: 34px;
    height: 28px;
    font-size: 11px;
  }

  .archivist-row-sep {
    font-size: 11px;
  }

  .archivist-angler-wrap {
    gap: 3px 5px;
  }

  .archivist-angler-name {
    font-size: 12.5px;
  }

  .archivist-self-pill {
    font-size: 9px;
    padding: 1px 5px;
  }

  .archivist-species-chips {
    flex: 1 1 112px;
    min-height: 26px;
    gap: 4px;
    padding-left: 8px;
    border-left: 2px solid rgba(255, 226, 180, 0.24);
  }

  .archivist-rank-item.is-self .archivist-species-chips {
    border-left-color: rgba(114, 226, 255, 0.48);
  }

  .archivist-species-chip {
    font-size: 10.5px;
    padding: 2px 7px;
  }

  .archivist-ad-area {
    margin-top: 0;
    padding-top: 10px;
    gap: 7px;
  }

  .archivist-ad-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .archivist-ad-slot-secondary {
    display: none;
  }

  .archivist-ad-slot {
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    padding: 10px 12px;
    font-size: 11.5px;
  }
}


