
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Serif+JP:wght@300;500;900&display=swap');

:root {
  --blue-light: #0095de;
  --blue-deep: #00429a;
  --font-yellow: #fccd37;
  /* 一番外側（body の深蓝フレーム）の太さ */
  --frame-inset: 8px;
}

body { 
  margin: 0; 
  padding: 0;
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--blue-deep);
  font-family: "Noto Sans JP", serif;
  font-optical-sizing: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  font-style: normal;
  font-weight: 300;
  overflow-y: hidden;
}

/* 入力フィールドやテキストエリアでは選択を有効にする */
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* カスタムattributionのスタイル */
#custom-attribution {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  color: white;
  z-index: 1000;
  max-width: 80%;
  line-height: 1.2;
}

input {
  cursor: pointer;
}

main {
  position: relative;
  width: 100%;
  height: 100%;
}

#background{
  position: absolute;
  background: var(--blue-light);
  border-radius: 10px;
  top: var(--frame-inset); 
  left: var(--frame-inset); 
  width: calc(100% - 2 * var(--frame-inset)); 
  height: calc(100% - 2 * var(--frame-inset)); 
}

#header {
  position: absolute;
  top: 8px;
  left: 50%;
  margin-left: -300px;
  width: 600px;
  height: 36px;
  /* background: white; */
  border-radius: 2px;
  overflow: hidden;
}
#header p {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--font-yellow);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

#header p.scroll-in {
  animation: scrollIn var(--scroll-duration, 1s) ease-out forwards;
}

#header p.scroll-out {
  animation: scrollOut var(--scroll-duration, 1s) ease-in forwards;
}

@keyframes scrollIn {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes scrollOut {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-100%);
    opacity: 0;
  }
}
#map { 
  position: absolute; 
  top: 44px; 
  left: var(--frame-inset); 
  /* 外側フレーム分だけ除いた幅（map 自身の border は box-sizing 内） */
  width: calc(100% - 2 * var(--frame-inset)); 
  height: calc(100% - 80px); 
  box-sizing: border-box;
  border: solid 2px var(--blue-deep);
  border-left: 0;
  border-right: 0;
}

.mapbox-logo {
  position: absolute;
  bottom: 10px;
  left: 53px;
  width: 70px;
  z-index: 10;
}

.left-top {
  position: absolute;
  top: 0px;
  left: 0px;
  padding: 56px 22px;
  user-select: none;
}

.logo {
  width: 100%;
  z-index: 100;
}
.qr {
  display: none;
  margin-left: auto;
  margin-right: auto;
  margin-top: 30px;
  width: 100%;
  filter: drop-shadow(2px 4px 6px black);
}
.qr img {
  width: 100%;
}
.qr p {
  margin: 0;
  margin-top: 5px;
  color: black;
  background: white;
  text-align: center;
  font-size: 12px;
}

.title {
  /* font-family: 'Bebas Neue', sans-serif; */
  font-family: 'Noto Serif JP', serif;
  font-weight: 800;
  color: white;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  /* QR 非表示時もロゴが潰れないよう固定幅（exhibition 以外でも表示） */
  width: 150px;
  max-width: 150px;
}
.title h1 {
  font-size: 80px;
  top: 0;
  left: 0;
  padding: 0;
  margin: 0;
  text-align: left;
}
.title h2 {
  padding: 0;
  margin: 0;
  text-align: left;
}

.post {
  pointer-events: initial;
  max-width: 400px;
  width: 90%;
  margin-top: 10px;
}
.post p {
  color: white;
  font-size: 12px;
}
.post button {
  cursor: pointer;
}
.post-description {
  display: none;
  padding: 2px 8px;
  background: #000000cc;
}

