* {
  box-sizing: border-box;
}

/* =========================
   カラートークン / グローバル
   ========================= */
:root{
  /* レイアウト調整用（JSで上書き） */
  --header-offset: 120px;

  /* 新デザイン寄りのトークン */
  --primary-color: #0f172a;    /* 濃いネイビー */
  --accent-color: #3b82f6;     /* モダンなブルー */
  --bg-color: #ffffff;         /* ほぼ完全な白 */
  --card-bg: #ffffff;
  --text-main: #334155;
  --text-sub: #64748b;
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.06);
  --radius-lg: 24px;
  --radius-md: 16px;

  /* 既存の待合室カード用トークン */
  --paper-bg-1: #FBF6ED;
  --paper-bg-2: #F2E7D8;
  --ink-900:   #1e2430;
  --ink-700:   #344054;
  --ink-500:   #667085;
  --ink-950:   #111827;
  --accent:    #3B82F6;
  --accent-ink:#ffffff;
  --card-shadow-1: 0 4px 10px rgba(0,0,0,.04);
  --card-shadow-2: 0 16px 30px rgba(0,0,0,.06);
}

html {
  height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable both-edges; /* 横ズレ防止 */
}

body {
  min-height: 100%;
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  font-family: "Plus Jakarta Sans", "Noto Sans JP", system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  min-height:100%;
}

/* =========================
   ヘッダー：ロゴ＋最上部固定
   ========================= */
header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  width: 100%;
  padding: 12px 20px 14px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align:center;
  border-bottom: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 10px 25px rgba(15,23,42,0.08);
  overflow: visible;
}

/* ヘッダー下にさりげないライン */
header::after{
  content: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(to right,
              transparent 0,
              rgba(59,130,246,0.45) 20%,
              rgba(59,130,246,0.8) 50%,
              rgba(59,130,246,0.45) 80%,
              transparent 100%);
  z-index: 0;
  pointer-events: none;
}

/* サイトタイトル（ページタイトル） */
.brand-logo-text{
  font-family: "Plus Jakarta Sans", "Noto Sans JP", system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 auto;
  margin-top: 4px;
  letter-spacing: -0.02em;
  z-index: 2;
  position: relative;
  pointer-events: auto;
  max-width: calc(100% - 160px);
  text-align: center;
  /* 475pxで14px、1280pxで30pxになる流体フォントサイズ（さらに一回り小さく） */
  font-size: clamp(
    14px,
    calc(14px + (30 - 14) * ((100vw - 475px) / (1280 - 475))),
    30px
  );
  text-shadow: 0 1px 2px rgba(15,23,42,0.12);
}

.brand-logo{
  font-size: 68px;
  display:block;
  max-width: calc(100% - 360px);
  margin: 0px auto -8px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  pointer-events:auto;
}

/* ヘッダー右上：言語切り替え（トグル＋ドロップダウン） */
.lang-switch{
  position:absolute;
  top:10px;
  right:16px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
  font-size:12px;
  font-weight:600;
  z-index:10;
}

.lang-switch__toggle{
  appearance:none;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background: rgba(248,250,252,0.95);
  color: var(--text-main);
  padding:6px 14px;
  font:600 12px/1.4 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  box-shadow:0 4px 10px rgba(15,23,42,0.08);
  white-space:nowrap;
  transition: background .18s ease, border-color .18s ease,
             box-shadow .18s ease, color .18s ease, transform .08s ease;
}
.lang-switch__toggle::after{
  content:"▾";
  font-size:10px;
  opacity:0.9;
}
.lang-switch__toggle:hover{
  background:#f1f5f9;
  border-color:#cbd5e1;
  color:var(--primary-color);
  box-shadow:0 6px 14px rgba(15,23,42,0.14);
  transform: translateY(-1px);
}
.lang-switch__toggle:active{
  transform: translateY(0);
  box-shadow:0 3px 8px rgba(15,23,42,0.12);
}

.lang-switch__menu{
  position:absolute;
  margin-top:4px;
  right:0;
  min-width:160px;
  padding:8px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.98);
  box-shadow:0 18px 40px rgba(15,23,42,0.22);
  backdrop-filter: blur(18px);
}
.lang-switch__menu[hidden]{
  display:none;
}
.lang-switch__menu button{
  width:100%;
  text-align:left;
  border:none;
  background:transparent;
  color:var(--text-main);
  font:500 12px/1.6 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  white-space:nowrap;
  transition: background .15s ease, color .15s ease, transform .06s ease;
}
.lang-switch__menu button:hover{
  background:#e5edff;
  color:#1d4ed8;
}
.lang-switch__menu button.is-active{
  font-weight:700;
  background:#1d4ed8;
  color:#f9fafb;
}

/* ヘッダー直下のボタン群（2つ） */
.intro-bar{
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;      /* デフォルト：縦並び */
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  z-index: 3;
}
.intro-bar__button{
  appearance: none;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--text-sub);
  padding: 8px 20px;
  font: 500 0.95rem/1.4 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 3px 8px rgba(15,23,42,0.06);
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
             border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.intro-bar__button:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.14);
  color: var(--accent-color);
  border-color: var(--accent-color);
  background:#f9fafb;
}
.intro-bar__button:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15,23,42,0.1);
}

