body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px 10px;
    box-sizing: border-box;
}
/* Grid container styling */
.grid-container {
    display: grid;
    /* 1fr で残りのスペースを均等に分割。最も確実な方法です。 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px;
    width: 100%;
    margin-bottom: 10px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 2px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    position: relative;
    /* flex-basis: 0; を追加すると、Safariでの挙動が安定することがあります */
    flex-basis: 0; 
    min-width: 0; 
    overflow: hidden;
    font-size: 12px;

}
 
#drop-area {
    /* width: 100% に変更 */
    width: 100%; 
    aspect-ratio: 1/1;
    border: 2px dashed #e43030;
    display: flex;
    align-items: center;
    justify-content: center;
    /* マージンは必要に応じて調整してください */
    margin: 20px ; 
    color: #999;
    font-size: 18px;
    position: relative;
    overflow: hidden;
}
#drop-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

#map {
    /* 既存のスタイル */
    width: 100%;
    height: 100%;
    /* aspect-ratio: 4/3; */
    text-align: center;
    font-size: 18px;
    background-color: #e0e0e0;
    z-index: 1;
    
    /* 💡 追加: 疑似要素の基準位置を相対にする */
    position: relative; 
}
#map2 {
    /* 既存のスタイル */
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1; 
    text-align: center;
    font-size: 18px;
    background-color: #e0e0e0;
    z-index: 1; 
    /* 💡 追加: 疑似要素の基準位置を相対にする */
    position: relative; 
}
/* ----------------------------------------------------- */

/* 1. 縦線 (十字の中心線) */
#map2::before {
    content: ''; /* 疑似要素には必須 */
    position: absolute;
    /* 縦線の太さと色 */
    width: 2px;
    background-color: rgb(255, 0, 225); 
    
    /* 縦線の高さ */
    height: 100px; 
    
    /* 中央に配置 */
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%); /* 自身のサイズを考慮して完全中央へ */
    z-index: 2; /* 地図の上の層に表示 */
}

/* 2. 横線 (十字の中心線) */
#map2::after {
    content: ''; /* 疑似要素には必須 */
    position: absolute;
    /* 横線の太さと色 */
    height: 2px;
    background-color: rgb(255, 0, 225);
    
    /* 横線の長さ */
    width: 100px;
    
    /* 中央に配置 */
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%); /* 自身のサイズを考慮して完全中央へ */
    z-index: 2; /* 地図の上の層に表示 */
    display: flex;
} 

#info{
    flex-grow: 1; 
    width: 100%; /* 幅を親要素に合わせる */
    padding: 0 10px; /* 必要に応じてパディングを追加 */
    margin-top: 20px;
    font-size: 12px;
    color: #333;
}

.hidden-button {
    /* ボタンを完全に非表示にします */
    display: none; 
}
.content-area {
    /* コンテンツエリアを非表示にします */
    display: none;
    padding: 20px;
    background-color: #f9f9f9;
    margin-top: 10px;
    width: 100%; /* 幅を親要素に合わせる */
    box-sizing: border-box; /* paddingを幅に含める */

}
/* #qrDetails p:last-of-type {
  margin-top: auto;     
} */
#secondPart h1 {
    text-align: center;
}

#secondPart p {
    width: 100%;
    margin-top: 10; 
    margin-bottom: 0;
    margin-left: 10;
    font-size: 18px;
} 
#secondPart label {
    margin-top: 10; 
} 
#secondPart input {
    font-size: 18px; 
    padding: 8px 20px; 
    width: 75%; 
    border: 1px solid #3b3c3d;
    border-radius: 4px; 
    margin-top: 0; 
    margin-bottom: 0;
    margin-left: 10;
}
#secondPart input.angle-slider {
    padding: 8px 0px; 
    width: 150px; 
    border: 1px solid #3b3c3d;
    border-radius: 4px; 
    margin-top: 0; 
    margin-bottom: 0;
    margin-left: 10;
}
#secondPart p.latlon-group{
    font-size: 14px;
}
#secondPart p.nodisp{
    font-size: 14px;
        display: none;
        margin-top: 0px;
    margin-left: auto; 
    margin-right: auto;
}
#applyButton, #reflectButton {
    /* 以前のボタンのスタイル */
    font-size: 14px;
    padding: 10px 20px;
    margin-top: 5px;
    margin-bottom: 20px;
    cursor: pointer;
    background-color: lightgray;
    color: black;
    border: none;
    margin-left: auto; 
    margin-right: auto;
    display: block; 
    width: fit-content;
}


#btn4 {
    font-size: 18px;
    padding: 10px 20px;
    margin-top: 5px;
    cursor: pointer;
    background-color: rgb(60, 60, 60);
    color: white;
    border: none;
    margin-left: auto; 
    margin-right: auto;
    display: block;
    width: fit-content;
}

#btn4:disabled {
    background-color: #a0a0a0; /* グレーアウト */
    color: #666666;            /* 文字色を薄く */
    cursor: not-allowed;      /* カーソルを「禁止マーク」にする */
    opacity: 0.7;              /* 全体的に透過させる */
}


 #outputContainer canvas {
            border: 1px solid #ccc;
            margin-top: 20px;
        }
#qrcode {
            margin:10px;
            display: none;
        }
#disp-area {
    width: 100%; 
    aspect-ratio: 1/1;
    border: 2px dashed rgba(51, 60, 238, 0.933);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px ; 
    color: #999;
    font-size: 18px;
    position: relative;
    overflow: hidden;
}
#disp-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
        
  .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db; /* 青い色 */
  border-radius: 50%;
  animation: spin 1s linear infinite; /* 1秒で1回転し続ける */
  margin: 10px auto;
}

/* 回転アニメーションの定義 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.angle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    padding: 20px;
  }

  .angle-header {
    font-size: 1.2rem;
    font-weight: bold;
  }

  #angle-display {
    color: #e63946; /* 赤系で強調 */
    display: inline-block;
    width: 3rem;
    text-align: center;
  }

  /* 円形の土台 */
  .angle-circle {
    width: 150px;
    height: 150px;
    border: 4px solid #333;
    border-radius: 50%;
    position: relative;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  }

  /* 赤い矢印のデザイン */
  .red-arrow {
    width: 20px;
    height: 70px;
    background-color: #e63946; /* 鮮やかな赤 */
    position: absolute;
    left: calc(50% - 10px);
    bottom: 50%;
    
    /* 矢印の形に切り抜く */
    clip-path: polygon(50% 0%, 100% 30%, 70% 30%, 70% 100%, 30% 100%, 30% 30%, 0% 30%);
    
    /* 回転の軸を矢印の「底辺中央（円の中心）」に設定 */
    transform-origin: bottom center;
    transition: transform 0.05s linear;
  }

  /* スライダーの見た目調整 */
  .angle-slider {
    width: 150px;
    cursor: pointer;
  }
