body {
    margin: 0;
    padding: 0;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}


/* In your CSS file (e.g., style.css) or a <style> tag */
.initial-position-text {
    color: white; /* This sets the text color to white */
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold; /* This sets the font weight to bold */
    white-space: nowrap;
    pointer-events: none;
    transform: translate(0, -50%);
}

.t24-position-text {
    color: white; /* This sets the text color to white */
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold; /* This sets the font weight to bold */
    white-space: nowrap;
    pointer-events: none;
    transform: translate(0, -50%);
}

.t48-position-text {
    color: white; /* This sets the text color to white */
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold; /* This sets the font weight to bold */
    white-space: nowrap;
    pointer-events: none;
    transform: translate(0, -50%);
}

.t72-position-text {
    color: white; /* This sets the text color to white */
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold; /* This sets the font weight to bold */
    white-space: nowrap;
    pointer-events: none;
    transform: translate(0, -50%);
}

.t96-position-text {
    color: white; /* This sets the text color to white */
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold; /* This sets the font weight to bold */
    white-space: nowrap;
    pointer-events: none;
    transform: translate(0, -50%);
}

/* 五個颱風logo */

.typhoon-logo-0 {
    width: 250px; 
    height: 250px;
    background: url('../icon/td2.png') no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 40;
}

.typhoon-logo-1 {
    width: 250px; 
    height: 250px;
    background: url('../icon/light2.png') no-repeat center;
    background-size: contain;
    pointer-events: none; 
    z-index: 41;
}

.typhoon-logo-2 {
    width: 250px; 
    height: 250px;
    background: url('../icon/medium2.png') no-repeat center;
    background-size: contain;
    pointer-events: none;
    z-index: 42;
}

.typhoon-logo-3 {
    width: 250px; 
    height: 250px;
    background: url('../icon/strong2.png') no-repeat center;
    background-size: contain;
    pointer-events: none; 
    z-index: 43;
}

.typhoon-logo-4 {
    width: 250px; 
    height: 250px;
    background: url('../icon/ex2.png') no-repeat center;
    background-size: contain;
    pointer-events: none; 
    z-index: 44;
}

.typhoon-dot {
    width: 15px; /* 小白點大小 */
    height: 15px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 39;
}

/* 左上角control欄位 */

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: 8px;
    max-width: 360px;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.control-group {
  margin-bottom: 12px;
}

#typhoon-list {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

/* 按鈕圖標樣式 */
.btn-icon {
    width: 40px;
    height: 40px;
    margin-right: 3px;
    vertical-align: middle;
}

.cat-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
html, body {
    height: 100%;
    overflow: hidden;
}

.btn {
    background: #4ECDC4;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #6FD9D2;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: translateY(1px);
}

.hide-btn {
    background: #FF6B6B;
}

.hide-btn:hover {
    background: #FF8E8E;
}


/* 貓咪pop出來時的樣式 */
.cat-container {
    position: fixed;
    left: 90px;
    bottom: -100px;
    display: flex;
    align-items: flex-end;
    z-index: 90;
    transition: bottom 0.3s ease;
}

.cat-image {
    width: 120px;
    height: auto;
    transform: scale(0);
    transition: transform 0.5s ease;
}

.speech-bubble {
    background: black;
    border-radius: 12px;
    padding: 12px;
    margin-left: 10px;
    position: relative;
    max-width: 300px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.3s ease 0.2s;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 15px;
    border: 8px solid transparent;
    border-right-color: white;
}

.cat-message {
    font-size: 18px;
    color: #333;
}

/* Animation when cat is shown */
.show-cat .cat-container {
    bottom: 50px;
}

.show-cat .cat-image {
    transform: scale(5);
}

.show-cat .speech-bubble {
    transform: translateY(0);
    opacity: 1;
}


/* 下面不知道 可能是浮水印*/

label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#custom-logo {
    pointer-events: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 0;
}

