.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; /* 追加 */
}
  /* 共通背景 */
  .background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

  /* PC版 */
  .pc-version {
    display: block;
  }

  .librarian {
      position: absolute;
      left: 13%;
      bottom: 0;
      height: 98%;
      width: auto;
      z-index: 10;
  }
  .bgparticles {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      pointer-events: none;
      z-index: 11;   /* librarian(10) の後ろ、背景(0) の前 */
  }

  .speech {
    position: absolute;
    bottom: 10%;
    left: 3%;
    width: 600px;
    height: 180px;
    padding: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 28px;
    border-radius: 12px;
    line-height: 1.4;
    z-index: 15;
    overflow: auto;
    word-wrap: break-word;
  }

  .button {
    position: absolute;
    cursor: pointer;
    z-index: 20;
    width: auto;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }
  .button:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  }

  @keyframes float {
      0% { transform: translateY(0px); }
      50% { transform: translateY(-8px); }
      100% { transform: translateY(0px); }
  }
  .shop {
      position: absolute;
      bottom: 5.0vh;       /* 1080px基準 5% → 5vh */
      left: 2.0vw;     /* 1920px基準 55% → 55vw */
      height: 20.0vh;
      width: auto;
      z-index: 20;
  }
  .shop:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease; /* スムーズに拡大 */
}
.talk {
    position: absolute;
    bottom: 5.0vh;       /* 1080px基準 5% → 5vh */
    left: 5.0vw;     /* 1920px基準 55% → 55vw */
    height: 20.0vh;
    width: auto;
    z-index: 20;
}
.talk:hover {
  transform: scale(1.1);
  transition: transform 0.2s ease; /* スムーズに拡大 */
}
  .button1 {
      position: absolute;
      top: 5.0vh;       /* 1080px基準 5% → 5vh */
      left: 55.0vw;     /* 1920px基準 55% → 55vw */
      height: 23.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 0s;
  }

  .button2 {
      position: absolute;
      top: 30.0vh;
      left: 60.0vw;
      height: 18.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 0.5s;
  }

  .button3 {
      position: absolute;
      top: 30.0vh;
      left: 77.0vw;
      height: 18.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 1s;
  }

  .button4 {
      position: absolute;
      top: 50.0vh;
      left: 65.0vw;
      height: 20.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 0.8s;
  }

  .button5 {
      position: absolute;
      top: 72.0vh;
      left: 60.0vw;
      height: 18.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 1.2s;
  }

  .button6 {
      position: absolute;
      top: 72.0vh;
      left: 77.0vw;
      height: 18.0vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 1.5s;
  }
  .button7 {
      position: absolute;
      top: 93.0vh;
      left: 77.0vw;
      height: 3.8vh;
      width: auto;
      z-index: 20;
      animation: float 10s ease-in-out infinite;
      animation-delay: 1.5s;
  }
  .button:active {
    transform: scale(0.95);
    filter: brightness(0.8);
}

  /* モバイル版 */
  .mobile-version {
    display: none;
  }

  .mobile-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 37%;
  display: flex;
  background: #111;
  z-index: 20;
  padding: 30px 10px 30px 10px; /* 下に30px余白 */
  box-sizing: border-box;
  gap: 8px;
}

/* 左縦長ボタン（縦横比1:2） */
.menu-left {
  flex: none;               /* フレックスの自動幅を無効化 */
  width: calc(50% * 0.5);   /* 左カラム幅の半分に設定 → 高さに対して1:2 */
  height: 100%;             /* フッター高さに合わせる */
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}
.menu-left:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* 右カラム */
.menu-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 右上横長 */
.menu-top {
  flex: 1;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}
.menu-top:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* 右下二等分 */
.menu-bottom {
  flex: 1;
  display: flex;
  gap: 8px;
}

/* 右下左右ボタン */
.menu-bottom-left,
.menu-bottom-right {
  flex: 1;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  transition: transform 0.3s, box-shadow 0.3s;
}
.menu-bottom-left:hover,
.menu-bottom-right:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* オーバーレイ全体 */
#intro-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 1s ease;
}

/* 中央文字 */
#intro-text {
    color: #fff;
    font-size: 4vw;
    opacity: 0;
    animation: fadeInOut 3s forwards;
    text-align: center;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
/* --- 共通 --- */
#header {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 100;
  font-family: 'Noto Sans JP', sans-serif;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-shadow: 1px 1px 3px black;
}

/* 上段を横並びに */
.header-top {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ロゴ */
#studio-name {
  font-size: 35px;
  font-weight: 500;
}

/* 全体を包むラッパー（位置は header と揃える） */
.header-buttons-wrapper{
    margin-left: 100px;
  position:relative;
  display:flex;
  align-items:center;
  height:60px;
  padding:8px 16px;
  border-radius:12px;
  z-index:120;
}