/* =========================
   ステージ（地球表示エリア）
   ========================= */
.stage{
  position:relative;
  width:100%;
  display:flex;
  flex-direction: column;   /* 縦並び */
  align-items:center;       /* PCでは中央寄せ */
  padding: calc(var(--header-offset) + 72px) 16px 40px;
  /* ほぼ真っ白：ごくわずかな差だけ付ける */
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #fcfcff 40%,
    #ffffff 100%
  );
  margin-top: 0;
}

.site-logo{
  pointer-events:none;
  position:absolute;
  top: calc(var(--header-offset) + 16px);
  left:50%;
  transform:translateX(-50%);
  /* もとの約2/3サイズ */
  width:min(20vw, 134px);
  opacity:.95;
  z-index:1; /* 説明ボタンより一段下にして被り感を低減 */
  filter: drop-shadow(0 4px 6px rgba(15,23,42,0.35));
}

/* WebXR iframe：角丸＋影でモダンに */
#webxr-iframe{
  display:block;
  width:100%;
  height:70vh;
  min-height:480px;
  max-width:1000px;
  border:none;
  margin-top:28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  background:#000;
  overscroll-behavior:contain;
  overflow:hidden;
}

/* =========================
   レイアウトレスポンシブ
   ========================= */
@media(min-width:1024px){
  /* PC 時：iframe は 90% */
  #webxr-iframe{
    width:90%;
    height:80vh;
  }
  .intro-bar{
    flex-direction: row;      /* 横並び */
    justify-content: center;
    align-items: center;
    padding-left: 0;
  }
  .intro-bar__button{
    width: auto;
    max-width: 420px;
    white-space: nowrap;
  }

  .brand-logo-text{
    margin: 0;
    margin-top: 4px;
    margin-left: 30px;
    margin-right: auto;
    text-align: left;
    max-width: calc(100% - 200px);
  }

  .stage{
    padding: calc(var(--header-offset) + 80px) 32px 56px;
  }
}

@media(max-width:1023px){
  /* スマホ・タブレット：左寄せ＆縦並び */
  .stage{
    align-items:flex-start;
    padding: calc(var(--header-offset) + 72px) 16px 40px;
  }
  #webxr-iframe{
    width: calc(100% - 30px);
    height: calc(86vw);
    margin-left: 2px;
  }
  .intro-bar{
    flex-direction: column;     /* 縦並び */
    align-items:flex-start;
    padding-left: 2px;
  }
  .intro-bar__button{
    width: calc(100% - 30px);
    max-width:none;
    white-space: normal;
  }

  .brand-logo-text{
    width: calc(100% - 160px);
    max-width: calc(100% - 160px);
    margin-top: 5px;
    margin-left: 5px;
    margin-right: auto;
    text-align: left;
  }
}

@media(max-width:624px){
  .brand-logo-text{
    max-width: calc(100% - 140px);
  }
}

/* =========================
   待ち合わせ一覧（Paper Cards）
   ========================= */
.meetups{
  width:min(1200px,100%);
  margin:32px auto 80px;
  padding:24px 20px 40px;
  position:relative;
  border-radius:18px;
  /* 台座感をなくして、真っ白＋ごく控えめな影のみ */
  background:#ffffff;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
  overflow:hidden;
}
.meetups::before{
  /* ハイライト装飾は完全オフ */
  content:"";
  position:absolute;
  inset:0;
  background:none;
  pointer-events:none;
}

/* タイトル + 作成ボタン行：左寄せ */
.meetups__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 20px;
}
.meetups__title{
  margin:0;
  font-weight:800;
  font-size: clamp(24px, 4.2vw, 32px);
  line-height:1.2;
  letter-spacing:.02em;
  color: var(--ink-950);
  text-align:left; /* 左寄せ */
}

/* 「待ち合わせ部屋を作る」ボタン（ヘッダー内ボタン） */
.meetups .head-create.btn{
  background:var(--primary-color);
  color:#fff;
  border:1px solid var(--primary-color);
  height:44px;
  padding:0 18px;
  border-radius:12px;
  font:700 14px/1 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  white-space:nowrap;
  box-shadow:0 10px 24px rgba(15,23,42,.25), inset 0 -2px 0 rgba(0,0,0,.15);
  transition:transform .05s ease, box-shadow .15s ease, opacity .15s ease;
}
.meetups .head-create.btn:hover{
  box-shadow:0 14px 30px rgba(15,23,42,.32), inset 0 -2px 0 rgba(0,0,0,.2);
  opacity:.98;
}
.meetups .head-create.btn:active{
  transform:translateY(1px);
  box-shadow:0 6px 16px rgba(15,23,42,.28), inset 0 -1px 0 rgba(0,0,0,.18);
}