#custom-logo img {
    height: 1000px;
    opacity: 0.03;
}

/* css最後加上 */

/* 圖例控制按鈕 */
.legend-controls {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
}

.legend-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    color: white;
    border: none;
    font-size: 24px; /* 放大問號大小 */
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* 確保問號垂直居中 */
    padding: 0; /* 移除內邊距 */
}

.legend-btn:hover {
    background-color: #4c4c4c;
    transform: scale(1.1);
}

/* 圖例動畫效果 - 修正版 */
#legend-box {
    position: fixed; /* 改用fixed定位 */
    right: -300px; /* 初始完全隱藏在屏幕外 */
    bottom: 80px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    opacity: 0.8;
    z-index: 999;
    /* 移除transform避免影響佈局 */
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* 確保不會影響文檔流 */
    pointer-events: none; /* 隱藏時不接受任何交互 */
}

#legend-box.show-legend {
    right: 10px; /* 顯示位置 */
    pointer-events: auto; /* 顯示時恢復交互 */
    /* 使用transform實現彈跳但不影響佈局 */
    animation: legendBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes legendBounce {
    0% { transform: translateX(30px); }
    50% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

/* 圖片效果保持不變 */
#legend-box img {
    display: block;
    max-width: 180px;
    margin-bottom: 5px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

#legend-box.show-legend img {
    transform: scale(1.05);
}

/* 控制按鈕位置調整 */
.legend-controls {
    position: fixed; /* 改用fixed定位 */
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    transition: right 0.3s ease;
}

#legend-box.show-legend ~ .legend-controls {
    right: calc(180px + 20px); /* 根據圖例寬度計算 */
}

/* 開發團隊按鈕 */
.team-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.team-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 20px;
    color: #4ECDC4;
}

.team-btn:hover {
    background-color: #4c4c4c;
    transform: scale(1.1);
}

/* 優化後的團隊介紹框 */
#team-box {
    position: absolute;
    top: 60px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.98);
    border: 1px solid #e1e1e1;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 350px; /* 固定寬度 */
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 999;
    text-align: left; /* 確保文字左對齊 */
    line-height: 1.6; /* 增加行高 */
}

#team-box.show-team {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.team-member {
    margin-bottom: 12px;
    color: #2d3748;
    font-size: 15px;
    padding-left: 10px;
    border-left: 3px solid #4ECDC4; /* 左側裝飾線 */
    transition: all 0.2s ease;
}

.team-member:hover {
    border-left-color: #FF6B6B; /* 懸停效果 */
    padding-left: 12px;
}

.team-member:last-child {
    margin-bottom: 0;
}

/* 彩蛋 */
.easter-cat {
    width: 90px; 
    height: 90px;
    background: url('../icon/eastercat.png') no-repeat center;
    background-size: contain;
    pointer-events: none; 
    z-index: 30;
}

.hong {
    width: 70px; 
    height: 70px;
    background: url('../icon/hong.png') no-repeat center;
    background-size: contain;
    pointer-events: none; 
    z-index: 30;
}