/* 白い半透明のガラス背景 */
.header-buttons-bg{

  position:absolute;
  inset:0;
  border-radius:12px;
  background:rgba(255,255,255,0.5);
  backdrop-filter:blur(8px);
  box-shadow:0 4px 12px rgba(0,0,0,0.25);
  z-index:1;
}

/* ボタン群（ここが前面） */
.header-buttons{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

/* 既存 .header-icon はそのまま活かす */
.header-icon{
  width:38px;
  height:38px;
  border-radius:10px;
  background:rgba(255,255,255,0.15);
  border:1px solid rgba(255,255,255,0.3);
  padding:6px;
  cursor:pointer;
  backdrop-filter:blur(6px);
  transition:all 0.2s ease;
  object-fit:contain;
}
.header-icon:hover{
  background:rgba(255,255,255,0.3);
  transform:scale(1.07);
}
/* 画像ボタン */
.header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  object-fit: contain;
}

.header-icon:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.07);
}

/* 日時 */
#current-datetime {
  font-size: 13px;
  opacity: 0.8;
}
/* フェードイン → 少し表示 → フェードアウト */
@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.05); }
    70% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}



/* --- モーダル背景 --- */
#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* --- 中央ウィンドウ --- */
#modal-window {
  position: relative;
  background: rgba(30, 30, 30, 0.95);
  border-radius: 16px;
  padding: 25px 20px 20px 20px;
  width: 320px;
  max-width: 90%;
  color: white;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  text-align: center;
  font-family: 'Noto Sans JP', sans-serif;
  animation: modal-fade 0.25s ease-out;
}

/* --- 閉じるボタン --- */
#modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
#modal-close:hover {
  background: rgba(255,255,255,0.25);
}

/* --- フェードイン --- */
@keyframes modal-fade {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- モバイル対応 --- */
@media (max-width: 768px) {
  #modal-window {
    width: 90%;
    padding: 20px;
  }
}
/* 共通ボタン */
.login-button{
  display:block;width:100%;padding:12px 0;
  margin:10px 0;border-radius:6px;
  text-align:center;font-size:15px;font-weight:600;
  border:1px solid #3a7afe;
  background:#3a7afe;color:#fff;
  text-decoration:none;cursor:pointer;
  transition:background 0.15s,border-color 0.15s;
}
.login-button:hover{
  background:#2f6af0;
}

/* ログアウトボタン（青系のまま） */
#logout-btn{
  background:#3a7afe;border-color:#3a7afe;color:#fff;
}
#logout-btn:hover{
  background:#2f6af0;
}

/* 退会ボタン（警告） */
#delete-user-btn{
  background:#d9534f;border-color:#d9534f;color:#fff;
}
#delete-user-btn:hover{
  background:#c64743;
}

/* ログイン誘導ボタン（未ログイン時） */
#login-btn{
  background:#3a7afe;border-color:#3a7afe;color:#fff;
}
#login-btn:hover{background:#2f6af0;}

/* 閉じるボタン */
#modal-close{
  position:absolute;top:12px;right:12px;
  cursor:pointer;font-size:20px;font-weight:bold;
  color:#666;transition:color .2s;
}
#modal-close:hover{color:#000;}

/* ステータス HUD */
.hud-status{
  position:absolute;
  top:33%; left:0;
  width:22%; height:120px;
  z-index:60;
  pointer-events:auto;
}

/* 黒透明 HUD 背景 */
.hud-status-bg{
  position:absolute;
  left:0; top:0; bottom:0; width:100%;
  border-radius:0 14px 14px 0;
  background:linear-gradient(90deg,
    rgba(0,0,0,0.75)0%,
    rgba(0,0,0,0.55)40%,
    rgba(0,0,0,0.28)75%,
    rgba(0,0,0,0)100%);
  backdrop-filter:blur(4px);
}

/* DisplayName */
.hud-status-name{
  position:absolute;
  top:28%; left:0;
  transform:translateY(-50%);
  width:100%;
  padding-left:23%;
  font-size:1.45rem;
  font-weight:700;
  color:#fff;
  letter-spacing:1px;
  white-space:nowrap;
  text-shadow:1px 1px 3px rgba(0,0,0,0.7);
}

/* グラスボタン（高級感・SF調） */
.hud-status-btn{
  position:absolute;
  left:23%; bottom:12px;
  width:65%; height:38px;
  border:none;
  border-radius:8px;
  background:rgba(255,255,255,0.12);
  backdrop-filter:blur(5px);
  color:#fff;
  font-size:0.95rem;
  font-weight:600;
  letter-spacing:1px;
  cursor:pointer;
  transition:all .25s ease;
  box-shadow:0 3px 12px rgba(0,0,0,0.4);
}
.hud-status-btn:hover{
  background:rgba(255,255,255,0.22);
  transform:translateY(-3px);
  box-shadow:0 6px 18px rgba(0,0,0,0.55);
}
.hud-status-btn:active{
  transform:scale(0.96);
  filter:brightness(0.85);
}