.about {
  position: absolute;
  z-index: 1000;
  height: calc(100% - 84px);
  width: 400px;
  padding: 0px;
  right: 8px;
  top: 45px;
  pointer-events: none;
}
.about-bg {
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  background: #ffffffee;
  width: 100%;
  height: 100%;
}
.about-checkbox {
  z-index: 3;
  position: relative;
  color: #fff;
  font-size: 14px;
  padding: 10px 10px 0 0;
  text-align: right;
  background: none;
  text-decoration: underline;
  pointer-events: initial;
  margin-top: -40px;
}
.about-checkbox input[type="checkbox"] {
  display: none;
}
.about-checkbox label {
  cursor: pointer;
}
.about-checkbox:has(input:disabled) label {
  cursor: default;
  opacity: 0.7;
}
/* 開いているときはパネル内「閉じる」のみ（外側ラベルと重ねない） */
.about:has(#aboutCheckbox:checked) .about-checkbox {
  visibility: hidden;
  pointer-events: none;
}
.about .description {
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  height: 90%;
  pointer-events: initial;
  line-height: 2;
}
.about-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 5;
  margin: 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--blue-deep);
  font-size: 14px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  pointer-events: auto;
}
.about .description .description-inner {
  height: 100%;
  padding: 36px 20px 20px;
  overflow-y: auto; 
}
.about .description .description-inner  p {
  color: black;
  font-size: 14px;
}

.about .description .description-inner p.credit-mediaarts{
  font-size: 10px;
}


.bottom-section {
  z-index: 10;
  position: absolute;
  bottom: 36px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  flex-direction: column;
}

.legends {
  display: flex;
  justify-content: center;
  color: black;
  font-size: 12px;
  pointer-events: auto;
  max-width: 85%;
  padding: 5px 20px;
  background: white;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  margin-bottom: 8px;
}

.layer-legends {
  display: flex;
  justify-content: space-between;
}
.layer-legends > div {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 20px;
}
.legend-line {
  height: 1px;
  width: 20px;
  margin-right: 5px;
}
.ai-legend-border .legend-line {
  border-top: 3px dashed rgb(255, 0, 0);
} 
.transit-legend-jr .legend-line {
  border-top: 3px solid rgb(0, 209, 56);
} 
.transit-legend-rails .legend-line {
  border-top: 3px solid rgb(32, 165, 167);
} 
.transit-legend-express .legend-line {
  border-top: 3px solid rgba(219, 10, 10, 0.6);
} 



.control-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  background-color: rgba(255, 255, 255, 0.9);
}

.layer-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  pointer-events: auto;
  padding-right: 20px;
}

.layer-btns .toggle {
  margin-right: 20px;
}


.layer-btns input[type="checkbox"] {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  vertical-align: -5px;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

.layer-btns input[type="checkbox"]:checked:before {
  position: absolute;
  top: 1px;
  left: 4px;
  transform: rotate(50deg);
  width: 4px;
  height: 8px;
  border-right: 2px solid #000;
  border-bottom: 2px solid #000;
  content: '';
}

.opacity-control-container {
  display: flex;
  justify-content: center;
}
.opacity-control {
  padding: 5px 20px;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  pointer-events: auto;
}
.opacity-control span {
  width: 80px;
  max-width: 80px;
  margin: 0 10px;
  text-align: center;
}

/* ベースのスタイル */
input[type="range"] {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none; /* ブラウザのデフォルトのスタイルを無効化 */
  outline: none;
  width: 100%;
  max-width: 400px;
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -10px;
  width: 8px;
  height: 24px;
  background-color: #333;
  border-radius: 4px;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  background-color: #aaa;
  height: 4px;
}

input[type="range"]::-moz-range-track {
  background-color: #aaa;
  height: 4px;
}
input[type="range"]::-moz-range-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -10px;
  width: 8px;
  height: 24px;
  background-color: #888;
  border-radius: 4px;
  cursor: pointer;
}

input[type="range"]::-ms-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -10px;
  width: 8px;
  height: 24px;
  background-color: #888;
  border-radius: 4px;
  cursor: pointer;
}

