/* ============================================
   PC（既存挙動そのまま）
============================================ */
.wrapper {
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
    position: relative;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

body > .wrapper {
    position: absolute;
    top: 0; left: 0;
    transform-origin: top left;
    transform: scale(calc(100vw / 1920));
    width: 1920px;
    height: 1080px;
    overflow: hidden;
}

/* ============================================
   Unity風 wrapper/canvas（PCでは横長）
============================================ */
#wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;

  display: flex;
  justify-content: center;
  align-items: center;
}

/* PC: 横 1920×1080 */
#canvas {
  width: 1920px;
  height: 1080px;
  position: relative;
  transform-origin: top left;
}

/* ============================================
   UI (PC用：あなたの既存と同じ)
============================================ */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.score-display {
  position: fixed;
  top: 5%;
  left: 13%;
  height: 60px;
  background: rgba(0,0,0,0.55);
  padding: 10px 25px;
  font-size: 1.2em;
  color: #fff;
  backdrop-filter: blur(5px);
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 999;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character {
  position: fixed;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 40%;
  height: auto;
  z-index: 2;
}

.speech{
  position:fixed;
  top:20%;
  right:10%;
  background:rgba(0,0,0,0.6);
  color:#fff;
  padding:14px 22px;
  border-radius:10px;
  font-size:1.2rem;
  max-width:80%;
  width:max-content;
  white-space:normal;
  word-break:break-word;
  text-align:center;
  z-index:3;
}

.button-book, .button-left, .button-right, .button-chara, .button-data, .info, .hatena, .mail {
  position: fixed;
  z-index: 3;
  cursor: pointer;
}

.button-book {
  top: 30%;
  right: 10%;
  width: 100px;
}

.button-left {
  bottom: 5%;
  left: 5%;
  width: 300px;
  animation: float 4s ease-in-out infinite;
}

.button-right {
  bottom: 5%;
  right: 5%;
  width: 400px;
  animation: float 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

.button-chara {
  bottom: 55%;
  right: 5%;
  width: 300px;
  animation: float 4s ease-in-out infinite;
  animation-delay: 0.7s;
}

.button-data {
  bottom: 38%;
  right: 5%;
  width: 250px;
  border-radius: 12px;
  animation: float 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

.info {
  bottom: 38%;
  right: 25%;
  width: 100px;
  animation: float 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

.button-left:hover, .button-right:hover, .button-chara:hover, .button-data:hover, .info:hover {
  transform: translateY(-15px) scale(1.05);
  transition: transform 0.3s;
}

.mail {
  top: 5%;
  right: 11%;
  height: 60px;
}
.seo-panel{
  scrollbar-width:none;       /* Firefox */
  -ms-overflow-style:none;    /* IE/Edge */
}

.seo-panel::-webkit-scrollbar{
  display:none;               /* Chrome/Safari */
}
.seo-panel{
  position:fixed;
  top:40%;
  left:6%;
  transform:translateY(-50%);
  width:28%;
  max-height:40%;
  overflow-y:auto;
  padding:0;
  z-index:3;
}

.seo-inner{
  background:rgba(10,20,35,0.75);
  backdrop-filter:blur(8px);
  border:1px solid rgba(120,200,255,0.25);
  padding:22px 26px;
  color:#dff6ff;
  font-size:0.95rem;
  line-height:1.7;
}
.seo-inner h1{
  font-size:1.6rem;
  margin:0 0 15px 0;
  color:#ffffff;
  letter-spacing:0.05em;
}

.seo-inner h2{
  font-size:1.1rem;
  margin:20px 0 8px;
  color:#9ddcff;
}
.seo-inner ul{
  list-style:none;
  padding:0;
  margin:10px 0 0;
}

.seo-inner li{
  margin-bottom:10px;
}

.seo-inner a{
  display:block;
  padding:8px 14px;
  background:rgba(0,150,255,0.12);
  border:1px solid rgba(0,180,255,0.4);
  border-radius:8px;
  color:#c8f3ff;
  text-decoration:none;
  font-size:0.9rem;
  transition:all 0.2s ease;
}

.seo-inner a:hover{
  background:rgba(0,180,255,0.25);
  transform:translateX(4px);
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}
/* ============================================
   スマホ（縦向き）専用：ここだけ挙動を変える
============================================ */
@media (max-width: 768px) and (orientation: portrait) {

  /* キャンバスを1080×1920の縦解像度に変更 */
  #canvas {
    width: 1080px;
    height: 1920px;
  }

  /* スマホは縦キャンバス基準の scale */
  #wrapper {
    --scale: calc(min(100vw / 1080, 100vh / 1920));
  }

  /* あなたの既存スマホ調整も維持 */
  body > .wrapper {
    transform: scale(calc(100vw / 768));
  }

  /* 挙動調整など（既存のまま） */
  .button-left,
  .button-right,
  .button-chara,
  .button-data,
  .info {
    animation: float-small 4s ease-in-out infinite;
  }

  @keyframes float-small {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
  }

  .score-display {
    top: 3%;
    left: 25%;
    font-size: 1em;
    padding: 8px 15px;
  }

  .character {
    left: 60%;
    top: 65%;
    max-width: 120%;
    z-index: 5;
  }

  .speech {
    display: none;
    top: 45%;
    left: 0;
    max-width: 90%;
    font-size: 1rem;
    border-radius: 0px;
    padding: 10px 15px;
  }

  .button-book {
    top: 25%;
    right: 5%;
    width: 80px;
    z-index: 6;
  }

  .button-left {
    bottom: 27.5%;
    left: 13%;
    width: 150px;
    z-index: 6;
  }

  .button-right {
    bottom: 3%;
    left: 13%;
    width: 300px;
    z-index: 6;
  }

  .button-chara {
    bottom: 38%;
    right: 10%;
    width: 150px;
    z-index: 6;
  }

  .button-data {
    bottom: 27%;
    right: 10%;
    border-radius: 0px;
    width: 110px;
    z-index: 6;
  }

  .info {
    bottom: 40%;
    left: 12%;
    width: 60px;
    z-index: 6;
  }

  .mail {
    right: 25%;
    top: 6%;
    height: 40px;
  }

  .player-status {
    width: 50%;
    height: 50px;
    top: 25%;
  }

  .player-status__text {
    font-size: 1rem;
    padding-left: 20%;
  }
  .seo-panel{
    position:fixed;
    top:17%;
    left:50%;
    transform:translateX(-50%);
    width:90%;
    max-height:20%;
    overflow-y:auto;
    padding:0;
    z-index:3;
  }

  .seo-inner{
    background:rgba(10,20,35,0.75);
    backdrop-filter:blur(8px);
    border:1px solid rgba(120,200,255,0.25);
    padding:22px 26px;
    color:#dff6ff;
    font-size:0.95rem;
    line-height:1.7;
  }
  .seo-inner h1{
    font-size:1.2rem;
    margin:0 0 15px 0;
    color:#ffffff;
    letter-spacing:0.05em;
  }

  .seo-inner h2{
    font-size:1rem;
    margin:20px 0 8px;
    color:#9ddcff;
  }
}