/* 手機畫面處理(螢幕較小) */
/* 新增媒體查詢區塊來處理移動設備 */
@media only screen and (max-width: 768px) {
  /* 調整地圖容器 */
  #map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  #controls {
    max-width: 250px; /* 原 360px → 縮小 ~30% */
    padding: 10px;    /* 原 16px → 縮小 ~37% */
    top: 8px;
    left: 8px;
    font-size: 12px;  /* 原 14px → 縮小 ~14% */
    border-radius: 10px; /* 原 8px → 縮小 25% */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); /* 陰影縮小 */
    opacity: 0.9;
  }

  .control-group {
    margin-bottom: 8px; /* 原 12px → 縮小 ~33% */
  }

  #typhoon-list {
    padding: 6px;      /* 原 8px → 縮小 25% */
    font-size: 12px;   /* 原 14px → 縮小 ~14% */
    margin-bottom: 8px; /* 原 10px → 縮小 20% */
    border-radius: 3px; /* 原 4px → 縮小 25% */
  }

  .btn {
    padding: 8px 16px; /* 原 12px 25px → 縮小 ~33% */
    font-size: 0.78rem; /* 原 1.1rem → 縮小 ~18% */
    border-radius: 40px; /* 原 50px → 縮小 20% */
    min-height: 36px;  /* 確保觸控區域足夠 */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* 縮小陰影 */
  }

  .btn-icon {
    width: 30px;       /* 原 40px → 縮小 25% */
    height: 30px;      /* 原 40px → 縮小 25% */
    margin-right: 2px; /* 原 3px → 縮小 33% */
  }

  .cat-controls {
    gap: 6px;         /* 原 10px → 縮小 40% */
    margin-top: 8px;  /* 原 10px → 縮小 20% */
  }
  
  /* 調整颱風標記大小 */
  .typhoon-logo-0, 
  .typhoon-logo-1,
  .typhoon-logo-2,
  .typhoon-logo-3,
  .typhoon-logo-4 {
    width: 200px;
    height: 200px;
  }

  .typhoon-dot {
      width: 10px; /* 小白點大小 */
      height: 10px;
  }
  
  /* 調整文字標記 */
  .initial-position-text,
  .t24-position-text,
  .t48-position-text,
  .t72-position-text,
  .t96-position-text {
    font-size: 12px;
    padding: 3px 5px;
  }
  
  /* 調整圖例位置 */
  .legend-controls {
    bottom: 15px;
    right: 5px;
  }
  
  .legend-btn {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .legend-btn:hover {
      background-color: #ffffff;
      transform: scale(1.1);
  }
  
  #legend-box {
    bottom: 60px;
    right: -250px;
    max-width: 80vw;
    opacity: 1;
  }
  
  #legend-box.show-legend {
    right: 5px;
  }
  
  #legend-box img {
    max-width: 100px;
  }

  /* 開發人員介紹 */

  .team-controls {
      top: 8px;
      right: 8px;
  }
  
  .team-btn {
      width: 36px;
      height: 36px;
      font-size: 18px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  
  /* 團隊介紹框手機版樣式 (與圖例風格一致) */
  #team-box {
      top: 50px;
      right: 8px;
      width: 280px; /* 比桌面版稍窄 */
      padding: 15px;
      border-radius: 8px;
      box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  }
  
  .team-member {
      font-size: 12px;
      margin-bottom: 10px;
      padding-left: 8px;
      border-left-width: 2px;
  }
  
  .team-member:hover {
      padding-left: 10px;
  }
  
  /* 調整貓咪對話框 */
  .cat-container {
    left: 30px;
  }
  
  .cat-image {
    width: 80px;
  }
  
  .speech-bubble {
    max-width: 130px;
    padding: 8px;
  }

  .cat-message {
      font-size: 12px;
      color: #333;
  }
  
  .show-cat .cat-image {
    transform: scale(3);
  }
  
  /* 調整下拉選單 */
  #typhoon-list {
    font-size: 12px;
    padding: 6px;
  }
  
  /* 調整控制組間距 */
  .control-group {
    margin-bottom: 8px;
  }
  
  /* 觸控優化 - 增加點擊目標大小 */
  label {
    padding: 5px 0;
  }
}

/* 針對非常小的手機 (如iPhone 5/SE) */
@media only screen and (max-width: 320px) {
  #controls {
    padding: 8px;
    font-size: 12px;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .typhoon-logo-0, 
  .typhoon-logo-1,
  .typhoon-logo-2,
  .typhoon-logo-3,
  .typhoon-logo-4 {
    width: 80px;
    height: 80px;
  }
  
  .cat-image {
    width: 60px;
  }
  
  .show-cat .cat-image {
    transform: scale(2.5);
  }
}