.random-image-container {
  position: absolute;
  opacity: 0;
  transition: opacity 2s;
  width: 250px;
  height: auto;
  pointer-events: none;
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(2px 4px 6px #333);
}

.maplibregl-popup {
    filter: drop-shadow(2px 4px 6px #333);
    z-index: 1000;
}

.maplibregl-popup-content {
  background-color: #fccd34 !important;
  border-radius: 14px !important;
  user-select: none;
  color: #09408f;
  font-weight: 800;
}

.maplibregl-popup-content textarea{
  background: transparent !important;
  border: none;
  resize: none;
  height: 80px;
  width: 200px;
  color: #09408f;
  font-size: 16px;
  font-weight: 800;
  transform: scale(1);
}
.maplibregl-popup-content .input-popup-name {
  display: flex;
  font-size: 14px;
}

.maplibregl-popup-content input {
  margin-left: 5px;
  margin-bottom: 20px;
  background: transparent !important;
  border: none;
  resize: none;
  height: 20px;
  max-width: 80%;
  color: #09408f;
  font-weight: 800;
  transform: scale(1);
}
.maplibregl-popup-content button {
  display: block;
  background: #fff;
  cursor: pointer;
  border: none;
  border-radius: 8px;
}
.maplibregl-popup-content .post-btn {
  width: 80px;
  margin: auto;
}


.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: #fccd34 !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #fccd34 !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #fccd34 !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #fccd34 !important;
}

.popup-text {
  background: transparent !important;
  padding: 10px !important;
  margin: 8px 10px !important;
}

.mouse-cta {
  z-index: 100;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  justify-content: center;
  align-items: center;
}
.mouse-cta div {
  width: 320px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}
.mouse-cta img {
  width: 100%;
}
.fade-blink {
  animation: fadeBlink 5s infinite;
}
@keyframes fadeBlink {
  0% { opacity: 0.7; }
  50% { opacity: 0.95; }
  100% { opacity: 0.7; }
}

.workshop {
  position: absolute;
  bottom: 80px;
  left: 0;
  height: 150px;
  min-width: 95%;
  display: none;
  justify-content: center;
  align-items: center;
  background: #ffffffcc;
  z-index: 1000;
  padding: 20px;
  overflow-y: scroll;
}

.city-score p{
  font-size: 14px;
  font-weight: 600;
  margin: 5px;
}
.reason {
  display: none;
  font-size: 12px;
  font-weight: 400;
}

/*--------------------------------------*/
@media (max-width: 768px) {
  main {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  #map {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 5px;
  }

  .logo {
    width: 80px;
    filter: drop-shadow(2px 4px 6px black)
  }
  .qr {
    display: none;
  }

  .about {
    width: 100%;
    top: 0;
    left: 0;
    right: initial;
    padding: 0;
    background: none;
  }
  .about .about-checkbox {
    margin-top: 20px;
    margin-right: 20px;
    z-index: 4;
  }
  .about .description {
    padding: 40px 20px 20px 20px;
    margin-top: -40px;
  }
  .about-close {
    top: 12px;
    right: 16px;
    color: #000;
  }

  .left-top {
    padding: 0;
    pointer-events: none;
  }
  .left-top .title {
    padding: 10px 20px 0 20px;
    padding-bottom: 0;
  }
  .left-top .title h1 {
    font-size: 50px;
  }
  .left-top .title h2 {
    font-size: 1em;
  }
  .left-top .post {
    width: 80%;
    padding: 0 20px;
    pointer-events: none;
  }
  .left-top .post button {
    margin-top: 4px;
    font-size: 12px;
    pointer-events: initial;
  }
  .left-top .post p {
    font-size: 10px;
    margin: 10px 0;
    filter: drop-shadow(2px 4px 6px black);
    pointer-events: none;
  }

  .bottom-section {
    bottom: 44px;
    height: 70px;
  }
  .bottom-section .control-panel {
    flex-direction: column;
    height: 100%;
    width: 90%;
  }

  .bottom-section .control-panel .opacity-control-container {
    width: 100%;
  }

  .bottom-section .control-panel .opacity-control-container .opacity-control {
    width: 100%;
    justify-content: space-between;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 22px;
  }  
  input[type="range"]::-moz-range-thumb {
    width: 22px;
  }
  input[type="range"]::-ms-thumb {
    width: 22px;
  }

  .opacity-control span { 
    margin: 0;
  }

  .random-image-container {
    width: 150px;
    z-index: 10;
  }

}

/* 最小化popup用のスタイル */
.minimized-popup {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
}

/* 最小化popupのMapLibre GL JSスタイル上書き */
.maplibregl-popup .minimized-popup {
  padding: 4px 4px !important;
  border-radius: 2px !important;
}

.maplibregl-popup-content .minimized-popup {
  padding: 4px 4px !important;
  border-radius: 2px !important;
}

/* より具体的なセレクタで確実に上書き */
.maplibregl-popup-content {
  padding: 4px 4px !important;
  border-radius: 2px !important;
}

.maplibregl-popup-content:has(.minimized-popup) {
  padding: 4px 4px !important;
  border-radius: 2px !important;
}

.minimized-dot {
  width: 4px;
  height: 4px;
  background: #007bff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.6);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.6);
  }
}