/* グリッド */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:20px;
}

/* 待ち合わせカード：白＋枠線のみ */
.card{
  position:relative;
  border:1px solid rgba(148,163,184,.5);
  border-radius:16px;
  padding:14px 14px 56px;
  background:var(--card-bg);
  box-shadow:0 6px 14px rgba(15,23,42,.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow:hidden;
  isolation:isolate;
}
.card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15,23,42,.12);
  border-color: rgba(148,163,184,.8);
}

.title {
  font:700 17px/1.4 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  margin:0 0 6px;
  color:var(--ink-900);
}
.meta{
  color:var(--ink-500);
  font:12px/1.4 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  margin:0 0 8px;
}

/* カード内ツールアイコン */
.tools{
  position:absolute;
  right:10px;
  top:10px;
  display:flex;
  gap:6px;
  z-index:2;
}
.icon{
  width:28px;
  height:28px;
  padding:0;
  border-radius:8px;
  display:inline-grid;
  place-items:center;
  background:#f6f7fb;
  border:1px solid #e6e8ef;
  color:#334155;
}

/* 「入室」ボタン */
.meetups .card [data-enter].btn{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:12px;
  cursor:pointer;
  font:700 14px/1 "Plus Jakarta Sans","Noto Sans JP",system-ui;
  letter-spacing:.02em;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(59,130,246,.35), inset 0 -2px 0 rgba(0,0,0,.08);
  transition: transform .05s ease, box-shadow .15s ease, opacity .15s ease;
  text-decoration:none;
}
.meetups .card [data-enter].btn:hover{
  box-shadow: 0 10px 22px rgba(59,130,246,.45), inset 0 -2px 0 rgba(0,0,0,.12);
}
.meetups .card [data-enter].btn:active{
  transform: translateY(1px);
}

/* 汎用ボタン */
.btn{
  appearance:none;
  border:1px solid #111;
  background:#111;
  color:#fff;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  font:600 12px "Plus Jakarta Sans","Noto Sans JP",system-ui;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.btn.ghost{
  background:#fff;
  color:#111;
}
.btn.danger{
  background:#b00020;
  border-color:#b00020;
}

/* =========================
   モーダル / フォーム
   ========================= */
.backdrop{
  position:fixed;
  inset:0;
  background:rgba(15, 23, 42, 0.6);
  display:none;
  align-items:flex-start;                                  /* 上寄せ表示 */
  justify-content:center;                                  /* 横は中央 */
  z-index:20;
  touch-action: manipulation;
  padding: calc(var(--header-offset) + 20px) 16px 16px;    /* ヘッダーの下から表示開始 */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal{
  width:min(720px,92vw);
  background:#fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow:hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border:none;
}

/* モーダル内のヘッダーはページヘッダーとは別扱い */
.modal header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  background:#f8fafc;
  color:var(--primary-color);
  font:700 16px "Plus Jakarta Sans","Noto Sans JP",system-ui;
  position: static;
  border-bottom:1px solid #e2e8f0;
}
.close{
  cursor:pointer;
  font-size:20px;
  line-height:1;
}

/* 本文スクロール領域 */
.body{
  padding:16px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* フォーム */
.form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px 16px;
}
@media(max-width:640px){
  .form{grid-template-columns:1fr;}
}
label{
  font:600 12px "Plus Jakarta Sans","Noto Sans JP",system-ui;
  color:#333;
}
input,
select{
  width:100%;
  padding:10px 12px;
  border:1px solid #d4d4d8;
  border-radius:10px;
  font:14px "Plus Jakarta Sans","Noto Sans JP",system-ui;
  box-sizing:border-box;
  background:#fff;
}
select{
  position:relative;
  z-index:30;
}

/* モーダル下部アクション */
.actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding:0 16px 16px;
  flex-wrap:wrap;
}
.actions .left{
  margin-right:auto;
  display:flex;
  gap:10px;
  align-items:center;
}

/* ステータスメッセージ */
.status{
  display:none;
  padding:12px 16px 16px;
  color:#0a7f3f;
  font:600 14px "Plus Jakarta Sans","Noto Sans JP",system-ui;
}
.note{
  font:12px "Plus Jakarta Sans","Noto Sans JP",system-ui;
  color:#666;
  margin-top:6px;
}

/* =========================
   フッター
   ========================= */
footer{
  width:100%;
  height:60px;
  margin:0;
  padding:0;
  background:#000;
}

/* =========================
   About / Guide モーダル本文
   ========================= */
#aboutBody p,
#guideBody p{
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 0.8em;
  text-align: left;
  font-family: "Noto Sans JP","Plus Jakarta Sans",system-ui,-apple-system,
               BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* 大きめ見出し */
#aboutBody p.heading-large,
#guideBody p.heading-large{
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 0.5em;
}

/* 特大見出し（動画数など） */
#aboutBody p.heading-strong,
#guideBody p.heading-strong{
  font-size: 34px;
  font-weight: bold;
  margin-bottom: 0.4em;
}
